Generated by Cython 0.25.2
Yellow lines hint at Python interaction.
Click on a line that starts with a "+
" to see the C code that Cython generated for it.
Raw output: io_vcf_read.c
+0001: # cython: linetrace=False
__pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_20) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
0002: # cython: profile=False
0003: # cython: binding=False
0004: # cython: boundscheck=False
0005: # cython: wraparound=False
0006: # cython: initializedcheck=False
0007: # cython: nonecheck=False
0008: """
0009: # options for profiling...
0010: # cython: profile=True
0011: # cython: binding=True
0012: # cython: linetrace=True
0013: # distutils: define_macros=CYTHON_TRACE=1
0014: # distutils: define_macros=CYTHON_TRACE_NOGIL=1
0015: """
0016: from __future__ import absolute_import, print_function, division
0017:
0018:
+0019: import warnings
__pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0020: # noinspection PyUnresolvedReferences
0021: from cpython.bytes cimport PyBytes_AS_STRING, PyBytes_FromStringAndSize
0022: # noinspection PyUnresolvedReferences
0023: from libc.stdlib cimport strtol, strtof, strtod, malloc, free, realloc
0024: # noinspection PyUnresolvedReferences
0025: from libc.string cimport strcmp, memcpy
+0026: import numpy as np
__pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0027: cimport numpy as np
0028: from cpython.ref cimport PyObject
0029: cdef extern from "Python.h":
0030: char* PyByteArray_AS_STRING(object string)
0031: # from multiprocessing.pool import ThreadPool
0032:
0033:
+0034: from allel.compat import PY2
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PY2); __Pyx_GIVEREF(__pyx_n_s_PY2); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PY2); __pyx_t_2 = __Pyx_Import(__pyx_n_s_allel_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY2, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
0035:
0036:
0037: #########################################################################################
0038: # Constants.
0039:
0040:
0041: # for Windows compatibility
+0042: cdef double NAN = np.nan
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_5allel_3opt_11io_vcf_read_NAN = __pyx_t_3;
0043:
0044: # predefine useful characters
+0045: cdef char TAB = b'\t'
__pyx_v_5allel_3opt_11io_vcf_read_TAB = '\t';
+0046: cdef char LF = b'\n'
__pyx_v_5allel_3opt_11io_vcf_read_LF = '\n';
+0047: cdef char CR = b'\r'
__pyx_v_5allel_3opt_11io_vcf_read_CR = '\r';
+0048: cdef char HASH = b'#'
__pyx_v_5allel_3opt_11io_vcf_read_HASH = '#';
+0049: cdef char COLON = b':'
__pyx_v_5allel_3opt_11io_vcf_read_COLON = ':';
+0050: cdef char SEMICOLON = b';'
__pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON = ';';
+0051: cdef char PERIOD = b'.'
__pyx_v_5allel_3opt_11io_vcf_read_PERIOD = '.';
+0052: cdef char COMMA = b','
__pyx_v_5allel_3opt_11io_vcf_read_COMMA = ',';
+0053: cdef char SLASH = b'/'
__pyx_v_5allel_3opt_11io_vcf_read_SLASH = '/';
+0054: cdef char PIPE = b'|'
__pyx_v_5allel_3opt_11io_vcf_read_PIPE = '|';
+0055: cdef char EQUALS = b'='
__pyx_v_5allel_3opt_11io_vcf_read_EQUALS = '=';
+0056: cdef char ASTERISK = b'*'
__pyx_v_5allel_3opt_11io_vcf_read_ASTERISK = '*';
0057:
0058: # user field specifications for fixed fields
+0059: CHROM_FIELD = 'variants/CHROM'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHROM_FIELD, __pyx_kp_s_variants_CHROM) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
+0060: POS_FIELD = 'variants/POS'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_FIELD, __pyx_kp_s_variants_POS) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
+0061: ID_FIELD = 'variants/ID'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ID_FIELD, __pyx_kp_s_variants_ID) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
+0062: REF_FIELD = 'variants/REF'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_REF_FIELD, __pyx_kp_s_variants_REF) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
+0063: ALT_FIELD = 'variants/ALT'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ALT_FIELD, __pyx_kp_s_variants_ALT) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
+0064: QUAL_FIELD = 'variants/QUAL'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUAL_FIELD, __pyx_kp_s_variants_QUAL) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
0065:
0066: # useful to lookup max int values
+0067: II8 = np.iinfo(np.int8)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_II8, __pyx_t_1) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0068: II16 = np.iinfo(np.int16)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_II16, __pyx_t_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0069: II32 = np.iinfo(np.int32)
__pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_II32, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0070: II64 = np.iinfo(np.int64)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_II64, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0071: IU8 = np.iinfo(np.uint8)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_IU8, __pyx_t_1) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0072: IU16 = np.iinfo(np.uint16)
__pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_IU16, __pyx_t_1) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0073: IU32 = np.iinfo(np.uint32)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_IU32, __pyx_t_1) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0074: IU64 = np.iinfo(np.uint64)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_IU64, __pyx_t_1) < 0) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0075:
0076:
0077: ##########################################################################################
0078: # Fused Types.
0079:
0080:
0081: ctypedef fused integer:
0082: np.int8_t
0083: np.int16_t
0084: np.int32_t
0085: np.int64_t
0086: np.uint8_t
0087: np.uint16_t
0088: np.uint32_t
0089: np.uint64_t
0090:
0091:
0092: ctypedef fused floating:
0093: np.float32_t
0094: np.float64_t
0095:
0096:
0097: ##########################################################################################
0098: # Vectors, written in pure C for speed and ease of use without GIL.
0099:
0100:
+0101: cdef struct CharVector:
struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector { int size; int capacity; char *data; };
0102: int size
0103: int capacity
0104: char* data
0105:
0106:
+0107: cdef inline void CharVector_init(CharVector* self, int capacity) nogil:
static CYTHON_INLINE void __pyx_f_5allel_3opt_11io_vcf_read_CharVector_init(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_self, int __pyx_v_capacity) { /* … */ /* function exit code */ }
+0108: self.size = 0
__pyx_v_self->size = 0;
+0109: self.capacity = capacity
__pyx_v_self->capacity = __pyx_v_capacity;
+0110: self.data = <char*> malloc(sizeof(char) * capacity)
__pyx_v_self->data = ((char *)malloc(((sizeof(char)) * __pyx_v_capacity)));
0111:
0112:
+0113: cdef inline void CharVector_free(CharVector* self) nogil:
static CYTHON_INLINE void __pyx_f_5allel_3opt_11io_vcf_read_CharVector_free(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_self) { /* … */ /* function exit code */ }
+0114: if self.data is not NULL:
__pyx_t_1 = ((__pyx_v_self->data != NULL) != 0); if (__pyx_t_1) { /* … */ }
+0115: free(self.data)
free(__pyx_v_self->data);
0116:
0117:
+0118: cdef inline void CharVector_append(CharVector* self, char c) nogil:
static CYTHON_INLINE void __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_self, char __pyx_v_c) { /* … */ /* function exit code */ }
+0119: if self.size >= self.capacity:
__pyx_t_1 = ((__pyx_v_self->size >= __pyx_v_self->capacity) != 0); if (__pyx_t_1) { /* … */ }
+0120: self.capacity *= 2
__pyx_v_self->capacity = (__pyx_v_self->capacity * 2);
+0121: self.data = <char*> realloc(self.data, sizeof(char) * self.capacity)
__pyx_v_self->data = ((char *)realloc(__pyx_v_self->data, ((sizeof(char)) * __pyx_v_self->capacity)));
+0122: self.data[self.size] = c
(__pyx_v_self->data[__pyx_v_self->size]) = __pyx_v_c;
+0123: self.size += 1
__pyx_v_self->size = (__pyx_v_self->size + 1);
0124:
0125:
+0126: cdef inline void CharVector_clear(CharVector* self) nogil:
static CYTHON_INLINE void __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_self) { /* … */ /* function exit code */ }
+0127: self.size = 0
__pyx_v_self->size = 0;
0128:
0129:
+0130: cdef inline void CharVector_terminate(CharVector* self) nogil:
static CYTHON_INLINE void __pyx_f_5allel_3opt_11io_vcf_read_CharVector_terminate(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_self) { /* … */ /* function exit code */ }
+0131: CharVector_append(self, 0)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_append(__pyx_v_self, 0);
0132:
0133:
+0134: cdef bytes CharVector_to_pybytes(CharVector* self):
static PyObject *__pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pybytes(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CharVector_to_pybytes", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("allel.opt.io_vcf_read.CharVector_to_pybytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0135: return PyBytes_FromStringAndSize(self.data, self.size)
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->data, __pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0;
0136:
0137:
+0138: cdef object CharVector_to_pystr(CharVector* self):
static PyObject *__pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_self) { PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CharVector_to_pystr", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.CharVector_to_pystr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0139: v = PyBytes_FromStringAndSize(self.data, self.size)
__pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->data, __pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0;
+0140: if not PY2:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* … */ }
+0141: v = str(v, 'ascii')
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_v); __Pyx_GIVEREF(__pyx_v_v); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_v); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0;
+0142: return v
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_v); __pyx_r = __pyx_v_v; goto __pyx_L0;
0143:
0144:
+0145: cdef object CharVector_to_pystr_sized(CharVector* self, int size):
static PyObject *__pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr_sized(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_self, int __pyx_v_size) { PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CharVector_to_pystr_sized", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.CharVector_to_pystr_sized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0146: v = PyBytes_FromStringAndSize(self.data, size)
__pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->data, __pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0;
+0147: if not PY2:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* … */ }
+0148: v = str(v, 'ascii')
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_v); __Pyx_GIVEREF(__pyx_v_v); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_v); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0;
+0149: return v
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_v); __pyx_r = __pyx_v_v; goto __pyx_L0;
0150:
0151:
+0152: cdef struct IntVector:
struct __pyx_t_5allel_3opt_11io_vcf_read_IntVector { int size; int capacity; int *data; };
0153: int size
0154: int capacity
0155: int* data
0156:
0157:
+0158: cdef inline void IntVector_init(IntVector* self, int capacity) nogil:
static CYTHON_INLINE void __pyx_f_5allel_3opt_11io_vcf_read_IntVector_init(struct __pyx_t_5allel_3opt_11io_vcf_read_IntVector *__pyx_v_self, int __pyx_v_capacity) { /* … */ /* function exit code */ }
+0159: self.size = 0
__pyx_v_self->size = 0;
+0160: self.capacity = capacity
__pyx_v_self->capacity = __pyx_v_capacity;
+0161: self.data = <int*> malloc(sizeof(int) * capacity)
__pyx_v_self->data = ((int *)malloc(((sizeof(int)) * __pyx_v_capacity)));
0162:
0163:
+0164: cdef inline void IntVector_free(IntVector* self) nogil:
static CYTHON_INLINE void __pyx_f_5allel_3opt_11io_vcf_read_IntVector_free(struct __pyx_t_5allel_3opt_11io_vcf_read_IntVector *__pyx_v_self) { /* … */ /* function exit code */ }
+0165: if self.data is not NULL:
__pyx_t_1 = ((__pyx_v_self->data != NULL) != 0); if (__pyx_t_1) { /* … */ }
+0166: free(self.data)
free(__pyx_v_self->data);
0167:
0168:
+0169: cdef inline void IntVector_append(IntVector* self, int c) nogil:
static CYTHON_INLINE void __pyx_f_5allel_3opt_11io_vcf_read_IntVector_append(struct __pyx_t_5allel_3opt_11io_vcf_read_IntVector *__pyx_v_self, int __pyx_v_c) { /* … */ /* function exit code */ }
+0170: if self.size >= self.capacity:
__pyx_t_1 = ((__pyx_v_self->size >= __pyx_v_self->capacity) != 0); if (__pyx_t_1) { /* … */ }
+0171: self.capacity *= 2
__pyx_v_self->capacity = (__pyx_v_self->capacity * 2);
+0172: self.data = <int*> realloc(self.data, sizeof(int) * self.capacity)
__pyx_v_self->data = ((int *)realloc(__pyx_v_self->data, ((sizeof(int)) * __pyx_v_self->capacity)));
+0173: self.data[self.size] = c
(__pyx_v_self->data[__pyx_v_self->size]) = __pyx_v_c;
+0174: self.size += 1
__pyx_v_self->size = (__pyx_v_self->size + 1);
0175:
0176:
+0177: cdef inline void IntVector_clear(IntVector* self) nogil:
static CYTHON_INLINE void __pyx_f_5allel_3opt_11io_vcf_read_IntVector_clear(struct __pyx_t_5allel_3opt_11io_vcf_read_IntVector *__pyx_v_self) { /* … */ /* function exit code */ }
+0178: self.size = 0
__pyx_v_self->size = 0;
0179:
0180:
0181: ##########################################################################################
0182: # C string utilities.
0183:
0184:
+0185: cdef inline int search_sorted_cstr(char* query, char** compare, int n_items) nogil:
static CYTHON_INLINE int __pyx_f_5allel_3opt_11io_vcf_read_search_sorted_cstr(char *__pyx_v_query, char **__pyx_v_compare, int __pyx_v_n_items) { int __pyx_v_i; int __pyx_r; /* … */ /* function exit code */ __pyx_L0:; return __pyx_r; }
0186: cdef:
0187: int i
0188:
0189: # N.B., we could do a binary search here, but in fact this is not the performance
0190: # bottleneck, so stick with a simple scan for now
0191:
+0192: for i in range(n_items):
__pyx_t_1 = __pyx_v_n_items; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2;
+0193: if strcmp(query, compare[i]) == 0:
__pyx_t_3 = ((strcmp(__pyx_v_query, (__pyx_v_compare[__pyx_v_i])) == 0) != 0); if (__pyx_t_3) { /* … */ } }
+0194: return i
__pyx_r = __pyx_v_i; goto __pyx_L0;
0195:
+0196: return -1
__pyx_r = -1; goto __pyx_L0;
0197:
0198:
0199: ##########################################################################################
0200: # General I/O utilities.
0201:
0202:
+0203: cdef class InputStreamBase:
struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase { PyObject_HEAD struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_vtab; char c; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase { int (*advance)(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_vtabptr_5allel_3opt_11io_vcf_read_InputStreamBase;
0204: """Abstract base class defining an input stream over C chars."""
0205:
0206: cdef:
0207: # character at the current position in the stream
0208: char c
0209:
+0210: cdef int advance(self) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_15InputStreamBase_advance(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("advance", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0211: """Read the next character from the stream and store it in the `c` attribute."""
0212: pass
0213:
0214:
+0215: cdef class FileInputStream(InputStreamBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream { struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase __pyx_base; PyObject *fileobj; int buffer_size; PyObject *buffer; char *buffer_start; char *buffer_end; char *stream; int close; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase __pyx_base; int (*_bufferup)(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *); int (*read_line_into)(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *, struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *); int (*read_lines_into)(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *, struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *, int); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *__pyx_vtabptr_5allel_3opt_11io_vcf_read_FileInputStream;
0216:
0217: cdef:
0218: # Python file-like object
0219: object fileobj
0220: int buffer_size
0221: bytearray buffer
0222: char* buffer_start
0223: char* buffer_end
0224: char* stream
0225: bint close
0226:
+0227: def __init__(self, fileobj, buffer_size=2**14, close=False):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_15FileInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_15FileInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fileobj = 0; PyObject *__pyx_v_buffer_size = 0; PyObject *__pyx_v_close = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileobj,&__pyx_n_s_buffer_size,&__pyx_n_s_close,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)__pyx_int_16384); values[2] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fileobj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer_size); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 227, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fileobj = values[0]; __pyx_v_buffer_size = values[1]; __pyx_v_close = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 227, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.FileInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_15FileInputStream___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self), __pyx_v_fileobj, __pyx_v_buffer_size, __pyx_v_close); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_15FileInputStream___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *__pyx_v_self, PyObject *__pyx_v_fileobj, PyObject *__pyx_v_buffer_size, PyObject *__pyx_v_close) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.FileInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0228: self.fileobj = fileobj
__Pyx_INCREF(__pyx_v_fileobj); __Pyx_GIVEREF(__pyx_v_fileobj); __Pyx_GOTREF(__pyx_v_self->fileobj); __Pyx_DECREF(__pyx_v_self->fileobj); __pyx_v_self->fileobj = __pyx_v_fileobj;
+0229: self.buffer_size = buffer_size
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_buffer_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __pyx_v_self->buffer_size = __pyx_t_1;
0230: # initialise input buffer
+0231: self.buffer = bytearray(buffer_size)
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_buffer_size); __Pyx_GIVEREF(__pyx_v_buffer_size); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_buffer_size); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->buffer); __Pyx_DECREF(__pyx_v_self->buffer); __pyx_v_self->buffer = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0;
+0232: self.buffer_start = PyByteArray_AS_STRING(self.buffer)
__pyx_t_3 = __pyx_v_self->buffer; __Pyx_INCREF(__pyx_t_3); __pyx_v_self->buffer_start = PyByteArray_AS_STRING(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0233: self.stream = self.buffer_start
__pyx_t_4 = __pyx_v_self->buffer_start; __pyx_v_self->stream = __pyx_t_4;
+0234: self.close = close
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_close); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_v_self->close = __pyx_t_5;
+0235: self._bufferup()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->_bufferup(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 235, __pyx_L1_error)
+0236: self.advance()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.advance(((struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 236, __pyx_L1_error)
0237:
+0238: def __dealloc__(self):
/* Python wrapper */ static void __pyx_pw_5allel_3opt_11io_vcf_read_15FileInputStream_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_5allel_3opt_11io_vcf_read_15FileInputStream_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_5allel_3opt_11io_vcf_read_15FileInputStream_2__dealloc__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_5allel_3opt_11io_vcf_read_15FileInputStream_2__dealloc__(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* … */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_WriteUnraisable("allel.opt.io_vcf_read.FileInputStream.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); }
+0239: if self.close:
__pyx_t_1 = (__pyx_v_self->close != 0); if (__pyx_t_1) { /* … */ }
+0240: self.fileobj.close()
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->fileobj, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
0241:
+0242: cdef int _bufferup(self) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_15FileInputStream__bufferup(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *__pyx_v_self) { int __pyx_v_l; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_bufferup", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.FileInputStream._bufferup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0243: """Read as many bytes as possible from the underlying file object into the
0244: buffer."""
0245: cdef int l
0246: # with gil:
+0247: l = self.fileobj.readinto(self.buffer)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->fileobj, __pyx_n_s_readinto); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->buffer}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->buffer}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->buffer); __Pyx_GIVEREF(__pyx_v_self->buffer); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->buffer); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_l = __pyx_t_5;
+0248: if l > 0:
__pyx_t_6 = ((__pyx_v_l > 0) != 0); if (__pyx_t_6) { /* … */ goto __pyx_L3; }
+0249: self.stream = self.buffer_start
__pyx_t_7 = __pyx_v_self->buffer_start; __pyx_v_self->stream = __pyx_t_7;
+0250: self.buffer_end = self.buffer_start + l
__pyx_v_self->buffer_end = (__pyx_v_self->buffer_start + __pyx_v_l);
0251: else:
+0252: self.stream = NULL
/*else*/ { __pyx_v_self->stream = NULL; } __pyx_L3:;
0253:
+0254: cdef int advance(self) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_15FileInputStream_advance(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("advance", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.FileInputStream.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0255: """Read the next character from the stream and store it in the `c` attribute."""
+0256: if self.stream is self.buffer_end:
__pyx_t_1 = ((__pyx_v_self->stream == __pyx_v_self->buffer_end) != 0); if (__pyx_t_1) { /* … */ }
+0257: self._bufferup()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->_bufferup(__pyx_v_self); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 257, __pyx_L1_error)
+0258: if self.stream is NULL:
__pyx_t_1 = ((__pyx_v_self->stream == NULL) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L4; }
0259: # end of file
+0260: self.c = 0
__pyx_v_self->__pyx_base.c = 0;
0261: else:
+0262: self.c = self.stream[0]
/*else*/ { __pyx_v_self->__pyx_base.c = (__pyx_v_self->stream[0]);
+0263: self.stream += 1
__pyx_v_self->stream = (__pyx_v_self->stream + 1); } __pyx_L4:;
0264:
+0265: cdef int read_line_into(self, CharVector* dest) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_15FileInputStream_read_line_into(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *__pyx_v_self, struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_dest) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_line_into", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.FileInputStream.read_line_into", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0266: """Read up to end of line or end of file (whichever comes first) and append
0267: chars to the `dest` buffer."""
0268:
+0269: while True:
while (1) {
0270:
+0271: if self.c == 0:
__pyx_t_1 = ((__pyx_v_self->__pyx_base.c == 0) != 0); if (__pyx_t_1) { /* … */ }
+0272: break
goto __pyx_L4_break;
0273:
+0274: elif self.c == LF:
__pyx_t_1 = ((__pyx_v_self->__pyx_base.c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_1) { /* … */ }
+0275: CharVector_append(dest, LF)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_append(__pyx_v_dest, __pyx_v_5allel_3opt_11io_vcf_read_LF);
0276: # advance input stream beyond EOL
+0277: self.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.advance(((struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 277, __pyx_L1_error)
+0278: break
goto __pyx_L4_break;
0279:
+0280: elif self.c == CR:
__pyx_t_1 = ((__pyx_v_self->__pyx_base.c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (__pyx_t_1) { /* … */ }
0281: # translate newdests
+0282: CharVector_append(dest, LF)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_append(__pyx_v_dest, __pyx_v_5allel_3opt_11io_vcf_read_LF);
0283: # advance input stream beyond EOL
+0284: self.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.advance(((struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 284, __pyx_L1_error)
+0285: if self.c == LF:
__pyx_t_1 = ((__pyx_v_self->__pyx_base.c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_1) { /* … */ }
0286: # handle Windows CRLF
+0287: self.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.advance(((struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 287, __pyx_L1_error)
+0288: break
goto __pyx_L4_break;
0289:
0290: else:
+0291: CharVector_append(dest, self.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append(__pyx_v_dest, __pyx_v_self->__pyx_base.c);
+0292: self.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.advance(((struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 292, __pyx_L1_error) } } __pyx_L4_break:;
0293:
+0294: cdef int read_lines_into(self, CharVector* dest, int n) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_15FileInputStream_read_lines_into(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *__pyx_v_self, struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_dest, int __pyx_v_n) { int __pyx_v_n_lines_read; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_lines_into", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.FileInputStream.read_lines_into", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0295: """Read up to `n` lines into the `dest` buffer."""
+0296: cdef int n_lines_read = 0
__pyx_v_n_lines_read = 0;
0297:
0298: # with nogil:
0299:
+0300: while n_lines_read < n and self.c != 0:
while (1) { __pyx_t_2 = ((__pyx_v_n_lines_read < __pyx_v_n) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = ((__pyx_v_self->__pyx_base.c != 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (!__pyx_t_1) break;
+0301: self.read_line_into(dest)
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->read_line_into(__pyx_v_self, __pyx_v_dest); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
+0302: n_lines_read += 1
__pyx_v_n_lines_read = (__pyx_v_n_lines_read + 1); }
0303:
+0304: return n_lines_read
__pyx_r = __pyx_v_n_lines_read; goto __pyx_L0;
0305:
+0306: def readline(self):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_15FileInputStream_5readline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5allel_3opt_11io_vcf_read_15FileInputStream_4readline[] = "Read characters up to end of line or end of file and return as Python bytes\n object."; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_15FileInputStream_5readline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readline (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_15FileInputStream_4readline(((struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_15FileInputStream_4readline(struct __pyx_obj_5allel_3opt_11io_vcf_read_FileInputStream *__pyx_v_self) { struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector __pyx_v_line; PyObject *__pyx_v_ret = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readline", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.FileInputStream.readline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0307: """Read characters up to end of line or end of file and return as Python bytes
0308: object."""
0309: cdef CharVector line
+0310: CharVector_init(&line, 2**8)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_init((&__pyx_v_line), 0x100);
+0311: self.read_line_into(&line)
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_FileInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->read_line_into(__pyx_v_self, (&__pyx_v_line)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 311, __pyx_L1_error)
+0312: ret = CharVector_to_pybytes(&line)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pybytes((&__pyx_v_line)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ret = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
+0313: CharVector_free(&line)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_free((&__pyx_v_line));
+0314: return ret
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0;
0315:
0316:
+0317: cdef class CharVectorInputStream(InputStreamBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_CharVectorInputStream { struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase __pyx_base; struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector vector; int stream_index; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_CharVectorInputStream { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase __pyx_base; void (*clear)(struct __pyx_obj_5allel_3opt_11io_vcf_read_CharVectorInputStream *); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_CharVectorInputStream *__pyx_vtabptr_5allel_3opt_11io_vcf_read_CharVectorInputStream;
0318:
0319: cdef:
0320: CharVector vector
0321: int stream_index
0322:
+0323: def __cinit__(self, int capacity):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_21CharVectorInputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_21CharVectorInputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_capacity; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_capacity,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_capacity)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 323, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_capacity = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_capacity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 323, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.CharVectorInputStream.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_21CharVectorInputStream___cinit__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_CharVectorInputStream *)__pyx_v_self), __pyx_v_capacity); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_21CharVectorInputStream___cinit__(struct __pyx_obj_5allel_3opt_11io_vcf_read_CharVectorInputStream *__pyx_v_self, int __pyx_v_capacity) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* … */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0324: CharVector_init(&self.vector, capacity)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_init((&__pyx_v_self->vector), __pyx_v_capacity);
+0325: self.stream_index = 0
__pyx_v_self->stream_index = 0;
0326:
+0327: def __dealloc__(self):
/* Python wrapper */ static void __pyx_pw_5allel_3opt_11io_vcf_read_21CharVectorInputStream_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_5allel_3opt_11io_vcf_read_21CharVectorInputStream_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_5allel_3opt_11io_vcf_read_21CharVectorInputStream_2__dealloc__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_CharVectorInputStream *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_5allel_3opt_11io_vcf_read_21CharVectorInputStream_2__dealloc__(struct __pyx_obj_5allel_3opt_11io_vcf_read_CharVectorInputStream *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* … */ /* function exit code */ __Pyx_RefNannyFinishContext(); }
+0328: CharVector_free(&self.vector)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_free((&__pyx_v_self->vector));
0329:
+0330: cdef int advance(self) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_21CharVectorInputStream_advance(struct __pyx_obj_5allel_3opt_11io_vcf_read_CharVectorInputStream *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("advance", 0); /* … */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0331: if self.stream_index < self.vector.size:
__pyx_t_1 = ((__pyx_v_self->stream_index < __pyx_v_self->vector.size) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L3; }
+0332: self.c = self.vector.data[self.stream_index]
__pyx_v_self->__pyx_base.c = (__pyx_v_self->vector.data[__pyx_v_self->stream_index]);
+0333: self.stream_index += 1
__pyx_v_self->stream_index = (__pyx_v_self->stream_index + 1);
0334: else:
+0335: self.c = 0
/*else*/ { __pyx_v_self->__pyx_base.c = 0; } __pyx_L3:;
0336:
+0337: cdef void clear(self) : # nogil
static void __pyx_f_5allel_3opt_11io_vcf_read_21CharVectorInputStream_clear(struct __pyx_obj_5allel_3opt_11io_vcf_read_CharVectorInputStream *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear", 0); /* … */ /* function exit code */ __Pyx_RefNannyFinishContext(); }
+0338: CharVector_clear(&self.vector)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_self->vector));
+0339: self.stream_index = 0
__pyx_v_self->stream_index = 0;
0340:
0341:
0342: ##########################################################################################
0343: # VCF Parsing.
0344:
0345:
+0346: cdef enum VCFState:
enum __pyx_t_5allel_3opt_11io_vcf_read_VCFState { __pyx_e_5allel_3opt_11io_vcf_read_CHROM = 0, __pyx_e_5allel_3opt_11io_vcf_read_POS = 1, __pyx_e_5allel_3opt_11io_vcf_read_ID = 2, __pyx_e_5allel_3opt_11io_vcf_read_REF = 3, __pyx_e_5allel_3opt_11io_vcf_read_ALT = 4, __pyx_e_5allel_3opt_11io_vcf_read_QUAL = 5, __pyx_e_5allel_3opt_11io_vcf_read_FILTER = 6, __pyx_e_5allel_3opt_11io_vcf_read_INFO = 7, __pyx_e_5allel_3opt_11io_vcf_read_FORMAT = 8, __pyx_e_5allel_3opt_11io_vcf_read_CALLDATA = 9, __pyx_e_5allel_3opt_11io_vcf_read_EOL = 10, __pyx_e_5allel_3opt_11io_vcf_read_EOF = 11 };
0347: CHROM = 0,
0348: POS = 1,
0349: ID = 2,
0350: REF = 3,
0351: ALT = 4,
0352: QUAL = 5,
0353: FILTER = 6,
0354: INFO = 7,
0355: FORMAT = 8,
0356: CALLDATA = 9,
0357: EOL = 10,
0358: EOF = 11
0359:
0360:
+0361: cdef class VCFContext:
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext { PyObject_HEAD PyObject *headers; PyObject *fields; PyObject *formats; int state; int variant_index; int chunk_variant_index; int sample_index; int sample_output_index; int sample_field_index; struct __pyx_t_5allel_3opt_11io_vcf_read_IntVector variant_format_indices; struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector temp; struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector info_key; struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector info_val; struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector chrom; long pos; int ref_len; };
0362:
0363: cdef:
0364: # useful stuff
0365: object headers
0366: list fields
0367: list formats
0368:
0369: # dynamic attributes - reflect current state during parsing
0370: int state # overall parser state
0371: int variant_index # index of current variant
0372: int chunk_variant_index # index of current variant within current chunk
0373: int sample_index # index of current sample within call data
0374: int sample_output_index # index of current sample within output calldata arrays
0375: int sample_field_index # index of field within call data for current sample
0376: IntVector variant_format_indices # indices of formats for the current variant
0377:
0378: # buffers
0379: CharVector temp # used for numeric values
0380: CharVector info_key # used for info key
0381: CharVector info_val # used for info value
0382:
0383: # keep track of current chrom and pos, even if fields are skipped
0384: CharVector chrom
0385: long pos
0386:
0387: # track size of reference allele (needed for svlen)
0388: int ref_len
0389:
+0390: def __cinit__(self, headers, fields):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_10VCFContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_10VCFContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_headers = 0; PyObject *__pyx_v_fields = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_headers,&__pyx_n_s_fields,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_headers)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 390, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 390, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_headers = values[0]; __pyx_v_fields = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 390, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFContext.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_10VCFContext___cinit__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *)__pyx_v_self), __pyx_v_headers, __pyx_v_fields); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_10VCFContext___cinit__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_self, PyObject *__pyx_v_headers, PyObject *__pyx_v_fields) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_v_name = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFContext.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_group); __Pyx_XDECREF(__pyx_v_name); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0391: self.headers = headers
__Pyx_INCREF(__pyx_v_headers); __Pyx_GIVEREF(__pyx_v_headers); __Pyx_GOTREF(__pyx_v_self->headers); __Pyx_DECREF(__pyx_v_self->headers); __pyx_v_self->headers = __pyx_v_headers;
+0392: self.fields = list(fields)
__pyx_t_1 = PySequence_List(__pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->fields); __Pyx_DECREF(__pyx_v_self->fields); __pyx_v_self->fields = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0393: self.formats = list()
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->formats); __Pyx_DECREF(__pyx_v_self->formats); __pyx_v_self->formats = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0394: for f in fields:
if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) { __pyx_t_1 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 394, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 394, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 394, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4); __pyx_t_4 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0395: group, name = f.split('/')
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 395, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 395, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6); __pyx_t_6 = 0; /* … */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2);
+0396: if group == 'calldata':
__pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_group, __pyx_n_s_calldata, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
if (__pyx_t_9) {
/* … */
}
+0397: self.formats.append(name)
if (unlikely(__pyx_v_self->formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); __PYX_ERR(0, 397, __pyx_L1_error) } __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->formats, __pyx_v_name); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 397, __pyx_L1_error)
0398:
0399: # initialise dynamic state
+0400: self.state = VCFState.CHROM
__pyx_v_self->state = __pyx_e_5allel_3opt_11io_vcf_read_CHROM;
+0401: self.variant_index = -1
__pyx_v_self->variant_index = -1;
+0402: self.chunk_variant_index = -1
__pyx_v_self->chunk_variant_index = -1;
+0403: self.sample_index = 0
__pyx_v_self->sample_index = 0;
+0404: self.sample_output_index = -1
__pyx_v_self->sample_output_index = -1;
+0405: self.sample_field_index = 0
__pyx_v_self->sample_field_index = 0;
+0406: IntVector_init(&self.variant_format_indices, 2**6)
__pyx_f_5allel_3opt_11io_vcf_read_IntVector_init((&__pyx_v_self->variant_format_indices), 64);
0407:
0408: # initialise temporary buffers
+0409: CharVector_init(&self.temp, 2**6)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_init((&__pyx_v_self->temp), 64);
+0410: CharVector_init(&self.info_key, 2**6)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_init((&__pyx_v_self->info_key), 64);
+0411: CharVector_init(&self.info_val, 2**6)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_init((&__pyx_v_self->info_val), 64);
0412:
0413: # initialise chrom and pos
+0414: CharVector_init(&self.chrom, 2**6)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_init((&__pyx_v_self->chrom), 64);
+0415: self.pos = -1
__pyx_v_self->pos = -1L;
+0416: self.ref_len = 0
__pyx_v_self->ref_len = 0;
0417:
+0418: def __dealloc__(self):
/* Python wrapper */ static void __pyx_pw_5allel_3opt_11io_vcf_read_10VCFContext_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_5allel_3opt_11io_vcf_read_10VCFContext_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_5allel_3opt_11io_vcf_read_10VCFContext_2__dealloc__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_5allel_3opt_11io_vcf_read_10VCFContext_2__dealloc__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* … */ /* function exit code */ __Pyx_RefNannyFinishContext(); }
+0419: IntVector_free(&self.variant_format_indices)
__pyx_f_5allel_3opt_11io_vcf_read_IntVector_free((&__pyx_v_self->variant_format_indices));
+0420: CharVector_free(&self.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_free((&__pyx_v_self->temp));
+0421: CharVector_free(&self.info_key)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_free((&__pyx_v_self->info_key));
+0422: CharVector_free(&self.info_val)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_free((&__pyx_v_self->info_val));
+0423: CharVector_free(&self.chrom)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_free((&__pyx_v_self->chrom));
0424:
0425:
+0426: def check_samples(loc_samples, headers):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_1check_samples(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_5allel_3opt_11io_vcf_read_1check_samples = {"check_samples", (PyCFunction)__pyx_pw_5allel_3opt_11io_vcf_read_1check_samples, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_1check_samples(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loc_samples = 0; PyObject *__pyx_v_headers = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check_samples (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc_samples,&__pyx_n_s_headers,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc_samples)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_headers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("check_samples", 1, 2, 2, 1); __PYX_ERR(0, 426, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check_samples") < 0)) __PYX_ERR(0, 426, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_loc_samples = values[0]; __pyx_v_headers = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("check_samples", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 426, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.check_samples", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_check_samples(__pyx_self, __pyx_v_loc_samples, __pyx_v_headers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_check_samples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loc_samples, PyObject *__pyx_v_headers) { Py_ssize_t __pyx_v_n_samples; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check_samples", 0); __Pyx_INCREF(__pyx_v_loc_samples); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.check_samples", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_loc_samples); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__131 = PyTuple_Pack(3, __pyx_n_s_loc_samples, __pyx_n_s_headers, __pyx_n_s_n_samples); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__131); __Pyx_GIVEREF(__pyx_tuple__131); /* … */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5allel_3opt_11io_vcf_read_1check_samples, NULL, __pyx_n_s_allel_opt_io_vcf_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_samples, __pyx_t_1) < 0) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_check_samples, 426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 426, __pyx_L1_error)
+0427: n_samples = len(headers.samples)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_headers, __pyx_n_s_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_samples = __pyx_t_2;
+0428: if loc_samples is None:
__pyx_t_3 = (__pyx_v_loc_samples == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* … */ goto __pyx_L3; }
+0429: loc_samples = np.ones(n_samples, dtype='u1')
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 429, __pyx_L1_error) __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_loc_samples, __pyx_t_7); __pyx_t_7 = 0;
0430: else:
0431: # assume samples is already a boolean indexing array
+0432: loc_samples = loc_samples.view('u1')
/*else*/ { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_loc_samples, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_loc_samples, __pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3);
+0433: assert loc_samples.shape[0] == n_samples
#ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_loc_samples, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 433, __pyx_L1_error) } } #endif } __pyx_L3:;
+0434: return loc_samples
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_loc_samples); __pyx_r = __pyx_v_loc_samples; goto __pyx_L0;
0435:
0436:
+0437: cdef class VCFChunkIterator:
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChunkIterator { PyObject_HEAD struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *stream; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *context; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *parser; };
0438:
0439: cdef:
0440: InputStreamBase stream
0441: VCFContext context
0442: VCFParser parser
0443:
+0444: def __init__(self,
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_16VCFChunkIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_16VCFChunkIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream = 0; int __pyx_v_chunk_length; PyObject *__pyx_v_headers = 0; PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_numbers = 0; PyObject *__pyx_v_fills = 0; PyObject *__pyx_v_region = 0; PyObject *__pyx_v_loc_samples = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_chunk_length,&__pyx_n_s_headers,&__pyx_n_s_fields,&__pyx_n_s_types,&__pyx_n_s_numbers,&__pyx_n_s_fills,&__pyx_n_s_region,&__pyx_n_s_loc_samples,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 1); __PYX_ERR(0, 444, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_headers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 2); __PYX_ERR(0, 444, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 3); __PYX_ERR(0, 444, __pyx_L3_error) } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 4); __PYX_ERR(0, 444, __pyx_L3_error) } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numbers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 5); __PYX_ERR(0, 444, __pyx_L3_error) } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fills)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 6); __PYX_ERR(0, 444, __pyx_L3_error) } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 7); __PYX_ERR(0, 444, __pyx_L3_error) } case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc_samples)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 8); __PYX_ERR(0, 444, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 444, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[8] = PyTuple_GET_ITEM(__pyx_args, 8); } __pyx_v_stream = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *)values[0]); __pyx_v_chunk_length = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_chunk_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) __pyx_v_headers = values[2]; __pyx_v_fields = values[3]; __pyx_v_types = values[4]; __pyx_v_numbers = values[5]; __pyx_v_fills = values[6]; __pyx_v_region = values[7]; __pyx_v_loc_samples = values[8]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 444, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFChunkIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_5allel_3opt_11io_vcf_read_InputStreamBase, 1, "stream", 0))) __PYX_ERR(0, 445, __pyx_L1_error) __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_16VCFChunkIterator___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChunkIterator *)__pyx_v_self), __pyx_v_stream, __pyx_v_chunk_length, __pyx_v_headers, __pyx_v_fields, __pyx_v_types, __pyx_v_numbers, __pyx_v_fills, __pyx_v_region, __pyx_v_loc_samples); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_16VCFChunkIterator___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChunkIterator *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, int __pyx_v_chunk_length, PyObject *__pyx_v_headers, PyObject *__pyx_v_fields, PyObject *__pyx_v_types, PyObject *__pyx_v_numbers, PyObject *__pyx_v_fills, PyObject *__pyx_v_region, PyObject *__pyx_v_loc_samples) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_fields); __Pyx_INCREF(__pyx_v_loc_samples); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFChunkIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fields); __Pyx_XDECREF(__pyx_v_loc_samples); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0445: InputStreamBase stream,
0446: int chunk_length,
0447: headers,
0448: fields,
0449: types,
0450: numbers,
0451: fills,
0452: region,
0453: loc_samples):
0454:
0455: # store reference to input stream
+0456: self.stream = stream
__Pyx_INCREF(((PyObject *)__pyx_v_stream)); __Pyx_GIVEREF(((PyObject *)__pyx_v_stream)); __Pyx_GOTREF(__pyx_v_self->stream); __Pyx_DECREF(((PyObject *)__pyx_v_self->stream)); __pyx_v_self->stream = __pyx_v_stream;
0457:
0458: # setup context
+0459: fields = sorted(fields)
__pyx_t_2 = PySequence_List(__pyx_v_fields); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_1); __pyx_t_1 = 0;
+0460: self.context = VCFContext(headers, fields)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_headers); __Pyx_GIVEREF(__pyx_v_headers); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_headers); __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_fields); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFContext), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->context); __Pyx_DECREF(((PyObject *)__pyx_v_self->context)); __pyx_v_self->context = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *)__pyx_t_2); __pyx_t_2 = 0;
0461:
0462: # setup parser
+0463: loc_samples = check_samples(loc_samples, headers)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_loc_samples, __pyx_v_headers}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_loc_samples, __pyx_v_headers}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_loc_samples); __Pyx_GIVEREF(__pyx_v_loc_samples); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_loc_samples); __Pyx_INCREF(__pyx_v_headers); __Pyx_GIVEREF(__pyx_v_headers); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_headers); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_loc_samples, __pyx_t_2); __pyx_t_2 = 0;
+0464: self.parser = VCFParser(fields=fields, types=types, numbers=numbers,
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fields, __pyx_v_fields) < 0) __PYX_ERR(0, 464, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_types, __pyx_v_types) < 0) __PYX_ERR(0, 464, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_numbers, __pyx_v_numbers) < 0) __PYX_ERR(0, 464, __pyx_L1_error) /* … */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFParser), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->parser)); __pyx_v_self->parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_t_1); __pyx_t_1 = 0;
+0465: chunk_length=chunk_length, loc_samples=loc_samples,
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_t_1) < 0) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_loc_samples, __pyx_v_loc_samples) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
+0466: fills=fills, region=region)
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fills, __pyx_v_fills) < 0) __PYX_ERR(0, 464, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_region, __pyx_v_region) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
0467:
+0468: def __iter__(self):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_16VCFChunkIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_16VCFChunkIterator_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_16VCFChunkIterator_2__iter__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChunkIterator *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_16VCFChunkIterator_2__iter__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChunkIterator *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0469: return self
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0;
0470:
+0471: def __next__(self):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_16VCFChunkIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_16VCFChunkIterator_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_16VCFChunkIterator_4__next__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChunkIterator *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_16VCFChunkIterator_4__next__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChunkIterator *__pyx_v_self) { long __pyx_v_chunk_length; PyObject *__pyx_v_chunk = NULL; PyObject *__pyx_v_chrom = NULL; long __pyx_v_pos; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFChunkIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_chunk); __Pyx_XDECREF(__pyx_v_chrom); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0472:
+0473: if self.context.state == VCFState.EOF:
__pyx_t_1 = ((__pyx_v_self->context->state == __pyx_e_5allel_3opt_11io_vcf_read_EOF) != 0); if (__pyx_t_1) { /* … */ }
+0474: raise StopIteration
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
__PYX_ERR(0, 474, __pyx_L1_error)
0475:
0476: # reset indices
+0477: self.context.chunk_variant_index = -1
__pyx_v_self->context->chunk_variant_index = -1;
0478:
0479: # allocate arrays for next chunk
+0480: self.parser.malloc_chunk()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self->parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->parser); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 480, __pyx_L1_error)
0481:
0482: # parse next chunk
+0483: self.parser.parse(self.stream, self.context)
__pyx_t_3 = ((PyObject *)__pyx_v_self->stream); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_v_self->context); __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self->parser->__pyx_vtab)->parse(__pyx_v_self->parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_t_3), ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *)__pyx_t_4)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
0484:
0485: # get the chunk
+0486: chunk_length = self.context.chunk_variant_index + 1
__pyx_v_chunk_length = (__pyx_v_self->context->chunk_variant_index + 1);
+0487: chunk = self.parser.make_chunk(chunk_length)
__pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_chunk_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self->parser->__pyx_vtab)->make_chunk(__pyx_v_self->parser, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_chunk = __pyx_t_3; __pyx_t_3 = 0;
0488:
+0489: if chunk is None:
__pyx_t_1 = (__pyx_v_chunk == Py_None); __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { /* … */ }
+0490: raise StopIteration
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
__PYX_ERR(0, 490, __pyx_L1_error)
0491:
+0492: chrom = CharVector_to_pybytes(&self.context.chrom)
__pyx_t_3 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pybytes((&__pyx_v_self->context->chrom)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_chrom = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
+0493: pos = self.context.pos
__pyx_t_6 = __pyx_v_self->context->pos; __pyx_v_pos = __pyx_t_6;
+0494: return chunk, chunk_length, chrom, pos
__Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_chunk_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_pos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_chunk); __Pyx_GIVEREF(__pyx_v_chunk); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); __Pyx_INCREF(__pyx_v_chrom); __Pyx_GIVEREF(__pyx_v_chrom); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_chrom); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0;
0495:
0496:
+0497: cdef class VCFParser:
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser { PyObject_HEAD struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFParser *__pyx_vtab; int chunk_length; __Pyx_memviewslice loc_samples; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *chrom_pos_parser; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *id_parser; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *ref_parser; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *alt_parser; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *qual_parser; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *filter_parser; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *info_parser; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *format_parser; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *calldata_parser; PyObject *region_chrom; int region_begin; int region_end; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFParser { int (*parse)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *); int (*malloc_chunk)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *); PyObject *(*make_chunk)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *, PyObject *); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFParser;
0498:
0499: cdef:
0500: int chunk_length
0501: np.uint8_t[:] loc_samples
0502: VCFFieldParserBase chrom_pos_parser
0503: VCFFieldParserBase id_parser
0504: VCFFieldParserBase ref_parser
0505: VCFFieldParserBase alt_parser
0506: VCFFieldParserBase qual_parser
0507: VCFFieldParserBase filter_parser
0508: VCFFieldParserBase info_parser
0509: VCFFieldParserBase format_parser
0510: VCFFieldParserBase calldata_parser
0511: bytes region_chrom
0512: int region_begin
0513: int region_end
0514:
+0515: def __init__(self, fields, types, numbers, chunk_length, loc_samples, fills, region):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_numbers = 0; PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_loc_samples = 0; PyObject *__pyx_v_fills = 0; PyObject *__pyx_v_region = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,&__pyx_n_s_numbers,&__pyx_n_s_chunk_length,&__pyx_n_s_loc_samples,&__pyx_n_s_fills,&__pyx_n_s_region,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 515, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numbers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 515, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 515, __pyx_L3_error) } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc_samples)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 515, __pyx_L3_error) } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fills)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 515, __pyx_L3_error) } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 515, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 515, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; __pyx_v_numbers = values[2]; __pyx_v_chunk_length = values[3]; __pyx_v_loc_samples = values[4]; __pyx_v_fills = values[5]; __pyx_v_region = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 515, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), __pyx_v_fields, __pyx_v_types, __pyx_v_numbers, __pyx_v_chunk_length, __pyx_v_loc_samples, __pyx_v_fills, __pyx_v_region); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types, PyObject *__pyx_v_numbers, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_loc_samples, PyObject *__pyx_v_fills, PyObject *__pyx_v_region) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0516: self.chunk_length = chunk_length
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_chunk_length); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_v_self->chunk_length = __pyx_t_1;
+0517: self.loc_samples = loc_samples
__pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_loc_samples); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 517, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->loc_samples, 0); __pyx_v_self->loc_samples = __pyx_t_2; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
0518:
0519: # handle region
+0520: self._init_region(region)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_region); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_region); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_region}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_region}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_region); __Pyx_GIVEREF(__pyx_v_region); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_region); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
0521:
0522: # setup parsers
+0523: self._init_chrom_pos(fields, types)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_chrom_pos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_fields, __pyx_v_types}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_fields, __pyx_v_types}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_1, __pyx_v_fields); __Pyx_INCREF(__pyx_v_types); __Pyx_GIVEREF(__pyx_v_types); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_1, __pyx_v_types); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0524: self._init_id(fields, types)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_fields, __pyx_v_types}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_fields, __pyx_v_types}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_1, __pyx_v_fields); __Pyx_INCREF(__pyx_v_types); __Pyx_GIVEREF(__pyx_v_types); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_1, __pyx_v_types); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0525: self._init_ref(fields, types)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_ref); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_fields, __pyx_v_types}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_fields, __pyx_v_types}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_1, __pyx_v_fields); __Pyx_INCREF(__pyx_v_types); __Pyx_GIVEREF(__pyx_v_types); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_1, __pyx_v_types); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0526: self._init_alt(fields, types, numbers)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_alt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_fields, __pyx_v_types, __pyx_v_numbers}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_fields, __pyx_v_types, __pyx_v_numbers}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_1, __pyx_v_fields); __Pyx_INCREF(__pyx_v_types); __Pyx_GIVEREF(__pyx_v_types); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_1, __pyx_v_types); __Pyx_INCREF(__pyx_v_numbers); __Pyx_GIVEREF(__pyx_v_numbers); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_1, __pyx_v_numbers); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0527: self._init_qual(fields, types, fills)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_qual); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_fields, __pyx_v_types, __pyx_v_fills}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_fields, __pyx_v_types, __pyx_v_fills}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_1, __pyx_v_fields); __Pyx_INCREF(__pyx_v_types); __Pyx_GIVEREF(__pyx_v_types); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_1, __pyx_v_types); __Pyx_INCREF(__pyx_v_fills); __Pyx_GIVEREF(__pyx_v_fills); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_1, __pyx_v_fills); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0528: self._init_filter(fields)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_filter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_fields}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_fields}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_fields); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0529: self._init_info(fields, types, numbers, fills)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_fields, __pyx_v_types, __pyx_v_numbers, __pyx_v_fills}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 4+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_fields, __pyx_v_types, __pyx_v_numbers, __pyx_v_fills}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 4+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_5 = PyTuple_New(4+__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_1, __pyx_v_fields); __Pyx_INCREF(__pyx_v_types); __Pyx_GIVEREF(__pyx_v_types); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_1, __pyx_v_types); __Pyx_INCREF(__pyx_v_numbers); __Pyx_GIVEREF(__pyx_v_numbers); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_1, __pyx_v_numbers); __Pyx_INCREF(__pyx_v_fills); __Pyx_GIVEREF(__pyx_v_fills); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_1, __pyx_v_fills); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0530: self._init_format_calldata(fields, types, numbers, fills)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_format_calldata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_fields, __pyx_v_types, __pyx_v_numbers, __pyx_v_fills}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 4+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_fields, __pyx_v_types, __pyx_v_numbers, __pyx_v_fills}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 4+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(4+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_1, __pyx_v_fields); __Pyx_INCREF(__pyx_v_types); __Pyx_GIVEREF(__pyx_v_types); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_1, __pyx_v_types); __Pyx_INCREF(__pyx_v_numbers); __Pyx_GIVEREF(__pyx_v_numbers); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_1, __pyx_v_numbers); __Pyx_INCREF(__pyx_v_fills); __Pyx_GIVEREF(__pyx_v_fills); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_1, __pyx_v_fills); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
0531:
+0532: if fields:
__pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_fields); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 532, __pyx_L1_error)
if (__pyx_t_7) {
/* … */
}
0533: # shouldn't ever be any left over
+0534: raise RuntimeError('unexpected fields left over: %r' % set(fields))
__pyx_t_3 = PySet_New(__pyx_v_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_unexpected_fields_left_over_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 534, __pyx_L1_error)
0535:
+0536: def _init_region(self, region):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_3_init_region(PyObject *__pyx_v_self, PyObject *__pyx_v_region); /*proto*/ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_3_init_region(PyObject *__pyx_v_self, PyObject *__pyx_v_region) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_region (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_2_init_region(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), ((PyObject *)__pyx_v_region)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_2_init_region(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_region) { PyObject *__pyx_v_tokens = NULL; PyObject *__pyx_v_range_tokens = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_region", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_region", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tokens); __Pyx_XDECREF(__pyx_v_range_tokens); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0537: self.region_chrom = b''
__Pyx_INCREF(__pyx_kp_b__4); __Pyx_GIVEREF(__pyx_kp_b__4); __Pyx_GOTREF(__pyx_v_self->region_chrom); __Pyx_DECREF(__pyx_v_self->region_chrom); __pyx_v_self->region_chrom = __pyx_kp_b__4;
+0538: self.region_begin = 0
__pyx_v_self->region_begin = 0;
+0539: self.region_end = 0
__pyx_v_self->region_end = 0;
+0540: if region is not None:
__pyx_t_1 = (__pyx_v_region != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* … */ }
+0541: tokens = region.split(':')
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_region, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tokens = __pyx_t_4; __pyx_t_4 = 0; /* … */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6);
+0542: if len(tokens) == 0:
__pyx_t_5 = PyObject_Length(__pyx_v_tokens); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 542, __pyx_L1_error)
__pyx_t_2 = ((__pyx_t_5 == 0) != 0);
if (__pyx_t_2) {
/* … */
}
+0543: raise ValueError('bad region string: %r' % region)
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_bad_region_string_r, __pyx_v_region); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 543, __pyx_L1_error)
+0544: if PY2:
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L5; }
+0545: self.region_chrom = tokens[0]
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_tokens, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->region_chrom); __Pyx_DECREF(__pyx_v_self->region_chrom); __pyx_v_self->region_chrom = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0;
0546: else:
+0547: self.region_chrom = tokens[0].encode('ascii')
/*else*/ { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_tokens, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->region_chrom); __Pyx_DECREF(__pyx_v_self->region_chrom); __pyx_v_self->region_chrom = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L5:; /* … */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7);
+0548: if len(tokens) > 1:
__pyx_t_5 = PyObject_Length(__pyx_v_tokens); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 548, __pyx_L1_error)
__pyx_t_2 = ((__pyx_t_5 > 1) != 0);
if (__pyx_t_2) {
/* … */
}
+0549: range_tokens = tokens[1].split('-')
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_tokens, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_range_tokens = __pyx_t_4; __pyx_t_4 = 0; /* … */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9);
+0550: if len(range_tokens) != 2:
__pyx_t_5 = PyObject_Length(__pyx_v_range_tokens); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 550, __pyx_L1_error)
__pyx_t_2 = ((__pyx_t_5 != 2) != 0);
if (__pyx_t_2) {
/* … */
}
+0551: raise ValueError('bad region string: %r' % region)
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_bad_region_string_r, __pyx_v_region); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 551, __pyx_L1_error)
+0552: self.region_begin = int(range_tokens[0])
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_range_tokens, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->region_begin = __pyx_t_6;
+0553: self.region_end = int(range_tokens[1])
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_range_tokens, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->region_end = __pyx_t_6;
0554:
+0555: def _init_chrom_pos(self, fields, types):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_5_init_chrom_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5allel_3opt_11io_vcf_read_9VCFParser_4_init_chrom_pos[] = "Setup CHROM and POS parser."; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_5_init_chrom_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_chrom_pos (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_chrom_pos", 1, 2, 2, 1); __PYX_ERR(0, 555, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_chrom_pos") < 0)) __PYX_ERR(0, 555, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_init_chrom_pos", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 555, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_chrom_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_4_init_chrom_pos(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), __pyx_v_fields, __pyx_v_types); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_4_init_chrom_pos(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types) { PyObject *__pyx_v_kwds = NULL; PyObject *__pyx_v_t = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChromPosParser *__pyx_v_chrom_pos_parser = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_chrom_pos", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_chrom_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_kwds); __Pyx_XDECREF(__pyx_v_t); __Pyx_XDECREF((PyObject *)__pyx_v_chrom_pos_parser); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0556: """Setup CHROM and POS parser."""
+0557: kwds = dict(dtype=None, chunk_length=self.chunk_length,
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, Py_None) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chunk_length, __pyx_t_2) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0558: region_chrom=self.region_chrom, region_begin=self.region_begin,
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_chrom, __pyx_v_self->region_chrom) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->region_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_begin, __pyx_t_2) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0559: region_end=self.region_end, store_chrom=False, store_pos=False)
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->region_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_end, __pyx_t_2) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_store_chrom, Py_False) < 0) __PYX_ERR(0, 557, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_store_pos, Py_False) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __pyx_v_kwds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
0560:
+0561: if CHROM_FIELD in fields:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CHROM_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* … */ }
+0562: kwds['dtype'] = types[CHROM_FIELD]
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CHROM_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetItem(__pyx_v_types, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyDict_SetItem(__pyx_v_kwds, __pyx_n_s_dtype, __pyx_t_2) < 0)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0563: kwds['store_chrom'] = True
if (unlikely(PyDict_SetItem(__pyx_v_kwds, __pyx_n_s_store_chrom, Py_True) < 0)) __PYX_ERR(0, 563, __pyx_L1_error)
+0564: fields.remove(CHROM_FIELD)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_CHROM_FIELD); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
0565:
+0566: if POS_FIELD in fields:
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_POS_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* … */ }
+0567: if POS_FIELD in types:
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_POS_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_types, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* … */ }
+0568: t = types[POS_FIELD]
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_POS_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_GetItem(__pyx_v_types, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_t = __pyx_t_1; __pyx_t_1 = 0;
+0569: if t != np.dtype('int32'):
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* … */ } /* … */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10);
+0570: warnings.warn('only int32 supported for POS field, ignoring requested type: %r' % t)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_only_int32_supported_for_POS_fie, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0571: kwds['store_pos'] = True
if (unlikely(PyDict_SetItem(__pyx_v_kwds, __pyx_n_s_store_pos, Py_True) < 0)) __PYX_ERR(0, 571, __pyx_L1_error)
+0572: fields.remove(POS_FIELD)
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_POS_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
0573:
+0574: chrom_pos_parser = VCFChromPosParser(**kwds)
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFChromPosParser), __pyx_empty_tuple, __pyx_v_kwds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_chrom_pos_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChromPosParser *)__pyx_t_2); __pyx_t_2 = 0;
+0575: chrom_pos_parser.malloc_chunk()
__pyx_t_8 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFChromPosParser *)__pyx_v_chrom_pos_parser->__pyx_base.__pyx_vtab)->__pyx_base.malloc_chunk(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_chrom_pos_parser)); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
+0576: self.chrom_pos_parser = chrom_pos_parser
__Pyx_INCREF(((PyObject *)__pyx_v_chrom_pos_parser)); __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom_pos_parser)); __Pyx_GOTREF(__pyx_v_self->chrom_pos_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->chrom_pos_parser)); __pyx_v_self->chrom_pos_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_chrom_pos_parser);
0577:
+0578: def _init_id(self, fields, types):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_7_init_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5allel_3opt_11io_vcf_read_9VCFParser_6_init_id[] = "Setup ID parser."; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_7_init_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_id (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_id", 1, 2, 2, 1); __PYX_ERR(0, 578, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_id") < 0)) __PYX_ERR(0, 578, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_init_id", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 578, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_6_init_id(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), __pyx_v_fields, __pyx_v_types); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_6_init_id(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types) { PyObject *__pyx_v_t = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_id_parser = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_id", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_t); __Pyx_XDECREF((PyObject *)__pyx_v_id_parser); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0579: """Setup ID parser."""
+0580: if ID_FIELD in fields:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ID_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+0581: t = types[ID_FIELD]
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ID_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(__pyx_v_types, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_t = __pyx_t_4; __pyx_t_4 = 0;
+0582: t = check_string_dtype(t)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_string_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_t}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_t}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_t); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0;
+0583: if t.kind == 'S':
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_kind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L4; }
+0584: id_parser = VCFIDStringParser(dtype=t, chunk_length=self.chunk_length)
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_v_t) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_chunk_length, __pyx_t_1) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFIDStringParser), __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_id_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_1); __pyx_t_1 = 0;
0585: else:
+0586: id_parser = VCFIDObjectParser(chunk_length=self.chunk_length)
/*else*/ { __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chunk_length, __pyx_t_4) < 0) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFIDObjectParser), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_id_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:;
+0587: fields.remove(ID_FIELD)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ID_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
0588: else:
+0589: id_parser = VCFSkipFieldParser(key=b'ID')
/*else*/ { __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_n_b_ID) < 0) __PYX_ERR(0, 589, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipFieldParser), __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_id_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:;
+0590: id_parser.malloc_chunk()
__pyx_t_8 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_id_parser->__pyx_vtab)->malloc_chunk(__pyx_v_id_parser); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 590, __pyx_L1_error)
+0591: self.id_parser = id_parser
__Pyx_INCREF(((PyObject *)__pyx_v_id_parser)); __Pyx_GIVEREF(((PyObject *)__pyx_v_id_parser)); __Pyx_GOTREF(__pyx_v_self->id_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->id_parser)); __pyx_v_self->id_parser = __pyx_v_id_parser;
0592:
+0593: def _init_ref(self, fields, types):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_9_init_ref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_9_init_ref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_ref (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_ref", 1, 2, 2, 1); __PYX_ERR(0, 593, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_ref") < 0)) __PYX_ERR(0, 593, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_init_ref", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 593, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_ref", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_8_init_ref(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), __pyx_v_fields, __pyx_v_types); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_8_init_ref(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types) { PyObject *__pyx_v_t = NULL; int __pyx_v_store; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_ref_parser = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_ref", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_ref", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_t); __Pyx_XDECREF((PyObject *)__pyx_v_ref_parser); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0594: # setup REF parser
+0595: t = types.get(REF_FIELD, None)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_types, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_REF_FIELD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, Py_None}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, Py_None}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_t = __pyx_t_1; __pyx_t_1 = 0;
+0596: store = False
__pyx_v_store = 0;
+0597: if REF_FIELD in fields:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_REF_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* … */ }
+0598: store = True
__pyx_v_store = 1;
+0599: fields.remove(REF_FIELD)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_REF_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_6}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_6}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0600: t = check_string_dtype(t)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_string_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_t}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_t}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_t); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_1); __pyx_t_1 = 0;
+0601: if t is not None and t.kind == 'S':
__pyx_t_7 = (__pyx_v_t != Py_None); __pyx_t_9 = (__pyx_t_7 != 0); if (__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __pyx_t_9; __pyx_L5_bool_binop_done:; if (__pyx_t_8) { /* … */ goto __pyx_L4; }
+0602: ref_parser = VCFRefStringParser(dtype=t, chunk_length=self.chunk_length, store=store)
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_t) < 0) __PYX_ERR(0, 602, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chunk_length, __pyx_t_2) < 0) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_store); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_store, __pyx_t_2) < 0) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFRefStringParser), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ref_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_2); __pyx_t_2 = 0;
0603: else:
+0604: ref_parser = VCFRefObjectParser(chunk_length=self.chunk_length, store=store)
/*else*/ { __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_t_1) < 0) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_store); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_store, __pyx_t_1) < 0) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFRefObjectParser), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ref_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_1); __pyx_t_1 = 0; } __pyx_L4:;
+0605: ref_parser.malloc_chunk()
__pyx_t_5 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_ref_parser->__pyx_vtab)->malloc_chunk(__pyx_v_ref_parser); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 605, __pyx_L1_error)
+0606: self.ref_parser = ref_parser
__Pyx_INCREF(((PyObject *)__pyx_v_ref_parser)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ref_parser)); __Pyx_GOTREF(__pyx_v_self->ref_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->ref_parser)); __pyx_v_self->ref_parser = __pyx_v_ref_parser;
0607:
+0608: def _init_alt(self, fields, types, numbers):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_11_init_alt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5allel_3opt_11io_vcf_read_9VCFParser_10_init_alt[] = "Setup ALT parser."; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_11_init_alt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_numbers = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_alt (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,&__pyx_n_s_numbers,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_alt", 1, 3, 3, 1); __PYX_ERR(0, 608, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numbers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_alt", 1, 3, 3, 2); __PYX_ERR(0, 608, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_alt") < 0)) __PYX_ERR(0, 608, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; __pyx_v_numbers = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_init_alt", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 608, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_alt", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_10_init_alt(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), __pyx_v_fields, __pyx_v_types, __pyx_v_numbers); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_10_init_alt(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types, PyObject *__pyx_v_numbers) { int __pyx_v_store_alt; int __pyx_v_store_numalt; int __pyx_v_store_svlen; int __pyx_v_store_is_snp; PyObject *__pyx_v_t = NULL; PyObject *__pyx_v_n = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_alt_parser = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_alt", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_alt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_t); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF((PyObject *)__pyx_v_alt_parser); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0609: """Setup ALT parser."""
0610:
+0611: store_alt = False
__pyx_v_store_alt = 0;
+0612: store_numalt = False
__pyx_v_store_numalt = 0;
+0613: store_svlen = False
__pyx_v_store_svlen = 0;
+0614: store_is_snp = False
__pyx_v_store_is_snp = 0;
+0615: t = types.get(ALT_FIELD, None)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_types, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ALT_FIELD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, Py_None}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, Py_None}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_t = __pyx_t_1; __pyx_t_1 = 0;
+0616: n = numbers.get(ALT_FIELD, 1)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_numbers, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ALT_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_6, __pyx_int_1}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_6, __pyx_int_1}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_int_1); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_n = __pyx_t_1; __pyx_t_1 = 0;
+0617: if ALT_FIELD in fields:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ALT_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* … */ }
+0618: store_alt = True
__pyx_v_store_alt = 1;
+0619: fields.remove(ALT_FIELD)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ALT_FIELD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0620: if 'variants/numalt' in fields:
__pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_variants_numalt, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 620, __pyx_L1_error)
__pyx_t_7 = (__pyx_t_8 != 0);
if (__pyx_t_7) {
/* … */
}
+0621: store_numalt = True
__pyx_v_store_numalt = 1;
+0622: fields.remove('variants/numalt')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_variants_numalt); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11);
+0623: if 'variants/svlen' in fields:
__pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_variants_svlen, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
__pyx_t_8 = (__pyx_t_7 != 0);
if (__pyx_t_8) {
/* … */
}
+0624: store_svlen = True
__pyx_v_store_svlen = 1;
+0625: fields.remove('variants/svlen')
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_variants_svlen); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12);
+0626: if 'variants/is_snp' in fields:
__pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_variants_is_snp, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 626, __pyx_L1_error)
__pyx_t_7 = (__pyx_t_8 != 0);
if (__pyx_t_7) {
/* … */
}
+0627: store_is_snp = True
__pyx_v_store_is_snp = 1;
+0628: fields.remove('variants/is_snp')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_variants_is_snp); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13);
0629:
+0630: if store_alt or store_numalt or store_svlen or store_is_snp:
__pyx_t_8 = (__pyx_v_store_alt != 0); if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L8_bool_binop_done; } __pyx_t_8 = (__pyx_v_store_numalt != 0); if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L8_bool_binop_done; } __pyx_t_8 = (__pyx_v_store_svlen != 0); if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L8_bool_binop_done; } __pyx_t_8 = (__pyx_v_store_is_snp != 0); __pyx_t_7 = __pyx_t_8; __pyx_L8_bool_binop_done:; if (__pyx_t_7) { /* … */ goto __pyx_L7; }
+0631: if store_alt:
__pyx_t_7 = (__pyx_v_store_alt != 0); if (__pyx_t_7) { /* … */ }
+0632: t = check_string_dtype(t)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_string_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_t}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_t}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_t); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_2); __pyx_t_2 = 0;
+0633: if t is not None and t.kind == 'S':
__pyx_t_8 = (__pyx_v_t != Py_None); __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L14_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __pyx_t_9; __pyx_L14_bool_binop_done:; if (__pyx_t_7) { /* … */ goto __pyx_L13; }
+0634: alt_parser = VCFAltStringParser(dtype=t, number=n, chunk_length=self.chunk_length,
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_v_t) < 0) __PYX_ERR(0, 634, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 634, __pyx_L1_error) __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_t_1) < 0) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFAltStringParser), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_alt_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_1); __pyx_t_1 = 0;
+0635: store_alt=store_alt, store_numalt=store_numalt,
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_store_alt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_store_alt, __pyx_t_1) < 0) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_store_numalt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_store_numalt, __pyx_t_1) < 0) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0636: store_svlen=store_svlen, store_is_snp=store_is_snp)
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_store_svlen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_store_svlen, __pyx_t_1) < 0) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_store_is_snp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_store_is_snp, __pyx_t_1) < 0) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0637: else:
+0638: alt_parser = VCFAltObjectParser(number=n, chunk_length=self.chunk_length, store_alt=store_alt,
/*else*/ { __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 638, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chunk_length, __pyx_t_2) < 0) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_store_alt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_store_alt, __pyx_t_2) < 0) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFAltObjectParser), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_alt_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L13:;
+0639: store_numalt=store_numalt,
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_store_numalt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_store_numalt, __pyx_t_2) < 0) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0640: store_svlen=store_svlen, store_is_snp=store_is_snp)
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_store_svlen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_store_svlen, __pyx_t_2) < 0) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_store_is_snp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_store_is_snp, __pyx_t_2) < 0) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
0641: else:
+0642: alt_parser = VCFSkipFieldParser(key=b'ALT')
/*else*/ { __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_ALT) < 0) __PYX_ERR(0, 642, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipFieldParser), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_alt_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_1); __pyx_t_1 = 0; } __pyx_L7:;
0643:
+0644: alt_parser.malloc_chunk()
__pyx_t_5 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_alt_parser->__pyx_vtab)->malloc_chunk(__pyx_v_alt_parser); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 644, __pyx_L1_error)
+0645: self.alt_parser = alt_parser
__Pyx_INCREF(((PyObject *)__pyx_v_alt_parser)); __Pyx_GIVEREF(((PyObject *)__pyx_v_alt_parser)); __Pyx_GOTREF(__pyx_v_self->alt_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->alt_parser)); __pyx_v_self->alt_parser = __pyx_v_alt_parser;
0646:
+0647: def _init_qual(self, fields, types, fills):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_13_init_qual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5allel_3opt_11io_vcf_read_9VCFParser_12_init_qual[] = "Setup QUAL parser."; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_13_init_qual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_fills = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_qual (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,&__pyx_n_s_fills,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_qual", 1, 3, 3, 1); __PYX_ERR(0, 647, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fills)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_qual", 1, 3, 3, 2); __PYX_ERR(0, 647, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_qual") < 0)) __PYX_ERR(0, 647, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; __pyx_v_fills = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_init_qual", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 647, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_qual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_12_init_qual(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), __pyx_v_fields, __pyx_v_types, __pyx_v_fills); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_12_init_qual(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types, PyObject *__pyx_v_fills) { PyObject *__pyx_v_t = NULL; PyObject *__pyx_v_fill = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_qual_parser = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_qual", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_qual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_t); __Pyx_XDECREF(__pyx_v_fill); __Pyx_XDECREF((PyObject *)__pyx_v_qual_parser); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0648: """Setup QUAL parser."""
+0649: if QUAL_FIELD in fields:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_QUAL_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+0650: if QUAL_FIELD in types:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_QUAL_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_types, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* … */ }
+0651: t = types[QUAL_FIELD]
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_QUAL_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(__pyx_v_types, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_t = __pyx_t_4; __pyx_t_4 = 0;
+0652: if t != np.dtype('float32'):
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ } /* … */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_float32); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14);
+0653: warnings.warn('only float32 supported for QUAL field, ignoring requested type: %r' % t)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_only_float32_supported_for_QUAL, __pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0654: fill = fills.get(QUAL_FIELD, -1)
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_QUAL_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_7, __pyx_int_neg_1}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_7, __pyx_int_neg_1}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_t_7); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_int_neg_1); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_fill = __pyx_t_1; __pyx_t_1 = 0;
+0655: qual_parser = VCFQualParser(chunk_length=self.chunk_length, fill=fill)
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chunk_length, __pyx_t_5) < 0) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 655, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFQualParser), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_qual_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_5); __pyx_t_5 = 0;
+0656: fields.remove(QUAL_FIELD)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_QUAL_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_7) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
0657: else:
+0658: qual_parser = VCFSkipFieldParser(key=b'QUAL')
/*else*/ { __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, __pyx_n_b_QUAL) < 0) __PYX_ERR(0, 658, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipFieldParser), __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_qual_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:;
+0659: qual_parser.malloc_chunk()
__pyx_t_8 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_qual_parser->__pyx_vtab)->malloc_chunk(__pyx_v_qual_parser); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 659, __pyx_L1_error)
+0660: self.qual_parser = qual_parser
__Pyx_INCREF(((PyObject *)__pyx_v_qual_parser)); __Pyx_GIVEREF(((PyObject *)__pyx_v_qual_parser)); __Pyx_GOTREF(__pyx_v_self->qual_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->qual_parser)); __pyx_v_self->qual_parser = __pyx_v_qual_parser;
0661:
+0662: def _init_filter(self, fields):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_15_init_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_fields); /*proto*/ static char __pyx_doc_5allel_3opt_11io_vcf_read_9VCFParser_14_init_filter[] = "Setup FILTER parser."; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_15_init_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_fields) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_filter (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_14_init_filter(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), ((PyObject *)__pyx_v_fields)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_14_init_filter(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_fields) { PyObject *__pyx_v_filter_keys = NULL; PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_k = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_filter_parser = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_filter", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_filter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filter_keys); __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF((PyObject *)__pyx_v_filter_parser); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0663: """Setup FILTER parser."""
+0664: filter_keys = list()
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_filter_keys = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0665: for field in list(fields):
__pyx_t_1 = PySequence_List(__pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 665, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_1); __pyx_t_1 = 0; /* … */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0666: if field.startswith('variants/FILTER_'):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* … */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_variants_FILTER); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* … */ }
+0667: k = field[16:]
__pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_field, 16, 0, NULL, NULL, &__pyx_slice__16, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4); __pyx_t_4 = 0; /* … */ __pyx_slice__16 = PySlice_New(__pyx_int_16, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__16); __Pyx_GIVEREF(__pyx_slice__16);
+0668: if not PY2:
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { /* … */ }
+0669: k = k.encode('ascii')
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17);
+0670: filter_keys.append(k)
__pyx_t_7 = __Pyx_PyList_Append(__pyx_v_filter_keys, __pyx_v_k); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 670, __pyx_L1_error)
+0671: fields.remove(field)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_field}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_field}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_field); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0672: if filter_keys:
__pyx_t_6 = (__pyx_v_filter_keys != Py_None) && (PyList_GET_SIZE(__pyx_v_filter_keys) != 0);
if (__pyx_t_6) {
/* … */
goto __pyx_L7;
}
+0673: filter_parser = VCFFilterParser(filter_keys=filter_keys, chunk_length=self.chunk_length)
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_filter_keys, __pyx_v_filter_keys) < 0) __PYX_ERR(0, 673, __pyx_L1_error) __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_t_1) < 0) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFFilterParser), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_filter_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_1); __pyx_t_1 = 0;
0674: else:
+0675: filter_parser = VCFSkipFieldParser(key=b'FILTER')
/*else*/ { __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_n_b_FILTER) < 0) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipFieldParser), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_filter_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L7:;
+0676: filter_parser.malloc_chunk()
__pyx_t_10 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_filter_parser->__pyx_vtab)->malloc_chunk(__pyx_v_filter_parser); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 676, __pyx_L1_error)
+0677: self.filter_parser = filter_parser
__Pyx_INCREF(((PyObject *)__pyx_v_filter_parser)); __Pyx_GIVEREF(((PyObject *)__pyx_v_filter_parser)); __Pyx_GOTREF(__pyx_v_self->filter_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->filter_parser)); __pyx_v_self->filter_parser = __pyx_v_filter_parser;
0678:
+0679: def _init_info(self, fields, types, numbers, fills):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_17_init_info(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_17_init_info(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_numbers = 0; PyObject *__pyx_v_fills = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_info (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,&__pyx_n_s_numbers,&__pyx_n_s_fills,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_info", 1, 4, 4, 1); __PYX_ERR(0, 679, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numbers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_info", 1, 4, 4, 2); __PYX_ERR(0, 679, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fills)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_info", 1, 4, 4, 3); __PYX_ERR(0, 679, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_info") < 0)) __PYX_ERR(0, 679, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; __pyx_v_numbers = values[2]; __pyx_v_fills = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_init_info", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 679, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_16_init_info(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), __pyx_v_fields, __pyx_v_types, __pyx_v_numbers, __pyx_v_fills); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_16_init_info(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types, PyObject *__pyx_v_numbers, PyObject *__pyx_v_fills) { PyObject *__pyx_v_info_keys = NULL; PyObject *__pyx_v_info_types = NULL; PyObject *__pyx_v_info_numbers = NULL; PyObject *__pyx_v_info_fills = NULL; PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_key = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_info_parser = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_info", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_info_keys); __Pyx_XDECREF(__pyx_v_info_types); __Pyx_XDECREF(__pyx_v_info_numbers); __Pyx_XDECREF(__pyx_v_info_fills); __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_group); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF((PyObject *)__pyx_v_info_parser); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0680: # setup INFO parser
+0681: info_keys = list()
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_info_keys = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0682: info_types = dict()
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_info_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0683: info_numbers = dict()
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_info_numbers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0684: info_fills = dict()
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_info_fills = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
0685: # assume any variants fields left are INFO
+0686: for field in list(fields):
__pyx_t_1 = PySequence_List(__pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 686, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_1); __pyx_t_1 = 0; /* … */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0687: group, name = field.split('/')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 687, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 687, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 687, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; /* … */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18);
+0688: if group == 'variants':
__pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_group, __pyx_n_s_variants, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 688, __pyx_L1_error)
if (__pyx_t_8) {
/* … */
}
+0689: if not PY2:
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = ((!__pyx_t_8) != 0); if (__pyx_t_9) { /* … */ goto __pyx_L8; }
+0690: key = name.encode('ascii')
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; /* … */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19);
0691: else:
+0692: key = name
/*else*/ { __Pyx_INCREF(__pyx_v_name); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_v_name); } __pyx_L8:;
+0693: info_keys.append(key)
__pyx_t_10 = __Pyx_PyList_Append(__pyx_v_info_keys, __pyx_v_key); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 693, __pyx_L1_error)
+0694: fields.remove(field)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_1) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_field}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_field}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_field); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0695: info_types[key] = types[field]
__pyx_t_5 = PyObject_GetItem(__pyx_v_types, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyDict_SetItem(__pyx_v_info_types, __pyx_v_key, __pyx_t_5) < 0)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0696: info_numbers[key] = numbers[field]
__pyx_t_5 = PyObject_GetItem(__pyx_v_numbers, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyDict_SetItem(__pyx_v_info_numbers, __pyx_v_key, __pyx_t_5) < 0)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0697: if field in fills:
__pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_field, __pyx_v_fills, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 697, __pyx_L1_error)
__pyx_t_8 = (__pyx_t_9 != 0);
if (__pyx_t_8) {
/* … */
}
+0698: info_fills[key] = fills[field]
__pyx_t_5 = PyObject_GetItem(__pyx_v_fills, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyDict_SetItem(__pyx_v_info_fills, __pyx_v_key, __pyx_t_5) < 0)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0699: if info_keys:
__pyx_t_8 = (__pyx_v_info_keys != Py_None) && (PyList_GET_SIZE(__pyx_v_info_keys) != 0);
if (__pyx_t_8) {
/* … */
goto __pyx_L10;
}
+0700: info_parser = VCFInfoParser(info_keys=info_keys,
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_info_keys, __pyx_v_info_keys) < 0) __PYX_ERR(0, 700, __pyx_L1_error) /* … */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoParser), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_info_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_5); __pyx_t_5 = 0;
+0701: types=info_types,
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_types, __pyx_v_info_types) < 0) __PYX_ERR(0, 700, __pyx_L1_error)
+0702: numbers=info_numbers,
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_numbers, __pyx_v_info_numbers) < 0) __PYX_ERR(0, 700, __pyx_L1_error)
+0703: chunk_length=self.chunk_length,
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_t_5) < 0) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0704: fills=info_fills)
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fills, __pyx_v_info_fills) < 0) __PYX_ERR(0, 700, __pyx_L1_error)
0705: else:
+0706: info_parser = VCFSkipFieldParser(key=b'INFO')
/*else*/ { __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, __pyx_n_b_INFO) < 0) __PYX_ERR(0, 706, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipFieldParser), __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_info_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L10:;
+0707: info_parser.malloc_chunk()
__pyx_t_11 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_info_parser->__pyx_vtab)->malloc_chunk(__pyx_v_info_parser); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 707, __pyx_L1_error)
+0708: self.info_parser = info_parser
__Pyx_INCREF(((PyObject *)__pyx_v_info_parser)); __Pyx_GIVEREF(((PyObject *)__pyx_v_info_parser)); __Pyx_GOTREF(__pyx_v_self->info_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->info_parser)); __pyx_v_self->info_parser = __pyx_v_info_parser;
0709:
+0710: def _init_format_calldata(self, fields, types, numbers, fills):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_19_init_format_calldata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5allel_3opt_11io_vcf_read_9VCFParser_18_init_format_calldata[] = "Setup FORMAT and calldata parsers."; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9VCFParser_19_init_format_calldata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_numbers = 0; PyObject *__pyx_v_fills = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_format_calldata (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,&__pyx_n_s_numbers,&__pyx_n_s_fills,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_format_calldata", 1, 4, 4, 1); __PYX_ERR(0, 710, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numbers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_format_calldata", 1, 4, 4, 2); __PYX_ERR(0, 710, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fills)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_init_format_calldata", 1, 4, 4, 3); __PYX_ERR(0, 710, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_format_calldata") < 0)) __PYX_ERR(0, 710, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; __pyx_v_numbers = values[2]; __pyx_v_fills = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_init_format_calldata", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 710, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_format_calldata", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_18_init_format_calldata(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *)__pyx_v_self), __pyx_v_fields, __pyx_v_types, __pyx_v_numbers, __pyx_v_fills); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_9VCFParser_18_init_format_calldata(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types, PyObject *__pyx_v_numbers, PyObject *__pyx_v_fills) { PyObject *__pyx_v_format_keys = NULL; PyObject *__pyx_v_format_types = NULL; PyObject *__pyx_v_format_numbers = NULL; PyObject *__pyx_v_format_fills = NULL; PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_key = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_format_parser = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_calldata_parser = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_format_calldata", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser._init_format_calldata", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_format_keys); __Pyx_XDECREF(__pyx_v_format_types); __Pyx_XDECREF(__pyx_v_format_numbers); __Pyx_XDECREF(__pyx_v_format_fills); __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_group); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF((PyObject *)__pyx_v_format_parser); __Pyx_XDECREF((PyObject *)__pyx_v_calldata_parser); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
0711: """Setup FORMAT and calldata parsers."""
+0712: format_keys = list()
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_format_keys = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0713: format_types = dict()
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_format_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0714: format_numbers = dict()
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_format_numbers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0715: format_fills = dict()
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_format_fills = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0716: for field in list(fields):
__pyx_t_1 = PySequence_List(__pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 716, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_1); __pyx_t_1 = 0; /* … */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0717: group, name = field.split('/')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 717, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 717, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 717, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; /* … */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20);
+0718: if group == 'calldata':
__pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_group, __pyx_n_s_calldata, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 718, __pyx_L1_error)
if (__pyx_t_8) {
/* … */
}
+0719: if not PY2:
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = ((!__pyx_t_8) != 0); if (__pyx_t_9) { /* … */ goto __pyx_L8; }
+0720: key = name.encode('ascii')
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; /* … */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21);
0721: else:
+0722: key = name
/*else*/ { __Pyx_INCREF(__pyx_v_name); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_v_name); } __pyx_L8:;
+0723: format_keys.append(key)
__pyx_t_10 = __Pyx_PyList_Append(__pyx_v_format_keys, __pyx_v_key); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 723, __pyx_L1_error)
+0724: fields.remove(field)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_1) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_field}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_field}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_field); __Pyx_GIVEREF(__pyx_v_field); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_field); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0725: format_types[key] = types[field]
__pyx_t_5 = PyObject_GetItem(__pyx_v_types, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyDict_SetItem(__pyx_v_format_types, __pyx_v_key, __pyx_t_5) < 0)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0726: format_numbers[key] = numbers[field]
__pyx_t_5 = PyObject_GetItem(__pyx_v_numbers, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyDict_SetItem(__pyx_v_format_numbers, __pyx_v_key, __pyx_t_5) < 0)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0727: if field in fills:
__pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_field, __pyx_v_fills, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 727, __pyx_L1_error)
__pyx_t_8 = (__pyx_t_9 != 0);
if (__pyx_t_8) {
/* … */
}
+0728: format_fills[key] = fills[field]
__pyx_t_5 = PyObject_GetItem(__pyx_v_fills, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyDict_SetItem(__pyx_v_format_fills, __pyx_v_key, __pyx_t_5) < 0)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0729: if format_keys:
__pyx_t_8 = (__pyx_v_format_keys != Py_None) && (PyList_GET_SIZE(__pyx_v_format_keys) != 0);
if (__pyx_t_8) {
/* … */
goto __pyx_L10;
}
+0730: format_parser = VCFFormatParser(format_keys=format_keys)
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_format_keys, __pyx_v_format_keys) < 0) __PYX_ERR(0, 730, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFFormatParser), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_format_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_5); __pyx_t_5 = 0;
+0731: calldata_parser = VCFCallDataParser(format_keys=format_keys,
__pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_format_keys, __pyx_v_format_keys) < 0) __PYX_ERR(0, 731, __pyx_L1_error) /* … */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataParser), __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_calldata_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_2); __pyx_t_2 = 0;
+0732: types=format_types,
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_types, __pyx_v_format_types) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+0733: numbers=format_numbers,
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_numbers, __pyx_v_format_numbers) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+0734: chunk_length=self.chunk_length,
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_chunk_length, __pyx_t_2) < 0) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0735: loc_samples=self.loc_samples,
__pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->loc_samples, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_loc_samples, __pyx_t_2) < 0) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0736: fills=format_fills)
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fills, __pyx_v_format_fills) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
0737: else:
+0738: format_parser = VCFSkipFieldParser(key=b'FORMAT')
/*else*/ { __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_FORMAT) < 0) __PYX_ERR(0, 738, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipFieldParser), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_format_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_5); __pyx_t_5 = 0;
+0739: calldata_parser = VCFSkipAllCallDataParser()
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipAllCallDataParser), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_calldata_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_t_5); __pyx_t_5 = 0; } __pyx_L10:;
+0740: format_parser.malloc_chunk()
__pyx_t_11 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_format_parser->__pyx_vtab)->malloc_chunk(__pyx_v_format_parser); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 740, __pyx_L1_error)
+0741: calldata_parser.malloc_chunk()
__pyx_t_11 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_calldata_parser->__pyx_vtab)->malloc_chunk(__pyx_v_calldata_parser); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 741, __pyx_L1_error)
+0742: self.format_parser = format_parser
__Pyx_INCREF(((PyObject *)__pyx_v_format_parser)); __Pyx_GIVEREF(((PyObject *)__pyx_v_format_parser)); __Pyx_GOTREF(__pyx_v_self->format_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->format_parser)); __pyx_v_self->format_parser = __pyx_v_format_parser;
+0743: self.calldata_parser = calldata_parser
__Pyx_INCREF(((PyObject *)__pyx_v_calldata_parser)); __Pyx_GIVEREF(((PyObject *)__pyx_v_calldata_parser)); __Pyx_GOTREF(__pyx_v_self->calldata_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->calldata_parser)); __pyx_v_self->calldata_parser = __pyx_v_calldata_parser;
0744:
+0745: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_9VCFParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0746: """Parse to end of current chunk or EOF."""
0747:
0748: # with nogil:
0749:
+0750: while True:
while (1) {
0751:
+0752: if context.state == VCFState.EOF:
switch (__pyx_v_context->state) { case __pyx_e_5allel_3opt_11io_vcf_read_EOF: /* … */ break;
+0753: break
goto __pyx_L4_break;
0754:
+0755: elif context.state == VCFState.EOL:
case __pyx_e_5allel_3opt_11io_vcf_read_EOL: /* … */ break;
0756:
0757: # handle line terminators
+0758: if stream.c == LF:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+0759: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 759, __pyx_L1_error)
+0760: elif stream.c == CR:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+0761: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 761, __pyx_L1_error)
+0762: if stream.c == LF:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_1) { /* … */ }
+0763: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 763, __pyx_L1_error)
0764: else:
0765: # shouldn't ever happen
0766: # with gil:
+0767: warn('unexpected EOL character', context)
/*else*/ { __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_unexpected_EOL_character, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 767, __pyx_L1_error)
+0768: break
goto __pyx_L4_break; } __pyx_L5:;
0769:
0770: # advance state
+0771: context.state = VCFState.CHROM
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_CHROM;
0772:
0773: # end of chunk?
+0774: if context.chunk_variant_index + 1 == self.chunk_length:
__pyx_t_1 = (((__pyx_v_context->chunk_variant_index + 1) == __pyx_v_self->chunk_length) != 0); if (__pyx_t_1) { /* … */ }
0775: # we're done
+0776: break
goto __pyx_L4_break;
0777:
+0778: elif context.state == VCFState.CHROM:
case __pyx_e_5allel_3opt_11io_vcf_read_CHROM: /* … */ break;
+0779: self.chrom_pos_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->chrom_pos_parser->__pyx_vtab)->parse(__pyx_v_self->chrom_pos_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 779, __pyx_L1_error)
0780:
+0781: elif context.state == VCFState.ID:
case __pyx_e_5allel_3opt_11io_vcf_read_ID: /* … */ break;
+0782: self.id_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->id_parser->__pyx_vtab)->parse(__pyx_v_self->id_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 782, __pyx_L1_error)
0783:
+0784: elif context.state == VCFState.REF:
case __pyx_e_5allel_3opt_11io_vcf_read_REF: /* … */ break;
+0785: self.ref_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->ref_parser->__pyx_vtab)->parse(__pyx_v_self->ref_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 785, __pyx_L1_error)
0786:
+0787: elif context.state == VCFState.ALT:
case __pyx_e_5allel_3opt_11io_vcf_read_ALT: /* … */ break;
+0788: self.alt_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->alt_parser->__pyx_vtab)->parse(__pyx_v_self->alt_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 788, __pyx_L1_error)
0789:
+0790: elif context.state == VCFState.QUAL:
case __pyx_e_5allel_3opt_11io_vcf_read_QUAL: /* … */ break;
+0791: self.qual_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->qual_parser->__pyx_vtab)->parse(__pyx_v_self->qual_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 791, __pyx_L1_error)
0792:
+0793: elif context.state == VCFState.FILTER:
case __pyx_e_5allel_3opt_11io_vcf_read_FILTER: /* … */ break;
+0794: self.filter_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->filter_parser->__pyx_vtab)->parse(__pyx_v_self->filter_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 794, __pyx_L1_error)
0795:
+0796: elif context.state == VCFState.INFO:
case __pyx_e_5allel_3opt_11io_vcf_read_INFO: /* … */ break;
+0797: self.info_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->info_parser->__pyx_vtab)->parse(__pyx_v_self->info_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 797, __pyx_L1_error)
0798:
+0799: elif context.state == VCFState.FORMAT:
case __pyx_e_5allel_3opt_11io_vcf_read_FORMAT: /* … */ break;
+0800: self.format_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->format_parser->__pyx_vtab)->parse(__pyx_v_self->format_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 800, __pyx_L1_error)
0801:
+0802: elif context.state == VCFState.CALLDATA:
case __pyx_e_5allel_3opt_11io_vcf_read_CALLDATA: /* … */ break; default:
+0803: self.calldata_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->calldata_parser->__pyx_vtab)->parse(__pyx_v_self->calldata_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 803, __pyx_L1_error)
0804:
0805: else:
0806: # shouldn't ever happen
0807: # with gil:
+0808: warn('unexpected parser state', context)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_unexpected_parser_state, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 808, __pyx_L1_error)
+0809: break
goto __pyx_L4_break; break; } } __pyx_L4_break:;
0810:
+0811: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_9VCFParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0812: self.chrom_pos_parser.malloc_chunk()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->chrom_pos_parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->chrom_pos_parser); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 812, __pyx_L1_error)
+0813: self.id_parser.malloc_chunk()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->id_parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->id_parser); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 813, __pyx_L1_error)
+0814: self.ref_parser.malloc_chunk()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->ref_parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->ref_parser); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 814, __pyx_L1_error)
+0815: self.alt_parser.malloc_chunk()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->alt_parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->alt_parser); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 815, __pyx_L1_error)
+0816: self.qual_parser.malloc_chunk()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->qual_parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->qual_parser); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
+0817: self.filter_parser.malloc_chunk()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->filter_parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->filter_parser); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 817, __pyx_L1_error)
+0818: self.info_parser.malloc_chunk()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->info_parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->info_parser); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 818, __pyx_L1_error)
+0819: self.format_parser.malloc_chunk()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->format_parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->format_parser); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 819, __pyx_L1_error)
+0820: self.calldata_parser.malloc_chunk()
__pyx_t_1 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->calldata_parser->__pyx_vtab)->malloc_chunk(__pyx_v_self->calldata_parser); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 820, __pyx_L1_error)
0821:
+0822: cdef object make_chunk(self, chunk_length):
static PyObject *__pyx_f_5allel_3opt_11io_vcf_read_9VCFParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFParser *__pyx_v_self, PyObject *__pyx_v_chunk_length) { PyObject *__pyx_v_limit = NULL; PyObject *__pyx_v_chunk = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_limit); __Pyx_XDECREF(__pyx_v_chunk); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0823: if chunk_length > 0:
__pyx_t_1 = PyObject_RichCompare(__pyx_v_chunk_length, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 823, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+0824: if chunk_length < self.chunk_length:
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_v_chunk_length, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L4; }
+0825: limit = chunk_length
__Pyx_INCREF(__pyx_v_chunk_length);
__pyx_v_limit = __pyx_v_chunk_length;
0826: else:
+0827: limit = None
/*else*/ {
__Pyx_INCREF(Py_None);
__pyx_v_limit = Py_None;
}
__pyx_L4:;
+0828: chunk = dict()
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_chunk = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0;
+0829: self.chrom_pos_parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->chrom_pos_parser->__pyx_vtab)->make_chunk(__pyx_v_self->chrom_pos_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 829, __pyx_L1_error)
+0830: self.id_parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->id_parser->__pyx_vtab)->make_chunk(__pyx_v_self->id_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 830, __pyx_L1_error)
+0831: self.ref_parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->ref_parser->__pyx_vtab)->make_chunk(__pyx_v_self->ref_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 831, __pyx_L1_error)
+0832: self.alt_parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->alt_parser->__pyx_vtab)->make_chunk(__pyx_v_self->alt_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 832, __pyx_L1_error)
+0833: self.qual_parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->qual_parser->__pyx_vtab)->make_chunk(__pyx_v_self->qual_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 833, __pyx_L1_error)
+0834: self.filter_parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->filter_parser->__pyx_vtab)->make_chunk(__pyx_v_self->filter_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 834, __pyx_L1_error)
+0835: self.info_parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->info_parser->__pyx_vtab)->make_chunk(__pyx_v_self->info_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 835, __pyx_L1_error)
+0836: self.calldata_parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self->calldata_parser->__pyx_vtab)->make_chunk(__pyx_v_self->calldata_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 836, __pyx_L1_error)
+0837: return chunk
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_chunk); __pyx_r = __pyx_v_chunk; goto __pyx_L0;
0838:
0839: else:
+0840: return None
/*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; }
0841:
0842:
+0843: cdef class VCFFieldParserBase:
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase { PyObject_HEAD struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_vtab; PyObject *key; PyArray_Descr *dtype; int itemsize; int number; PyObject *fill; int chunk_length; PyArrayObject *values; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase { int (*parse)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *); int (*malloc_chunk)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *); int (*make_chunk)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *, PyObject *, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFFieldParserBase_make_chunk *__pyx_optional_args); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFFieldParserBase;
0844: """Abstract base class for top-level field parsers."""
0845:
0846: cdef:
0847: bytes key
0848: np.dtype dtype
0849: int itemsize
0850: int number
0851: object fill
0852: int chunk_length
0853: np.ndarray values
0854:
+0855: def __init__(self, key=None, dtype=None, number=1, fill=None, chunk_length=0):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFFieldParserBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFFieldParserBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_number = 0; PyObject *__pyx_v_fill = 0; PyObject *__pyx_v_chunk_length = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_dtype,&__pyx_n_s_number,&__pyx_n_s_fill,&__pyx_n_s_chunk_length,0}; PyObject* values[5] = {0,0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)__pyx_int_1); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 855, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; __pyx_v_dtype = values[1]; __pyx_v_number = values[2]; __pyx_v_fill = values[3]; __pyx_v_chunk_length = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 855, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFieldParserBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFFieldParserBase___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *)__pyx_v_self), __pyx_v_key, __pyx_v_dtype, __pyx_v_number, __pyx_v_fill, __pyx_v_chunk_length); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFFieldParserBase___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_dtype, PyObject *__pyx_v_number, PyObject *__pyx_v_fill, PyObject *__pyx_v_chunk_length) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_dtype); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFieldParserBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dtype); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0856: self.key = key
if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 856, __pyx_L1_error) __pyx_t_1 = __pyx_v_key; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->key); __Pyx_DECREF(__pyx_v_self->key); __pyx_v_self->key = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+0857: if dtype is not None:
__pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+0858: dtype = np.dtype(dtype)
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dtype); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_4); __pyx_t_4 = 0;
+0859: self.itemsize = dtype.itemsize
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->itemsize = __pyx_t_5;
0860: else:
+0861: self.itemsize = 0
/*else*/ { __pyx_v_self->itemsize = 0; } __pyx_L3:;
+0862: self.dtype = dtype
if (!(likely(((__pyx_v_dtype) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dtype, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 862, __pyx_L1_error) __pyx_t_4 = __pyx_v_dtype; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype)); __pyx_v_self->dtype = ((PyArray_Descr *)__pyx_t_4); __pyx_t_4 = 0;
+0863: self.number = number
__pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_number); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L1_error) __pyx_v_self->number = __pyx_t_5;
+0864: self.fill = fill
__Pyx_INCREF(__pyx_v_fill); __Pyx_GIVEREF(__pyx_v_fill); __Pyx_GOTREF(__pyx_v_self->fill); __Pyx_DECREF(__pyx_v_self->fill); __pyx_v_self->fill = __pyx_v_fill;
+0865: self.chunk_length = chunk_length
__pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_chunk_length); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L1_error) __pyx_v_self->chunk_length = __pyx_t_5;
0866:
+0867: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFFieldParserBase_parse(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0868: pass
0869:
+0870: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFFieldParserBase_malloc_chunk(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0871: pass
0872:
+0873: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFFieldParserBase_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFFieldParserBase_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_values = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFieldParserBase.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_values); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFFieldParserBase_make_chunk { int __pyx_n; PyObject *limit; };
+0874: if PY2:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L3; }
+0875: field = 'variants/' + self.key
__pyx_t_1 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_v_self->key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0;
0876: else:
+0877: field = 'variants/' + str(self.key, 'ascii')
/*else*/ { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->key); __Pyx_GIVEREF(__pyx_v_self->key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->key); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:;
+0878: values = self.values
__pyx_t_1 = ((PyObject *)__pyx_v_self->values);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_values = __pyx_t_1;
__pyx_t_1 = 0;
+0879: if self.values.ndim > 1 and self.number == 1:
__pyx_t_4 = ((__pyx_v_self->values->nd > 1) != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = ((__pyx_v_self->number == 1) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* … */ }
+0880: values = values.squeeze(axis=1)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 880, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_5); __pyx_t_5 = 0;
+0881: chunk[field] = values[:limit]
__pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_values, 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_5) < 0)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
0882:
0883:
+0884: cdef class VCFSkipFieldParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFSkipFieldParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFSkipFieldParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFSkipFieldParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFSkipFieldParser;
0885: """Parser to skip a tab-delimited field."""
0886:
+0887: def __init__(self, key):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFSkipFieldParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFSkipFieldParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 887, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_key = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 887, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFSkipFieldParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFSkipFieldParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFSkipFieldParser *)__pyx_v_self), __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFSkipFieldParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFSkipFieldParser *__pyx_v_self, PyObject *__pyx_v_key) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFSkipFieldParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+0888: super(VCFSkipFieldParser, self).__init__(key=key)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipFieldParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipFieldParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFSkipFieldParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(0, 888, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
0889:
+0890: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFSkipFieldParser_parse(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFSkipFieldParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFSkipFieldParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0891:
+0892: while True:
while (1) {
0893:
+0894: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+0895: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+0896: break
goto __pyx_L4_break;
0897:
+0898: elif stream.c == LF or stream.c == CR:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+0899: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+0900: break
goto __pyx_L4_break;
0901:
+0902: elif stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
+0903: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 903, __pyx_L1_error)
+0904: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+0905: break
goto __pyx_L4_break;
0906:
0907: # advance input stream
+0908: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_L4_break:;
0909:
+0910: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFSkipFieldParser_malloc_chunk(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFSkipFieldParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0911: pass
0912:
+0913: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFSkipFieldParser_make_chunk(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFSkipFieldParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFSkipFieldParser_make_chunk *__pyx_optional_args) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { } /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFSkipFieldParser_make_chunk { int __pyx_n; PyObject *limit; };
0914: pass
0915:
0916:
+0917: def check_string_dtype(dtype):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_3check_string_dtype(PyObject *__pyx_self, PyObject *__pyx_v_dtype); /*proto*/ static PyMethodDef __pyx_mdef_5allel_3opt_11io_vcf_read_3check_string_dtype = {"check_string_dtype", (PyCFunction)__pyx_pw_5allel_3opt_11io_vcf_read_3check_string_dtype, METH_O, 0}; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_3check_string_dtype(PyObject *__pyx_self, PyObject *__pyx_v_dtype) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check_string_dtype (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_2check_string_dtype(__pyx_self, ((PyObject *)__pyx_v_dtype)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_2check_string_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check_string_dtype", 0); __Pyx_INCREF(__pyx_v_dtype); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.check_string_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__133 = PyTuple_Pack(1, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__133); __Pyx_GIVEREF(__pyx_tuple__133); /* … */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5allel_3opt_11io_vcf_read_3check_string_dtype, NULL, __pyx_n_s_allel_opt_io_vcf_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_string_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_check_string_dtype, 917, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 917, __pyx_L1_error)
+0918: dtype = np.dtype(dtype)
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dtype); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_2); __pyx_t_2 = 0;
+0919: if dtype.kind not in ['S', 'O']:
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_S, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 919, __pyx_L1_error) if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_O, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 919, __pyx_L1_error) __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* … */ }
+0920: raise ValueError("expected string ('S') or object ('O') dtype, found: %r" % dtype)
__pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_expected_string_S_or_object_O_dt, __pyx_v_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 920, __pyx_L1_error)
+0921: return dtype
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_dtype); __pyx_r = __pyx_v_dtype; goto __pyx_L0;
0922:
0923:
+0924: cdef int vcf_read_field(InputStreamBase stream,
static int __pyx_f_5allel_3opt_11io_vcf_read_vcf_read_field(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_dest) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vcf_read_field", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_read_field", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0925: VCFContext context,
0926: CharVector* dest) except -1: # nogil
0927:
0928: # setup temp vector to store value
+0929: CharVector_clear(dest)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear(__pyx_v_dest);
0930:
+0931: while True:
while (1) {
0932:
+0933: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+0934: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+0935: break
goto __pyx_L4_break;
0936:
+0937: elif stream.c == LF or stream.c == CR:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+0938: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+0939: break
goto __pyx_L4_break;
0940:
+0941: elif stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
+0942: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 942, __pyx_L1_error)
0943: # leave it to caller to advance state
+0944: break
goto __pyx_L4_break;
0945:
0946: else:
+0947: CharVector_append(dest, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append(__pyx_v_dest, __pyx_v_stream->c); }
0948:
0949: # advance input stream
+0950: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 950, __pyx_L1_error) } __pyx_L4_break:;
0951:
0952:
+0953: cdef int vcf_parse_missing(InputStreamBase stream,
static int __pyx_f_5allel_3opt_11io_vcf_read_vcf_parse_missing(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vcf_parse_missing", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_parse_missing", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0954: VCFContext context) except -1: # nogil
0955:
+0956: while True:
while (1) {
0957:
+0958: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+0959: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+0960: break
goto __pyx_L4_break;
0961:
+0962: elif stream.c == LF or stream.c == CR:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+0963: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+0964: break
goto __pyx_L4_break;
0965:
+0966: elif stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
0967: # advance input stream beyond tab
+0968: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 968, __pyx_L1_error)
+0969: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+0970: break
goto __pyx_L4_break;
0971:
0972: # advance input stream
+0973: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 973, __pyx_L1_error) } __pyx_L4_break:;
0974:
0975:
+0976: cdef int vcf_skip_variant(InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_vcf_skip_variant(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vcf_skip_variant", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_skip_variant", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
0977: # skip to EOL or EOF
+0978: while True:
while (1) {
+0979: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+0980: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+0981: break
goto __pyx_L4_break;
+0982: elif stream.c == LF or stream.c == CR:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+0983: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+0984: break
goto __pyx_L4_break;
0985: # advance input stream
+0986: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 986, __pyx_L1_error) } __pyx_L4_break:;
0987:
0988:
+0989: cdef class VCFChromPosParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChromPosParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; __Pyx_memviewslice chrom_memory; __Pyx_memviewslice pos_memory; int store_chrom; int store_pos; char *region_chrom; int region_begin; int region_end; PyArrayObject *chrom_values; PyArrayObject *pos_values; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFChromPosParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFChromPosParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFChromPosParser;
0990:
0991: cdef:
0992: np.uint8_t[:] chrom_memory
0993: np.int32_t[:] pos_memory
0994: bint store_chrom
0995: bint store_pos
0996: char* region_chrom
0997: int region_begin
0998: int region_end
0999: np.ndarray chrom_values
1000: np.ndarray pos_values
1001:
+1002: def __init__(self, dtype, store_chrom, store_pos, chunk_length, region_chrom,
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFChromPosParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFChromPosParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_store_chrom = 0; PyObject *__pyx_v_store_pos = 0; PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_region_chrom = 0; PyObject *__pyx_v_region_begin = 0; PyObject *__pyx_v_region_end = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,&__pyx_n_s_store_chrom,&__pyx_n_s_store_pos,&__pyx_n_s_chunk_length,&__pyx_n_s_region_chrom,&__pyx_n_s_region_begin,&__pyx_n_s_region_end,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_chrom)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 1002, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_pos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 1002, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 1002, __pyx_L3_error) } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region_chrom)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 1002, __pyx_L3_error) } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region_begin)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 1002, __pyx_L3_error) } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 1002, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1002, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_dtype = values[0]; __pyx_v_store_chrom = values[1]; __pyx_v_store_pos = values[2]; __pyx_v_chunk_length = values[3]; __pyx_v_region_chrom = values[4]; __pyx_v_region_begin = values[5]; __pyx_v_region_end = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1002, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFChromPosParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_17VCFChromPosParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChromPosParser *)__pyx_v_self), __pyx_v_dtype, __pyx_v_store_chrom, __pyx_v_store_pos, __pyx_v_chunk_length, __pyx_v_region_chrom, __pyx_v_region_begin, __pyx_v_region_end); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_17VCFChromPosParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChromPosParser *__pyx_v_self, PyObject *__pyx_v_dtype, PyObject *__pyx_v_store_chrom, PyObject *__pyx_v_store_pos, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_region_chrom, PyObject *__pyx_v_region_begin, PyObject *__pyx_v_region_end) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_dtype); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFChromPosParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dtype); __Pyx_RefNannyFinishContext(); return __pyx_r; }
1003: region_begin, region_end):
+1004: if store_chrom:
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store_chrom); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1004, __pyx_L1_error)
if (__pyx_t_1) {
/* … */
}
+1005: dtype = check_string_dtype(dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_string_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dtype}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dtype}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_dtype); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_2); __pyx_t_2 = 0;
+1006: super(VCFChromPosParser, self).__init__(key=b'CHROM', dtype=dtype, number=1, chunk_length=chunk_length)
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFChromPosParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFChromPosParser)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFChromPosParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_n_b_CHROM) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_number, __pyx_int_1) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+1007: self.store_chrom = store_chrom
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store_chrom); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1007, __pyx_L1_error) __pyx_v_self->store_chrom = __pyx_t_1;
+1008: self.store_pos = store_pos
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store_pos); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1008, __pyx_L1_error) __pyx_v_self->store_pos = __pyx_t_1;
+1009: if region_chrom:
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_region_chrom); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1009, __pyx_L1_error)
if (__pyx_t_1) {
/* … */
goto __pyx_L4;
}
+1010: self.region_chrom = <char*> region_chrom
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_region_chrom); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1010, __pyx_L1_error) __pyx_v_self->region_chrom = ((char *)__pyx_t_6);
+1011: self.region_begin = region_begin
__pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_region_begin); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L1_error) __pyx_v_self->region_begin = __pyx_t_7;
+1012: self.region_end = region_end
__pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_region_end); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1012, __pyx_L1_error) __pyx_v_self->region_end = __pyx_t_7;
1013: else:
+1014: self.region_chrom = NULL
/*else*/ { __pyx_v_self->region_chrom = NULL;
+1015: self.region_begin = 0
__pyx_v_self->region_begin = 0;
+1016: self.region_end = 0
__pyx_v_self->region_end = 0; } __pyx_L4:;
1017:
+1018: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFChromPosParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChromPosParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_i; int __pyx_v_n; int __pyx_v_cmp; int __pyx_v_memory_offset; PyObject *__pyx_v_v = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFChromPosParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v); __Pyx_RefNannyFinishContext(); return __pyx_r; }
1019: cdef:
1020: int i, n, cmp
1021: # index into memory view
1022: int memory_offset
1023:
1024: # reset context
+1025: CharVector_clear(&context.chrom)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->chrom));
+1026: context.pos = 0
__pyx_v_context->pos = 0;
+1027: context.ref_len = 0
__pyx_v_context->ref_len = 0;
1028:
1029: # check for EOF early - important to handle file with no final line terminator
+1030: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+1031: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+1032: return 0
__pyx_r = 0; goto __pyx_L0;
1033:
1034: # read chrom
+1035: vcf_read_field(stream, context, &context.chrom)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_read_field(__pyx_v_stream, __pyx_v_context, (&__pyx_v_context->chrom)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1035, __pyx_L1_error)
+1036: if context.chrom.size == 0:
__pyx_t_1 = ((__pyx_v_context->chrom.size == 0) != 0); if (__pyx_t_1) { /* … */ }
1037: # with gil:
+1038: warn('empty CHROM', context)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_empty_CHROM, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1038, __pyx_L1_error)
+1039: CharVector_terminate(&context.chrom)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_terminate((&__pyx_v_context->chrom));
1040:
1041: # read pos
+1042: if context.state == VCFState.CHROM:
__pyx_t_1 = ((__pyx_v_context->state == __pyx_e_5allel_3opt_11io_vcf_read_CHROM) != 0); if (__pyx_t_1) { /* … */ }
+1043: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
1044: # read pos
+1045: vcf_read_field(stream, context, &context.temp)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_read_field(__pyx_v_stream, __pyx_v_context, (&__pyx_v_context->temp)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1045, __pyx_L1_error)
+1046: if context.temp.size == 0:
__pyx_t_1 = ((__pyx_v_context->temp.size == 0) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L6; }
1047: # with gil:
+1048: warn('empty POS', context)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_empty_POS, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1048, __pyx_L1_error)
1049: else:
+1050: vcf_strtol(&context.temp, context, &context.pos)
/*else*/ { __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_context->pos)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1050, __pyx_L1_error) } __pyx_L6:;
1051:
+1052: if context.state == VCFState.POS:
__pyx_t_1 = ((__pyx_v_context->state == __pyx_e_5allel_3opt_11io_vcf_read_POS) != 0); if (__pyx_t_1) { /* … */ }
+1053: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
1054:
1055: # handle region
+1056: if self.region_chrom is not NULL:
__pyx_t_1 = ((__pyx_v_self->region_chrom != NULL) != 0); if (__pyx_t_1) { /* … */ }
1057:
1058: # compare with region chrom
+1059: cmp = strcmp(context.chrom.data, self.region_chrom)
__pyx_v_cmp = strcmp(__pyx_v_context->chrom.data, __pyx_v_self->region_chrom);
1060:
+1061: if cmp < 0:
__pyx_t_1 = ((__pyx_v_cmp < 0) != 0); if (__pyx_t_1) { /* … */ }
+1062: return vcf_skip_variant(stream, context)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_skip_variant(__pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1062, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0;
1063:
+1064: if cmp > 0:
__pyx_t_1 = ((__pyx_v_cmp > 0) != 0); if (__pyx_t_1) { /* … */ }
1065: # we're done
+1066: context.state = EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+1067: return 0
__pyx_r = 0; goto __pyx_L0;
1068:
+1069: if self.region_begin > 0 and context.pos < self.region_begin:
__pyx_t_3 = ((__pyx_v_self->region_begin > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L12_bool_binop_done; } __pyx_t_3 = ((__pyx_v_context->pos < __pyx_v_self->region_begin) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L12_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1070: return vcf_skip_variant(stream, context)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_skip_variant(__pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1070, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0;
1071:
+1072: if 0 < self.region_end < context.pos:
__pyx_t_1 = (0 < __pyx_v_self->region_end); if (__pyx_t_1) { __pyx_t_1 = (__pyx_v_self->region_end < __pyx_v_context->pos); } __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* … */ }
1073: # we're done
+1074: context.state = EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+1075: return 0
__pyx_r = 0; goto __pyx_L0;
1076:
1077: # setup context
+1078: context.sample_index = 0
__pyx_v_context->sample_index = 0;
+1079: context.sample_field_index = 0
__pyx_v_context->sample_field_index = 0;
+1080: context.sample_output_index = -1
__pyx_v_context->sample_output_index = -1;
+1081: context.variant_index += 1
__pyx_v_context->variant_index = (__pyx_v_context->variant_index + 1);
+1082: context.chunk_variant_index += 1
__pyx_v_context->chunk_variant_index = (__pyx_v_context->chunk_variant_index + 1);
1083:
1084: # store in chunk
+1085: if self.store_chrom:
__pyx_t_3 = (__pyx_v_self->store_chrom != 0); if (__pyx_t_3) { /* … */ }
1086:
+1087: if self.dtype.kind == 'S':
__pyx_t_3 = ((__pyx_v_self->__pyx_base.dtype->kind == 'S') != 0); if (__pyx_t_3) { /* … */ goto __pyx_L16; }
1088:
1089: # initialise memory index
+1090: memory_offset = context.chunk_variant_index * self.itemsize
__pyx_v_memory_offset = (__pyx_v_context->chunk_variant_index * __pyx_v_self->__pyx_base.itemsize);
1091:
1092: # figure out how many characters to store
+1093: n = min(context.chrom.size - 1, self.itemsize)
__pyx_t_2 = __pyx_v_self->__pyx_base.itemsize; __pyx_t_4 = (__pyx_v_context->chrom.size - 1); if (((__pyx_t_2 < __pyx_t_4) != 0)) { __pyx_t_5 = __pyx_t_2; } else { __pyx_t_5 = __pyx_t_4; } __pyx_v_n = __pyx_t_5;
1094:
1095: # store characters
+1096: for i in range(n):
__pyx_t_2 = __pyx_v_n; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6;
+1097: self.chrom_memory[memory_offset + i] = context.chrom.data[i]
__pyx_t_7 = (__pyx_v_memory_offset + __pyx_v_i); *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->chrom_memory.data + __pyx_t_7 * __pyx_v_self->chrom_memory.strides[0]) )) = (__pyx_v_context->chrom.data[__pyx_v_i]); }
1098:
1099: else:
1100: # with gil:
1101: # N.B., don't include terminating null byte
+1102: v = CharVector_to_pystr_sized(&context.chrom, context.chrom.size - 1)
/*else*/ {
__pyx_t_8 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr_sized((&__pyx_v_context->chrom), (__pyx_v_context->chrom.size - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_v_v = __pyx_t_8;
__pyx_t_8 = 0;
+1103: self.chrom_values[context.chunk_variant_index] = v
if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_self->chrom_values), __pyx_v_context->chunk_variant_index, __pyx_v_v, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 1103, __pyx_L1_error)
}
__pyx_L16:;
1104:
+1105: if self.store_pos:
__pyx_t_3 = (__pyx_v_self->store_pos != 0); if (__pyx_t_3) { /* … */ }
+1106: self.pos_memory[context.chunk_variant_index] = context.pos
__pyx_t_5 = __pyx_v_context->pos; __pyx_t_9 = __pyx_v_context->chunk_variant_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_self->pos_memory.data + __pyx_t_9 * __pyx_v_self->pos_memory.strides[0]) )) = __pyx_t_5;
1107:
+1108: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFChromPosParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChromPosParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFChromPosParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1109: if self.store_chrom:
__pyx_t_1 = (__pyx_v_self->store_chrom != 0); if (__pyx_t_1) { /* … */ }
+1110: self.chrom_values = np.zeros(self.chunk_length, dtype=self.dtype)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 1110, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->chrom_values); __Pyx_DECREF(((PyObject *)__pyx_v_self->chrom_values)); __pyx_v_self->chrom_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0;
+1111: if self.dtype.kind == 'S':
__pyx_t_1 = ((__pyx_v_self->__pyx_base.dtype->kind == 'S') != 0); if (__pyx_t_1) { /* … */ goto __pyx_L4; }
+1112: self.chrom_memory = self.chrom_values.view('u1')
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->chrom_values), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->chrom_memory, 0); __pyx_v_self->chrom_memory = __pyx_t_6; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; /* … */ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22);
1113: else:
+1114: self.chrom_values.fill('')
/*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->chrom_values), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L4:; /* … */ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23);
+1115: if self.store_pos:
__pyx_t_1 = (__pyx_v_self->store_pos != 0); if (__pyx_t_1) { /* … */ }
+1116: self.pos_values = np.zeros(self.chunk_length, dtype='int32')
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 1116, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->pos_values); __Pyx_DECREF(((PyObject *)__pyx_v_self->pos_values)); __pyx_v_self->pos_values = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0;
+1117: self.pos_memory = self.pos_values
__pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_self->pos_values)); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1117, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->pos_memory, 0); __pyx_v_self->pos_memory = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL;
1118:
+1119: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFChromPosParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFChromPosParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFChromPosParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFChromPosParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFChromPosParser_make_chunk { int __pyx_n; PyObject *limit; };
+1120: if self.store_chrom:
__pyx_t_1 = (__pyx_v_self->store_chrom != 0); if (__pyx_t_1) { /* … */ }
+1121: chunk[CHROM_FIELD] = self.chrom_values[:limit]
__pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->chrom_values), 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_CHROM_FIELD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1122: if self.store_pos:
__pyx_t_1 = (__pyx_v_self->store_pos != 0); if (__pyx_t_1) { /* … */ }
+1123: chunk[POS_FIELD] = self.pos_values[:limit]
__pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->pos_values), 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_POS_FIELD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(0, 1123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1124:
1125:
+1126: cdef class VCFIDStringParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDStringParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFIDStringParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFIDStringParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFIDStringParser;
1127:
1128: cdef np.uint8_t[:] memory
1129:
+1130: def __init__(self, dtype, chunk_length):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFIDStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFIDStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_chunk_length = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,&__pyx_n_s_chunk_length,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1130, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1130, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_dtype = values[0]; __pyx_v_chunk_length = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1130, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFIDStringParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_17VCFIDStringParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDStringParser *)__pyx_v_self), __pyx_v_dtype, __pyx_v_chunk_length); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_17VCFIDStringParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDStringParser *__pyx_v_self, PyObject *__pyx_v_dtype, PyObject *__pyx_v_chunk_length) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFIDStringParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1131: super(VCFIDStringParser, self).__init__(key=b'ID', dtype=dtype, number=1, chunk_length=chunk_length)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFIDStringParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFIDStringParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFIDStringParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_ID) < 0) __PYX_ERR(0, 1131, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1131, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_int_1) < 0) __PYX_ERR(0, 1131, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1131, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1132:
+1133: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFIDStringParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDStringParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_memory_index; int __pyx_v_chars_stored; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFIDStringParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1134: cdef:
1135: # index into memory view
+1136: int memory_index = context.chunk_variant_index * self.itemsize
__pyx_v_memory_index = (__pyx_v_context->chunk_variant_index * __pyx_v_self->__pyx_base.itemsize);
1137: # number of characters read into current value
+1138: int chars_stored = 0
__pyx_v_chars_stored = 0;
1139:
+1140: while True:
while (1) {
1141:
+1142: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+1143: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+1144: break
goto __pyx_L4_break;
1145:
+1146: elif stream.c == LF or stream.c == CR:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1147: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+1148: break
goto __pyx_L4_break;
1149:
+1150: elif stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
1151: # advance input stream beyond tab
+1152: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1152, __pyx_L1_error)
1153: # advance to next field
+1154: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+1155: break
goto __pyx_L4_break;
1156:
+1157: elif chars_stored < self.itemsize:
__pyx_t_1 = ((__pyx_v_chars_stored < __pyx_v_self->__pyx_base.itemsize) != 0); if (__pyx_t_1) { /* … */ }
1158: # store value
+1159: self.memory[memory_index] = stream.c
__pyx_t_4 = __pyx_v_stream->c; __pyx_t_5 = __pyx_v_memory_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->memory.data + __pyx_t_5 * __pyx_v_self->memory.strides[0]) )) = __pyx_t_4;
1160: # advance memory index
+1161: memory_index += 1
__pyx_v_memory_index = (__pyx_v_memory_index + 1);
1162: # advance number of characters stored
+1163: chars_stored += 1
__pyx_v_chars_stored = (__pyx_v_chars_stored + 1);
1164:
1165: # advance input stream
+1166: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1166, __pyx_L1_error) } __pyx_L4_break:;
1167:
+1168: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFIDStringParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDStringParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFIDStringParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1169: self.values = np.zeros(self.chunk_length, dtype=self.dtype)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+1170: self.memory = self.values.view('u1')
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; /* … */ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24);
1171:
1172:
+1173: cdef class VCFIDObjectParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDObjectParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFIDObjectParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFIDObjectParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFIDObjectParser;
1174:
+1175: def __init__(self, chunk_length):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFIDObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFIDObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_chunk_length = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chunk_length,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1175, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_chunk_length = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1175, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFIDObjectParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_17VCFIDObjectParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDObjectParser *)__pyx_v_self), __pyx_v_chunk_length); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_17VCFIDObjectParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDObjectParser *__pyx_v_self, PyObject *__pyx_v_chunk_length) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFIDObjectParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1176: super(VCFIDObjectParser, self).__init__(key=b'ID', dtype=np.dtype('object'), number=1,
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFIDObjectParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFIDObjectParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFIDObjectParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_ID) < 0) __PYX_ERR(0, 1176, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_int_1) < 0) __PYX_ERR(0, 1176, __pyx_L1_error) /* … */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* … */ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25);
+1177: chunk_length=chunk_length)
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1176, __pyx_L1_error)
1178:
+1179: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFIDObjectParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDObjectParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { PyObject *__pyx_v_v = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFIDObjectParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v); __Pyx_RefNannyFinishContext(); return __pyx_r; }
1180:
+1181: vcf_read_field(stream, context, &context.temp)
__pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_read_field(__pyx_v_stream, __pyx_v_context, (&__pyx_v_context->temp)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1181, __pyx_L1_error)
1182:
1183: # with gil:
+1184: v = CharVector_to_pystr(&context.temp)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->temp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_v = __pyx_t_2;
__pyx_t_2 = 0;
+1185: self.values[context.chunk_variant_index] = v
if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_v_context->chunk_variant_index, __pyx_v_v, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 1185, __pyx_L1_error)
1186:
+1187: if context.state == VCFState.ID:
__pyx_t_3 = ((__pyx_v_context->state == __pyx_e_5allel_3opt_11io_vcf_read_ID) != 0); if (__pyx_t_3) { /* … */ }
+1188: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
1189:
+1190: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFIDObjectParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFIDObjectParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFIDObjectParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1191: self.values = np.empty(self.chunk_length, dtype=self.dtype)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 1191, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+1192: self.values.fill('')
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26);
1193:
1194:
+1195: cdef class VCFRefStringParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefStringParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; __Pyx_memviewslice memory; int store; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFRefStringParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFRefStringParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFRefStringParser;
1196:
1197: cdef:
1198: np.uint8_t[:] memory
1199: bint store
1200:
+1201: def __init__(self, dtype, chunk_length, store):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFRefStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFRefStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_store = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,&__pyx_n_s_chunk_length,&__pyx_n_s_store,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 1201, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 1201, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1201, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_dtype = values[0]; __pyx_v_chunk_length = values[1]; __pyx_v_store = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1201, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefStringParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFRefStringParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefStringParser *)__pyx_v_self), __pyx_v_dtype, __pyx_v_chunk_length, __pyx_v_store); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFRefStringParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefStringParser *__pyx_v_self, PyObject *__pyx_v_dtype, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_store) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_dtype); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefStringParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dtype); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1202: if store:
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1202, __pyx_L1_error)
if (__pyx_t_1) {
/* … */
}
+1203: dtype = check_string_dtype(dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_string_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dtype}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dtype}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_dtype); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_2); __pyx_t_2 = 0;
+1204: super(VCFRefStringParser, self).__init__(key=b'REF', dtype=dtype, number=1, chunk_length=chunk_length)
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFRefStringParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFRefStringParser)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFRefStringParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_n_b_REF) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_number, __pyx_int_1) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+1205: self.store = store
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1205, __pyx_L1_error) __pyx_v_self->store = __pyx_t_1;
1206:
+1207: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFRefStringParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefStringParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_memory_index; int __pyx_v_chars_stored; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefStringParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1208: cdef:
1209: # index into memory view
+1210: int memory_index = context.chunk_variant_index * self.itemsize
__pyx_v_memory_index = (__pyx_v_context->chunk_variant_index * __pyx_v_self->__pyx_base.itemsize);
1211: # number of characters read into current value
+1212: int chars_stored = 0
__pyx_v_chars_stored = 0;
1213:
+1214: while True:
while (1) {
1215:
+1216: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+1217: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+1218: break
goto __pyx_L4_break;
1219:
+1220: elif stream.c == LF or stream.c == CR:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1221: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+1222: break
goto __pyx_L4_break;
1223:
+1224: elif stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
1225: # advance input stream beyond tab
+1226: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1226, __pyx_L1_error)
1227: # advance to next field
+1228: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+1229: break
goto __pyx_L4_break;
1230:
1231: else:
+1232: if stream.c != PERIOD:
/*else*/ { __pyx_t_1 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); if (__pyx_t_1) { /* … */ }
+1233: context.ref_len += 1
__pyx_v_context->ref_len = (__pyx_v_context->ref_len + 1);
+1234: if self.store and chars_stored < self.itemsize:
__pyx_t_2 = (__pyx_v_self->store != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L10_bool_binop_done; } __pyx_t_2 = ((__pyx_v_chars_stored < __pyx_v_self->__pyx_base.itemsize) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L10_bool_binop_done:; if (__pyx_t_1) { /* … */ } }
1235: # store value
+1236: self.memory[memory_index] = stream.c
__pyx_t_4 = __pyx_v_stream->c; __pyx_t_5 = __pyx_v_memory_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->memory.data + __pyx_t_5 * __pyx_v_self->memory.strides[0]) )) = __pyx_t_4;
1237: # advance number of characters stored
+1238: chars_stored += 1
__pyx_v_chars_stored = (__pyx_v_chars_stored + 1);
1239: # advance memory index
+1240: memory_index += 1
__pyx_v_memory_index = (__pyx_v_memory_index + 1);
1241:
1242: # advance input stream
+1243: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1243, __pyx_L1_error) } __pyx_L4_break:;
1244:
+1245: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFRefStringParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefStringParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefStringParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1246: if self.store:
__pyx_t_1 = (__pyx_v_self->store != 0); if (__pyx_t_1) { /* … */ }
+1247: self.values = np.zeros(self.chunk_length, dtype=self.dtype)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 1247, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0;
+1248: self.memory = self.values.view('u1')
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_6; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; /* … */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27);
1249:
+1250: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFRefStringParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefStringParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFRefStringParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefStringParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFRefStringParser_make_chunk { int __pyx_n; PyObject *limit; };
+1251: if self.store:
__pyx_t_1 = (__pyx_v_self->store != 0); if (__pyx_t_1) { /* … */ }
+1252: chunk[REF_FIELD] = self.values[:limit]
__pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->__pyx_base.values), 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_REF_FIELD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1253:
1254:
+1255: cdef class VCFRefObjectParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefObjectParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; int store; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFRefObjectParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFRefObjectParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFRefObjectParser;
1256:
1257: cdef:
1258: bint store
1259:
+1260: def __init__(self, chunk_length, store):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFRefObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFRefObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_store = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chunk_length,&__pyx_n_s_store,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1260, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1260, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_chunk_length = values[0]; __pyx_v_store = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1260, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefObjectParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFRefObjectParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefObjectParser *)__pyx_v_self), __pyx_v_chunk_length, __pyx_v_store); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFRefObjectParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefObjectParser *__pyx_v_self, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_store) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefObjectParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1261: super(VCFRefObjectParser, self).__init__(key=b'REF', dtype=np.dtype('object'), number=1, chunk_length=chunk_length)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFRefObjectParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFRefObjectParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFRefObjectParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_REF) < 0) __PYX_ERR(0, 1261, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_int_1) < 0) __PYX_ERR(0, 1261, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1261, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* … */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28);
+1262: self.store = store
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_store); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1262, __pyx_L1_error) __pyx_v_self->store = __pyx_t_4;
1263:
+1264: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFRefObjectParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefObjectParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { PyObject *__pyx_v_v = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefObjectParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v); __Pyx_RefNannyFinishContext(); return __pyx_r; }
1265:
+1266: vcf_read_field(stream, context, &context.temp)
__pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_read_field(__pyx_v_stream, __pyx_v_context, (&__pyx_v_context->temp)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1266, __pyx_L1_error)
1267:
1268: # with gil:
+1269: v = CharVector_to_pystr(&context.temp)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->temp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_v = __pyx_t_2;
__pyx_t_2 = 0;
+1270: if v != '.':
__pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_v, __pyx_kp_s__29, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1270, __pyx_L1_error)
if (__pyx_t_3) {
/* … */
}
+1271: context.ref_len = len(v)
__pyx_t_4 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1271, __pyx_L1_error)
__pyx_v_context->ref_len = __pyx_t_4;
+1272: if self.store:
__pyx_t_3 = (__pyx_v_self->store != 0); if (__pyx_t_3) { /* … */ }
+1273: self.values[context.chunk_variant_index] = v
if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_v_context->chunk_variant_index, __pyx_v_v, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 1273, __pyx_L1_error)
1274:
+1275: if context.state == VCFState.REF:
__pyx_t_3 = ((__pyx_v_context->state == __pyx_e_5allel_3opt_11io_vcf_read_REF) != 0); if (__pyx_t_3) { /* … */ }
+1276: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
1277:
+1278: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFRefObjectParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefObjectParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefObjectParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1279: if self.store:
__pyx_t_1 = (__pyx_v_self->store != 0); if (__pyx_t_1) { /* … */ }
+1280: self.values = np.empty(self.chunk_length, dtype=self.dtype)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 1280, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0;
+1281: self.values.fill('')
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30);
1282:
+1283: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFRefObjectParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFRefObjectParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFRefObjectParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFRefObjectParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFRefObjectParser_make_chunk { int __pyx_n; PyObject *limit; };
+1284: if self.store:
__pyx_t_1 = (__pyx_v_self->store != 0); if (__pyx_t_1) { /* … */ }
+1285: chunk[REF_FIELD] = self.values[:limit]
__pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->__pyx_base.values), 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_REF_FIELD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1286:
1287:
+1288: cdef class VCFAltStringParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltStringParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; __Pyx_memviewslice memory; __Pyx_memviewslice numalt_memory; __Pyx_memviewslice svlen_memory; __Pyx_memviewslice is_snp_memory; PyArrayObject *numalt_values; PyArrayObject *svlen_values; PyArrayObject *is_snp_values; int store_alt; int store_numalt; int store_svlen; int store_is_snp; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFAltStringParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFAltStringParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFAltStringParser;
1289:
1290: cdef:
1291: np.uint8_t[:] memory
1292: np.int32_t[:] numalt_memory
1293: np.int32_t[:, :] svlen_memory
1294: np.uint8_t[:] is_snp_memory
1295: np.ndarray numalt_values
1296: np.ndarray svlen_values
1297: np.ndarray is_snp_values
1298: bint store_alt
1299: bint store_numalt
1300: bint store_svlen
1301: bint store_is_snp
1302:
+1303: def __init__(self, dtype, number, chunk_length, store_alt, store_numalt, store_svlen,
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFAltStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFAltStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_number = 0; PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_store_alt = 0; PyObject *__pyx_v_store_numalt = 0; PyObject *__pyx_v_store_svlen = 0; PyObject *__pyx_v_store_is_snp = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,&__pyx_n_s_number,&__pyx_n_s_chunk_length,&__pyx_n_s_store_alt,&__pyx_n_s_store_numalt,&__pyx_n_s_store_svlen,&__pyx_n_s_store_is_snp,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 1303, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 1303, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_alt)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 1303, __pyx_L3_error) } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_numalt)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 1303, __pyx_L3_error) } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_svlen)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 1303, __pyx_L3_error) } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_is_snp)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 1303, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1303, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_dtype = values[0]; __pyx_v_number = values[1]; __pyx_v_chunk_length = values[2]; __pyx_v_store_alt = values[3]; __pyx_v_store_numalt = values[4]; __pyx_v_store_svlen = values[5]; __pyx_v_store_is_snp = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1303, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltStringParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFAltStringParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltStringParser *)__pyx_v_self), __pyx_v_dtype, __pyx_v_number, __pyx_v_chunk_length, __pyx_v_store_alt, __pyx_v_store_numalt, __pyx_v_store_svlen, __pyx_v_store_is_snp); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFAltStringParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltStringParser *__pyx_v_self, PyObject *__pyx_v_dtype, PyObject *__pyx_v_number, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_store_alt, PyObject *__pyx_v_store_numalt, PyObject *__pyx_v_store_svlen, PyObject *__pyx_v_store_is_snp) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_dtype); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltStringParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dtype); __Pyx_RefNannyFinishContext(); return __pyx_r; }
1304: store_is_snp):
+1305: if store_alt:
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store_alt); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1305, __pyx_L1_error)
if (__pyx_t_1) {
/* … */
}
+1306: dtype = check_string_dtype(dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_string_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dtype}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dtype}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_dtype); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_2); __pyx_t_2 = 0;
+1307: super(VCFAltStringParser, self).__init__(key=b'ALT', dtype=dtype, number=number,
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFAltStringParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFAltStringParser)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFAltStringParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_n_b_ALT) < 0) __PYX_ERR(0, 1307, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1307, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_number, __pyx_v_number) < 0) __PYX_ERR(0, 1307, __pyx_L1_error) /* … */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+1308: chunk_length=chunk_length)
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
+1309: self.store_alt = store_alt
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store_alt); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1309, __pyx_L1_error) __pyx_v_self->store_alt = __pyx_t_1;
+1310: self.store_numalt = store_numalt
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store_numalt); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1310, __pyx_L1_error) __pyx_v_self->store_numalt = __pyx_t_1;
+1311: self.store_svlen = store_svlen
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store_svlen); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1311, __pyx_L1_error) __pyx_v_self->store_svlen = __pyx_t_1;
+1312: self.store_is_snp = store_is_snp
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_store_is_snp); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1312, __pyx_L1_error) __pyx_v_self->store_is_snp = __pyx_t_1;
1313:
+1314: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFAltStringParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltStringParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_alt_index; int __pyx_v_memory_offset; int __pyx_v_memory_index; int __pyx_v_chars_stored; int __pyx_v_alt_len; int __pyx_v_is_snp; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltStringParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1315: cdef:
1316: # index of alt values
+1317: int alt_index = 0
__pyx_v_alt_index = 0;
1318: # index into memory view
1319: int memory_offset, memory_index
1320: # number of characters read into current value
+1321: int chars_stored = 0
__pyx_v_chars_stored = 0;
1322: # size of alt allel
+1323: int alt_len = 0
__pyx_v_alt_len = 0;
1324: # is the variant a SNP?
+1325: bint is_snp = context.ref_len == 1
__pyx_v_is_snp = (__pyx_v_context->ref_len == 1);
1326:
1327: # bail out early for missing value
+1328: if stream.c == PERIOD:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); if (__pyx_t_1) { /* … */ }
1329: # treat period as missing value, regardless of what comes next
+1330: return vcf_parse_missing(stream, context)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_parse_missing(__pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1330, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0;
1331:
1332: # bail out early for empty value
+1333: if stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
+1334: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1334, __pyx_L1_error)
+1335: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+1336: return 0
__pyx_r = 0; goto __pyx_L0;
1337:
1338: # initialise memory offset and index
+1339: memory_offset = context.chunk_variant_index * self.itemsize * self.number
__pyx_v_memory_offset = ((__pyx_v_context->chunk_variant_index * __pyx_v_self->__pyx_base.itemsize) * __pyx_v_self->__pyx_base.number);
+1340: memory_index = memory_offset
__pyx_v_memory_index = __pyx_v_memory_offset;
1341:
+1342: while True:
while (1) {
1343:
+1344: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+1345: is_snp = is_snp and alt_len == 1
__pyx_t_3 = (__pyx_v_is_snp != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L8_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_len == 1) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L8_bool_binop_done:; __pyx_v_is_snp = __pyx_t_1;
+1346: if self.store_svlen and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L11_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1347: self.svlen_memory[context.chunk_variant_index, alt_index] = \
__pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_alt_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->svlen_memory.data + __pyx_t_4 * __pyx_v_self->svlen_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_self->svlen_memory.strides[1]) )) = (__pyx_v_alt_len - __pyx_v_context->ref_len);
1348: alt_len - context.ref_len
+1349: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+1350: break
goto __pyx_L6_break;
1351:
+1352: elif stream.c == LF or stream.c == CR:
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L13_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L13_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1353: is_snp = is_snp and alt_len == 1
__pyx_t_3 = (__pyx_v_is_snp != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L15_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_len == 1) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L15_bool_binop_done:; __pyx_v_is_snp = __pyx_t_1;
+1354: if self.store_svlen and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L18_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L18_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1355: self.svlen_memory[context.chunk_variant_index, alt_index] = \
__pyx_t_6 = __pyx_v_context->chunk_variant_index; __pyx_t_7 = __pyx_v_alt_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->svlen_memory.data + __pyx_t_6 * __pyx_v_self->svlen_memory.strides[0]) ) + __pyx_t_7 * __pyx_v_self->svlen_memory.strides[1]) )) = (__pyx_v_alt_len - __pyx_v_context->ref_len);
1356: alt_len - context.ref_len
+1357: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+1358: break
goto __pyx_L6_break;
1359:
+1360: if stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
+1361: is_snp = is_snp and alt_len == 1
__pyx_t_3 = (__pyx_v_is_snp != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L21_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_len == 1) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L21_bool_binop_done:; __pyx_v_is_snp = __pyx_t_1;
+1362: if self.store_svlen and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L24_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L24_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1363: self.svlen_memory[context.chunk_variant_index, alt_index] = \
__pyx_t_8 = __pyx_v_context->chunk_variant_index; __pyx_t_9 = __pyx_v_alt_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->svlen_memory.data + __pyx_t_8 * __pyx_v_self->svlen_memory.strides[0]) ) + __pyx_t_9 * __pyx_v_self->svlen_memory.strides[1]) )) = (__pyx_v_alt_len - __pyx_v_context->ref_len);
1364: alt_len - context.ref_len
+1365: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1365, __pyx_L1_error)
+1366: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+1367: break
goto __pyx_L6_break;
1368:
+1369: elif stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L20; }
+1370: is_snp = is_snp and alt_len == 1
__pyx_t_3 = (__pyx_v_is_snp != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L26_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_len == 1) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L26_bool_binop_done:; __pyx_v_is_snp = __pyx_t_1;
+1371: if self.store_svlen and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L29_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L29_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1372: self.svlen_memory[context.chunk_variant_index, alt_index] = \
__pyx_t_10 = __pyx_v_context->chunk_variant_index; __pyx_t_11 = __pyx_v_alt_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->svlen_memory.data + __pyx_t_10 * __pyx_v_self->svlen_memory.strides[0]) ) + __pyx_t_11 * __pyx_v_self->svlen_memory.strides[1]) )) = (__pyx_v_alt_len - __pyx_v_context->ref_len);
1373: alt_len - context.ref_len
1374: # advance value index
+1375: alt_index += 1
__pyx_v_alt_index = (__pyx_v_alt_index + 1);
1376: # reset alt_len
+1377: alt_len = 0
__pyx_v_alt_len = 0;
1378: # set memory index to beginning of next item
+1379: memory_index = memory_offset + (alt_index * self.itemsize)
__pyx_v_memory_index = (__pyx_v_memory_offset + (__pyx_v_alt_index * __pyx_v_self->__pyx_base.itemsize));
1380: # reset chars stored
+1381: chars_stored = 0
__pyx_v_chars_stored = 0;
1382:
1383: else:
+1384: if stream.c != PERIOD and stream.c != ASTERISK:
/*else*/ { __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L32_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_ASTERISK) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L32_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1385: alt_len += 1
__pyx_v_alt_len = (__pyx_v_alt_len + 1);
+1386: if self.store_alt and chars_stored < self.itemsize and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_alt != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L35_bool_binop_done; } __pyx_t_3 = ((__pyx_v_chars_stored < __pyx_v_self->__pyx_base.itemsize) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L35_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L35_bool_binop_done:; if (__pyx_t_1) { /* … */ } } __pyx_L20:;
1387: # store value
+1388: self.memory[memory_index] = stream.c
__pyx_t_12 = __pyx_v_stream->c; __pyx_t_13 = __pyx_v_memory_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->memory.data + __pyx_t_13 * __pyx_v_self->memory.strides[0]) )) = __pyx_t_12;
1389: # advance number of characters stored
+1390: chars_stored += 1
__pyx_v_chars_stored = (__pyx_v_chars_stored + 1);
1391: # advance memory index
+1392: memory_index += 1
__pyx_v_memory_index = (__pyx_v_memory_index + 1);
1393:
1394: # advance input stream
+1395: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1395, __pyx_L1_error) } __pyx_L6_break:;
1396:
+1397: if self.store_numalt:
__pyx_t_1 = (__pyx_v_self->store_numalt != 0); if (__pyx_t_1) { /* … */ }
+1398: self.numalt_memory[context.chunk_variant_index] = alt_index + 1
__pyx_t_14 = __pyx_v_context->chunk_variant_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_self->numalt_memory.data + __pyx_t_14 * __pyx_v_self->numalt_memory.strides[0]) )) = (__pyx_v_alt_index + 1);
+1399: if self.store_is_snp:
__pyx_t_1 = (__pyx_v_self->store_is_snp != 0); if (__pyx_t_1) { /* … */ }
+1400: self.is_snp_memory[context.chunk_variant_index] = is_snp
__pyx_t_15 = __pyx_v_context->chunk_variant_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->is_snp_memory.data + __pyx_t_15 * __pyx_v_self->is_snp_memory.strides[0]) )) = __pyx_v_is_snp;
1401:
+1402: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFAltStringParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltStringParser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltStringParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1403: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+1404: if self.store_alt:
__pyx_t_4 = (__pyx_v_self->store_alt != 0); if (__pyx_t_4) { /* … */ }
+1405: self.values = np.zeros(shape, dtype=self.dtype, order='C')
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 1405, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 1405, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1405, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0;
+1406: self.memory = self.values.reshape(-1).view('u1')
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_6; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32);
+1407: if self.store_numalt:
__pyx_t_4 = (__pyx_v_self->store_numalt != 0); if (__pyx_t_4) { /* … */ }
+1408: self.numalt_values = np.zeros(self.chunk_length, dtype='int32')
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 1408, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->numalt_values); __Pyx_DECREF(((PyObject *)__pyx_v_self->numalt_values)); __pyx_v_self->numalt_values = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0;
+1409: self.numalt_memory = self.numalt_values
__pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_self->numalt_values)); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1409, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->numalt_memory, 0); __pyx_v_self->numalt_memory = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL;
+1410: if self.store_svlen:
__pyx_t_4 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_4) { /* … */ }
+1411: self.svlen_values = np.zeros(shape, dtype='int32')
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 1411, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->svlen_values); __Pyx_DECREF(((PyObject *)__pyx_v_self->svlen_values)); __pyx_v_self->svlen_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0;
+1412: self.svlen_memory = self.svlen_values
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_self->svlen_values)); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1412, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->svlen_memory, 0); __pyx_v_self->svlen_memory = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL;
+1413: if self.store_is_snp:
__pyx_t_4 = (__pyx_v_self->store_is_snp != 0); if (__pyx_t_4) { /* … */ }
+1414: self.is_snp_values = np.zeros(self.chunk_length, dtype=bool)
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 1414, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->is_snp_values); __Pyx_DECREF(((PyObject *)__pyx_v_self->is_snp_values)); __pyx_v_self->is_snp_values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+1415: self.is_snp_memory = self.is_snp_values.view('u1')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->is_snp_values), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_5); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->is_snp_memory, 0); __pyx_v_self->is_snp_memory = __pyx_t_6; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; /* … */ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33);
1416:
+1417: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFAltStringParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltStringParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFAltStringParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_values = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltStringParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_values); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFAltStringParser_make_chunk { int __pyx_n; PyObject *limit; };
+1418: if self.store_alt:
__pyx_t_1 = (__pyx_v_self->store_alt != 0); if (__pyx_t_1) { /* … */ }
+1419: if PY2:
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1419, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* … */ goto __pyx_L4; }
+1420: field = 'variants/' + self.key
__pyx_t_2 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_v_self->__pyx_base.key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_field = __pyx_t_2; __pyx_t_2 = 0;
1421: else:
+1422: field = 'variants/' + str(self.key, 'ascii')
/*else*/ { __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->__pyx_base.key); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.key); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->__pyx_base.key); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ascii); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_field = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L4:;
+1423: values = self.values
__pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.values);
__Pyx_INCREF(__pyx_t_2);
__pyx_v_values = __pyx_t_2;
__pyx_t_2 = 0;
+1424: if self.values.ndim > 1 and self.number == 1:
__pyx_t_4 = ((__pyx_v_self->__pyx_base.values->nd > 1) != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = ((__pyx_v_self->__pyx_base.number == 1) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1425: values = values.squeeze(axis=1)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1425, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_5); __pyx_t_5 = 0;
+1426: chunk[field] = values[:limit]
__pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_values, 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_5) < 0)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+1427: if self.store_numalt:
__pyx_t_1 = (__pyx_v_self->store_numalt != 0); if (__pyx_t_1) { /* … */ }
+1428: field = 'variants/numalt'
__Pyx_INCREF(__pyx_kp_s_variants_numalt); __Pyx_XDECREF_SET(__pyx_v_field, __pyx_kp_s_variants_numalt);
+1429: values = self.numalt_values
__pyx_t_5 = ((PyObject *)__pyx_v_self->numalt_values); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_5); __pyx_t_5 = 0;
+1430: chunk[field] = values[:limit]
__pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_values, 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_5) < 0)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+1431: if self.store_svlen:
__pyx_t_1 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_1) { /* … */ }
+1432: field = 'variants/svlen'
__Pyx_INCREF(__pyx_kp_s_variants_svlen); __Pyx_XDECREF_SET(__pyx_v_field, __pyx_kp_s_variants_svlen);
+1433: values = self.svlen_values
__pyx_t_5 = ((PyObject *)__pyx_v_self->svlen_values); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_5); __pyx_t_5 = 0;
+1434: if self.values.ndim > 1 and self.number == 1:
__pyx_t_4 = ((__pyx_v_self->__pyx_base.values->nd > 1) != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L11_bool_binop_done; } __pyx_t_4 = ((__pyx_v_self->__pyx_base.number == 1) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1435: values = values.squeeze(axis=1)
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1435, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_2); __pyx_t_2 = 0;
+1436: chunk[field] = values[:limit]
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_values, 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_2) < 0)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1437: if self.store_is_snp:
__pyx_t_1 = (__pyx_v_self->store_is_snp != 0); if (__pyx_t_1) { /* … */ }
+1438: field = 'variants/is_snp'
__Pyx_INCREF(__pyx_kp_s_variants_is_snp); __Pyx_XDECREF_SET(__pyx_v_field, __pyx_kp_s_variants_is_snp);
+1439: values = self.is_snp_values
__pyx_t_2 = ((PyObject *)__pyx_v_self->is_snp_values); __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_2); __pyx_t_2 = 0;
+1440: chunk[field] = values[:limit]
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_values, 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_2) < 0)) __PYX_ERR(0, 1440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1441:
1442:
+1443: cdef class VCFAltObjectParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltObjectParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; __Pyx_memviewslice numalt_memory; __Pyx_memviewslice svlen_memory; __Pyx_memviewslice is_snp_memory; PyArrayObject *numalt_values; PyArrayObject *svlen_values; PyArrayObject *is_snp_values; int store_alt; int store_numalt; int store_svlen; int store_is_snp; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFAltObjectParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFAltObjectParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFAltObjectParser;
1444:
1445: cdef:
1446: np.int32_t[:] numalt_memory
1447: np.int32_t[:, :] svlen_memory
1448: np.uint8_t[:] is_snp_memory
1449: np.ndarray numalt_values
1450: np.ndarray svlen_values
1451: np.ndarray is_snp_values
1452: bint store_alt
1453: bint store_numalt
1454: bint store_svlen
1455: bint store_is_snp
1456:
+1457: def __init__(self, number, chunk_length, store_alt, store_numalt, store_svlen, store_is_snp):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFAltObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFAltObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_number = 0; PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_store_alt = 0; PyObject *__pyx_v_store_numalt = 0; PyObject *__pyx_v_store_svlen = 0; PyObject *__pyx_v_store_is_snp = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_number,&__pyx_n_s_chunk_length,&__pyx_n_s_store_alt,&__pyx_n_s_store_numalt,&__pyx_n_s_store_svlen,&__pyx_n_s_store_is_snp,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 1); __PYX_ERR(0, 1457, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_alt)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 2); __PYX_ERR(0, 1457, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_numalt)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 3); __PYX_ERR(0, 1457, __pyx_L3_error) } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_svlen)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 4); __PYX_ERR(0, 1457, __pyx_L3_error) } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_store_is_snp)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 5); __PYX_ERR(0, 1457, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1457, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_number = values[0]; __pyx_v_chunk_length = values[1]; __pyx_v_store_alt = values[2]; __pyx_v_store_numalt = values[3]; __pyx_v_store_svlen = values[4]; __pyx_v_store_is_snp = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1457, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltObjectParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFAltObjectParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltObjectParser *)__pyx_v_self), __pyx_v_number, __pyx_v_chunk_length, __pyx_v_store_alt, __pyx_v_store_numalt, __pyx_v_store_svlen, __pyx_v_store_is_snp); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFAltObjectParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltObjectParser *__pyx_v_self, PyObject *__pyx_v_number, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_store_alt, PyObject *__pyx_v_store_numalt, PyObject *__pyx_v_store_svlen, PyObject *__pyx_v_store_is_snp) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltObjectParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1458: super(VCFAltObjectParser, self).__init__(key=b'ALT', dtype=np.dtype('object'), number=number,
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFAltObjectParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFAltObjectParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFAltObjectParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_ALT) < 0) __PYX_ERR(0, 1458, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_v_number) < 0) __PYX_ERR(0, 1458, __pyx_L1_error) /* … */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* … */ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34);
+1459: chunk_length=chunk_length)
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1458, __pyx_L1_error)
+1460: self.store_alt = store_alt
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_store_alt); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1460, __pyx_L1_error) __pyx_v_self->store_alt = __pyx_t_4;
+1461: self.store_numalt = store_numalt
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_store_numalt); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1461, __pyx_L1_error) __pyx_v_self->store_numalt = __pyx_t_4;
+1462: self.store_svlen = store_svlen
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_store_svlen); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1462, __pyx_L1_error) __pyx_v_self->store_svlen = __pyx_t_4;
+1463: self.store_is_snp = store_is_snp
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_store_is_snp); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1463, __pyx_L1_error) __pyx_v_self->store_is_snp = __pyx_t_4;
1464:
+1465: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFAltObjectParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltObjectParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_alt_index; int __pyx_v_alt_len; int __pyx_v_is_snp; PyObject *__pyx_v_v = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltObjectParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v); __Pyx_RefNannyFinishContext(); return __pyx_r; }
1466: cdef:
1467: # index of alt values
+1468: int alt_index = 0
__pyx_v_alt_index = 0;
1469: # size of alt allele
+1470: int alt_len = 0
__pyx_v_alt_len = 0;
1471: # is the variant a SNP?
+1472: bint is_snp = context.ref_len == 1
__pyx_v_is_snp = (__pyx_v_context->ref_len == 1);
1473:
1474: # bail out early for missing value
+1475: if stream.c == PERIOD:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); if (__pyx_t_1) { /* … */ }
1476: # treat period as missing value, regardless of what comes next
+1477: return vcf_parse_missing(stream, context)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_parse_missing(__pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1477, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0;
1478:
1479: # bail out early for empty value
+1480: if stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
+1481: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1481, __pyx_L1_error)
+1482: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+1483: return 0
__pyx_r = 0; goto __pyx_L0;
1484:
1485: # setup temp
+1486: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
1487:
+1488: while True:
while (1) {
1489:
+1490: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+1491: is_snp = is_snp and alt_len == 1
__pyx_t_3 = (__pyx_v_is_snp != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L8_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_len == 1) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L8_bool_binop_done:; __pyx_v_is_snp = __pyx_t_1;
+1492: if self.store_svlen and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L11_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1493: self.svlen_memory[context.chunk_variant_index, alt_index] = \
__pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_alt_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->svlen_memory.data + __pyx_t_4 * __pyx_v_self->svlen_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_self->svlen_memory.strides[1]) )) = (__pyx_v_alt_len - __pyx_v_context->ref_len);
1494: alt_len - context.ref_len
+1495: if self.store_alt and alt_index < self.number and context.temp.size > 0:
__pyx_t_3 = (__pyx_v_self->store_alt != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L14_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L14_bool_binop_done; } __pyx_t_3 = ((__pyx_v_context->temp.size > 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L14_bool_binop_done:; if (__pyx_t_1) { /* … */ }
1496: # with gil:
+1497: v = CharVector_to_pystr(&context.temp)
__pyx_t_6 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->temp)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0;
+1498: self.values[context.chunk_variant_index, alt_index] = v
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_context->chunk_variant_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_alt_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_t_8, __pyx_v_v) < 0)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1499: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+1500: break
goto __pyx_L6_break;
1501:
+1502: elif stream.c == LF or stream.c == CR:
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L17_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L17_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1503: is_snp = is_snp and alt_len == 1
__pyx_t_3 = (__pyx_v_is_snp != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L19_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_len == 1) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L19_bool_binop_done:; __pyx_v_is_snp = __pyx_t_1;
+1504: if self.store_svlen and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L22_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L22_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1505: self.svlen_memory[context.chunk_variant_index, alt_index] = \
__pyx_t_9 = __pyx_v_context->chunk_variant_index; __pyx_t_10 = __pyx_v_alt_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->svlen_memory.data + __pyx_t_9 * __pyx_v_self->svlen_memory.strides[0]) ) + __pyx_t_10 * __pyx_v_self->svlen_memory.strides[1]) )) = (__pyx_v_alt_len - __pyx_v_context->ref_len);
1506: alt_len - context.ref_len
+1507: if self.store_alt and alt_index < self.number and context.temp.size > 0:
__pyx_t_3 = (__pyx_v_self->store_alt != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L25_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L25_bool_binop_done; } __pyx_t_3 = ((__pyx_v_context->temp.size > 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L25_bool_binop_done:; if (__pyx_t_1) { /* … */ }
1508: # with gil:
+1509: v = CharVector_to_pystr(&context.temp)
__pyx_t_8 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->temp)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8); __pyx_t_8 = 0;
+1510: self.values[context.chunk_variant_index, alt_index] = v
__pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_context->chunk_variant_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_alt_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); __pyx_t_8 = 0; __pyx_t_7 = 0; if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_t_6, __pyx_v_v) < 0)) __PYX_ERR(0, 1510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1511: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+1512: break
goto __pyx_L6_break;
1513:
+1514: if stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
+1515: is_snp = is_snp and alt_len == 1
__pyx_t_3 = (__pyx_v_is_snp != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L29_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_len == 1) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L29_bool_binop_done:; __pyx_v_is_snp = __pyx_t_1;
+1516: if self.store_svlen and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L32_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L32_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1517: self.svlen_memory[context.chunk_variant_index, alt_index] = \
__pyx_t_11 = __pyx_v_context->chunk_variant_index; __pyx_t_12 = __pyx_v_alt_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->svlen_memory.data + __pyx_t_11 * __pyx_v_self->svlen_memory.strides[0]) ) + __pyx_t_12 * __pyx_v_self->svlen_memory.strides[1]) )) = (__pyx_v_alt_len - __pyx_v_context->ref_len);
1518: alt_len - context.ref_len
+1519: if self.store_alt and alt_index < self.number and context.temp.size > 0:
__pyx_t_3 = (__pyx_v_self->store_alt != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L35_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L35_bool_binop_done; } __pyx_t_3 = ((__pyx_v_context->temp.size > 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L35_bool_binop_done:; if (__pyx_t_1) { /* … */ }
1520: # with gil:
+1521: v = CharVector_to_pystr(&context.temp)
__pyx_t_6 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->temp)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0;
+1522: self.values[context.chunk_variant_index, alt_index] = v
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_context->chunk_variant_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_alt_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_t_8, __pyx_v_v) < 0)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1523: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1523, __pyx_L1_error)
+1524: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+1525: break
goto __pyx_L6_break;
1526:
+1527: elif stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L28; }
+1528: is_snp = is_snp and alt_len == 1
__pyx_t_3 = (__pyx_v_is_snp != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L38_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_len == 1) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L38_bool_binop_done:; __pyx_v_is_snp = __pyx_t_1;
+1529: if self.store_svlen and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L41_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L41_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1530: self.svlen_memory[context.chunk_variant_index, alt_index] = \
__pyx_t_13 = __pyx_v_context->chunk_variant_index; __pyx_t_14 = __pyx_v_alt_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->svlen_memory.data + __pyx_t_13 * __pyx_v_self->svlen_memory.strides[0]) ) + __pyx_t_14 * __pyx_v_self->svlen_memory.strides[1]) )) = (__pyx_v_alt_len - __pyx_v_context->ref_len);
1531: alt_len - context.ref_len
+1532: if self.store_alt and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_alt != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L44_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L44_bool_binop_done:; if (__pyx_t_1) { /* … */ }
1533: # with gil:
+1534: v = CharVector_to_pystr(&context.temp)
__pyx_t_8 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->temp)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8); __pyx_t_8 = 0;
+1535: self.values[context.chunk_variant_index, alt_index] = v
__pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_context->chunk_variant_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_alt_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); __pyx_t_8 = 0; __pyx_t_7 = 0; if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_t_6, __pyx_v_v) < 0)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1536: # advance value index
+1537: alt_index += 1
__pyx_v_alt_index = (__pyx_v_alt_index + 1);
1538: # reset
+1539: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
+1540: alt_len = 0
__pyx_v_alt_len = 0;
1541:
1542: else:
+1543: if stream.c != PERIOD and stream.c != ASTERISK:
/*else*/ { __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L47_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_ASTERISK) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L47_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1544: alt_len += 1
__pyx_v_alt_len = (__pyx_v_alt_len + 1);
+1545: if self.store_alt and alt_index < self.number:
__pyx_t_3 = (__pyx_v_self->store_alt != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L50_bool_binop_done; } __pyx_t_3 = ((__pyx_v_alt_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L50_bool_binop_done:; if (__pyx_t_1) { /* … */ } } __pyx_L28:;
+1546: CharVector_append(&context.temp, stream.c)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c);
1547:
1548: # advance input stream
+1549: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1549, __pyx_L1_error) } __pyx_L6_break:;
1550:
+1551: if self.store_numalt:
__pyx_t_1 = (__pyx_v_self->store_numalt != 0); if (__pyx_t_1) { /* … */ }
+1552: self.numalt_memory[context.chunk_variant_index] = alt_index + 1
__pyx_t_15 = __pyx_v_context->chunk_variant_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_self->numalt_memory.data + __pyx_t_15 * __pyx_v_self->numalt_memory.strides[0]) )) = (__pyx_v_alt_index + 1);
+1553: if self.store_is_snp:
__pyx_t_1 = (__pyx_v_self->store_is_snp != 0); if (__pyx_t_1) { /* … */ }
+1554: self.is_snp_memory[context.chunk_variant_index] = is_snp
__pyx_t_16 = __pyx_v_context->chunk_variant_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->is_snp_memory.data + __pyx_t_16 * __pyx_v_self->is_snp_memory.strides[0]) )) = __pyx_v_is_snp;
1555:
+1556: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFAltObjectParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltObjectParser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltObjectParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1557: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+1558: if self.store_alt:
__pyx_t_4 = (__pyx_v_self->store_alt != 0); if (__pyx_t_4) { /* … */ }
+1559: self.values = np.empty(shape, dtype=self.dtype, order='C')
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 1559, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 1559, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1559, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0;
+1560: self.values.fill('')
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1560, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35);
+1561: if self.store_numalt:
__pyx_t_4 = (__pyx_v_self->store_numalt != 0); if (__pyx_t_4) { /* … */ }
+1562: self.numalt_values = np.zeros(self.chunk_length, dtype='int32')
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 1562, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1562, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->numalt_values); __Pyx_DECREF(((PyObject *)__pyx_v_self->numalt_values)); __pyx_v_self->numalt_values = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0;
+1563: self.numalt_memory = self.numalt_values
__pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_self->numalt_values)); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1563, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->numalt_memory, 0); __pyx_v_self->numalt_memory = __pyx_t_6; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL;
+1564: if self.store_svlen:
__pyx_t_4 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_4) { /* … */ }
+1565: self.svlen_values = np.zeros(shape, dtype='int32')
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 1565, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1565, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->svlen_values); __Pyx_DECREF(((PyObject *)__pyx_v_self->svlen_values)); __pyx_v_self->svlen_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0;
+1566: self.svlen_memory = self.svlen_values
__pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_self->svlen_values)); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1566, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->svlen_memory, 0); __pyx_v_self->svlen_memory = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL;
+1567: if self.store_is_snp:
__pyx_t_4 = (__pyx_v_self->store_is_snp != 0); if (__pyx_t_4) { /* … */ }
+1568: self.is_snp_values = np.zeros(self.chunk_length, dtype=bool)
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 1568, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->is_snp_values); __Pyx_DECREF(((PyObject *)__pyx_v_self->is_snp_values)); __pyx_v_self->is_snp_values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+1569: self.is_snp_memory = self.is_snp_values.view('u1')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->is_snp_values), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_5); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->is_snp_memory, 0); __pyx_v_self->is_snp_memory = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; /* … */ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1569, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36);
1570:
+1571: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFAltObjectParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFAltObjectParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFAltObjectParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_values = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFAltObjectParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_values); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_18VCFAltObjectParser_make_chunk { int __pyx_n; PyObject *limit; };
+1572: if self.store_alt:
__pyx_t_1 = (__pyx_v_self->store_alt != 0); if (__pyx_t_1) { /* … */ }
+1573: if PY2:
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1573, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* … */ goto __pyx_L4; }
+1574: field = 'variants/' + self.key
__pyx_t_2 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_v_self->__pyx_base.key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_field = __pyx_t_2; __pyx_t_2 = 0;
1575: else:
+1576: field = 'variants/' + str(self.key, 'ascii')
/*else*/ { __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->__pyx_base.key); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.key); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->__pyx_base.key); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ascii); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_field = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L4:;
+1577: values = self.values
__pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.values);
__Pyx_INCREF(__pyx_t_2);
__pyx_v_values = __pyx_t_2;
__pyx_t_2 = 0;
+1578: if self.values.ndim > 1 and self.number == 1:
__pyx_t_4 = ((__pyx_v_self->__pyx_base.values->nd > 1) != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = ((__pyx_v_self->__pyx_base.number == 1) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1579: values = values.squeeze(axis=1)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1579, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_5); __pyx_t_5 = 0;
+1580: chunk[field] = values[:limit]
__pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_values, 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_5) < 0)) __PYX_ERR(0, 1580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+1581: if self.store_numalt:
__pyx_t_1 = (__pyx_v_self->store_numalt != 0); if (__pyx_t_1) { /* … */ }
+1582: field = 'variants/numalt'
__Pyx_INCREF(__pyx_kp_s_variants_numalt); __Pyx_XDECREF_SET(__pyx_v_field, __pyx_kp_s_variants_numalt);
+1583: values = self.numalt_values
__pyx_t_5 = ((PyObject *)__pyx_v_self->numalt_values); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_5); __pyx_t_5 = 0;
+1584: chunk[field] = values[:limit]
__pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_values, 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_5) < 0)) __PYX_ERR(0, 1584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+1585: if self.store_svlen:
__pyx_t_1 = (__pyx_v_self->store_svlen != 0); if (__pyx_t_1) { /* … */ }
+1586: field = 'variants/svlen'
__Pyx_INCREF(__pyx_kp_s_variants_svlen); __Pyx_XDECREF_SET(__pyx_v_field, __pyx_kp_s_variants_svlen);
+1587: values = self.svlen_values
__pyx_t_5 = ((PyObject *)__pyx_v_self->svlen_values); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_5); __pyx_t_5 = 0;
+1588: if self.values.ndim > 1 and self.number == 1:
__pyx_t_4 = ((__pyx_v_self->__pyx_base.values->nd > 1) != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L11_bool_binop_done; } __pyx_t_4 = ((__pyx_v_self->__pyx_base.number == 1) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1589: values = values.squeeze(axis=1)
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1589, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_2); __pyx_t_2 = 0;
+1590: chunk[field] = values[:limit]
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_values, 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_2) < 0)) __PYX_ERR(0, 1590, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1591: if self.store_is_snp:
__pyx_t_1 = (__pyx_v_self->store_is_snp != 0); if (__pyx_t_1) { /* … */ }
+1592: field = 'variants/is_snp'
__Pyx_INCREF(__pyx_kp_s_variants_is_snp); __Pyx_XDECREF_SET(__pyx_v_field, __pyx_kp_s_variants_is_snp);
+1593: values = self.is_snp_values
__pyx_t_2 = ((PyObject *)__pyx_v_self->is_snp_values); __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_2); __pyx_t_2 = 0;
+1594: chunk[field] = values[:limit]
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_values, 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_2) < 0)) __PYX_ERR(0, 1594, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1595:
1596:
+1597: cdef class VCFQualParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFQualParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFQualParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFQualParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFQualParser;
1598:
1599: cdef np.float32_t[:] memory
1600:
+1601: def __init__(self, chunk_length, fill=NAN):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_13VCFQualParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_13VCFQualParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_fill = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chunk_length,&__pyx_n_s_fill,0}; PyObject* values[2] = {0,0}; values[1] = __pyx_k__37; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1601, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_chunk_length = values[0]; __pyx_v_fill = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1601, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFQualParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_13VCFQualParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFQualParser *)__pyx_v_self), __pyx_v_chunk_length, __pyx_v_fill); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_13VCFQualParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFQualParser *__pyx_v_self, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_fill) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFQualParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_5allel_3opt_11io_vcf_read_NAN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_k__37 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0;
+1602: super(VCFQualParser, self).__init__(key=b'QUAL', dtype='float32', number=1,
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFQualParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFQualParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFQualParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_QUAL) < 0) __PYX_ERR(0, 1602, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_float32) < 0) __PYX_ERR(0, 1602, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_int_1) < 0) __PYX_ERR(0, 1602, __pyx_L1_error) /* … */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+1603: fill=fill, chunk_length=chunk_length)
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1602, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1602, __pyx_L1_error)
1604:
+1605: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_13VCFQualParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFQualParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { double __pyx_v_value; int __pyx_v_parsed; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFQualParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1606: cdef:
1607: double value
1608: int parsed
1609:
1610: # read into temp
+1611: vcf_read_field(stream, context, &context.temp)
__pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_read_field(__pyx_v_stream, __pyx_v_context, (&__pyx_v_context->temp)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1611, __pyx_L1_error)
1612:
1613: # parse string as floating
+1614: parsed = vcf_strtod(&context.temp, context, &value)
__pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtod((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1614, __pyx_L1_error) __pyx_v_parsed = __pyx_t_1;
1615:
+1616: if parsed > 0:
__pyx_t_2 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_2) { /* … */ }
1617: # store value
+1618: self.memory[context.chunk_variant_index] = value
__pyx_t_3 = __pyx_v_context->chunk_variant_index; *((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_self->memory.data + __pyx_t_3 * __pyx_v_self->memory.strides[0]) )) = __pyx_v_value;
1619:
+1620: if context.state == VCFState.QUAL:
__pyx_t_2 = ((__pyx_v_context->state == __pyx_e_5allel_3opt_11io_vcf_read_QUAL) != 0); if (__pyx_t_2) { /* … */ }
+1621: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
1622:
+1623: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_13VCFQualParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFQualParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFQualParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1624: self.values = np.empty(self.chunk_length, dtype='float32')
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_float32) < 0) __PYX_ERR(0, 1624, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1624, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+1625: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1625, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+1626: self.memory[:] = NAN
{ __pyx_t_5numpy_float32_t __pyx_temp_scalar = __pyx_v_5allel_3opt_11io_vcf_read_NAN; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { *((__pyx_t_5numpy_float32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar; __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
1627:
1628:
+1629: cdef class VCFFilterParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; __Pyx_memviewslice memory; PyObject *filter_keys; int n_filters; char **filter_keys_cstr; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFilterParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; int (*parse_filter)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFilterParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFFilterParser;
1630:
1631: cdef:
1632: np.uint8_t[:, :] memory
1633: tuple filter_keys
1634: int n_filters
1635: char** filter_keys_cstr
1636:
+1637: def __cinit__(self, filter_keys, chunk_length):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFilterParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFilterParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filter_keys = 0; CYTHON_UNUSED PyObject *__pyx_v_chunk_length = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filter_keys,&__pyx_n_s_chunk_length,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filter_keys)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 1637, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1637, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_filter_keys = values[0]; __pyx_v_chunk_length = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1637, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFilterParser.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFilterParser___cinit__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *)__pyx_v_self), __pyx_v_filter_keys, __pyx_v_chunk_length); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFilterParser___cinit__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *__pyx_v_self, PyObject *__pyx_v_filter_keys, CYTHON_UNUSED PyObject *__pyx_v_chunk_length) { int __pyx_v_i; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFilterParser.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1638: cdef:
1639: int i
1640: # N.B., need to keep a reference to these, otherwise C strings will not behave
+1641: self.filter_keys = tuple(sorted(filter_keys))
__pyx_t_2 = PySequence_List(__pyx_v_filter_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1641, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1641, __pyx_L1_error) } __pyx_t_2 = PyList_AsTuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->filter_keys); __Pyx_DECREF(__pyx_v_self->filter_keys); __pyx_v_self->filter_keys = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
+1642: self.n_filters = len(self.filter_keys)
__pyx_t_2 = __pyx_v_self->filter_keys; __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 1642, __pyx_L1_error) } __pyx_t_4 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->n_filters = __pyx_t_4;
+1643: self.filter_keys_cstr = <char**> malloc(sizeof(char*) * self.n_filters)
__pyx_v_self->filter_keys_cstr = ((char **)malloc(((sizeof(char *)) * __pyx_v_self->n_filters)));
+1644: for i in range(self.n_filters):
__pyx_t_5 = __pyx_v_self->n_filters; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6;
+1645: self.filter_keys_cstr[i] = <char*> self.filter_keys[i]
if (unlikely(__pyx_v_self->filter_keys == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1645, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyObject_AsString(PyTuple_GET_ITEM(__pyx_v_self->filter_keys, __pyx_v_i)); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 1645, __pyx_L1_error) (__pyx_v_self->filter_keys_cstr[__pyx_v_i]) = ((char *)__pyx_t_7); }
1646:
+1647: def __init__(self, filter_keys, chunk_length):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFilterParser_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFilterParser_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filter_keys = 0; PyObject *__pyx_v_chunk_length = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filter_keys,&__pyx_n_s_chunk_length,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filter_keys)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1647, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1647, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_filter_keys = values[0]; __pyx_v_chunk_length = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1647, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFilterParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFilterParser_2__init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *)__pyx_v_self), __pyx_v_filter_keys, __pyx_v_chunk_length); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFilterParser_2__init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *__pyx_v_self, PyObject *__pyx_v_filter_keys, PyObject *__pyx_v_chunk_length) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFilterParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1648: super(VCFFilterParser, self).__init__(key=b'FILTER', dtype='bool', number=len(filter_keys), fill=0,
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFFilterParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFFilterParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFFilterParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_FILTER) < 0) __PYX_ERR(0, 1648, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1648, __pyx_L1_error) __pyx_t_3 = PyObject_Length(__pyx_v_filter_keys); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1648, __pyx_L1_error) __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_t_4) < 0) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fill, __pyx_int_0) < 0) __PYX_ERR(0, 1648, __pyx_L1_error) /* … */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+1649: chunk_length=chunk_length)
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1648, __pyx_L1_error)
1650:
+1651: def __dealloc__(self):
/* Python wrapper */ static void __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFilterParser_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFilterParser_5__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFilterParser_4__dealloc__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFilterParser_4__dealloc__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* … */ /* function exit code */ __Pyx_RefNannyFinishContext(); }
+1652: if self.filter_keys_cstr is not NULL:
__pyx_t_1 = ((__pyx_v_self->filter_keys_cstr != NULL) != 0); if (__pyx_t_1) { /* … */ }
+1653: free(self.filter_keys_cstr)
free(__pyx_v_self->filter_keys_cstr);
1654:
+1655: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_15VCFFilterParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFilterParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1656: cdef:
1657: int filter_index
1658:
1659: # check for explicit missing value
+1660: if stream.c == PERIOD:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); if (__pyx_t_1) { /* … */ }
1661: # treat leading period as missing, regardless of what comes next
+1662: return vcf_parse_missing(stream, context)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_parse_missing(__pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1662, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0;
1663:
1664: # reset temporary buffer
+1665: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
1666:
+1667: while True:
while (1) {
1668:
+1669: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+1670: self.parse_filter(context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFilterParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->parse_filter(__pyx_v_self, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1670, __pyx_L1_error)
+1671: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+1672: break
goto __pyx_L5_break;
1673:
+1674: elif stream.c == LF or stream.c == CR:
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1675: self.parse_filter(context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFilterParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->parse_filter(__pyx_v_self, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1675, __pyx_L1_error)
+1676: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+1677: break
goto __pyx_L5_break;
1678:
+1679: elif stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
+1680: self.parse_filter(context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFilterParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->parse_filter(__pyx_v_self, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1680, __pyx_L1_error)
1681: # advance input stream beyond tab
+1682: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1682, __pyx_L1_error)
+1683: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+1684: break
goto __pyx_L5_break;
1685:
+1686: elif stream.c == COMMA or stream.c == COLON or stream.c == SEMICOLON:
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L9_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L6; }
1687: # some of these delimiters are not strictly kosher, but have seen them
+1688: self.parse_filter(context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFilterParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->parse_filter(__pyx_v_self, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1688, __pyx_L1_error)
+1689: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
1690:
1691: else:
+1692: CharVector_append(&context.temp, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L6:;
1693:
1694: # advance input stream
+1695: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1695, __pyx_L1_error) } __pyx_L5_break:;
1696:
+1697: return 1
__pyx_r = 1; goto __pyx_L0;
1698:
+1699: cdef int parse_filter(self, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_15VCFFilterParser_parse_filter(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_filter_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_filter", 0); /* … */ /* function exit code */ __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1700: cdef:
1701: int filter_index
1702: int i
1703:
+1704: if context.temp.size == 0:
__pyx_t_1 = ((__pyx_v_context->temp.size == 0) != 0); if (__pyx_t_1) { /* … */ }
1705: # not strictly kosher, treat as missing/empty
+1706: return 0
__pyx_r = 0; goto __pyx_L0;
1707:
+1708: CharVector_terminate(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_terminate((&__pyx_v_context->temp));
1709:
1710: # search through filters to find index
+1711: filter_index = search_sorted_cstr(context.temp.data, self.filter_keys_cstr, self.n_filters)
__pyx_v_filter_index = __pyx_f_5allel_3opt_11io_vcf_read_search_sorted_cstr(__pyx_v_context->temp.data, __pyx_v_self->filter_keys_cstr, __pyx_v_self->n_filters);
1712:
1713: # store value
+1714: if filter_index >= 0:
__pyx_t_1 = ((__pyx_v_filter_index >= 0) != 0); if (__pyx_t_1) { /* … */ }
+1715: self.memory[context.chunk_variant_index, filter_index] = 1
__pyx_t_2 = __pyx_v_context->chunk_variant_index; __pyx_t_3 = __pyx_v_filter_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->memory.data + __pyx_t_2 * __pyx_v_self->memory.strides[0]) ) + __pyx_t_3 * __pyx_v_self->memory.strides[1]) )) = 1;
1716:
+1717: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_15VCFFilterParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFilterParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1718: shape = (self.chunk_length, self.n_filters)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n_filters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+1719: self.values = np.zeros(shape, dtype=bool)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 1719, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1719, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+1720: self.memory = self.values.view('u1')
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; /* … */ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1720, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38);
1721:
+1722: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_15VCFFilterParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFilterParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_15VCFFilterParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_field = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFilterParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_field); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_15VCFFilterParser_make_chunk { int __pyx_n; PyObject *limit; };
+1723: for i, f in enumerate(self.filter_keys):
__Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; __pyx_t_2 = __pyx_v_self->filter_keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1723, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; /* … */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1724: if not PY2:
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { /* … */ }
+1725: f = str(f, 'ascii')
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_f); __Pyx_GIVEREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_ascii); __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_7); __pyx_t_7 = 0;
+1726: field = 'variants/FILTER_' + f
__pyx_t_7 = PyNumber_Add(__pyx_kp_s_variants_FILTER, __pyx_v_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_7); __pyx_t_7 = 0;
+1727: chunk[field] = self.values[:limit, i]
__pyx_t_7 = PySlice_New(Py_None, __pyx_v_limit, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_i); __pyx_t_7 = 0; __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_7) < 0)) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1728:
1729:
1730: ##########################################################################################
1731: # INFO parsing
1732:
1733:
+1734: cdef class VCFInfoParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; PyObject *info_keys; int n_infos; char **info_keys_cstr; PyObject *info_parsers; PyObject **info_parsers_cptr; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *skip_parser; PyObject *fills; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; int (*parse_info)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoParser;
1735:
1736: cdef:
1737: tuple info_keys
1738: int n_infos
1739: char** info_keys_cstr
1740: tuple info_parsers
1741: PyObject** info_parsers_cptr
1742: VCFInfoParserBase skip_parser
1743: object fills
1744:
+1745: def __cinit__(self, info_keys, types, numbers, chunk_length, fills):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_13VCFInfoParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_13VCFInfoParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_info_keys = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_numbers = 0; PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_fills = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_info_keys,&__pyx_n_s_types,&__pyx_n_s_numbers,&__pyx_n_s_chunk_length,&__pyx_n_s_fills,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_info_keys)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); __PYX_ERR(0, 1745, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numbers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); __PYX_ERR(0, 1745, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); __PYX_ERR(0, 1745, __pyx_L3_error) } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fills)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); __PYX_ERR(0, 1745, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1745, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_info_keys = values[0]; __pyx_v_types = values[1]; __pyx_v_numbers = values[2]; __pyx_v_chunk_length = values[3]; __pyx_v_fills = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1745, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParser.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_13VCFInfoParser___cinit__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *)__pyx_v_self), __pyx_v_info_keys, __pyx_v_types, __pyx_v_numbers, __pyx_v_chunk_length, __pyx_v_fills); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_13VCFInfoParser___cinit__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *__pyx_v_self, PyObject *__pyx_v_info_keys, PyObject *__pyx_v_types, PyObject *__pyx_v_numbers, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_fills) { int __pyx_v_i; PyObject *__pyx_v_info_parsers = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_t = NULL; PyObject *__pyx_v_n = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *__pyx_v_parser = NULL; PyObject *__pyx_v_fill = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParser.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_info_parsers); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_t); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF((PyObject *)__pyx_v_parser); __Pyx_XDECREF(__pyx_v_fill); __Pyx_RefNannyFinishContext(); return __pyx_r; }
1746:
1747: # setup INFO keys
1748: # N.B., need to keep a reference to these, otherwise C strings will not behave
+1749: self.info_keys = tuple(sorted(info_keys))
__pyx_t_2 = PySequence_List(__pyx_v_info_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1749, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1749, __pyx_L1_error) } __pyx_t_2 = PyList_AsTuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->info_keys); __Pyx_DECREF(__pyx_v_self->info_keys); __pyx_v_self->info_keys = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
+1750: self.n_infos = len(self.info_keys)
__pyx_t_2 = __pyx_v_self->info_keys; __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 1750, __pyx_L1_error) } __pyx_t_4 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1750, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->n_infos = __pyx_t_4;
1751:
1752: # setup INFO keys as C strings for nogil searching
+1753: self.info_keys_cstr = <char**> malloc(sizeof(char*) * self.n_infos)
__pyx_v_self->info_keys_cstr = ((char **)malloc(((sizeof(char *)) * __pyx_v_self->n_infos)));
+1754: for i in range(self.n_infos):
__pyx_t_5 = __pyx_v_self->n_infos; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6;
+1755: self.info_keys_cstr[i] = <char*> self.info_keys[i]
if (unlikely(__pyx_v_self->info_keys == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1755, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyObject_AsString(PyTuple_GET_ITEM(__pyx_v_self->info_keys, __pyx_v_i)); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L1_error) (__pyx_v_self->info_keys_cstr[__pyx_v_i]) = ((char *)__pyx_t_7); }
1756:
1757: # setup INFO parsers
+1758: info_parsers = list()
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_info_parsers = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
+1759: self.skip_parser = VCFInfoSkipParser(key=None)
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, Py_None) < 0) __PYX_ERR(0, 1759, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoSkipParser), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->skip_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->skip_parser)); __pyx_v_self->skip_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_1); __pyx_t_1 = 0;
+1760: for key in self.info_keys:
if (unlikely(__pyx_v_self->info_keys == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1760, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->info_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1760, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1761: t = types[key]
__pyx_t_2 = PyObject_GetItem(__pyx_v_types, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_2); __pyx_t_2 = 0;
+1762: n = numbers[key]
__pyx_t_2 = PyObject_GetItem(__pyx_v_numbers, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0;
+1763: if t == np.dtype(bool) or n == 0:
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject*)&PyBool_Type)); __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_10) { } else { __pyx_t_8 = __pyx_t_10; goto __pyx_L8_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_t_10; __pyx_L8_bool_binop_done:; if (__pyx_t_8) { /* … */ goto __pyx_L7; }
+1764: if t != np.dtype(bool):
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject*)&PyBool_Type)); __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject*)&PyBool_Type)); __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_9, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_8) { /* … */ }
+1765: warnings.warn('cannot have non-bool dtype for field with number 0, ignoring type %r' % t)
__pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_warn); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_cannot_have_non_bool_dtype_for_f, __pyx_v_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_12) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_9}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_9}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1766: parser = VCFInfoFlagParser(key, chunk_length=chunk_length)
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1766, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFlagParser), __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_13)); __pyx_t_13 = 0;
+1767: elif t == np.dtype('int8'):
__pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = PyObject_RichCompare(__pyx_v_t, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_int8); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1767, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39);
+1768: fill = fills.get(key, -1)
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_2 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1768, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1768, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_int_neg_1); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_11); __pyx_t_11 = 0;
+1769: parser = VCFInfoInt8Parser(key, number=n,
__pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_key); __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1769, __pyx_L1_error) /* … */ __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser), __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_9)); __pyx_t_9 = 0;
+1770: fill=fill, chunk_length=chunk_length)
if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1769, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1769, __pyx_L1_error)
+1771: elif t == np.dtype('int16'):
__pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = PyObject_RichCompare(__pyx_v_t, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_int16); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40);
+1772: fill = fills.get(key, -1)
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1772, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_13); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1772, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_13); } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_int_neg_1); __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_13); __pyx_t_13 = 0;
+1773: parser = VCFInfoInt16Parser(key, number=n, chunk_length=chunk_length,
__pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_key); __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1773, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1773, __pyx_L1_error) /* … */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser), __pyx_t_13, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_2)); __pyx_t_2 = 0;
+1774: fill=fill)
if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1773, __pyx_L1_error)
+1775: elif t == np.dtype('int32'):
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1775, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1775, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1775, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41);
+1776: fill = fills.get(key, -1)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1776, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1776, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); __pyx_t_13 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_int_neg_1); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_9); __pyx_t_9 = 0;
+1777: parser = VCFInfoInt32Parser(key, number=n, chunk_length=chunk_length,
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_key); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1777, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1777, __pyx_L1_error) /* … */ __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser), __pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_11)); __pyx_t_11 = 0;
+1778: fill=fill)
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1777, __pyx_L1_error)
+1779: elif t == np.dtype('int64'):
__pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1779, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42);
+1780: fill = fills.get(key, -1)
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1780, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1780, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_5, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_5, __pyx_int_neg_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_2); __pyx_t_2 = 0;
+1781: parser = VCFInfoInt64Parser(key, number=n, chunk_length=chunk_length,
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1781, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1781, __pyx_L1_error) /* … */ __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser), __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_13)); __pyx_t_13 = 0;
+1782: fill=fill)
if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1781, __pyx_L1_error)
+1783: elif t == np.dtype('uint8'):
__pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = PyObject_RichCompare(__pyx_v_t, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1783, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1783, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_uint8); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1783, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43);
+1784: fill = fills.get(key, IU8.max)
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, __pyx_t_9}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, __pyx_t_9}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_11); __pyx_t_11 = 0;
+1785: parser = VCFInfoUInt8Parser(key, number=n, chunk_length=chunk_length,
__pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_key); __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1785, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1785, __pyx_L1_error) /* … */ __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser), __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+1786: fill=fill)
if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1785, __pyx_L1_error)
+1787: elif t == np.dtype('uint16'):
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1787, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1787, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_uint16); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1787, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44);
+1788: fill = fills.get(key, IU16.max)
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_max); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_key, __pyx_t_9}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1788, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_key, __pyx_t_9}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1788, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_2, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_13); __pyx_t_13 = 0;
+1789: parser = VCFInfoUInt16Parser(key, number=n, chunk_length=chunk_length,
__pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1789, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1789, __pyx_L1_error) /* … */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser), __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_2)); __pyx_t_2 = 0;
+1790: fill=fill)
if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1789, __pyx_L1_error)
+1791: elif t == np.dtype('uint32'):
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_uint32); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1791, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45);
+1792: fill = fills.get(key, IU32.max)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_max); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_key, __pyx_t_9}; __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_key, __pyx_t_9}; __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); __pyx_t_13 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_12); __pyx_t_12 = 0;
+1793: parser = VCFInfoUInt32Parser(key, number=n, chunk_length=chunk_length,
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1793, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1793, __pyx_L1_error) /* … */ __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser), __pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_11)); __pyx_t_11 = 0;
+1794: fill=fill)
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1793, __pyx_L1_error)
+1795: elif t == np.dtype('uint64'):
__pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1795, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1795, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_uint64); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1795, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46);
+1796: fill = fills.get(key, IU64.max)
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_max); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_key, __pyx_t_9}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_key, __pyx_t_9}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_5, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_5, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_2); __pyx_t_2 = 0;
+1797: parser = VCFInfoUInt64Parser(key, number=n, chunk_length=chunk_length,
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1797, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1797, __pyx_L1_error) /* … */ __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser), __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_13)); __pyx_t_13 = 0;
+1798: fill=fill)
if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1797, __pyx_L1_error)
+1799: elif t == np.dtype('float32'):
__pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = PyObject_RichCompare(__pyx_v_t, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1799, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1799, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_float32); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1799, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47);
+1800: fill = fills.get(key, NAN)
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_5allel_3opt_11io_vcf_read_NAN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_key, __pyx_t_2}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_key, __pyx_t_2}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_11); __pyx_t_11 = 0;
+1801: parser = VCFInfoFloat32Parser(key, number=n, chunk_length=chunk_length,
__pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_key); __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1801, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1801, __pyx_L1_error) /* … */ __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser), __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+1802: fill=fill)
if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1801, __pyx_L1_error)
+1803: elif t == np.dtype('float64'):
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1803, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1803, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; } /* … */ __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1803, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48);
+1804: fill = fills.get(key, NAN)
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = PyFloat_FromDouble(__pyx_v_5allel_3opt_11io_vcf_read_NAN); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, __pyx_t_11}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1804, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, __pyx_t_11}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1804, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_13); __pyx_t_13 = 0;
+1805: parser = VCFInfoFloat64Parser(key, number=n, chunk_length=chunk_length,
__pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1805, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1805, __pyx_L1_error) /* … */ __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser), __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_9)); __pyx_t_9 = 0;
+1806: fill=fill)
if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_v_fill) < 0) __PYX_ERR(0, 1805, __pyx_L1_error)
+1807: elif t == np.dtype(bool):
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject*)&PyBool_Type)); __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject*)&PyBool_Type)); __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_9, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1807, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1807, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; }
+1808: parser = VCFInfoFlagParser(key, chunk_length=chunk_length)
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1808, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFlagParser), __pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_13)); __pyx_t_13 = 0;
+1809: elif t.kind == 'S':
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_kind); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_13, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; }
+1810: parser = VCFInfoStringParser(key, dtype=t, number=n, chunk_length=chunk_length)
__pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_v_t) < 0) __PYX_ERR(0, 1810, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1810, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1810, __pyx_L1_error) __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoStringParser), __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_9)); __pyx_t_9 = 0;
+1811: elif t.kind == 'O':
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1811, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { /* … */ goto __pyx_L7; }
+1812: parser = VCFInfoObjectParser(key, number=n, chunk_length=chunk_length)
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 1812, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1812, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoObjectParser), __pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_13)); __pyx_t_13 = 0;
1813: else:
+1814: parser = VCFInfoSkipParser(key)
/*else*/ { __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_key); __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoSkipParser), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+1815: warnings.warn('type %s not supported for INFO field %r, field will be skipped' % (t, key))
__pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_warn); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_t); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_key); __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_type_s_not_supported_for_INFO_fi, __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_13) { __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_12); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_13); __pyx_t_13 = NULL; __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_L7:;
+1816: info_parsers.append(parser)
__pyx_t_3 = __Pyx_PyList_Append(__pyx_v_info_parsers, ((PyObject *)__pyx_v_parser)); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1816, __pyx_L1_error)
+1817: self.info_parsers = tuple(info_parsers)
__pyx_t_1 = PyList_AsTuple(__pyx_v_info_parsers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->info_parsers); __Pyx_DECREF(__pyx_v_self->info_parsers); __pyx_v_self->info_parsers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
1818:
1819: # store pointers to parsers for nogil trickery
+1820: self.info_parsers_cptr = <PyObject**> malloc(sizeof(PyObject*) * self.n_infos)
__pyx_v_self->info_parsers_cptr = ((PyObject **)malloc(((sizeof(PyObject *)) * __pyx_v_self->n_infos)));
+1821: for i in range(self.n_infos):
__pyx_t_5 = __pyx_v_self->n_infos; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6;
+1822: self.info_parsers_cptr[i] = <PyObject*> self.info_parsers[i]
if (unlikely(__pyx_v_self->info_parsers == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1822, __pyx_L1_error) } (__pyx_v_self->info_parsers_cptr[__pyx_v_i]) = ((PyObject *)PyTuple_GET_ITEM(__pyx_v_self->info_parsers, __pyx_v_i)); }
1823:
+1824: def __init__(self, info_keys, types, numbers, chunk_length, fills):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_13VCFInfoParser_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_13VCFInfoParser_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_info_keys = 0; CYTHON_UNUSED PyObject *__pyx_v_types = 0; CYTHON_UNUSED PyObject *__pyx_v_numbers = 0; PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_fills = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_info_keys,&__pyx_n_s_types,&__pyx_n_s_numbers,&__pyx_n_s_chunk_length,&__pyx_n_s_fills,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_info_keys)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); __PYX_ERR(0, 1824, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numbers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); __PYX_ERR(0, 1824, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); __PYX_ERR(0, 1824, __pyx_L3_error) } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fills)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); __PYX_ERR(0, 1824, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1824, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_info_keys = values[0]; __pyx_v_types = values[1]; __pyx_v_numbers = values[2]; __pyx_v_chunk_length = values[3]; __pyx_v_fills = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1824, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_13VCFInfoParser_2__init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *)__pyx_v_self), __pyx_v_info_keys, __pyx_v_types, __pyx_v_numbers, __pyx_v_chunk_length, __pyx_v_fills); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_13VCFInfoParser_2__init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_info_keys, CYTHON_UNUSED PyObject *__pyx_v_types, CYTHON_UNUSED PyObject *__pyx_v_numbers, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_fills) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1825: super(VCFInfoParser, self).__init__(key=b'INFO', chunk_length=chunk_length)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_INFO) < 0) __PYX_ERR(0, 1825, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 1825, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+1826: self.fills = fills
__Pyx_INCREF(__pyx_v_fills); __Pyx_GIVEREF(__pyx_v_fills); __Pyx_GOTREF(__pyx_v_self->fills); __Pyx_DECREF(__pyx_v_self->fills); __pyx_v_self->fills = __pyx_v_fills;
1827:
+1828: def __dealloc__(self):
/* Python wrapper */ static void __pyx_pw_5allel_3opt_11io_vcf_read_13VCFInfoParser_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_5allel_3opt_11io_vcf_read_13VCFInfoParser_5__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_5allel_3opt_11io_vcf_read_13VCFInfoParser_4__dealloc__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_5allel_3opt_11io_vcf_read_13VCFInfoParser_4__dealloc__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* … */ /* function exit code */ __Pyx_RefNannyFinishContext(); }
+1829: if self.info_keys_cstr is not NULL:
__pyx_t_1 = ((__pyx_v_self->info_keys_cstr != NULL) != 0); if (__pyx_t_1) { /* … */ }
+1830: free(self.info_keys_cstr)
free(__pyx_v_self->info_keys_cstr);
+1831: if self.info_parsers_cptr is not NULL:
__pyx_t_1 = ((__pyx_v_self->info_parsers_cptr != NULL) != 0); if (__pyx_t_1) { /* … */ }
+1832: free(self.info_parsers_cptr)
free(__pyx_v_self->info_parsers_cptr);
1833:
+1834: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_13VCFInfoParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1835:
1836: # reset buffers
+1837: CharVector_clear(&context.info_key)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_key));
+1838: CharVector_clear(&context.info_val)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val));
1839:
1840: # check for missing value
+1841: if stream.c == PERIOD:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); if (__pyx_t_1) { /* … */ }
1842: # treat leading period as missing, regardless of what comes next
+1843: return vcf_parse_missing(stream, context)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_parse_missing(__pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1843, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0;
1844:
1845: # check for empty value
+1846: if stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
1847: # not strictly kosher, treat as missing/empty
+1848: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1848, __pyx_L1_error)
+1849: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+1850: return 0
__pyx_r = 0; goto __pyx_L0;
1851:
+1852: while True:
while (1) {
1853:
+1854: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
+1855: if context.info_key.size > 0:
__pyx_t_1 = ((__pyx_v_context->info_key.size > 0) != 0); if (__pyx_t_1) { /* … */ }
1856: # handle flag
+1857: self.parse_info(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->parse_info(__pyx_v_self, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1857, __pyx_L1_error)
+1858: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+1859: break
goto __pyx_L6_break;
1860:
+1861: elif stream.c == LF or stream.c == CR:
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L9_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+1862: if context.info_key.size > 0:
__pyx_t_1 = ((__pyx_v_context->info_key.size > 0) != 0); if (__pyx_t_1) { /* … */ }
1863: # handle flag
+1864: self.parse_info(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->parse_info(__pyx_v_self, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1864, __pyx_L1_error)
+1865: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+1866: break
goto __pyx_L6_break;
1867:
+1868: elif stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
+1869: if context.info_key.size > 0:
__pyx_t_1 = ((__pyx_v_context->info_key.size > 0) != 0); if (__pyx_t_1) { /* … */ }
1870: # handle flag
+1871: self.parse_info(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->parse_info(__pyx_v_self, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1871, __pyx_L1_error)
1872: # advance input stream beyond tab
+1873: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1873, __pyx_L1_error)
+1874: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+1875: break
goto __pyx_L6_break;
1876:
+1877: elif stream.c == SEMICOLON:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L7; }
+1878: if context.info_key.size > 0:
__pyx_t_1 = ((__pyx_v_context->info_key.size > 0) != 0); if (__pyx_t_1) { /* … */ }
1879: # handle flag
+1880: self.parse_info(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->parse_info(__pyx_v_self, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1880, __pyx_L1_error)
+1881: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1881, __pyx_L1_error)
1882:
+1883: elif stream.c == EQUALS:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_EQUALS) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L7; }
1884: # advance input stream beyond '='
+1885: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1885, __pyx_L1_error)
+1886: if context.info_key.size > 0:
__pyx_t_1 = ((__pyx_v_context->info_key.size > 0) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L14; }
+1887: self.parse_info(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->parse_info(__pyx_v_self, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1887, __pyx_L1_error)
1888: else:
1889: # with gil:
+1890: warn('missing INFO key', context)
/*else*/ { __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_missing_INFO_key, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1890, __pyx_L1_error)
+1891: self.skip_parser.parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_v_self->skip_parser->__pyx_vtab)->parse(__pyx_v_self->skip_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1891, __pyx_L1_error) } __pyx_L14:;
1892:
1893: else:
1894:
+1895: CharVector_append(&context.info_key, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_key), __pyx_v_stream->c);
+1896: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1896, __pyx_L1_error) } __pyx_L7:; } __pyx_L6_break:;
1897:
+1898: cdef int parse_info(self,
static int __pyx_f_5allel_3opt_11io_vcf_read_13VCFInfoParser_parse_info(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_parser_index; PyObject *__pyx_v_parser; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_info", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParser.parse_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1899: InputStreamBase stream,
1900: VCFContext context) except -1: # nogil
1901:
1902: cdef:
1903: int parser_index
1904: PyObject* parser
1905:
1906: # terminate key
+1907: CharVector_terminate(&context.info_key)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_terminate((&__pyx_v_context->info_key));
1908:
1909: # search for index of current INFO key
+1910: parser_index = search_sorted_cstr(context.info_key.data, self.info_keys_cstr, self.n_infos)
__pyx_v_parser_index = __pyx_f_5allel_3opt_11io_vcf_read_search_sorted_cstr(__pyx_v_context->info_key.data, __pyx_v_self->info_keys_cstr, __pyx_v_self->n_infos);
1911:
1912: # clear out key for good measure
+1913: CharVector_clear(&context.info_key)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_key));
1914:
+1915: if parser_index >= 0:
__pyx_t_1 = ((__pyx_v_parser_index >= 0) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L3; }
1916: # obtain parser, use trickery for nogil
+1917: parser = self.info_parsers_cptr[parser_index]
__pyx_v_parser = (__pyx_v_self->info_parsers_cptr[__pyx_v_parser_index]);
+1918: (<VCFInfoParserBase> parser).parse(stream, context)
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_v_parser)->__pyx_vtab)->parse(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_v_parser), __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1918, __pyx_L1_error)
1919: else:
+1920: self.skip_parser.parse(stream, context)
/*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_v_self->skip_parser->__pyx_vtab)->parse(__pyx_v_self->skip_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1920, __pyx_L1_error) } __pyx_L3:;
1921:
+1922: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_13VCFInfoParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *__pyx_v_self) { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *__pyx_v_parser = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parser); __Pyx_RefNannyFinishContext(); return __pyx_r; }
1923: cdef VCFInfoParserBase parser
+1924: for parser in self.info_parsers:
if (unlikely(__pyx_v_self->info_parsers == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1924, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->info_parsers; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1924, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoParserBase))))) __PYX_ERR(0, 1924, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_3)); __pyx_t_3 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1925: parser.malloc_chunk()
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_v_parser->__pyx_vtab)->malloc_chunk(__pyx_v_parser); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1925, __pyx_L1_error)
1926:
+1927: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_13VCFInfoParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_13VCFInfoParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *__pyx_v_parser = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parser); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_13VCFInfoParser_make_chunk { int __pyx_n; PyObject *limit; };
1928: cdef VCFInfoParserBase parser
+1929: for parser in self.info_parsers:
if (unlikely(__pyx_v_self->info_parsers == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1929, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->info_parsers; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1929, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoParserBase))))) __PYX_ERR(0, 1929, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_t_3)); __pyx_t_3 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1930: parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_v_parser->__pyx_vtab)->make_chunk(__pyx_v_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1930, __pyx_L1_error)
1931:
1932:
+1933: cdef class VCFInfoParserBase:
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase { PyObject_HEAD struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase *__pyx_vtab; PyObject *key; PyArray_Descr *dtype; int itemsize; int number; PyObject *fill; PyArrayObject *values; int chunk_length; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase { int (*parse)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *); int (*make_chunk)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *, PyObject *, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFInfoParserBase_make_chunk *__pyx_optional_args); int (*malloc_chunk)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoParserBase;
1934:
1935: cdef:
1936: bytes key
1937: np.dtype dtype
1938: int itemsize
1939: int number
1940: object fill
1941: np.ndarray values
1942: int chunk_length
1943:
+1944: def __init__(self, key=None, dtype=None, number=1, fill=0, chunk_length=0):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFInfoParserBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFInfoParserBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_number = 0; PyObject *__pyx_v_fill = 0; PyObject *__pyx_v_chunk_length = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_dtype,&__pyx_n_s_number,&__pyx_n_s_fill,&__pyx_n_s_chunk_length,0}; PyObject* values[5] = {0,0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)__pyx_int_1); values[3] = ((PyObject *)__pyx_int_0); values[4] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1944, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; __pyx_v_dtype = values[1]; __pyx_v_number = values[2]; __pyx_v_fill = values[3]; __pyx_v_chunk_length = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1944, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParserBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_17VCFInfoParserBase___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *)__pyx_v_self), __pyx_v_key, __pyx_v_dtype, __pyx_v_number, __pyx_v_fill, __pyx_v_chunk_length); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_17VCFInfoParserBase___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_dtype, PyObject *__pyx_v_number, PyObject *__pyx_v_fill, PyObject *__pyx_v_chunk_length) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_dtype); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParserBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dtype); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1945: self.key = key
if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 1945, __pyx_L1_error) __pyx_t_1 = __pyx_v_key; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->key); __Pyx_DECREF(__pyx_v_self->key); __pyx_v_self->key = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+1946: if dtype is not None:
__pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+1947: dtype = np.dtype(dtype)
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dtype); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_4); __pyx_t_4 = 0;
+1948: self.dtype = dtype
if (!(likely(__Pyx_TypeTest(__pyx_v_dtype, __pyx_ptype_5numpy_dtype)))) __PYX_ERR(0, 1948, __pyx_L1_error) __pyx_t_4 = __pyx_v_dtype; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype)); __pyx_v_self->dtype = ((PyArray_Descr *)__pyx_t_4); __pyx_t_4 = 0;
+1949: self.itemsize = dtype.itemsize
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1949, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->itemsize = __pyx_t_5;
1950: else:
+1951: self.dtype = dtype
/*else*/ { if (!(likely(((__pyx_v_dtype) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dtype, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 1951, __pyx_L1_error) __pyx_t_4 = __pyx_v_dtype; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype)); __pyx_v_self->dtype = ((PyArray_Descr *)__pyx_t_4); __pyx_t_4 = 0;
+1952: self.itemsize = 0
__pyx_v_self->itemsize = 0; } __pyx_L3:;
+1953: self.number = number
__pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_number); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L1_error) __pyx_v_self->number = __pyx_t_5;
+1954: self.fill = fill
__Pyx_INCREF(__pyx_v_fill); __Pyx_GIVEREF(__pyx_v_fill); __Pyx_GOTREF(__pyx_v_self->fill); __Pyx_DECREF(__pyx_v_self->fill); __pyx_v_self->fill = __pyx_v_fill;
+1955: self.chunk_length = chunk_length
__pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_chunk_length); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1955, __pyx_L1_error) __pyx_v_self->chunk_length = __pyx_t_5;
1956:
+1957: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoParserBase_parse(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1958: pass
1959:
+1960: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoParserBase_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFInfoParserBase_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_values = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoParserBase.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_values); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFInfoParserBase_make_chunk { int __pyx_n; PyObject *limit; };
+1961: if PY2:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L3; }
+1962: field = 'variants/' + self.key
__pyx_t_1 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_v_self->key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0;
1963: else:
+1964: field = 'variants/' + str(self.key, 'ascii')
/*else*/ { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->key); __Pyx_GIVEREF(__pyx_v_self->key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->key); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:;
+1965: values = self.values[:limit]
__pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->values), 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_values = __pyx_t_1; __pyx_t_1 = 0;
+1966: if self.number == 1:
__pyx_t_2 = ((__pyx_v_self->number == 1) != 0); if (__pyx_t_2) { /* … */ }
+1967: values = values.squeeze(axis=1)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1967, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); __pyx_t_4 = 0;
+1968: chunk[field] = values
if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_v_values) < 0)) __PYX_ERR(0, 1968, __pyx_L1_error)
1969:
+1970: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoParserBase_malloc_chunk(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
1971: pass
1972:
1973:
+1974: cdef class VCFInfoInt8Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser;
1975:
1976: cdef np.int8_t[:, :] memory
1977:
+1978: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFInfoInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFInfoInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_17VCFInfoInt8Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_17VCFInfoInt8Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt8Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1979: kwargs['dtype'] = 'int8'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int8) < 0)) __PYX_ERR(0, 1979, __pyx_L1_error)
+1980: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1981: super(VCFInfoInt8Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1982:
+1983: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoInt8Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt8Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1984: return vcf_info_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1984, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
1985:
+1986: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoInt8Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt8Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt8Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1987: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+1988: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 1988, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+1989: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1989, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+1990: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int8(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1990, __pyx_L1_error)
{
__pyx_t_5numpy_int8_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
*((__pyx_t_5numpy_int8_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
1991:
1992:
+1993: cdef class VCFInfoInt16Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser;
1994:
1995: cdef np.int16_t[:, :] memory
1996:
+1997: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFInfoInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFInfoInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFInfoInt16Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFInfoInt16Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt16Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+1998: kwargs['dtype'] = 'int16'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int16) < 0)) __PYX_ERR(0, 1998, __pyx_L1_error)
+1999: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2000: super(VCFInfoInt16Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2001:
+2002: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFInfoInt16Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt16Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2003: return vcf_info_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2003, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2004:
+2005: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFInfoInt16Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt16Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt16Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2006: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2007: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2007, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2007, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2008: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2008, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2009: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int16(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2009, __pyx_L1_error)
{
__pyx_t_5numpy_int16_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
*((__pyx_t_5numpy_int16_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2010:
2011:
+2012: cdef class VCFInfoInt32Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser;
2013:
2014: cdef np.int32_t[:, :] memory
2015:
+2016: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFInfoInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFInfoInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFInfoInt32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFInfoInt32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2017: kwargs['dtype'] = 'int32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int32) < 0)) __PYX_ERR(0, 2017, __pyx_L1_error)
+2018: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2019: super(VCFInfoInt32Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2020:
+2021: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFInfoInt32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2022: return vcf_info_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2022, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2023:
+2024: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFInfoInt32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2025: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2026: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2026, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2026, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2027: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2027, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2028: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2028, __pyx_L1_error)
{
__pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
*((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2029:
2030:
+2031: cdef class VCFInfoInt64Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser;
2032:
2033: cdef np.int64_t[:, :] memory
2034:
+2035: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFInfoInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFInfoInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFInfoInt64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFInfoInt64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2036: kwargs['dtype'] = 'int64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int64) < 0)) __PYX_ERR(0, 2036, __pyx_L1_error)
+2037: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2038: super(VCFInfoInt64Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2039:
+2040: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFInfoInt64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2041: return vcf_info_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2041, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2042:
+2043: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFInfoInt64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoInt64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoInt64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2044: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2045: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2045, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2045, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2046: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2046, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2047: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2047, __pyx_L1_error)
{
__pyx_t_5numpy_int64_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
*((__pyx_t_5numpy_int64_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2048:
2049:
+2050: cdef class VCFInfoUInt8Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser;
2051:
2052: cdef np.uint8_t[:, :] memory
2053:
+2054: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFInfoUInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_18VCFInfoUInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_18VCFInfoUInt8Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_18VCFInfoUInt8Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt8Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2055: kwargs['dtype'] = 'uint8'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0)) __PYX_ERR(0, 2055, __pyx_L1_error)
+2056: kwargs.setdefault('fill', IU8.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2057: super(VCFInfoUInt8Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2058:
+2059: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFInfoUInt8Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt8Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2060: return vcf_info_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2060, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2061:
+2062: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_18VCFInfoUInt8Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt8Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt8Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2063: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2064: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2064, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2065: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2065, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2066: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint8(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2066, __pyx_L1_error)
{
__pyx_t_5numpy_uint8_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
*((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2067:
2068:
+2069: cdef class VCFInfoUInt16Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser;
2070:
2071: cdef np.uint16_t[:, :] memory
2072:
+2073: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoUInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoUInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoUInt16Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoUInt16Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt16Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2074: kwargs['dtype'] = 'uint16'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint16) < 0)) __PYX_ERR(0, 2074, __pyx_L1_error)
+2075: kwargs.setdefault('fill', IU16.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2076: super(VCFInfoUInt16Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2077:
+2078: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoUInt16Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt16Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2079: return vcf_info_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2079, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2080:
+2081: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoUInt16Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt16Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt16Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2082: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2083: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2083, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2084: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2084, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2085: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint16(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2085, __pyx_L1_error)
{
__pyx_t_5numpy_uint16_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
*((__pyx_t_5numpy_uint16_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2086:
2087:
+2088: cdef class VCFInfoUInt32Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser;
2089:
2090: cdef np.uint32_t[:, :] memory
2091:
+2092: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoUInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoUInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoUInt32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoUInt32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2093: kwargs['dtype'] = 'uint32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint32) < 0)) __PYX_ERR(0, 2093, __pyx_L1_error)
+2094: kwargs.setdefault('fill', IU32.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2095: super(VCFInfoUInt32Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2096:
+2097: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoUInt32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2098: return vcf_info_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2098, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2099:
+2100: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoUInt32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2101: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2102: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2102, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2103: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2103, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2104: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint32(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2104, __pyx_L1_error)
{
__pyx_t_5numpy_uint32_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
*((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2105:
2106:
+2107: cdef class VCFInfoUInt64Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser;
2108:
2109: cdef np.uint64_t[:, :] memory
2110:
+2111: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoUInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoUInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoUInt64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoUInt64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2112: kwargs['dtype'] = 'uint64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint64) < 0)) __PYX_ERR(0, 2112, __pyx_L1_error)
+2113: kwargs.setdefault('fill', IU64.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2114: super(VCFInfoUInt64Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2115:
+2116: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoUInt64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2117: return vcf_info_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2117, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2118:
+2119: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoUInt64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoUInt64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoUInt64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2120: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2121: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2121, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2122: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2122, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2123: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2123, __pyx_L1_error)
{
__pyx_t_5numpy_uint64_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
*((__pyx_t_5numpy_uint64_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2124:
2125:
+2126: cdef class VCFInfoFloat32Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser;
2127:
2128: cdef np.float32_t[:, :] memory
2129:
+2130: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_20VCFInfoFloat32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_20VCFInfoFloat32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_20VCFInfoFloat32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_20VCFInfoFloat32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFloat32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2131: kwargs['dtype'] = 'float32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_float32) < 0)) __PYX_ERR(0, 2131, __pyx_L1_error)
+2132: kwargs.setdefault('fill', NAN)
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_5allel_3opt_11io_vcf_read_NAN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+2133: super(VCFInfoFloat32Parser, self).__init__(*args, **kwargs)
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2134:
+2135: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_20VCFInfoFloat32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFloat32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2136: return vcf_info_parse_floating(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_floating(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2136, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2137:
+2138: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_20VCFInfoFloat32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFloat32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2139: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2140: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2140, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2140, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2141: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2141, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2142: self.memory[:] = self.fill
__pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2142, __pyx_L1_error) { __pyx_t_5numpy_float32_t __pyx_temp_scalar = __pyx_t_6; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { *((__pyx_t_5numpy_float32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar; __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
2143:
2144:
+2145: cdef class VCFInfoFloat64Parser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser;
2146:
2147: cdef np.float64_t[:, :] memory
2148:
+2149: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_20VCFInfoFloat64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_20VCFInfoFloat64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_20VCFInfoFloat64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_20VCFInfoFloat64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFloat64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2150: kwargs['dtype'] = 'float64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_float64) < 0)) __PYX_ERR(0, 2150, __pyx_L1_error)
+2151: kwargs.setdefault('fill', NAN)
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_5allel_3opt_11io_vcf_read_NAN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+2152: super(VCFInfoFloat64Parser, self).__init__(*args, **kwargs)
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2153:
+2154: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_20VCFInfoFloat64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFloat64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2155: return vcf_info_parse_floating(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_floating(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2155, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2156:
+2157: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_20VCFInfoFloat64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFloat64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFloat64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2158: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2159: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2159, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2160: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2160, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2161: self.memory[:] = self.fill
__pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2161, __pyx_L1_error) { __pyx_t_5numpy_float64_t __pyx_temp_scalar = __pyx_t_6; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { *((__pyx_t_5numpy_float64_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar; __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
2162:
2163:
+2164: cdef class VCFInfoFlagParser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFlagParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoFlagParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoFlagParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoFlagParser;
2165:
2166: cdef np.uint8_t[:] memory
2167:
+2168: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFInfoFlagParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFInfoFlagParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_17VCFInfoFlagParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFlagParser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_17VCFInfoFlagParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFlagParser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFlagParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2169: kwargs['dtype'] = 'uint8'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0)) __PYX_ERR(0, 2169, __pyx_L1_error)
+2170: super(VCFInfoFlagParser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFlagParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFlagParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoFlagParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2171:
+2172: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoFlagParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFlagParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFlagParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2173: # nothing to parse
+2174: self.memory[context.chunk_variant_index] = 1
__pyx_t_1 = __pyx_v_context->chunk_variant_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->memory.data + __pyx_t_1 * __pyx_v_self->memory.strides[0]) )) = 1;
2175: # ensure we advance the end of the field
+2176: while stream.c != SEMICOLON and \
while (1) { __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L5_bool_binop_done; }
+2177: stream.c != TAB and \
__pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L5_bool_binop_done; }
+2178: stream.c != LF and \
__pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L5_bool_binop_done; }
+2179: stream.c != CR and \
__pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L5_bool_binop_done; }
+2180: stream.c != 0:
__pyx_t_3 = ((__pyx_v_stream->c != 0) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (!__pyx_t_2) break;
+2181: stream.advance()
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2181, __pyx_L1_error) }
2182:
+2183: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoFlagParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFlagParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFInfoFlagParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); PyObject *__pyx_v_field = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFlagParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_field); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFInfoFlagParser_make_chunk { int __pyx_n; PyObject *limit; };
2184: # override to view as bool array
+2185: if PY2:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L3; }
+2186: field = 'variants/' + self.key
__pyx_t_1 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_v_self->__pyx_base.key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0;
2187: else:
+2188: field = 'variants/' + str(self.key, 'ascii')
/*else*/ { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.key); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.key); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:;
+2189: chunk[field] = self.values[:limit].view(bool)
__pyx_t_3 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->__pyx_base.values), 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject*)&PyBool_Type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject*)&PyBool_Type)}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject*)&PyBool_Type)}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(((PyObject*)&PyBool_Type)); __Pyx_GIVEREF(((PyObject*)&PyBool_Type)); PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject*)&PyBool_Type)); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_t_1) < 0)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2190:
+2191: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoFlagParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoFlagParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoFlagParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2192: self.values = np.empty(self.chunk_length, dtype=self.dtype)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2192, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2193: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2193, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2194: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint8(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2194, __pyx_L1_error)
{
__pyx_t_5numpy_uint8_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
*((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2195:
2196:
+2197: cdef class VCFInfoStringParser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoStringParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoStringParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoStringParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoStringParser;
2198:
2199: cdef np.uint8_t[:] memory
2200:
+2201: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoStringParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoStringParser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoStringParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoStringParser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoStringParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2202: kwargs['dtype'] = check_string_dtype(kwargs.get('dtype'))
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_string_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_dtype, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_t_1) < 0)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2203: super(VCFInfoStringParser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoStringParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoStringParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoStringParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2204:
+2205: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoStringParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoStringParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_value_index; int __pyx_v_memory_offset; int __pyx_v_memory_index; int __pyx_v_chars_stored; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoStringParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2206: cdef:
+2207: int value_index = 0
__pyx_v_value_index = 0;
2208: # index into memory view
2209: int memory_offset, memory_index
2210: # number of characters read into current value
+2211: int chars_stored = 0
__pyx_v_chars_stored = 0;
2212:
2213: # initialise memory index
+2214: memory_offset = context.chunk_variant_index * self.itemsize * self.number
__pyx_v_memory_offset = ((__pyx_v_context->chunk_variant_index * __pyx_v_self->__pyx_base.itemsize) * __pyx_v_self->__pyx_base.number);
+2215: memory_index = memory_offset
__pyx_v_memory_index = __pyx_v_memory_offset;
2216:
+2217: while True:
while (1) {
2218:
+2219: if stream.c == 0 or \
__pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+2220: stream.c == LF or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2221: stream.c == CR or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2222: stream.c == TAB or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2223: stream.c == SEMICOLON:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:;
+2224: break
goto __pyx_L4_break;
2225:
+2226: elif stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
2227: # advance value index
+2228: value_index += 1
__pyx_v_value_index = (__pyx_v_value_index + 1);
2229: # set memory index to beginning of next item
+2230: memory_index = memory_offset + (value_index * self.itemsize)
__pyx_v_memory_index = (__pyx_v_memory_offset + (__pyx_v_value_index * __pyx_v_self->__pyx_base.itemsize));
2231: # reset chars stored
+2232: chars_stored = 0
__pyx_v_chars_stored = 0;
2233:
+2234: elif chars_stored < self.itemsize and value_index < self.number:
__pyx_t_2 = ((__pyx_v_chars_stored < __pyx_v_self->__pyx_base.itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } __pyx_t_2 = ((__pyx_v_value_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* … */ } __pyx_L5:;
2235: # store value
+2236: self.memory[memory_index] = stream.c
__pyx_t_3 = __pyx_v_stream->c; __pyx_t_4 = __pyx_v_memory_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->memory.data + __pyx_t_4 * __pyx_v_self->memory.strides[0]) )) = __pyx_t_3;
2237: # advance memory index
+2238: memory_index += 1
__pyx_v_memory_index = (__pyx_v_memory_index + 1);
2239: # advance number of characters stored
+2240: chars_stored += 1
__pyx_v_chars_stored = (__pyx_v_chars_stored + 1);
2241:
2242: # advance input stream
+2243: stream.advance()
__pyx_t_5 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 2243, __pyx_L1_error) } __pyx_L4_break:;
2244:
+2245: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoStringParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoStringParser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoStringParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2246: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2247: self.values = np.zeros(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2247, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2248: self.memory = self.values.reshape(-1).view('u1')
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__49 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_1); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50);
2249:
2250:
+2251: cdef class VCFInfoObjectParser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoObjectParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoObjectParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoObjectParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoObjectParser;
2252:
+2253: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_19VCFInfoObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoObjectParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoObjectParser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_19VCFInfoObjectParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoObjectParser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoObjectParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2254: kwargs['dtype'] = np.dtype('object')
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_t_1) < 0)) __PYX_ERR(0, 2254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 2254, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51);
+2255: super(VCFInfoObjectParser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoObjectParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoObjectParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoObjectParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2256:
+2257: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoObjectParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoObjectParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_value_index; PyObject *__pyx_v_v = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoObjectParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v); __Pyx_RefNannyFinishContext(); return __pyx_r; }
2258: cdef:
+2259: int value_index = 0
__pyx_v_value_index = 0;
2260:
+2261: CharVector_clear(&context.info_val)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val));
2262:
+2263: while True:
while (1) {
2264:
+2265: if stream.c == 0 or \
__pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+2266: stream.c == LF or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2267: stream.c == CR or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2268: stream.c == TAB or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2269: stream.c == SEMICOLON:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:;
+2270: if value_index < self.number and context.info_val.size > 0:
__pyx_t_2 = ((__pyx_v_value_index < __pyx_v_self->__pyx_base.number) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L12_bool_binop_done; } __pyx_t_2 = ((__pyx_v_context->info_val.size > 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L12_bool_binop_done:; if (__pyx_t_1) { /* … */ }
2271: # with gil:
+2272: v = CharVector_to_pystr(&context.info_val)
__pyx_t_3 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->info_val)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0;
+2273: self.values[context.chunk_variant_index, value_index] = v
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_context->chunk_variant_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_value_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_t_5, __pyx_v_v) < 0)) __PYX_ERR(0, 2273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2274: break
goto __pyx_L4_break;
2275:
+2276: elif stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+2277: if value_index < self.number and context.info_val.size > 0:
__pyx_t_2 = ((__pyx_v_value_index < __pyx_v_self->__pyx_base.number) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L15_bool_binop_done; } __pyx_t_2 = ((__pyx_v_context->info_val.size > 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L15_bool_binop_done:; if (__pyx_t_1) { /* … */ }
2278: # with gil:
+2279: v = CharVector_to_pystr(&context.info_val)
__pyx_t_5 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->info_val)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); __pyx_t_5 = 0;
+2280: self.values[context.chunk_variant_index, value_index] = v
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_context->chunk_variant_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_value_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_t_3, __pyx_v_v) < 0)) __PYX_ERR(0, 2280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+2281: CharVector_clear(&context.info_val)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val));
2282: # advance value index
+2283: value_index += 1
__pyx_v_value_index = (__pyx_v_value_index + 1);
2284:
+2285: elif value_index < self.number:
__pyx_t_1 = ((__pyx_v_value_index < __pyx_v_self->__pyx_base.number) != 0); if (__pyx_t_1) { /* … */ } __pyx_L5:;
+2286: CharVector_append(&context.info_val, stream.c)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c);
2287:
2288: # advance input stream
+2289: stream.advance()
__pyx_t_6 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2289, __pyx_L1_error) } __pyx_L4_break:;
2290:
+2291: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_19VCFInfoObjectParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoObjectParser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoObjectParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2292: shape = (self.chunk_length, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_shape = __pyx_t_3; __pyx_t_3 = 0;
+2293: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2293, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2293, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
+2294: self.values.fill('')
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 2294, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52);
2295:
2296:
+2297: cdef class VCFInfoSkipParser(VCFInfoParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoSkipParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoSkipParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFInfoSkipParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFInfoSkipParser;
2298:
+2299: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFInfoSkipParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFInfoSkipParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; if (unlikely(__pyx_kwds)) { __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); } else { __pyx_v_kwargs = NULL; } __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_17VCFInfoSkipParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoSkipParser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_17VCFInfoSkipParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoSkipParser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoSkipParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2300: super(VCFInfoSkipParser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoSkipParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoSkipParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFInfoSkipParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2301:
+2302: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoSkipParser_parse(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoSkipParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFInfoSkipParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2303: # ensure we advance the end of the field
+2304: while stream.c != SEMICOLON and \
while (1) { __pyx_t_2 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; }
+2305: stream.c != TAB and \
__pyx_t_2 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; }
+2306: stream.c != LF and \
__pyx_t_2 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; }
+2307: stream.c != CR and \
__pyx_t_2 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; }
+2308: stream.c != 0:
__pyx_t_2 = ((__pyx_v_stream->c != 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (!__pyx_t_1) break;
+2309: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2309, __pyx_L1_error) }
2310:
+2311: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoSkipParser_malloc_chunk(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoSkipParser *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2312: pass
2313:
+2314: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFInfoSkipParser_make_chunk(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFInfoSkipParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFInfoSkipParser_make_chunk *__pyx_optional_args) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { } /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFInfoSkipParser_make_chunk { int __pyx_n; PyObject *limit; };
2315: pass
2316:
2317:
+2318: cdef int vcf_info_parse_integer(InputStreamBase stream,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_info_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_info_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_2vcf_info_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_3vcf_info_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_4vcf_info_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_5vcf_info_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_6vcf_info_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_7vcf_info_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2319: VCFContext context,
2320: integer[:, :] memory) except -1: # nogil
2321: cdef:
+2322: int value_index = 0
__pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0;
2323:
2324: # reset temporary buffer
+2325: CharVector_clear(&context.info_val)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val));
2326:
+2327: while True:
while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) {
2328:
+2329: if stream.c == 0 or \
__pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+2330: stream.c == LF or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2331: stream.c == CR or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2332: stream.c == TAB or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2333: stream.c == SEMICOLON:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:;
+2334: vcf_info_store_integer(context, value_index, memory)
__pyx_t_3 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2334, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2334, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2334, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2334, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2334, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2334, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2334, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2334, __pyx_L1_error)
+2335: break
goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break;
2336:
+2337: elif stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+2338: vcf_info_store_integer(context, value_index, memory)
__pyx_t_3 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2338, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2338, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2338, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2338, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2338, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2338, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2338, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2338, __pyx_L1_error)
+2339: CharVector_clear(&context.info_val)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val));
+2340: value_index += 1
__pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1);
2341:
2342: else:
+2343: CharVector_append(&context.info_val, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:;
2344:
+2345: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2345, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2345, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2345, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2345, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2345, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2345, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2345, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2345, __pyx_L1_error) } __pyx_L4_break:;
2346:
2347:
+2348: cdef int vcf_info_store_integer(VCFContext context,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_info_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_info_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_2vcf_info_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_3vcf_info_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_4vcf_info_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_5vcf_info_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_6vcf_info_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_7vcf_info_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2349: int value_index,
2350: integer[:, :] memory) except -1: # nogil
2351: cdef:
2352: int parsed
2353: long value
2354:
+2355: if value_index >= memory.shape[1]:
__pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ }
2356: # more values than we have room for, ignore
+2357: return 0
__pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0;
2358:
2359: # parse string as integer
+2360: parsed = vcf_strtol(&context.info_val, context, &value)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2360, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2360, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2360, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2360, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2360, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2360, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2360, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2360, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2;
2361:
+2362: if parsed > 0:
__pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ }
2363: # store value
+2364: memory[context.chunk_variant_index, value_index] = value
__pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value;
2365:
2366:
+2367: cdef int vcf_info_parse_floating(InputStreamBase stream,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_floating(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_info_parse_floating", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_floating", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_parse_floating(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_info_parse_floating", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_parse_floating", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2368: VCFContext context,
2369: floating[:, :] memory) except -1: # nogil
2370: cdef:
+2371: int value_index = 0
__pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0;
2372:
2373: # reset temporary buffer
+2374: CharVector_clear(&context.info_val)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val));
2375:
+2376: while True:
while (1) { /* … */ while (1) {
2377:
+2378: if stream.c == 0 or \
__pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+2379: stream.c == LF or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2380: stream.c == CR or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2381: stream.c == TAB or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+2382: stream.c == SEMICOLON:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SEMICOLON) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:;
+2383: vcf_info_store_floating(context, value_index, memory)
__pyx_t_3 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_floating(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2383, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_floating(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2383, __pyx_L1_error)
+2384: break
goto __pyx_L4_break; /* … */ goto __pyx_L4_break;
2385:
+2386: elif stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+2387: vcf_info_store_floating(context, value_index, memory)
__pyx_t_3 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_floating(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2387, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_floating(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2387, __pyx_L1_error)
+2388: CharVector_clear(&context.info_val)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->info_val));
+2389: value_index += 1
__pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1);
2390:
2391: else:
+2392: CharVector_append(&context.info_val, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->info_val), __pyx_v_stream->c); } __pyx_L5:;
2393:
+2394: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2394, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2394, __pyx_L1_error) } __pyx_L4_break:;
2395:
2396:
+2397: cdef int vcf_info_store_floating(VCFContext context,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_floating(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; double __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_info_store_floating", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_floating", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_info_store_floating(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; double __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_info_store_floating", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_info_store_floating", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2398: int value_index,
2399: floating[:, :] memory) except -1: # nogil
2400: cdef:
2401: int parsed
2402: double value
2403:
+2404: if value_index >= memory.shape[1]:
__pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[1])) != 0); if (__pyx_t_1) { /* … */ }
2405: # more values than we have room for, ignore
+2406: return 0
__pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0;
2407:
2408: # parse string as floating
+2409: parsed = vcf_strtod(&context.info_val, context, &value)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtod((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2409, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtod((&__pyx_v_context->info_val), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2409, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2;
2410:
+2411: if parsed > 0:
__pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ }
2412: # store value
+2413: memory[context.chunk_variant_index, value_index] = value
__pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_value_index; *((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) )) = __pyx_v_value;
2414:
2415:
2416: ##########################################################################################
2417: # FORMAT and calldata parsing
2418:
2419:
+2420: cdef class VCFFormatParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; PyObject *format_keys; int n_formats; char **format_keys_cstr; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFormatParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; int (*store_format)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser *, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFormatParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFFormatParser;
2421:
2422: cdef:
2423: tuple format_keys
2424: int n_formats
2425: char** format_keys_cstr
2426:
+2427: def __cinit__(self, format_keys):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFormatParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFormatParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_format_keys = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format_keys,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format_keys)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2427, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_format_keys = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2427, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFormatParser.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFormatParser___cinit__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser *)__pyx_v_self), __pyx_v_format_keys); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFormatParser___cinit__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser *__pyx_v_self, PyObject *__pyx_v_format_keys) { int __pyx_v_i; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFormatParser.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2428:
2429: # setup FORMAT keys
2430: # N.B., need to keep a reference to these, otherwise C strings will not behave
+2431: self.format_keys = tuple(sorted(format_keys))
__pyx_t_2 = PySequence_List(__pyx_v_format_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2431, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2431, __pyx_L1_error) } __pyx_t_2 = PyList_AsTuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->format_keys); __Pyx_DECREF(__pyx_v_self->format_keys); __pyx_v_self->format_keys = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
+2432: self.n_formats = len(self.format_keys)
__pyx_t_2 = __pyx_v_self->format_keys; __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 2432, __pyx_L1_error) } __pyx_t_4 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2432, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->n_formats = __pyx_t_4;
2433:
2434: # setup FORMAT keys as C strings for nogil searching
+2435: self.format_keys_cstr = <char**> malloc(sizeof(char*) * self.n_formats)
__pyx_v_self->format_keys_cstr = ((char **)malloc(((sizeof(char *)) * __pyx_v_self->n_formats)));
+2436: for i in range(self.n_formats):
__pyx_t_5 = __pyx_v_self->n_formats; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6;
+2437: self.format_keys_cstr[i] = <char*> self.format_keys[i]
if (unlikely(__pyx_v_self->format_keys == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2437, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyObject_AsString(PyTuple_GET_ITEM(__pyx_v_self->format_keys, __pyx_v_i)); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 2437, __pyx_L1_error) (__pyx_v_self->format_keys_cstr[__pyx_v_i]) = ((char *)__pyx_t_7); }
2438:
+2439: def __init__(self, format_keys):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFormatParser_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFormatParser_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_format_keys = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format_keys,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format_keys)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2439, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_format_keys = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2439, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFormatParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFormatParser_2__init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser *)__pyx_v_self), __pyx_v_format_keys); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFormatParser_2__init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_format_keys) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFormatParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2440: super(VCFFormatParser, self).__init__(key=b'FORMAT')
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFFormatParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFFormatParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFFormatParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_n_b_FORMAT) < 0) __PYX_ERR(0, 2440, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2441:
+2442: def __dealloc__(self):
/* Python wrapper */ static void __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFormatParser_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_5allel_3opt_11io_vcf_read_15VCFFormatParser_5__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFormatParser_4__dealloc__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_5allel_3opt_11io_vcf_read_15VCFFormatParser_4__dealloc__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* … */ /* function exit code */ __Pyx_RefNannyFinishContext(); }
+2443: if self.format_keys_cstr is not NULL:
__pyx_t_1 = ((__pyx_v_self->format_keys_cstr != NULL) != 0); if (__pyx_t_1) { /* … */ }
+2444: free(self.format_keys_cstr)
free(__pyx_v_self->format_keys_cstr);
2445:
+2446: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_15VCFFormatParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFFormatParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2447: cdef:
2448: int i
2449:
2450: # reset temporary buffer
+2451: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
+2452: IntVector_clear(&context.variant_format_indices)
__pyx_f_5allel_3opt_11io_vcf_read_IntVector_clear((&__pyx_v_context->variant_format_indices));
2453:
+2454: while True:
while (1) {
2455:
+2456: if stream.c == 0:
__pyx_t_1 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_1) { /* … */ }
2457: # no point setting format, there will be no calldata
+2458: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+2459: break
goto __pyx_L4_break;
2460:
+2461: elif stream.c == LF or stream.c == CR:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
2462: # no point setting format, there will be no calldata
+2463: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+2464: break
goto __pyx_L4_break;
2465:
+2466: elif stream.c == TAB:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_1) { /* … */ }
+2467: self.store_format(context)
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFormatParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->store_format(__pyx_v_self, __pyx_v_context); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2467, __pyx_L1_error)
2468: # we're done here, advance to next field
+2469: context.state += 1
__pyx_v_context->state = (__pyx_v_context->state + 1);
+2470: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2470, __pyx_L1_error)
+2471: break
goto __pyx_L4_break;
2472:
+2473: elif stream.c == COLON:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+2474: self.store_format(context)
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFormatParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->store_format(__pyx_v_self, __pyx_v_context); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2474, __pyx_L1_error)
2475:
2476: else:
+2477: CharVector_append(&context.temp, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:;
2478:
2479: # advance to next character
+2480: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2480, __pyx_L1_error) } __pyx_L4_break:;
2481:
+2482: cdef int store_format(self, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_15VCFFormatParser_store_format(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFormatParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_format_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("store_format", 0); /* … */ /* function exit code */ __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2483: cdef int format_index
2484:
2485: # deal with empty or missing data
+2486: if context.temp.size == 0:
__pyx_t_1 = ((__pyx_v_context->temp.size == 0) != 0); if (__pyx_t_1) { /* … */ }
2487: # not strictly kosher, handle as missing/empty
+2488: return 0
__pyx_r = 0; goto __pyx_L0;
2489:
+2490: if context.temp.size == 1 and context.temp.data[0] == PERIOD:
__pyx_t_2 = ((__pyx_v_context->temp.size == 1) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = (((__pyx_v_context->temp.data[0]) == __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+2491: return 0
__pyx_r = 0; goto __pyx_L0;
2492:
2493: # terminate the string
+2494: CharVector_terminate(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_terminate((&__pyx_v_context->temp));
2495:
2496: # find format index
+2497: format_index = search_sorted_cstr(context.temp.data, self.format_keys_cstr, self.n_formats)
__pyx_v_format_index = __pyx_f_5allel_3opt_11io_vcf_read_search_sorted_cstr(__pyx_v_context->temp.data, __pyx_v_self->format_keys_cstr, __pyx_v_self->n_formats);
2498:
2499: # add to vector of indices for the current variant
+2500: IntVector_append(&context.variant_format_indices, format_index)
__pyx_f_5allel_3opt_11io_vcf_read_IntVector_append((&__pyx_v_context->variant_format_indices), __pyx_v_format_index);
2501:
2502: # clear out temp
+2503: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
2504:
2505:
2506:
+2507: cdef class VCFSkipAllCallDataParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFSkipAllCallDataParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFSkipAllCallDataParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFSkipAllCallDataParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFSkipAllCallDataParser;
2508: """Skip a field."""
2509:
+2510: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFSkipAllCallDataParser_parse(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFSkipAllCallDataParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFSkipAllCallDataParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2511: return vcf_skip_variant(stream, context)
__pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_skip_variant(__pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2511, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2512:
+2513: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFSkipAllCallDataParser_make_chunk(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFSkipAllCallDataParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_24VCFSkipAllCallDataParser_make_chunk *__pyx_optional_args) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { } /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_24VCFSkipAllCallDataParser_make_chunk { int __pyx_n; PyObject *limit; };
2514: pass
2515:
2516:
+2517: cdef class VCFCallDataParser(VCFFieldParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; PyObject *format_keys; int n_formats; PyObject *parsers; PyObject **parsers_cptr; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *skip_parser; __Pyx_memviewslice loc_samples; int n_samples; int n_samples_out; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFFieldParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataParser;
2518:
2519: cdef:
2520: tuple format_keys
2521: int n_formats
2522: tuple parsers
2523: PyObject** parsers_cptr
2524: VCFCallDataParserBase skip_parser
2525: np.uint8_t[:] loc_samples
2526: int n_samples
2527: int n_samples_out
2528:
+2529: def __cinit__(self, format_keys, types, numbers, chunk_length, loc_samples, fills):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFCallDataParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFCallDataParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_format_keys = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_numbers = 0; PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_loc_samples = 0; PyObject *__pyx_v_fills = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format_keys,&__pyx_n_s_types,&__pyx_n_s_numbers,&__pyx_n_s_chunk_length,&__pyx_n_s_loc_samples,&__pyx_n_s_fills,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format_keys)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(0, 2529, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numbers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(0, 2529, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(0, 2529, __pyx_L3_error) } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc_samples)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(0, 2529, __pyx_L3_error) } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fills)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(0, 2529, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2529, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_format_keys = values[0]; __pyx_v_types = values[1]; __pyx_v_numbers = values[2]; __pyx_v_chunk_length = values[3]; __pyx_v_loc_samples = values[4]; __pyx_v_fills = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2529, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParser.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_17VCFCallDataParser___cinit__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser *)__pyx_v_self), __pyx_v_format_keys, __pyx_v_types, __pyx_v_numbers, __pyx_v_chunk_length, __pyx_v_loc_samples, __pyx_v_fills); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_17VCFCallDataParser___cinit__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser *__pyx_v_self, PyObject *__pyx_v_format_keys, PyObject *__pyx_v_types, PyObject *__pyx_v_numbers, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_loc_samples, PyObject *__pyx_v_fills) { PyObject *__pyx_v_parsers = NULL; PyObject *__pyx_v_kwds = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_t = NULL; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_fill = NULL; struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *__pyx_v_parser = NULL; int __pyx_v_i; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParser.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_parsers); __Pyx_XDECREF(__pyx_v_kwds); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_t); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_fill); __Pyx_XDECREF((PyObject *)__pyx_v_parser); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2530: self.chunk_length = chunk_length
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_chunk_length); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2530, __pyx_L1_error) __pyx_v_self->__pyx_base.chunk_length = __pyx_t_1;
+2531: self.loc_samples = loc_samples
__pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_loc_samples); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 2531, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->loc_samples, 0); __pyx_v_self->loc_samples = __pyx_t_2; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
+2532: self.n_samples = loc_samples.shape[0]
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_loc_samples, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2532, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->n_samples = __pyx_t_1;
+2533: self.n_samples_out = np.count_nonzero(loc_samples)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_count_nonzero); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_loc_samples); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_loc_samples}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2533, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_loc_samples}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2533, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_loc_samples); __Pyx_GIVEREF(__pyx_v_loc_samples); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_loc_samples); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->n_samples_out = __pyx_t_1;
2534:
2535: # setup formats
+2536: self.format_keys = tuple(sorted(format_keys))
__pyx_t_5 = PySequence_List(__pyx_v_format_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 2536, __pyx_L1_error) if (unlikely(__pyx_t_4 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2536, __pyx_L1_error) } __pyx_t_5 = PyList_AsTuple(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->format_keys); __Pyx_DECREF(__pyx_v_self->format_keys); __pyx_v_self->format_keys = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0;
+2537: self.n_formats = len(self.format_keys)
__pyx_t_5 = __pyx_v_self->format_keys; __Pyx_INCREF(__pyx_t_5); if (unlikely(__pyx_t_5 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 2537, __pyx_L1_error) } __pyx_t_8 = PyTuple_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 2537, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->n_formats = __pyx_t_8;
2538:
2539: # setup parsers
+2540: self.skip_parser = VCFCallDataSkipParser(key=None)
__pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, Py_None) < 0) __PYX_ERR(0, 2540, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser), __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->skip_parser); __Pyx_DECREF(((PyObject *)__pyx_v_self->skip_parser)); __pyx_v_self->skip_parser = ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_4); __pyx_t_4 = 0;
+2541: parsers = list()
__pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_parsers = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0;
+2542: kwds = dict(chunk_length=chunk_length, n_samples_out=self.n_samples_out)
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 2542, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->n_samples_out); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_n_samples_out, __pyx_t_5) < 0) __PYX_ERR(0, 2542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_kwds = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0;
+2543: for key in self.format_keys:
if (unlikely(__pyx_v_self->format_keys == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2543, __pyx_L1_error) } __pyx_t_4 = __pyx_v_self->format_keys; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; for (;;) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2543, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; /* … */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+2544: t = types[key]
__pyx_t_5 = PyObject_GetItem(__pyx_v_types, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5); __pyx_t_5 = 0;
+2545: n = numbers[key]
__pyx_t_5 = PyObject_GetItem(__pyx_v_numbers, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0;
2546:
2547: # special handling of "genotype" dtypes for any field
+2548: if isinstance(t, str) and t.startswith('genotype/'):
__pyx_t_10 = PyString_Check(__pyx_v_t); __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { } else { __pyx_t_9 = __pyx_t_11; goto __pyx_L6_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 2548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __pyx_t_11; __pyx_L6_bool_binop_done:; if (__pyx_t_9) { /* … */ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_genotype); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 2548, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); /* … */ goto __pyx_L5; }
+2549: fill = fills.get(key, -1)
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2549, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2549, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_fill, __pyx_t_6); __pyx_t_6 = 0;
+2550: t = np.dtype(t.split('/')[1])
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_6); __pyx_t_6 = 0; /* … */ __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54);
+2551: if t == np.dtype('int8'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L8; } /* … */ __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_int8); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 2551, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55);
+2552: parser = VCFGenotypeInt8Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2552, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2552, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2553: elif t == np.dtype('int16'):
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L8; } /* … */ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_int16); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 2553, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56);
+2554: parser = VCFGenotypeInt16Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2554, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2554, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2554, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_12, __pyx_v_kwds) < 0) __PYX_ERR(0, 2554, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser), __pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2555: elif t == np.dtype('int32'):
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L8; } /* … */ __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 2555, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57);
+2556: parser = VCFGenotypeInt32Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2556, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2556, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser), __pyx_t_12, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2557: elif t == np.dtype('int64'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L8; } /* … */ __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 2557, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58);
+2558: parser = VCFGenotypeInt64Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2558, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2558, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2559: elif t == np.dtype('uint8'):
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L8; } /* … */ __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_uint8); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 2559, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59);
+2560: parser = VCFGenotypeUInt8Parser(key, number=n, fill=fills.get(key, IU8.max), **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2560, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_12, __pyx_v_kwds) < 0) __PYX_ERR(0, 2560, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser), __pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2561: elif t == np.dtype('uint16'):
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L8; } /* … */ __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_uint16); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 2561, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60);
+2562: parser = VCFGenotypeUInt16Parser(key, number=n, fill=fills.get(key, IU16.max), **kwds)
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2562, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16); __pyx_t_16 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2562, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser), __pyx_t_12, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2563: elif t == np.dtype('uint32'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L8; } /* … */ __pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_s_uint32); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61);
+2564: parser = VCFGenotypeUInt32Parser(key, number=n, fill=fills.get(key, IU32.max), **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2564, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2564, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2565: elif t == np.dtype('uint64'):
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L8; } /* … */ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_uint64); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62);
+2566: parser = VCFGenotypeUInt64Parser(key, number=n, fill=fills.get(key, IU64.max), **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2566, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU64); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16); __pyx_t_16 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_12, __pyx_v_kwds) < 0) __PYX_ERR(0, 2566, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser), __pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
2567: else:
+2568: warnings.warn('type %r not supported for genotype field %r, field will be skipped' % (t, key))
/*else*/ { __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_t); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_key); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_type_r_not_supported_for_genotyp, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_12) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_3}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_3}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2569: parser = self.skip_parser
__pyx_t_5 = ((PyObject *)__pyx_v_self->skip_parser); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0; } __pyx_L8:;
2570:
2571: # special handling of "genotype_ac" dtypes for any field
+2572: elif isinstance(t, str) and t.startswith('genotype_ac/'):
__pyx_t_11 = PyString_Check(__pyx_v_t); __pyx_t_10 = (__pyx_t_11 != 0); if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L9_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L9_bool_binop_done:; if (__pyx_t_9) { /* … */ __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_genotype_ac); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* … */ goto __pyx_L5; }
+2573: t = np.dtype(t.split('/')[1])
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_6); __pyx_t_6 = 0; /* … */ __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64);
+2574: if t == np.dtype('int8'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L11; } /* … */ __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_int8); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65);
+2575: parser = VCFGenotypeACInt8Parser(key, number=n, **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2575, __pyx_L1_error) __pyx_t_6 = __pyx_t_13; __pyx_t_13 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2575, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_13)); __pyx_t_13 = 0;
+2576: elif t == np.dtype('int16'):
__pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L11; } /* … */ __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_int16); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66);
+2577: parser = VCFGenotypeACInt16Parser(key, number=n, **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2577, __pyx_L1_error) __pyx_t_13 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_13, __pyx_v_kwds) < 0) __PYX_ERR(0, 2577, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser), __pyx_t_6, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2578: elif t == np.dtype('int32'):
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L11; } /* … */ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67);
+2579: parser = VCFGenotypeACInt32Parser(key, number=n, **kwds)
__pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2579, __pyx_L1_error) __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2579, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser), __pyx_t_13, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2580: elif t == np.dtype('int64'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L11; } /* … */ __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 2580, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68);
+2581: parser = VCFGenotypeACInt64Parser(key, number=n, **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2581, __pyx_L1_error) __pyx_t_6 = __pyx_t_13; __pyx_t_13 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2581, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_13)); __pyx_t_13 = 0;
+2582: elif t == np.dtype('uint8'):
__pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L11; } /* … */ __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_uint8); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69);
+2583: parser = VCFGenotypeACUInt8Parser(key, number=n, **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2583, __pyx_L1_error) __pyx_t_13 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_13, __pyx_v_kwds) < 0) __PYX_ERR(0, 2583, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser), __pyx_t_6, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2584: elif t == np.dtype('uint16'):
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L11; } /* … */ __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_uint16); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70);
+2585: parser = VCFGenotypeACUInt16Parser(key, number=n, **kwds)
__pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2585, __pyx_L1_error) __pyx_t_5 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2585, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser), __pyx_t_13, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2586: elif t == np.dtype('uint32'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2586, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2586, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L11; } /* … */ __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_uint32); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 2586, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71);
+2587: parser = VCFGenotypeACUInt32Parser(key, number=n, **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2587, __pyx_L1_error) __pyx_t_6 = __pyx_t_13; __pyx_t_13 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2587, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_13)); __pyx_t_13 = 0;
+2588: elif t == np.dtype('uint64'):
__pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L11; } /* … */ __pyx_tuple__72 = PyTuple_Pack(1, __pyx_n_s_uint64); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72);
+2589: parser = VCFGenotypeACUInt64Parser(key, number=n, **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2589, __pyx_L1_error) __pyx_t_13 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_13, __pyx_v_kwds) < 0) __PYX_ERR(0, 2589, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser), __pyx_t_6, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
2590: else:
+2591: warnings.warn('type %r not supported for genotype_ac field %r, field will be skipped' % (t, key))
/*else*/ { __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_t); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_key); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_type_r_not_supported_for_genotyp_2, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_13) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_3}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_3}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); __pyx_t_13 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2592: parser = self.skip_parser
__pyx_t_5 = ((PyObject *)__pyx_v_self->skip_parser); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0; } __pyx_L11:;
2593:
2594: # special handling of GT field
+2595: elif key == b'GT' and t == np.dtype('int8'):
__pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_key, __pyx_n_b_GT, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2595, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2595, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2595, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L12_bool_binop_done:; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_int8); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 2595, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73);
+2596: parser = VCFGenotypeInt8Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2596, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2596, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser), __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2597: elif key == b'GT' and t == np.dtype('int16'):
__pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_key, __pyx_n_b_GT, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2597, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L14_bool_binop_done; } __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L14_bool_binop_done:; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_s_int16); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 2597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74);
+2598: parser = VCFGenotypeInt16Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2598, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_12, __pyx_v_kwds) < 0) __PYX_ERR(0, 2598, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser), __pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2599: elif key == b'GT' and t == np.dtype('int32'):
__pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_key, __pyx_n_b_GT, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2599, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L16_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L16_bool_binop_done:; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75);
+2600: parser = VCFGenotypeInt32Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2600, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2600, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser), __pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2601: elif key == b'GT' and t == np.dtype('int64'):
__pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_key, __pyx_n_b_GT, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2601, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L18_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L18_bool_binop_done:; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76);
+2602: parser = VCFGenotypeInt64Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2602, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2602, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser), __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2603: elif key == b'GT' and t == np.dtype('uint8'):
__pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_key, __pyx_n_b_GT, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2603, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L20_bool_binop_done; } __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2603, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2603, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L20_bool_binop_done:; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_uint8); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 2603, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77);
+2604: parser = VCFGenotypeUInt8Parser(key, number=n, fill=fills.get(key, IU8.max), **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2604, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_12, __pyx_v_kwds) < 0) __PYX_ERR(0, 2604, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser), __pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2605: elif key == b'GT' and t == np.dtype('uint16'):
__pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_key, __pyx_n_b_GT, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2605, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L22_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2605, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2605, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L22_bool_binop_done:; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__78 = PyTuple_Pack(1, __pyx_n_s_uint16); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 2605, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78);
+2606: parser = VCFGenotypeUInt16Parser(key, number=n, fill=fills.get(key, IU16.max), **kwds)
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2606, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16); __pyx_t_16 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2606, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser), __pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2607: elif key == b'GT' and t == np.dtype('uint32'):
__pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_key, __pyx_n_b_GT, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2607, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L24_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L24_bool_binop_done:; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_s_uint32); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79);
+2608: parser = VCFGenotypeUInt32Parser(key, number=n, fill=fills.get(key, IU32.max), **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2608, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2608, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser), __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2609: elif key == b'GT' and t == np.dtype('uint64'):
__pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_key, __pyx_n_b_GT, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2609, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L26_bool_binop_done; } __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L26_bool_binop_done:; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_s_uint64); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2609, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80);
+2610: parser = VCFGenotypeUInt64Parser(key, number=n, fill=fills.get(key, IU64.max), **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2610, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU64); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16); __pyx_t_16 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_12, __pyx_v_kwds) < 0) __PYX_ERR(0, 2610, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser), __pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
2611:
2612: # all other calldata
+2613: elif t == np.dtype('int8'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__81 = PyTuple_Pack(1, __pyx_n_s_int8); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81);
+2614: parser = VCFCallDataInt8Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2614, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2614, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser), __pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2615: elif t == np.dtype('int16'):
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_int16); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 2615, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82);
+2616: parser = VCFCallDataInt16Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2616, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2616, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2616, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2616, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2616, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser), __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2617: elif t == np.dtype('int32'):
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 2617, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83);
+2618: parser = VCFCallDataInt32Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2618, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2618, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2618, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_12, __pyx_v_kwds) < 0) __PYX_ERR(0, 2618, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser), __pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2619: elif t == np.dtype('int64'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 2619, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84);
+2620: parser = VCFCallDataInt64Parser(key, number=n, fill=fills.get(key, -1), **kwds)
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2620, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_int_neg_1}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_int_neg_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2620, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser), __pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2621: elif t == np.dtype('uint8'):
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_uint8); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85);
+2622: parser = VCFCallDataUInt8Parser(key, number=n, fill=fills.get(key, IU8.max), **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2622, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2622, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser), __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2623: elif t == np.dtype('uint16'):
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_uint16); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86);
+2624: parser = VCFCallDataUInt16Parser(key, number=n, fill=fills.get(key, IU16.max), **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2624, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU16); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16); __pyx_t_16 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_12, __pyx_v_kwds) < 0) __PYX_ERR(0, 2624, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser), __pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2625: elif t == np.dtype('uint32'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_s_uint32); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87);
+2626: parser = VCFCallDataUInt32Parser(key, number=n, fill=fills.get(key, IU32.max), **kwds)
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2626, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2626, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser), __pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2627: elif t == np.dtype('uint64'):
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_s_uint64); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__88); __Pyx_GIVEREF(__pyx_tuple__88);
+2628: parser = VCFCallDataUInt64Parser(key, number=n, fill=fills.get(key, IU64.max), **kwds)
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2628, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU64); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_key, __pyx_t_15}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else #endif { __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16); __pyx_t_16 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_t_15); __pyx_t_15 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwds) < 0) __PYX_ERR(0, 2628, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser), __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2629: elif t == np.dtype('float32'):
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_float32); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89);
+2630: parser = VCFCallDataFloat32Parser(key, number=n, fill=fills.get(key, NAN), **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2630, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = PyFloat_FromDouble(__pyx_v_5allel_3opt_11io_vcf_read_NAN); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_t_14}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, __pyx_t_14}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_1, __pyx_t_14); __pyx_t_14 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_t_6; __pyx_t_6 = 0; if (__Pyx_MergeKeywords(__pyx_t_12, __pyx_v_kwds) < 0) __PYX_ERR(0, 2630, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser), __pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2631: elif t == np.dtype('float64'):
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = PyObject_RichCompare(__pyx_v_t, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; } /* … */ __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90);
+2632: parser = VCFCallDataFloat64Parser(key, number=n, fill=fills.get(key, NAN), **kwds)
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2632, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_fills, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_16 = PyFloat_FromDouble(__pyx_v_5allel_3opt_11io_vcf_read_NAN); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_14 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_16}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_key, __pyx_t_16}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_1, __pyx_v_key); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fill, __pyx_t_3) < 0) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2632, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser), __pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
+2633: elif t.kind == 'S':
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_kind); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2633, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; }
+2634: parser = VCFCallDataStringParser(key, dtype=t, number=n, **kwds)
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_v_t) < 0) __PYX_ERR(0, 2634, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2634, __pyx_L1_error) __pyx_t_6 = __pyx_t_12; __pyx_t_12 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2634, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataStringParser), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_12)); __pyx_t_12 = 0;
+2635: elif t.kind == 'O':
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_kind); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_12, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2635, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_9) { /* … */ goto __pyx_L5; }
+2636: parser = VCFCallDataObjectParser(key, number=n, **kwds)
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_key); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_n) < 0) __PYX_ERR(0, 2636, __pyx_L1_error) __pyx_t_6 = __pyx_t_5; __pyx_t_5 = 0; if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwds) < 0) __PYX_ERR(0, 2636, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser), __pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_5)); __pyx_t_5 = 0;
2637:
2638: else:
+2639: parser = VCFCallDataSkipParser(key)
/*else*/ { __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key); __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_6)); __pyx_t_6 = 0;
+2640: warnings.warn('type %r not supported for FORMAT field %r, field will be skipped' % (t, key))
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_t); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_key); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_type_r_not_supported_for_FORMAT, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_5) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L5:;
2641:
+2642: parsers.append(parser)
__pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parsers, ((PyObject *)__pyx_v_parser)); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 2642, __pyx_L1_error)
+2643: self.parsers = tuple(parsers)
__pyx_t_4 = PyList_AsTuple(__pyx_v_parsers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->parsers); __Pyx_DECREF(__pyx_v_self->parsers); __pyx_v_self->parsers = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0;
2644:
2645: # store pointers to parsers
+2646: self.parsers_cptr = <PyObject**> malloc(sizeof(PyObject*) * self.n_formats)
__pyx_v_self->parsers_cptr = ((PyObject **)malloc(((sizeof(PyObject *)) * __pyx_v_self->n_formats)));
+2647: for i in range(self.n_formats):
__pyx_t_1 = __pyx_v_self->n_formats; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_1; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17;
+2648: self.parsers_cptr[i] = <PyObject*> self.parsers[i]
if (unlikely(__pyx_v_self->parsers == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 2648, __pyx_L1_error) } (__pyx_v_self->parsers_cptr[__pyx_v_i]) = ((PyObject *)PyTuple_GET_ITEM(__pyx_v_self->parsers, __pyx_v_i)); }
2649:
+2650: def __init__(self, format_keys, types, numbers, chunk_length, loc_samples, fills):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFCallDataParser_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_17VCFCallDataParser_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_format_keys = 0; CYTHON_UNUSED PyObject *__pyx_v_types = 0; CYTHON_UNUSED PyObject *__pyx_v_numbers = 0; PyObject *__pyx_v_chunk_length = 0; CYTHON_UNUSED PyObject *__pyx_v_loc_samples = 0; CYTHON_UNUSED PyObject *__pyx_v_fills = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format_keys,&__pyx_n_s_types,&__pyx_n_s_numbers,&__pyx_n_s_chunk_length,&__pyx_n_s_loc_samples,&__pyx_n_s_fills,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format_keys)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 1); __PYX_ERR(0, 2650, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numbers)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 2); __PYX_ERR(0, 2650, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 3); __PYX_ERR(0, 2650, __pyx_L3_error) } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc_samples)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 4); __PYX_ERR(0, 2650, __pyx_L3_error) } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fills)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 5); __PYX_ERR(0, 2650, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2650, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_format_keys = values[0]; __pyx_v_types = values[1]; __pyx_v_numbers = values[2]; __pyx_v_chunk_length = values[3]; __pyx_v_loc_samples = values[4]; __pyx_v_fills = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2650, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_17VCFCallDataParser_2__init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser *)__pyx_v_self), __pyx_v_format_keys, __pyx_v_types, __pyx_v_numbers, __pyx_v_chunk_length, __pyx_v_loc_samples, __pyx_v_fills); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_17VCFCallDataParser_2__init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_format_keys, CYTHON_UNUSED PyObject *__pyx_v_types, CYTHON_UNUSED PyObject *__pyx_v_numbers, PyObject *__pyx_v_chunk_length, CYTHON_UNUSED PyObject *__pyx_v_loc_samples, CYTHON_UNUSED PyObject *__pyx_v_fills) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2651: super(VCFCallDataParser, self).__init__(chunk_length=chunk_length)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_length, __pyx_v_chunk_length) < 0) __PYX_ERR(0, 2651, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2652:
+2653: def __dealloc__(self):
/* Python wrapper */ static void __pyx_pw_5allel_3opt_11io_vcf_read_17VCFCallDataParser_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_5allel_3opt_11io_vcf_read_17VCFCallDataParser_5__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_5allel_3opt_11io_vcf_read_17VCFCallDataParser_4__dealloc__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_5allel_3opt_11io_vcf_read_17VCFCallDataParser_4__dealloc__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* … */ /* function exit code */ __Pyx_RefNannyFinishContext(); }
+2654: if self.parsers_cptr is not NULL:
__pyx_t_1 = ((__pyx_v_self->parsers_cptr != NULL) != 0); if (__pyx_t_1) { /* … */ }
+2655: free(self.parsers_cptr)
free(__pyx_v_self->parsers_cptr);
2656:
+2657: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFCallDataParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { PyObject *__pyx_v_parser; int __pyx_v_format_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2658: cdef:
2659: int i
2660: PyObject* parser
2661:
2662: # initialise context
+2663: context.sample_index = 0
__pyx_v_context->sample_index = 0;
+2664: context.sample_output_index = -1
__pyx_v_context->sample_output_index = -1;
+2665: context.sample_field_index = 0
__pyx_v_context->sample_field_index = 0;
2666:
2667: # setup output indexing
+2668: if self.loc_samples[0]:
__pyx_t_1 = 0; __pyx_t_2 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->loc_samples.data + __pyx_t_1 * __pyx_v_self->loc_samples.strides[0]) ))) != 0); if (__pyx_t_2) { /* … */ goto __pyx_L3; }
+2669: context.sample_output_index += 1
__pyx_v_context->sample_output_index = (__pyx_v_context->sample_output_index + 1);
2670: else:
2671: # skip to next sample
+2672: while stream.c != 0 and stream.c != LF and stream.c != CR and stream.c != TAB:
/*else*/ { while (1) { __pyx_t_3 = ((__pyx_v_stream->c != 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L6_bool_binop_done:; if (!__pyx_t_2) break;
+2673: stream.advance()
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2673, __pyx_L1_error) } } __pyx_L3:;
2674:
+2675: while True:
while (1) {
2676:
+2677: if context.sample_index >= self.n_samples:
__pyx_t_2 = ((__pyx_v_context->sample_index >= __pyx_v_self->n_samples) != 0); if (__pyx_t_2) { /* … */ }
2678: # with gil:
+2679: warn('more samples than given in header', context)
__pyx_t_4 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_more_samples_than_given_in_heade, __pyx_v_context); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2679, __pyx_L1_error)
+2680: while stream.c != 0 and stream.c != LF and stream.c != CR:
while (1) { __pyx_t_3 = ((__pyx_v_stream->c != 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L15_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L15_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L15_bool_binop_done:; if (!__pyx_t_2) break;
+2681: stream.advance()
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2681, __pyx_L1_error) }
2682:
+2683: if stream.c == 0:
__pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); if (__pyx_t_2) { /* … */ }
+2684: context.state = VCFState.EOF
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOF;
+2685: break
goto __pyx_L11_break;
2686:
+2687: elif stream.c == LF or stream.c == CR:
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L19_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L19_bool_binop_done:; if (__pyx_t_2) { /* … */ }
+2688: context.state = VCFState.EOL
__pyx_v_context->state = __pyx_e_5allel_3opt_11io_vcf_read_EOL;
+2689: break
goto __pyx_L11_break;
2690:
+2691: elif stream.c == TAB:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_2) { /* … */ goto __pyx_L18; }
+2692: stream.advance()
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2692, __pyx_L1_error)
+2693: context.sample_index += 1
__pyx_v_context->sample_index = (__pyx_v_context->sample_index + 1);
+2694: context.sample_field_index = 0
__pyx_v_context->sample_field_index = 0;
+2695: if self.loc_samples[context.sample_index]:
__pyx_t_5 = __pyx_v_context->sample_index; __pyx_t_2 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->loc_samples.data + __pyx_t_5 * __pyx_v_self->loc_samples.strides[0]) ))) != 0); if (__pyx_t_2) { /* … */ goto __pyx_L21; }
+2696: context.sample_output_index += 1
__pyx_v_context->sample_output_index = (__pyx_v_context->sample_output_index + 1);
2697: else:
2698: # skip to next sample
+2699: while stream.c != 0 and stream.c != LF and stream.c != CR and stream.c != TAB:
/*else*/ { while (1) { __pyx_t_3 = ((__pyx_v_stream->c != 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L24_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L24_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L24_bool_binop_done; } __pyx_t_3 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L24_bool_binop_done:; if (!__pyx_t_2) break;
+2700: stream.advance()
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2700, __pyx_L1_error) } } __pyx_L21:;
2701:
+2702: elif stream.c == COLON:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (__pyx_t_2) { /* … */ goto __pyx_L18; }
+2703: context.sample_field_index += 1
__pyx_v_context->sample_field_index = (__pyx_v_context->sample_field_index + 1);
+2704: stream.advance()
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2704, __pyx_L1_error)
2705:
+2706: elif context.sample_field_index >= context.variant_format_indices.size:
__pyx_t_2 = ((__pyx_v_context->sample_field_index >= __pyx_v_context->variant_format_indices.size) != 0); if (__pyx_t_2) { /* … */ goto __pyx_L18; }
2707: # more sample fields than formats declared for this variant
+2708: self.skip_parser.parse(stream, context)
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_v_self->skip_parser->__pyx_vtab)->parse(__pyx_v_self->skip_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2708, __pyx_L1_error)
2709:
2710: else:
2711:
2712: # lookup format
+2713: format_index = context.variant_format_indices.data[context.sample_field_index]
/*else*/ { __pyx_v_format_index = (__pyx_v_context->variant_format_indices.data[__pyx_v_context->sample_field_index]);
2714:
2715: # find parser
+2716: if format_index >= 0:
__pyx_t_2 = ((__pyx_v_format_index >= 0) != 0); if (__pyx_t_2) { /* … */ goto __pyx_L28; }
+2717: parser = self.parsers_cptr[format_index]
__pyx_v_parser = (__pyx_v_self->parsers_cptr[__pyx_v_format_index]);
2718: # jump through some hoops to avoid references (which need the GIL)
+2719: (<VCFCallDataParserBase>parser).parse(stream, context)
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_v_parser)->__pyx_vtab)->parse(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_v_parser), __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2719, __pyx_L1_error)
2720:
2721: else:
+2722: self.skip_parser.parse(stream, context)
/*else*/ { __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_v_self->skip_parser->__pyx_vtab)->parse(__pyx_v_self->skip_parser, __pyx_v_stream, __pyx_v_context); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2722, __pyx_L1_error) } __pyx_L28:; } __pyx_L18:; } __pyx_L11_break:;
2723:
+2724: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFCallDataParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser *__pyx_v_self) { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *__pyx_v_parser = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parser); __Pyx_RefNannyFinishContext(); return __pyx_r; }
2725: cdef VCFCallDataParserBase parser
+2726: for parser in self.parsers:
if (unlikely(__pyx_v_self->parsers == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2726, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->parsers; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2726, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataParserBase))))) __PYX_ERR(0, 2726, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_3)); __pyx_t_3 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2727: parser.malloc_chunk()
__pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_v_parser->__pyx_vtab)->malloc_chunk(__pyx_v_parser); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2727, __pyx_L1_error)
2728:
+2729: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_17VCFCallDataParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFCallDataParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *__pyx_v_parser = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_parser); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_17VCFCallDataParser_make_chunk { int __pyx_n; PyObject *limit; };
2730: cdef VCFCallDataParserBase parser
+2731: for parser in self.parsers:
if (unlikely(__pyx_v_self->parsers == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 2731, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->parsers; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2731, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataParserBase))))) __PYX_ERR(0, 2731, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_parser, ((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_t_3)); __pyx_t_3 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2732: parser.make_chunk(chunk, limit=limit)
__pyx_t_5.__pyx_n = 1; __pyx_t_5.limit = __pyx_v_limit; __pyx_t_4 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_v_parser->__pyx_vtab)->make_chunk(__pyx_v_parser, __pyx_v_chunk, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2732, __pyx_L1_error)
2733:
2734:
+2735: cdef class VCFCallDataParserBase:
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase { PyObject_HEAD struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *__pyx_vtab; PyObject *key; PyArray_Descr *dtype; int itemsize; int number; PyObject *fill; PyArrayObject *values; int chunk_length; int n_samples_out; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase { int (*malloc_chunk)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *); int (*make_chunk)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *, PyObject *, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase_make_chunk *__pyx_optional_args); int (*parse)(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *); }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataParserBase;
2736:
2737: cdef:
2738: bytes key
2739: np.dtype dtype
2740: int itemsize
2741: int number
2742: object fill
2743: np.ndarray values
2744: int chunk_length
2745: int n_samples_out
2746:
+2747: def __init__(self, key=None, dtype=None, number=1, fill=0, chunk_length=0,
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_number = 0; PyObject *__pyx_v_fill = 0; PyObject *__pyx_v_chunk_length = 0; PyObject *__pyx_v_n_samples_out = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_dtype,&__pyx_n_s_number,&__pyx_n_s_fill,&__pyx_n_s_chunk_length,&__pyx_n_s_n_samples_out,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)__pyx_int_1); values[3] = ((PyObject *)__pyx_int_0); values[4] = ((PyObject *)__pyx_int_0); values[5] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_length); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_samples_out); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2747, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_key = values[0]; __pyx_v_dtype = values[1]; __pyx_v_number = values[2]; __pyx_v_fill = values[3]; __pyx_v_chunk_length = values[4]; __pyx_v_n_samples_out = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2747, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParserBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *)__pyx_v_self), __pyx_v_key, __pyx_v_dtype, __pyx_v_number, __pyx_v_fill, __pyx_v_chunk_length, __pyx_v_n_samples_out); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_dtype, PyObject *__pyx_v_number, PyObject *__pyx_v_fill, PyObject *__pyx_v_chunk_length, PyObject *__pyx_v_n_samples_out) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParserBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2748: n_samples_out=0):
+2749: self.key = key
if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 2749, __pyx_L1_error) __pyx_t_1 = __pyx_v_key; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->key); __Pyx_DECREF(__pyx_v_self->key); __pyx_v_self->key = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+2750: if dtype is not None:
__pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2751: self.dtype = np.dtype(dtype)
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dtype); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype)); __pyx_v_self->dtype = ((PyArray_Descr *)__pyx_t_4); __pyx_t_4 = 0;
+2752: self.itemsize = self.dtype.itemsize
__pyx_t_5 = __pyx_v_self->dtype->elsize; __pyx_v_self->itemsize = __pyx_t_5;
2753: else:
+2754: self.dtype = dtype
/*else*/ { if (!(likely(((__pyx_v_dtype) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dtype, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 2754, __pyx_L1_error) __pyx_t_4 = __pyx_v_dtype; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype)); __pyx_v_self->dtype = ((PyArray_Descr *)__pyx_t_4); __pyx_t_4 = 0;
+2755: self.itemsize = 0
__pyx_v_self->itemsize = 0; } __pyx_L3:;
+2756: self.number = number
__pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_number); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2756, __pyx_L1_error) __pyx_v_self->number = __pyx_t_5;
+2757: self.fill = fill
__Pyx_INCREF(__pyx_v_fill); __Pyx_GIVEREF(__pyx_v_fill); __Pyx_GOTREF(__pyx_v_self->fill); __Pyx_DECREF(__pyx_v_self->fill); __pyx_v_self->fill = __pyx_v_fill;
+2758: self.chunk_length = chunk_length
__pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_chunk_length); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2758, __pyx_L1_error) __pyx_v_self->chunk_length = __pyx_t_5;
+2759: self.n_samples_out = n_samples_out
__pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_n_samples_out); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2759, __pyx_L1_error) __pyx_v_self->n_samples_out = __pyx_t_5;
2760:
+2761: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase_malloc_chunk(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2762: pass
2763:
+2764: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_values = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataParserBase.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_values); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase_make_chunk { int __pyx_n; PyObject *limit; };
+2765: if PY2:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2765, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L3; }
+2766: field = 'calldata/' + self.key
__pyx_t_1 = PyNumber_Add(__pyx_kp_s_calldata_2, __pyx_v_self->key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0;
2767: else:
+2768: field = 'calldata/' + str(self.key, 'ascii')
/*else*/ { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->key); __Pyx_GIVEREF(__pyx_v_self->key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->key); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_kp_s_calldata_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:;
+2769: values = self.values[:limit]
__pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->values), 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_values = __pyx_t_1; __pyx_t_1 = 0;
+2770: if self.number == 1:
__pyx_t_2 = ((__pyx_v_self->number == 1) != 0); if (__pyx_t_2) { /* … */ }
+2771: values = values.squeeze(axis=2)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 2771, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); __pyx_t_4 = 0;
+2772: chunk[field] = values
if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_v_values) < 0)) __PYX_ERR(0, 2772, __pyx_L1_error)
2773:
+2774: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_21VCFCallDataParserBase_parse(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2775: pass
2776:
2777:
+2778: cdef class VCFCallDataSkipParser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser;
2779:
+2780: def __init__(self, key, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_21VCFCallDataSkipParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_21VCFCallDataSkipParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; CYTHON_UNUSED PyObject *__pyx_v_args = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_RefNannyFinishContext(); return -1; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 2780, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_key = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2780, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataSkipParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_21VCFCallDataSkipParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser *)__pyx_v_self), __pyx_v_key, __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_21VCFCallDataSkipParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser *__pyx_v_self, PyObject *__pyx_v_key, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataSkipParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2781: super(VCFCallDataSkipParser, self).__init__(key=key)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(0, 2781, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2782:
+2783: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_21VCFCallDataSkipParser_parse(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataSkipParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2784: while stream.c != COLON and \
while (1) { __pyx_t_2 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; }
+2785: stream.c != TAB and \
__pyx_t_2 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; }
+2786: stream.c != CR and \
__pyx_t_2 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; }
+2787: stream.c != LF and \
__pyx_t_2 = ((__pyx_v_stream->c != __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; }
+2788: stream.c != 0:
__pyx_t_2 = ((__pyx_v_stream->c != 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (!__pyx_t_1) break;
+2789: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2789, __pyx_L1_error) }
2790:
+2791: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_21VCFCallDataSkipParser_make_chunk(CYTHON_UNUSED struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataSkipParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_21VCFCallDataSkipParser_make_chunk *__pyx_optional_args) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { } /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_21VCFCallDataSkipParser_make_chunk { int __pyx_n; PyObject *limit; };
2792: pass
2793:
2794:
+2795: cdef class VCFGenotypeInt8Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser;
2796:
2797: cdef:
2798: np.int8_t[:, :, :] memory
2799:
+2800: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_21VCFGenotypeInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_21VCFGenotypeInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_21VCFGenotypeInt8Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_21VCFGenotypeInt8Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt8Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2801: kwargs['dtype'] = 'int8'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int8) < 0)) __PYX_ERR(0, 2801, __pyx_L1_error)
+2802: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2803: super(VCFGenotypeInt8Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2804:
+2805: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_21VCFGenotypeInt8Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt8Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2806: return vcf_genotype_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2806, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2807:
+2808: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_21VCFGenotypeInt8Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt8Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt8Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2809: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+2810: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2810, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2810, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+2811: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2811, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2812: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int8(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2812, __pyx_L1_error)
{
__pyx_t_5numpy_int8_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_int8_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2813:
2814:
+2815: cdef class VCFGenotypeInt16Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser;
2816:
2817: cdef:
2818: np.int16_t[:, :, :] memory
2819:
+2820: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFGenotypeInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFGenotypeInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_22VCFGenotypeInt16Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_22VCFGenotypeInt16Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt16Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2821: kwargs['dtype'] = 'int16'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int16) < 0)) __PYX_ERR(0, 2821, __pyx_L1_error)
+2822: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2823: super(VCFGenotypeInt16Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2824:
+2825: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFGenotypeInt16Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt16Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2826: return vcf_genotype_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2826, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2827:
+2828: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFGenotypeInt16Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt16Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt16Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2829: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+2830: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2830, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2830, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+2831: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2831, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2832: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int16(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2832, __pyx_L1_error)
{
__pyx_t_5numpy_int16_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_int16_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2833:
2834:
+2835: cdef class VCFGenotypeInt32Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser;
2836:
2837: cdef:
2838: np.int32_t[:, :, :] memory
2839:
+2840: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFGenotypeInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFGenotypeInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_22VCFGenotypeInt32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_22VCFGenotypeInt32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2841: kwargs['dtype'] = 'int32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int32) < 0)) __PYX_ERR(0, 2841, __pyx_L1_error)
+2842: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2843: super(VCFGenotypeInt32Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2844:
+2845: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFGenotypeInt32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2846: return vcf_genotype_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2846, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2847:
+2848: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFGenotypeInt32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2849: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+2850: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2850, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+2851: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2851, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2852: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2852, __pyx_L1_error)
{
__pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2853:
2854:
+2855: cdef class VCFGenotypeInt64Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser;
2856:
2857: cdef:
2858: np.int64_t[:, :, :] memory
2859:
+2860: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFGenotypeInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFGenotypeInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_22VCFGenotypeInt64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_22VCFGenotypeInt64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2861: kwargs['dtype'] = 'int64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int64) < 0)) __PYX_ERR(0, 2861, __pyx_L1_error)
+2862: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2863: super(VCFGenotypeInt64Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2864:
+2865: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFGenotypeInt64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2866: return vcf_genotype_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2866, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2867:
+2868: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFGenotypeInt64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeInt64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeInt64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2869: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+2870: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2870, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+2871: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2871, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2872: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2872, __pyx_L1_error)
{
__pyx_t_5numpy_int64_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_int64_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2873:
2874:
+2875: cdef class VCFGenotypeUInt8Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser;
2876:
2877: cdef:
2878: np.uint8_t[:, :, :] memory
2879:
+2880: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFGenotypeUInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFGenotypeUInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_22VCFGenotypeUInt8Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_22VCFGenotypeUInt8Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt8Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2881: kwargs['dtype'] = 'uint8'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0)) __PYX_ERR(0, 2881, __pyx_L1_error)
+2882: kwargs.setdefault('fill', IU8.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2883: super(VCFGenotypeUInt8Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2884:
+2885: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFGenotypeUInt8Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt8Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2886: return vcf_genotype_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2886, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2887:
+2888: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFGenotypeUInt8Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt8Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt8Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2889: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+2890: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2890, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+2891: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2891, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2892: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint8(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2892, __pyx_L1_error)
{
__pyx_t_5numpy_uint8_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2893:
2894:
+2895: cdef class VCFGenotypeUInt16Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser;
2896:
2897: cdef:
2898: np.uint16_t[:, :, :] memory
2899:
+2900: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt16Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt16Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt16Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2901: kwargs['dtype'] = 'uint16'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint16) < 0)) __PYX_ERR(0, 2901, __pyx_L1_error)
+2902: kwargs.setdefault('fill', IU16.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2903: super(VCFGenotypeUInt16Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2904:
+2905: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt16Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt16Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2906: return vcf_genotype_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2906, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2907:
+2908: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt16Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt16Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt16Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2909: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+2910: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2910, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2910, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+2911: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint16_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2911, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2912: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint16(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2912, __pyx_L1_error)
{
__pyx_t_5numpy_uint16_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_uint16_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2913:
2914:
+2915: cdef class VCFGenotypeUInt32Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser;
2916:
2917: cdef:
2918: np.uint32_t[:, :, :] memory
2919:
+2920: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2921: kwargs['dtype'] = 'uint32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint32) < 0)) __PYX_ERR(0, 2921, __pyx_L1_error)
+2922: kwargs.setdefault('fill', IU32.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2923: super(VCFGenotypeUInt32Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2924:
+2925: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2926: return vcf_genotype_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2926, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2927:
+2928: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2929: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+2930: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2930, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2930, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+2931: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2931, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2932: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint32(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2932, __pyx_L1_error)
{
__pyx_t_5numpy_uint32_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2933:
2934:
+2935: cdef class VCFGenotypeUInt64Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser;
2936:
2937: cdef:
2938: np.uint64_t[:, :, :] memory
2939:
+2940: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2941: kwargs['dtype'] = 'uint64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint64) < 0)) __PYX_ERR(0, 2941, __pyx_L1_error)
+2942: kwargs.setdefault('fill', IU64.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2943: super(VCFGenotypeUInt64Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2944:
+2945: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2946: return vcf_genotype_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2946, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
2947:
+2948: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFGenotypeUInt64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeUInt64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeUInt64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+2949: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+2950: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 2950, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2950, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+2951: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2951, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+2952: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L1_error)
{
__pyx_t_5numpy_uint64_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_uint64_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
2953:
2954:
+2955: cdef int vcf_genotype_parse(InputStreamBase stream,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_genotype_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_genotype_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_2vcf_genotype_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_3vcf_genotype_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_4vcf_genotype_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_5vcf_genotype_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_6vcf_genotype_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_7vcf_genotype_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2956: VCFContext context,
2957: integer[:, :, :] memory) except -1: # nogil
2958: cdef:
+2959: int value_index = 0
__pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0;
2960:
2961: # reset temporary buffer
+2962: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
2963:
+2964: while True:
while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) {
2965:
+2966: if stream.c == SLASH or stream.c == PIPE:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+2967: vcf_genotype_store(context, memory, value_index)
__pyx_t_3 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2967, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2967, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2967, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2967, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2967, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2967, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2967, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2967, __pyx_L1_error)
+2968: value_index += 1
__pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1);
+2969: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
2970:
+2971: elif stream.c == COLON or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+2972: stream.c == TAB or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; }
+2973: stream.c == LF or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; }
+2974: stream.c == CR or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; }
+2975: stream.c == 0:
__pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:;
+2976: vcf_genotype_store(context, memory, value_index)
__pyx_t_3 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2976, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2976, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2976, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2976, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2976, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2976, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2976, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(__pyx_v_context, __pyx_v_memory, __pyx_v_value_index); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2976, __pyx_L1_error)
+2977: break
goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break;
2978:
2979: else:
+2980: CharVector_append(&context.temp, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:;
2981:
+2982: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2982, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2982, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2982, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2982, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2982, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2982, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2982, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2982, __pyx_L1_error) } __pyx_L4_break:;
2983:
2984:
+2985: cdef int vcf_genotype_store(VCFContext context,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory, int __pyx_v_value_index) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_genotype_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory, int __pyx_v_value_index) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_genotype_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory, int __pyx_v_value_index) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_2vcf_genotype_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory, int __pyx_v_value_index) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_3vcf_genotype_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory, int __pyx_v_value_index) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_4vcf_genotype_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory, int __pyx_v_value_index) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_5vcf_genotype_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory, int __pyx_v_value_index) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_6vcf_genotype_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory, int __pyx_v_value_index) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_7vcf_genotype_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
2986: integer[:, :, :] memory,
2987: int value_index) except -1: # nogil
2988: cdef:
2989: int parsed
2990: long allele
2991:
+2992: if value_index >= memory.shape[2]:
__pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ }
2993: # more values than we've made room for, ignore
+2994: return 0
__pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0;
2995:
2996: # attempt to parse allele
+2997: parsed = vcf_strtol(&context.temp, context, &allele)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2997, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2997, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2997, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2997, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2997, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2997, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2997, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2997, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2;
2998:
2999: # store value
+3000: if parsed > 0:
__pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ }
+3001: memory[context.chunk_variant_index, context.sample_output_index, value_index] = allele
__pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_allele; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_allele; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_allele; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_allele; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_allele; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_allele; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_allele; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_allele;
3002:
3003:
+3004: cdef class VCFGenotypeACInt8Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser;
3005:
3006: cdef:
3007: np.int8_t[:, :, :] memory
3008:
+3009: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFGenotypeACInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFGenotypeACInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_23VCFGenotypeACInt8Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_23VCFGenotypeACInt8Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt8Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3010: kwargs['dtype'] = 'int8'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int8) < 0)) __PYX_ERR(0, 3010, __pyx_L1_error)
+3011: kwargs['fill'] = 0
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_0) < 0)) __PYX_ERR(0, 3011, __pyx_L1_error)
+3012: super(VCFGenotypeACInt8Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3013:
+3014: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFGenotypeACInt8Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt8Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3015: return vcf_genotype_ac_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3015, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3016:
+3017: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFGenotypeACInt8Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt8Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt8Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3018: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3019: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3019, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3019, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3020: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3020, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3021: self.memory[:] = 0
{ __pyx_t_5numpy_int8_t __pyx_temp_scalar = 0; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_int8_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3022:
3023:
+3024: cdef class VCFGenotypeACInt16Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser;
3025:
3026: cdef:
3027: np.int16_t[:, :, :] memory
3028:
+3029: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt16Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt16Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt16Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3030: kwargs['dtype'] = 'int16'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int16) < 0)) __PYX_ERR(0, 3030, __pyx_L1_error)
+3031: kwargs['fill'] = 0
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_0) < 0)) __PYX_ERR(0, 3031, __pyx_L1_error)
+3032: super(VCFGenotypeACInt16Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3033:
+3034: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt16Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt16Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3035: return vcf_genotype_ac_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3035, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3036:
+3037: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt16Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt16Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt16Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3038: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3039: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3039, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3039, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3040: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3040, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3041: self.memory[:] = 0
{ __pyx_t_5numpy_int16_t __pyx_temp_scalar = 0; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_int16_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3042:
3043:
+3044: cdef class VCFGenotypeACInt32Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser;
3045:
3046: cdef:
3047: np.int32_t[:, :, :] memory
3048:
+3049: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3050: kwargs['dtype'] = 'int32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int32) < 0)) __PYX_ERR(0, 3050, __pyx_L1_error)
+3051: kwargs['fill'] = 0
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_0) < 0)) __PYX_ERR(0, 3051, __pyx_L1_error)
+3052: super(VCFGenotypeACInt32Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3053:
+3054: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3055: return vcf_genotype_ac_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3055, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3056:
+3057: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3058: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3059: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3059, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3059, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3060: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3060, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3061: self.memory[:] = 0
{ __pyx_t_5numpy_int32_t __pyx_temp_scalar = 0; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3062:
3063:
+3064: cdef class VCFGenotypeACInt64Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser;
3065:
3066: cdef:
3067: np.int64_t[:, :, :] memory
3068:
+3069: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3070: kwargs['dtype'] = 'int64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int64) < 0)) __PYX_ERR(0, 3070, __pyx_L1_error)
+3071: kwargs['fill'] = 0
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_0) < 0)) __PYX_ERR(0, 3071, __pyx_L1_error)
+3072: super(VCFGenotypeACInt64Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3073:
+3074: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3075: return vcf_genotype_ac_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3075, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3076:
+3077: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFGenotypeACInt64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACInt64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACInt64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3078: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3079: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3079, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3079, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3080: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3080, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3081: self.memory[:] = 0
{ __pyx_t_5numpy_int64_t __pyx_temp_scalar = 0; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_int64_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3082:
3083:
+3084: cdef class VCFGenotypeACUInt8Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser;
3085:
3086: cdef:
3087: np.uint8_t[:, :, :] memory
3088:
+3089: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFGenotypeACUInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFGenotypeACUInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_24VCFGenotypeACUInt8Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_24VCFGenotypeACUInt8Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt8Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3090: kwargs['dtype'] = 'uint8'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0)) __PYX_ERR(0, 3090, __pyx_L1_error)
+3091: kwargs['fill'] = 0
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_0) < 0)) __PYX_ERR(0, 3091, __pyx_L1_error)
+3092: super(VCFGenotypeACUInt8Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3093:
+3094: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFGenotypeACUInt8Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt8Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3095: return vcf_genotype_ac_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3095, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3096:
+3097: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFGenotypeACUInt8Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt8Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt8Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3098: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3099: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3099, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3099, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3100: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3100, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3101: self.memory[:] = 0
{ __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3102:
3103:
+3104: cdef class VCFGenotypeACUInt16Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser;
3105:
3106: cdef:
3107: np.uint16_t[:, :, :] memory
3108:
+3109: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt16Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt16Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt16Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3110: kwargs['dtype'] = 'uint16'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint16) < 0)) __PYX_ERR(0, 3110, __pyx_L1_error)
+3111: kwargs['fill'] = 0
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_0) < 0)) __PYX_ERR(0, 3111, __pyx_L1_error)
+3112: super(VCFGenotypeACUInt16Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3113:
+3114: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt16Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt16Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3115: return vcf_genotype_ac_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3115, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3116:
+3117: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt16Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt16Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt16Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3118: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3119: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3119, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3119, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3120: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint16_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3120, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3121: self.memory[:] = 0
{ __pyx_t_5numpy_uint16_t __pyx_temp_scalar = 0; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_uint16_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3122:
3123:
+3124: cdef class VCFGenotypeACUInt32Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser;
3125:
3126: cdef:
3127: np.uint32_t[:, :, :] memory
3128:
+3129: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3130: kwargs['dtype'] = 'uint32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint32) < 0)) __PYX_ERR(0, 3130, __pyx_L1_error)
+3131: kwargs['fill'] = 0
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_0) < 0)) __PYX_ERR(0, 3131, __pyx_L1_error)
+3132: super(VCFGenotypeACUInt32Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3133:
+3134: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3135: return vcf_genotype_ac_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3135, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3136:
+3137: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3138: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3139: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3139, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3139, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3140: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3140, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3141: self.memory[:] = 0
{ __pyx_t_5numpy_uint32_t __pyx_temp_scalar = 0; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3142:
3143:
+3144: cdef class VCFGenotypeACUInt64Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser;
3145:
3146: cdef:
3147: np.uint64_t[:, :, :] memory
3148:
+3149: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3150: kwargs['dtype'] = 'uint64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint64) < 0)) __PYX_ERR(0, 3150, __pyx_L1_error)
+3151: kwargs['fill'] = 0
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_0) < 0)) __PYX_ERR(0, 3151, __pyx_L1_error)
+3152: super(VCFGenotypeACUInt64Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3153:
+3154: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3155: return vcf_genotype_ac_parse(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3155, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3156:
+3157: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_25VCFGenotypeACUInt64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFGenotypeACUInt64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFGenotypeACUInt64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3158: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3159: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3159, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3159, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3160: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3160, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3161: self.memory[:] = 0
{ __pyx_t_5numpy_uint64_t __pyx_temp_scalar = 0; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_uint64_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3162:
3163:
+3164: cdef int vcf_genotype_ac_parse(InputStreamBase stream,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_genotype_ac_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_genotype_ac_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_2vcf_genotype_ac_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_3vcf_genotype_ac_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_4vcf_genotype_ac_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_5vcf_genotype_ac_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_6vcf_genotype_ac_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_7vcf_genotype_ac_parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
3165: VCFContext context,
3166: integer[:, :, :] memory) except -1: # nogil
3167: # reset temporary buffer
+3168: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
3169:
+3170: while True:
while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) {
3171:
+3172: if stream.c == SLASH or stream.c == PIPE:
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_SLASH) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_PIPE) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+3173: vcf_genotype_ac_store(context, memory)
__pyx_t_3 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3173, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3173, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3173, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3173, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3173, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3173, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3173, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3173, __pyx_L1_error)
+3174: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
3175:
+3176: elif stream.c == COLON or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+3177: stream.c == TAB or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; }
+3178: stream.c == LF or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; }
+3179: stream.c == CR or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } /* … */ __pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; }
+3180: stream.c == 0:
__pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; /* … */ __pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:;
+3181: vcf_genotype_ac_store(context, memory)
__pyx_t_3 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3181, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3181, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3181, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3181, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3181, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3181, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3181, __pyx_L1_error) /* … */ __pyx_t_3 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(__pyx_v_context, __pyx_v_memory); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3181, __pyx_L1_error)
+3182: break
goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break;
3183:
3184: else:
+3185: CharVector_append(&context.temp, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:;
3186:
+3187: stream.advance()
__pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3187, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3187, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3187, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3187, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3187, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3187, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3187, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_3 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3187, __pyx_L1_error) } __pyx_L4_break:;
3188:
3189:
+3190: cdef int vcf_genotype_ac_store(VCFContext context,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_genotype_ac_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_genotype_ac_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_2vcf_genotype_ac_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_3vcf_genotype_ac_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_4vcf_genotype_ac_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_5vcf_genotype_ac_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_6vcf_genotype_ac_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_genotype_ac_store(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_allele; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_7vcf_genotype_ac_store", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_genotype_ac_store", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
3191: integer[:, :, :] memory) except -1: # nogil
3192: cdef:
3193: int parsed
3194: long allele
3195:
3196: # attempt to parse allele
+3197: parsed = vcf_strtol(&context.temp, context, &allele)
__pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3197, __pyx_L1_error) __pyx_v_parsed = __pyx_t_1; /* … */ __pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3197, __pyx_L1_error) __pyx_v_parsed = __pyx_t_1; /* … */ __pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3197, __pyx_L1_error) __pyx_v_parsed = __pyx_t_1; /* … */ __pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3197, __pyx_L1_error) __pyx_v_parsed = __pyx_t_1; /* … */ __pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3197, __pyx_L1_error) __pyx_v_parsed = __pyx_t_1; /* … */ __pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3197, __pyx_L1_error) __pyx_v_parsed = __pyx_t_1; /* … */ __pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3197, __pyx_L1_error) __pyx_v_parsed = __pyx_t_1; /* … */ __pyx_t_1 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_allele)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3197, __pyx_L1_error) __pyx_v_parsed = __pyx_t_1;
3198:
3199: # store value
+3200: if parsed > 0 and allele < memory.shape[2]:
__pyx_t_3 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_allele < (__pyx_v_memory.shape[2])) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_allele < (__pyx_v_memory.shape[2])) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_allele < (__pyx_v_memory.shape[2])) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_allele < (__pyx_v_memory.shape[2])) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_allele < (__pyx_v_memory.shape[2])) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_allele < (__pyx_v_memory.shape[2])) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_allele < (__pyx_v_memory.shape[2])) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_allele < (__pyx_v_memory.shape[2])) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* … */ }
+3201: memory[context.chunk_variant_index, context.sample_output_index, allele] += 1
__pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_context->sample_output_index; __pyx_t_6 = __pyx_v_allele; *((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_4 * __pyx_v_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_memory.strides[1]) ) + __pyx_t_6 * __pyx_v_memory.strides[2]) )) += 1; /* … */ __pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_context->sample_output_index; __pyx_t_6 = __pyx_v_allele; *((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_4 * __pyx_v_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_memory.strides[1]) ) + __pyx_t_6 * __pyx_v_memory.strides[2]) )) += 1; /* … */ __pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_context->sample_output_index; __pyx_t_6 = __pyx_v_allele; *((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_4 * __pyx_v_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_memory.strides[1]) ) + __pyx_t_6 * __pyx_v_memory.strides[2]) )) += 1; /* … */ __pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_context->sample_output_index; __pyx_t_6 = __pyx_v_allele; *((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_4 * __pyx_v_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_memory.strides[1]) ) + __pyx_t_6 * __pyx_v_memory.strides[2]) )) += 1; /* … */ __pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_context->sample_output_index; __pyx_t_6 = __pyx_v_allele; *((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_4 * __pyx_v_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_memory.strides[1]) ) + __pyx_t_6 * __pyx_v_memory.strides[2]) )) += 1; /* … */ __pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_context->sample_output_index; __pyx_t_6 = __pyx_v_allele; *((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_4 * __pyx_v_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_memory.strides[1]) ) + __pyx_t_6 * __pyx_v_memory.strides[2]) )) += 1; /* … */ __pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_context->sample_output_index; __pyx_t_6 = __pyx_v_allele; *((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_4 * __pyx_v_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_memory.strides[1]) ) + __pyx_t_6 * __pyx_v_memory.strides[2]) )) += 1; /* … */ __pyx_t_4 = __pyx_v_context->chunk_variant_index; __pyx_t_5 = __pyx_v_context->sample_output_index; __pyx_t_6 = __pyx_v_allele; *((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_4 * __pyx_v_memory.strides[0]) ) + __pyx_t_5 * __pyx_v_memory.strides[1]) ) + __pyx_t_6 * __pyx_v_memory.strides[2]) )) += 1;
3202:
3203:
+3204: cdef class VCFCallDataInt8Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser;
3205:
3206: cdef np.int8_t[:, :, :] memory
3207:
+3208: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_21VCFCallDataInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_21VCFCallDataInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_21VCFCallDataInt8Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_21VCFCallDataInt8Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt8Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3209: kwargs['dtype'] = 'int8'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int8) < 0)) __PYX_ERR(0, 3209, __pyx_L1_error)
+3210: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3211: super(VCFCallDataInt8Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3212:
+3213: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_21VCFCallDataInt8Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt8Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3214: return vcf_calldata_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3214, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3215:
+3216: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_21VCFCallDataInt8Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt8Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt8Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3217: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3218: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3218, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3218, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3219: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int8_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3219, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3220: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int8(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3220, __pyx_L1_error)
{
__pyx_t_5numpy_int8_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_int8_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
3221:
3222:
+3223: cdef class VCFCallDataInt16Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser;
3224:
3225: cdef np.int16_t[:, :, :] memory
3226:
+3227: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFCallDataInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFCallDataInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_22VCFCallDataInt16Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_22VCFCallDataInt16Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt16Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3228: kwargs['dtype'] = 'int16'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int16) < 0)) __PYX_ERR(0, 3228, __pyx_L1_error)
+3229: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3230: super(VCFCallDataInt16Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3231:
+3232: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFCallDataInt16Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt16Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3233: return vcf_calldata_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3233, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3234:
+3235: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFCallDataInt16Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt16Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt16Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3236: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3237: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3237, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3237, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3238: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int16_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3238, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3239: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int16(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3239, __pyx_L1_error)
{
__pyx_t_5numpy_int16_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_int16_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
3240:
3241:
+3242: cdef class VCFCallDataInt32Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser;
3243:
3244: cdef np.int32_t[:, :, :] memory
3245:
+3246: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFCallDataInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFCallDataInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_22VCFCallDataInt32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_22VCFCallDataInt32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3247: kwargs['dtype'] = 'int32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int32) < 0)) __PYX_ERR(0, 3247, __pyx_L1_error)
+3248: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3249: super(VCFCallDataInt32Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3250:
+3251: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFCallDataInt32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3252: return vcf_calldata_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3252, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3253:
+3254: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFCallDataInt32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3255: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3256: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3256, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3256, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3257: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3257, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3258: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3258, __pyx_L1_error)
{
__pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
3259:
3260:
+3261: cdef class VCFCallDataInt64Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser;
3262:
3263: cdef np.int64_t[:, :, :] memory
3264:
+3265: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFCallDataInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFCallDataInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_22VCFCallDataInt64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_22VCFCallDataInt64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3266: kwargs['dtype'] = 'int64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_int64) < 0)) __PYX_ERR(0, 3266, __pyx_L1_error)
+3267: kwargs.setdefault('fill', -1)
__pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_int_neg_1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3268: super(VCFCallDataInt64Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3269:
+3270: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFCallDataInt64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3271: return vcf_calldata_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3271, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3272:
+3273: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFCallDataInt64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataInt64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataInt64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3274: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3275: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3275, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3275, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3276: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3276, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3277: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3277, __pyx_L1_error)
{
__pyx_t_5numpy_int64_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_int64_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
3278:
3279:
+3280: cdef class VCFCallDataUInt8Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser;
3281:
3282: cdef np.uint8_t[:, :, :] memory
3283:
+3284: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFCallDataUInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_22VCFCallDataUInt8Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_22VCFCallDataUInt8Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_22VCFCallDataUInt8Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt8Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3285: kwargs['dtype'] = 'uint8'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0)) __PYX_ERR(0, 3285, __pyx_L1_error)
+3286: kwargs.setdefault('fill', IU8.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3287: super(VCFCallDataUInt8Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3288:
+3289: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFCallDataUInt8Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt8Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3290: return vcf_calldata_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3290, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3291:
+3292: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_22VCFCallDataUInt8Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt8Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt8Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3293: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3294: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3294, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3294, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3295: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3295, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3296: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint8(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3296, __pyx_L1_error)
{
__pyx_t_5numpy_uint8_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
3297:
3298:
+3299: cdef class VCFCallDataUInt16Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser;
3300:
3301: cdef np.uint16_t[:, :, :] memory
3302:
+3303: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataUInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataUInt16Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataUInt16Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataUInt16Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt16Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3304: kwargs['dtype'] = 'uint16'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint16) < 0)) __PYX_ERR(0, 3304, __pyx_L1_error)
+3305: kwargs.setdefault('fill', IU16.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3306: super(VCFCallDataUInt16Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3307:
+3308: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataUInt16Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt16Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3309: return vcf_calldata_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3309, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3310:
+3311: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataUInt16Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt16Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt16Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3312: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3313: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3313, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3313, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3314: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint16_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3314, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3315: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint16(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3315, __pyx_L1_error)
{
__pyx_t_5numpy_uint16_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_uint16_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
3316:
3317:
+3318: cdef class VCFCallDataUInt32Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser;
3319:
3320: cdef np.uint32_t[:, :, :] memory
3321:
+3322: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataUInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataUInt32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataUInt32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataUInt32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3323: kwargs['dtype'] = 'uint32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint32) < 0)) __PYX_ERR(0, 3323, __pyx_L1_error)
+3324: kwargs.setdefault('fill', IU32.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3325: super(VCFCallDataUInt32Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3326:
+3327: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataUInt32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3328: return vcf_calldata_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3328, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3329:
+3330: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataUInt32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3331: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3332: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3332, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3332, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3333: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3333, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3334: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint32(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3334, __pyx_L1_error)
{
__pyx_t_5numpy_uint32_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
3335:
3336:
+3337: cdef class VCFCallDataUInt64Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser;
3338:
3339: cdef np.uint64_t[:, :, :] memory
3340:
+3341: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataUInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataUInt64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataUInt64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataUInt64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3342: kwargs['dtype'] = 'uint64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_uint64) < 0)) __PYX_ERR(0, 3342, __pyx_L1_error)
+3343: kwargs.setdefault('fill', IU64.max)
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IU64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3344: super(VCFCallDataUInt64Parser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3345:
+3346: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataUInt64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3347: return vcf_calldata_parse_integer(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3347, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3348:
+3349: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataUInt64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataUInt64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataUInt64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3350: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3351: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3351, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3351, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3352: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3352, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3353: self.memory[:] = self.fill
__pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3353, __pyx_L1_error)
{
__pyx_t_5numpy_uint64_t __pyx_temp_scalar = __pyx_t_6;
{
Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0];
Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0];
char *__pyx_temp_pointer_0;
Py_ssize_t __pyx_temp_idx_0;
Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1];
Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1];
char *__pyx_temp_pointer_1;
Py_ssize_t __pyx_temp_idx_1;
Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2];
Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2];
char *__pyx_temp_pointer_2;
Py_ssize_t __pyx_temp_idx_2;
__pyx_temp_pointer_0 = __pyx_v_self->memory.data;
for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
__pyx_temp_pointer_1 = __pyx_temp_pointer_0;
for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
__pyx_temp_pointer_2 = __pyx_temp_pointer_1;
for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) {
*((__pyx_t_5numpy_uint64_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar;
__pyx_temp_pointer_2 += __pyx_temp_stride_2;
}
__pyx_temp_pointer_1 += __pyx_temp_stride_1;
}
__pyx_temp_pointer_0 += __pyx_temp_stride_0;
}
}
}
3354:
3355:
+3356: cdef class VCFCallDataFloat32Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser;
3357:
3358: cdef np.float32_t[:, :, :] memory
3359:
+3360: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFCallDataFloat32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFCallDataFloat32Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_24VCFCallDataFloat32Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_24VCFCallDataFloat32Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataFloat32Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3361: kwargs['dtype'] = 'float32'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_float32) < 0)) __PYX_ERR(0, 3361, __pyx_L1_error)
+3362: kwargs.setdefault('fill', NAN)
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_5allel_3opt_11io_vcf_read_NAN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3363: super(VCFCallDataFloat32Parser, self).__init__(*args, **kwargs)
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3364:
+3365: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFCallDataFloat32Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataFloat32Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3366: return vcf_calldata_parse_floating(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_floating(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3366, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3367:
+3368: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFCallDataFloat32Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat32Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataFloat32Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3369: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3370: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3370, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3370, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3371: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float32_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3371, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3372: self.memory[:] = self.fill
__pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3372, __pyx_L1_error) { __pyx_t_5numpy_float32_t __pyx_temp_scalar = __pyx_t_6; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_float32_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3373:
3374:
+3375: cdef class VCFCallDataFloat64Parser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser;
3376:
3377: cdef np.float64_t[:, :, :] memory
3378:
+3379: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFCallDataFloat64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_24VCFCallDataFloat64Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_24VCFCallDataFloat64Parser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_24VCFCallDataFloat64Parser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataFloat64Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3380: kwargs['dtype'] = 'float64'
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_n_s_float64) < 0)) __PYX_ERR(0, 3380, __pyx_L1_error)
+3381: kwargs.setdefault('fill', NAN)
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_5allel_3opt_11io_vcf_read_NAN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_fill, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3382: super(VCFCallDataFloat64Parser, self).__init__(*args, **kwargs)
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3383:
+3384: cdef int parse(self, InputStreamBase stream, VCFContext context) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFCallDataFloat64Parser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataFloat64Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3385: return vcf_calldata_parse_floating(stream, context, self.memory)
__pyx_t_1 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_floating(__pyx_v_stream, __pyx_v_context, __pyx_v_self->memory); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 3385, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0;
3386:
+3387: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_24VCFCallDataFloat64Parser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataFloat64Parser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataFloat64Parser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3388: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3389: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3389, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3389, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3390: self.memory = self.values
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_self->__pyx_base.values)); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3390, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
+3391: self.memory[:] = self.fill
__pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_self->__pyx_base.fill); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3391, __pyx_L1_error) { __pyx_t_5numpy_float64_t __pyx_temp_scalar = __pyx_t_6; { Py_ssize_t __pyx_temp_extent_0 = __pyx_v_self->memory.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_v_self->memory.strides[0]; char *__pyx_temp_pointer_0; Py_ssize_t __pyx_temp_idx_0; Py_ssize_t __pyx_temp_extent_1 = __pyx_v_self->memory.shape[1]; Py_ssize_t __pyx_temp_stride_1 = __pyx_v_self->memory.strides[1]; char *__pyx_temp_pointer_1; Py_ssize_t __pyx_temp_idx_1; Py_ssize_t __pyx_temp_extent_2 = __pyx_v_self->memory.shape[2]; Py_ssize_t __pyx_temp_stride_2 = __pyx_v_self->memory.strides[2]; char *__pyx_temp_pointer_2; Py_ssize_t __pyx_temp_idx_2; __pyx_temp_pointer_0 = __pyx_v_self->memory.data; for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) { __pyx_temp_pointer_1 = __pyx_temp_pointer_0; for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) { __pyx_temp_pointer_2 = __pyx_temp_pointer_1; for (__pyx_temp_idx_2 = 0; __pyx_temp_idx_2 < __pyx_temp_extent_2; __pyx_temp_idx_2++) { *((__pyx_t_5numpy_float64_t *) __pyx_temp_pointer_2) = __pyx_temp_scalar; __pyx_temp_pointer_2 += __pyx_temp_stride_2; } __pyx_temp_pointer_1 += __pyx_temp_stride_1; } __pyx_temp_pointer_0 += __pyx_temp_stride_0; } } }
3392:
3393:
+3394: cdef int vcf_calldata_parse_integer(InputStreamBase stream,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_calldata_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_calldata_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_2vcf_calldata_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_3vcf_calldata_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_4vcf_calldata_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_5vcf_calldata_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_6vcf_calldata_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_7vcf_calldata_parse_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
3395: VCFContext context,
3396: integer[:, :, :] memory) except -1: # nogil
3397:
3398: cdef:
+3399: int value_index = 0
__pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0;
3400:
3401: # reset temporary buffer
+3402: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
3403:
+3404: while True:
while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) { /* … */ while (1) {
3405:
+3406: if stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+3407: vcf_calldata_store_integer(context, value_index, memory)
__pyx_t_2 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3407, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3407, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3407, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3407, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3407, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3407, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3407, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3407, __pyx_L1_error)
+3408: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
+3409: value_index += 1
__pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1);
3410:
+3411: elif stream.c == COLON or \
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+3412: stream.c == TAB or \
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; }
+3413: stream.c == LF or \
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; }
+3414: stream.c == CR or \
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; }
+3415: stream.c == 0:
__pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:;
+3416: vcf_calldata_store_integer(context, value_index, memory)
__pyx_t_2 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3416, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3416, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3416, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3416, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3416, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3416, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3416, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3416, __pyx_L1_error)
+3417: break
goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break; /* … */ goto __pyx_L4_break;
3418:
3419: else:
+3420: CharVector_append(&context.temp, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:;
3421:
+3422: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3422, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3422, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3422, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3422, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3422, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3422, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3422, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3422, __pyx_L1_error) } __pyx_L4_break:;
3423:
3424:
+3425: cdef int vcf_calldata_store_integer(VCFContext context,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_calldata_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_calldata_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_2__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_2vcf_calldata_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_3__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_3vcf_calldata_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_4__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_4vcf_calldata_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_5__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_5vcf_calldata_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_6__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_6vcf_calldata_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_7__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_integer(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; long __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_7vcf_calldata_store_integer", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
3426: int value_index,
3427: integer[:, :, :] memory) except -1: # nogil
3428: cdef:
3429: int parsed
3430: long value
3431:
+3432: if value_index >= memory.shape[2]:
__pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ }
3433: # more values than we have room for, ignore
+3434: return 0
__pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0;
3435:
+3436: parsed = vcf_strtol(&context.temp, context, &value)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3436, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3436, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3436, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3436, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3436, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3436, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3436, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3436, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2;
3437:
3438: # store value
+3439: if parsed > 0:
__pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ }
+3440: memory[context.chunk_variant_index, context.sample_output_index, value_index] = value
__pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value;
3441:
3442:
+3443: cdef int vcf_calldata_parse_floating(InputStreamBase stream,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_floating(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_calldata_parse_floating", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_floating", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_parse_floating(struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_value_index; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_calldata_parse_floating", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_parse_floating", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
3444: VCFContext context,
3445: floating[:, :, :] memory) except -1: # nogil
3446:
3447: cdef:
+3448: int value_index = 0
__pyx_v_value_index = 0; /* … */ __pyx_v_value_index = 0;
3449:
3450: # reset temporary buffer
+3451: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
3452:
+3453: while True:
while (1) { /* … */ while (1) {
3454:
+3455: if stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; } /* … */ __pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+3456: vcf_calldata_store_floating(context, value_index, memory)
__pyx_t_2 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_floating(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3456, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_floating(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3456, __pyx_L1_error)
+3457: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp)); /* … */ __pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
+3458: value_index += 1
__pyx_v_value_index = (__pyx_v_value_index + 1); /* … */ __pyx_v_value_index = (__pyx_v_value_index + 1);
3459:
+3460: elif stream.c == COLON or \
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+3461: stream.c == TAB or \
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; }
+3462: stream.c == LF or \
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; }
+3463: stream.c == CR or \
__pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } /* … */ __pyx_t_3 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L6_bool_binop_done; }
+3464: stream.c == 0:
__pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:; /* … */ __pyx_t_3 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L6_bool_binop_done:;
+3465: vcf_calldata_store_floating(context, value_index, memory)
__pyx_t_2 = __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_floating(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3465, __pyx_L1_error) /* … */ __pyx_t_2 = __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_floating(__pyx_v_context, __pyx_v_value_index, __pyx_v_memory); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3465, __pyx_L1_error)
+3466: break
goto __pyx_L4_break; /* … */ goto __pyx_L4_break;
3467:
3468: else:
+3469: CharVector_append(&context.temp, stream.c)
/*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:; /* … */ /*else*/ { __pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c); } __pyx_L5:;
3470:
+3471: stream.advance()
__pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3471, __pyx_L1_error) } __pyx_L4_break:; /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3471, __pyx_L1_error) } __pyx_L4_break:;
3472:
3473:
+3474: cdef int vcf_calldata_store_floating(VCFContext context,
static int __pyx_fuse_0__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_floating(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; double __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_0vcf_calldata_store_floating", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_floating", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_fuse_1__pyx_f_5allel_3opt_11io_vcf_read_vcf_calldata_store_floating(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, int __pyx_v_value_index, __Pyx_memviewslice __pyx_v_memory) { int __pyx_v_parsed; double __pyx_v_value; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_fuse_1vcf_calldata_store_floating", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_calldata_store_floating", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
3475: int value_index,
3476: floating[:, :, :] memory) except -1: # nogil
3477: cdef:
3478: int parsed
3479: double value
3480:
+3481: if value_index >= memory.shape[2]:
__pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_value_index >= (__pyx_v_memory.shape[2])) != 0); if (__pyx_t_1) { /* … */ }
3482: # more values than we have room for, ignore
+3483: return 0
__pyx_r = 0; goto __pyx_L0; /* … */ __pyx_r = 0; goto __pyx_L0;
3484:
+3485: parsed = vcf_strtod(&context.temp, context, &value)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtod((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3485, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2; /* … */ __pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtod((&__pyx_v_context->temp), __pyx_v_context, (&__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3485, __pyx_L1_error) __pyx_v_parsed = __pyx_t_2;
3486:
3487: # store value
+3488: if parsed > 0:
__pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ } /* … */ __pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ }
+3489: memory[context.chunk_variant_index, context.sample_output_index, value_index] = value
__pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_float32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value; /* … */ __pyx_t_3 = __pyx_v_context->chunk_variant_index; __pyx_t_4 = __pyx_v_context->sample_output_index; __pyx_t_5 = __pyx_v_value_index; *((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_memory.data + __pyx_t_3 * __pyx_v_memory.strides[0]) ) + __pyx_t_4 * __pyx_v_memory.strides[1]) ) + __pyx_t_5 * __pyx_v_memory.strides[2]) )) = __pyx_v_value;
3490:
3491:
+3492: cdef class VCFCallDataStringParser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataStringParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataStringParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataStringParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataStringParser;
3493:
3494: cdef np.uint8_t[:] memory
3495:
+3496: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataStringParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataStringParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataStringParser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataStringParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataStringParser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataStringParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3497: kwargs['dtype'] = check_string_dtype(kwargs.get('dtype'))
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_string_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_dtype, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3497, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3497, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_t_1) < 0)) __PYX_ERR(0, 3497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3498: super(VCFCallDataStringParser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataStringParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataStringParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataStringParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3499:
+3500: cdef int parse(self,
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataStringParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataStringParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_value_index; int __pyx_v_memory_offset; int __pyx_v_memory_index; int __pyx_v_chars_stored; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataStringParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
3501: InputStreamBase stream,
3502: VCFContext context) except -1: # nogil
3503: cdef:
+3504: int value_index = 0
__pyx_v_value_index = 0;
3505: # index into memory view
3506: int memory_offset, memory_index
3507: # number of characters read into current value
+3508: int chars_stored = 0
__pyx_v_chars_stored = 0;
3509:
3510: # initialise memory index
3511: memory_offset = ((context.chunk_variant_index *
3512: self.n_samples_out *
3513: self.number *
+3514: self.itemsize) +
/* "allel/opt/io_vcf_read.pyx":3514 * self.n_samples_out * * self.number * * self.itemsize) + # <<<<<<<<<<<<<< * (context.sample_output_index * * self.number * */ __pyx_v_memory_offset = ((((__pyx_v_context->chunk_variant_index * __pyx_v_self->__pyx_base.n_samples_out) * __pyx_v_self->__pyx_base.number) * __pyx_v_self->__pyx_base.itemsize) + ((__pyx_v_context->sample_output_index * __pyx_v_self->__pyx_base.number) * __pyx_v_self->__pyx_base.itemsize));
3515: (context.sample_output_index *
3516: self.number *
3517: self.itemsize))
+3518: memory_index = memory_offset
__pyx_v_memory_index = __pyx_v_memory_offset;
3519:
3520: # read characters until tab
+3521: while True:
while (1) {
3522:
+3523: if stream.c == TAB or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+3524: stream.c == COLON or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+3525: stream.c == CR or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+3526: stream.c == LF or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+3527: stream.c == 0:
__pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:;
+3528: return 1
__pyx_r = 1; goto __pyx_L0;
3529:
+3530: elif stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
3531: # advance value index
+3532: value_index += 1
__pyx_v_value_index = (__pyx_v_value_index + 1);
3533: # set memory index to beginning of next item
+3534: memory_index = memory_offset + (value_index * self.itemsize)
__pyx_v_memory_index = (__pyx_v_memory_offset + (__pyx_v_value_index * __pyx_v_self->__pyx_base.itemsize));
3535: # reset chars stored
+3536: chars_stored = 0
__pyx_v_chars_stored = 0;
3537:
+3538: elif chars_stored < self.itemsize and value_index < self.number:
__pyx_t_2 = ((__pyx_v_chars_stored < __pyx_v_self->__pyx_base.itemsize) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } __pyx_t_2 = ((__pyx_v_value_index < __pyx_v_self->__pyx_base.number) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* … */ } __pyx_L5:;
3539: # store value
+3540: self.memory[memory_index] = stream.c
__pyx_t_3 = __pyx_v_stream->c; __pyx_t_4 = __pyx_v_memory_index; *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_self->memory.data + __pyx_t_4 * __pyx_v_self->memory.strides[0]) )) = __pyx_t_3;
3541: # advance memory index
+3542: memory_index += 1
__pyx_v_memory_index = (__pyx_v_memory_index + 1);
3543: # advance number of characters stored
+3544: chars_stored += 1
__pyx_v_chars_stored = (__pyx_v_chars_stored + 1);
3545:
3546: # advance input stream
+3547: stream.advance()
__pyx_t_5 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 3547, __pyx_L1_error) }
3548:
+3549: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataStringParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataStringParser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataStringParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3550: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3551: self.values = np.zeros(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3551, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3551, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3552: self.memory = self.values.reshape(-1).view('u1')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_tuple__91 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 3552, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_XDEC_MEMVIEW(&__pyx_v_self->memory, 0); __pyx_v_self->memory = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; __pyx_tuple__92 = PyTuple_Pack(1, __pyx_n_s_u1); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 3552, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__92); __Pyx_GIVEREF(__pyx_tuple__92);
3553:
+3554: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataStringParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataStringParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_23VCFCallDataStringParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_values = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataStringParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_values); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_23VCFCallDataStringParser_make_chunk { int __pyx_n; PyObject *limit; };
+3555: if PY2:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L3; }
+3556: field = 'calldata/' + self.key
__pyx_t_1 = PyNumber_Add(__pyx_kp_s_calldata_2, __pyx_v_self->__pyx_base.key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0;
3557: else:
+3558: field = 'calldata/' + str(self.key, 'ascii')
/*else*/ { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.key); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.key); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_kp_s_calldata_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:;
+3559: values = self.values[:limit]
__pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->__pyx_base.values), 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_values = __pyx_t_1; __pyx_t_1 = 0;
+3560: if self.number == 1:
__pyx_t_2 = ((__pyx_v_self->__pyx_base.number == 1) != 0); if (__pyx_t_2) { /* … */ }
+3561: values = values.squeeze(axis=2)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 3561, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); __pyx_t_4 = 0;
+3562: chunk[field] = values
if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_v_values) < 0)) __PYX_ERR(0, 3562, __pyx_L1_error)
3563:
3564:
+3565: cdef class VCFCallDataObjectParser(VCFCallDataParserBase):
struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser { struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; __Pyx_memviewslice memory; }; /* … */ struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser { struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataParserBase __pyx_base; }; static struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser *__pyx_vtabptr_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser;
3566:
3567: cdef np.uint8_t[:] memory
3568:
+3569: def __init__(self, *args, **kwargs):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_23VCFCallDataObjectParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataObjectParser___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_23VCFCallDataObjectParser___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataObjectParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3570: kwargs['dtype'] = np.dtype('object')
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_s_dtype, __pyx_t_1) < 0)) __PYX_ERR(0, 3570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__93 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 3570, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93);
+3571: super(VCFCallDataObjectParser, self).__init__(*args, **kwargs)
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3572:
+3573: cdef int parse(self,
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataObjectParser_parse(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser *__pyx_v_self, struct __pyx_obj_5allel_3opt_11io_vcf_read_InputStreamBase *__pyx_v_stream, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_value_index; PyObject *__pyx_v_v = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataObjectParser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v); __Pyx_RefNannyFinishContext(); return __pyx_r; }
3574: InputStreamBase stream,
3575: VCFContext context) except -1: # nogil
3576: cdef:
+3577: int value_index = 0
__pyx_v_value_index = 0;
3578:
+3579: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
3580:
3581: # read characters until tab
+3582: while True:
while (1) {
3583:
+3584: if stream.c == TAB or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_TAB) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* … */ if (__pyx_t_1) { /* … */ }
+3585: stream.c == COLON or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COLON) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+3586: stream.c == CR or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_CR) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+3587: stream.c == LF or \
__pyx_t_2 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_LF) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; }
+3588: stream.c == 0:
__pyx_t_2 = ((__pyx_v_stream->c == 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:;
+3589: if value_index < self.number and context.temp.size > 0:
__pyx_t_2 = ((__pyx_v_value_index < __pyx_v_self->__pyx_base.number) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L12_bool_binop_done; } __pyx_t_2 = ((__pyx_v_context->temp.size > 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L12_bool_binop_done:; if (__pyx_t_1) { /* … */ }
3590: # with gil:
+3591: v = CharVector_to_pystr(&context.temp)
__pyx_t_3 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->temp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0;
+3592: self.values[context.chunk_variant_index, context.sample_output_index, value_index] = v
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_context->chunk_variant_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_context->sample_output_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_value_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_t_6, __pyx_v_v) < 0)) __PYX_ERR(0, 3592, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+3593: break
goto __pyx_L4_break;
3594:
+3595: elif stream.c == COMMA:
__pyx_t_1 = ((__pyx_v_stream->c == __pyx_v_5allel_3opt_11io_vcf_read_COMMA) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L5; }
+3596: if value_index < self.number and context.temp.size > 0:
__pyx_t_2 = ((__pyx_v_value_index < __pyx_v_self->__pyx_base.number) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L15_bool_binop_done; } __pyx_t_2 = ((__pyx_v_context->temp.size > 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L15_bool_binop_done:; if (__pyx_t_1) { /* … */ }
3597: # with gil:
+3598: v = CharVector_to_pystr(&context.temp)
__pyx_t_6 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pystr((&__pyx_v_context->temp)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0;
+3599: self.values[context.chunk_variant_index, context.sample_output_index, value_index] = v
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_context->chunk_variant_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_context->sample_output_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_value_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_t_3, __pyx_v_v) < 0)) __PYX_ERR(0, 3599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+3600: CharVector_clear(&context.temp)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_clear((&__pyx_v_context->temp));
3601: # advance value index
+3602: value_index += 1
__pyx_v_value_index = (__pyx_v_value_index + 1);
3603:
+3604: elif value_index < self.number:
__pyx_t_1 = ((__pyx_v_value_index < __pyx_v_self->__pyx_base.number) != 0); if (__pyx_t_1) { /* … */ } __pyx_L5:;
+3605: CharVector_append(&context.temp, stream.c)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_append((&__pyx_v_context->temp), __pyx_v_stream->c);
3606:
3607: # advance input stream
+3608: stream.advance()
__pyx_t_7 = ((struct __pyx_vtabstruct_5allel_3opt_11io_vcf_read_InputStreamBase *)__pyx_v_stream->__pyx_vtab)->advance(__pyx_v_stream); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 3608, __pyx_L1_error) } __pyx_L4_break:;
3609:
+3610: cdef int malloc_chunk(self) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataObjectParser_malloc_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("malloc_chunk", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataObjectParser.malloc_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+3611: shape = (self.chunk_length, self.n_samples_out, self.number)
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.chunk_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.n_samples_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0;
+3612: self.values = np.empty(shape, dtype=self.dtype)
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)__pyx_v_self->__pyx_base.dtype)) < 0) __PYX_ERR(0, 3612, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3612, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.values); __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.values)); __pyx_v_self->__pyx_base.values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
+3613: self.values.fill('')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.values), __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 3613, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__94); __Pyx_GIVEREF(__pyx_tuple__94);
3614:
+3615: cdef int make_chunk(self, chunk, limit=None) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_23VCFCallDataObjectParser_make_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFCallDataObjectParser *__pyx_v_self, PyObject *__pyx_v_chunk, struct __pyx_opt_args_5allel_3opt_11io_vcf_read_23VCFCallDataObjectParser_make_chunk *__pyx_optional_args) { PyObject *__pyx_v_limit = ((PyObject *)Py_None); PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_values = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_chunk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_limit = __pyx_optional_args->limit; } } /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.VCFCallDataObjectParser.make_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_values); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_opt_args_5allel_3opt_11io_vcf_read_23VCFCallDataObjectParser_make_chunk { int __pyx_n; PyObject *limit; };
+3616: if PY2:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3616, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L3; }
+3617: field = 'calldata/' + self.key
__pyx_t_1 = PyNumber_Add(__pyx_kp_s_calldata_2, __pyx_v_self->__pyx_base.key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0;
3618: else:
+3619: field = 'calldata/' + str(self.key, 'ascii')
/*else*/ { __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base.key); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.key); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_kp_s_calldata_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_field = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:;
+3620: values = self.values[:limit]
__pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->__pyx_base.values), 0, 0, NULL, &__pyx_v_limit, NULL, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_values = __pyx_t_1; __pyx_t_1 = 0;
+3621: if self.number == 1:
__pyx_t_2 = ((__pyx_v_self->__pyx_base.number == 1) != 0); if (__pyx_t_2) { /* … */ }
+3622: values = values.squeeze(axis=2)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 3622, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4); __pyx_t_4 = 0;
+3623: chunk[field] = values
if (unlikely(PyObject_SetItem(__pyx_v_chunk, __pyx_v_field, __pyx_v_values) < 0)) __PYX_ERR(0, 3623, __pyx_L1_error)
3624:
3625:
3626: ##########################################################################################
3627: # Low-level VCF value parsing functions
3628:
3629:
+3630: cdef int vcf_strtol(CharVector* value, VCFContext context, long* l) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtol(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_value, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, long *__pyx_v_l) { char *__pyx_v_str_end; int __pyx_v_parsed; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vcf_strtol", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_strtol", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
3631: cdef:
3632: char* str_end
3633: int parsed
3634:
+3635: if value.size == 0:
__pyx_t_1 = ((__pyx_v_value->size == 0) != 0); if (__pyx_t_1) { /* … */ }
3636: # not strictly kosher, treat as missing value
+3637: return 0
__pyx_r = 0; goto __pyx_L0;
3638:
+3639: if value.size == 1 and value.data[0] == PERIOD:
__pyx_t_2 = ((__pyx_v_value->size == 1) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = (((__pyx_v_value->data[0]) == __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* … */ }
3640: # explicit missing value
+3641: return 0
__pyx_r = 0; goto __pyx_L0;
3642:
3643: # terminate string
+3644: CharVector_terminate(value)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_terminate(__pyx_v_value);
3645:
3646: # do parsing
+3647: l[0] = strtol(value.data, &str_end, 10)
(__pyx_v_l[0]) = strtol(__pyx_v_value->data, (&__pyx_v_str_end), 10);
3648:
3649: # check success
+3650: parsed = str_end - value.data
__pyx_v_parsed = (__pyx_v_str_end - __pyx_v_value->data);
3651:
3652: # check success
+3653: if value.size - 1 == parsed: # account for terminating null byte
__pyx_t_1 = (((__pyx_v_value->size - 1) == __pyx_v_parsed) != 0); if (__pyx_t_1) { /* … */ }
+3654: return parsed
__pyx_r = __pyx_v_parsed; goto __pyx_L0;
3655:
+3656: elif parsed > 0:
__pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ }
3657: # with gil:
+3658: warn('not all characters parsed for integer value', context)
__pyx_t_3 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_not_all_characters_parsed_for_in, __pyx_v_context); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3658, __pyx_L1_error)
+3659: return parsed
__pyx_r = __pyx_v_parsed; goto __pyx_L0;
3660:
3661: else:
3662: # with gil:
+3663: warn('error parsing integer value', context)
/*else*/ { __pyx_t_3 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_error_parsing_integer_value, __pyx_v_context); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3663, __pyx_L1_error)
+3664: return 0
__pyx_r = 0; goto __pyx_L0; }
3665:
3666:
+3667: cdef int vcf_strtod(CharVector* value, VCFContext context, double* d) except -1: # nogil
static int __pyx_f_5allel_3opt_11io_vcf_read_vcf_strtod(struct __pyx_t_5allel_3opt_11io_vcf_read_CharVector *__pyx_v_value, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context, double *__pyx_v_d) { char *__pyx_v_str_end; int __pyx_v_parsed; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vcf_strtod", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.vcf_strtod", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
3668: cdef:
3669: char* str_end
3670: int parsed
3671:
+3672: if value.size == 0:
__pyx_t_1 = ((__pyx_v_value->size == 0) != 0); if (__pyx_t_1) { /* … */ }
3673: # not strictly kosher, treat as missing value
+3674: return 0
__pyx_r = 0; goto __pyx_L0;
3675:
+3676: if value.size == 1 and value.data[0] == PERIOD:
__pyx_t_2 = ((__pyx_v_value->size == 1) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = (((__pyx_v_value->data[0]) == __pyx_v_5allel_3opt_11io_vcf_read_PERIOD) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* … */ }
3677: # explicit missing value
+3678: return 0
__pyx_r = 0; goto __pyx_L0;
3679:
3680: # terminate string
+3681: CharVector_terminate(value)
__pyx_f_5allel_3opt_11io_vcf_read_CharVector_terminate(__pyx_v_value);
3682:
3683: # do parsing
+3684: d[0] = strtod(value.data, &str_end)
(__pyx_v_d[0]) = strtod(__pyx_v_value->data, (&__pyx_v_str_end));
3685:
3686: # check success
+3687: parsed = str_end - value.data
__pyx_v_parsed = (__pyx_v_str_end - __pyx_v_value->data);
3688:
3689: # check success
+3690: if value.size - 1 == parsed: # account for terminating null byte
__pyx_t_1 = (((__pyx_v_value->size - 1) == __pyx_v_parsed) != 0); if (__pyx_t_1) { /* … */ }
+3691: return parsed
__pyx_r = __pyx_v_parsed; goto __pyx_L0;
3692:
+3693: elif parsed > 0:
__pyx_t_1 = ((__pyx_v_parsed > 0) != 0); if (__pyx_t_1) { /* … */ }
3694: # with gil:
+3695: warn('not all characters parsed for floating point value', context)
__pyx_t_3 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_not_all_characters_parsed_for_fl, __pyx_v_context); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3695, __pyx_L1_error)
+3696: return parsed
__pyx_r = __pyx_v_parsed; goto __pyx_L0;
3697:
3698: else:
3699: # with gil:
+3700: warn('error parsing floating point value', context)
/*else*/ { __pyx_t_3 = __pyx_f_5allel_3opt_11io_vcf_read_warn(__pyx_kp_s_error_parsing_floating_point_val, __pyx_v_context); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 3700, __pyx_L1_error)
+3701: return 0
__pyx_r = 0; goto __pyx_L0; }
3702:
3703:
3704: ##########################################################################################
3705: # LOGGING
3706:
3707:
+3708: vcf_state_labels = [
__pyx_t_1 = PyList_New(12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_CHROM); __Pyx_GIVEREF(__pyx_n_s_CHROM); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_CHROM); __Pyx_INCREF(__pyx_n_s_POS); __Pyx_GIVEREF(__pyx_n_s_POS); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_POS); __Pyx_INCREF(__pyx_n_s_ID); __Pyx_GIVEREF(__pyx_n_s_ID); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_ID); __Pyx_INCREF(__pyx_n_s_REF); __Pyx_GIVEREF(__pyx_n_s_REF); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_REF); __Pyx_INCREF(__pyx_n_s_ALT); __Pyx_GIVEREF(__pyx_n_s_ALT); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_ALT); __Pyx_INCREF(__pyx_n_s_QUAL); __Pyx_GIVEREF(__pyx_n_s_QUAL); PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_QUAL); __Pyx_INCREF(__pyx_n_s_FILTER); __Pyx_GIVEREF(__pyx_n_s_FILTER); PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_FILTER); __Pyx_INCREF(__pyx_n_s_INFO); __Pyx_GIVEREF(__pyx_n_s_INFO); PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_INFO); __Pyx_INCREF(__pyx_n_s_FORMAT); __Pyx_GIVEREF(__pyx_n_s_FORMAT); PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_FORMAT); __Pyx_INCREF(__pyx_n_s_CALLDATA); __Pyx_GIVEREF(__pyx_n_s_CALLDATA); PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_CALLDATA); __Pyx_INCREF(__pyx_n_s_EOL); __Pyx_GIVEREF(__pyx_n_s_EOL); PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_EOL); __Pyx_INCREF(__pyx_n_s_EOF); __Pyx_GIVEREF(__pyx_n_s_EOF); PyList_SET_ITEM(__pyx_t_1, 11, __pyx_n_s_EOF); if (PyDict_SetItem(__pyx_d, __pyx_n_s_vcf_state_labels, __pyx_t_1) < 0) __PYX_ERR(0, 3708, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3709: 'CHROM',
3710: 'POS',
3711: 'ID',
3712: 'REF',
3713: 'ALT',
3714: 'QUAL',
3715: 'FILTER',
3716: 'INFO',
3717: 'FORMAT',
3718: 'CALLDATA',
3719: 'EOL',
3720: 'EOF'
3721: ]
3722:
3723:
+3724: cdef int warn(message, VCFContext context) except -1:
static int __pyx_f_5allel_3opt_11io_vcf_read_warn(PyObject *__pyx_v_message, struct __pyx_obj_5allel_3opt_11io_vcf_read_VCFContext *__pyx_v_context) { int __pyx_v_format_index; PyObject *__pyx_v_chrom = NULL; PyObject *__pyx_v_sample = NULL; PyObject *__pyx_v_format = NULL; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("warn", 0); __Pyx_INCREF(__pyx_v_message); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.warn", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_chrom); __Pyx_XDECREF(__pyx_v_sample); __Pyx_XDECREF(__pyx_v_format); __Pyx_XDECREF(__pyx_v_message); __Pyx_RefNannyFinishContext(); return __pyx_r; }
3725: cdef int format_index
+3726: message += '; field: %s' % vcf_state_labels[context.state]
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_vcf_state_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_context->state, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_field_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); __pyx_t_2 = 0;
+3727: message += '; variant: %s' % context.variant_index
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_context->variant_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_variant_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); __pyx_t_2 = 0;
+3728: if context.state > VCFState.POS:
__pyx_t_3 = ((__pyx_v_context->state > __pyx_e_5allel_3opt_11io_vcf_read_POS) != 0); if (__pyx_t_3) { /* … */ }
+3729: chrom = CharVector_to_pybytes(&context.chrom)
__pyx_t_2 = __pyx_f_5allel_3opt_11io_vcf_read_CharVector_to_pybytes((&__pyx_v_context->chrom)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_chrom = __pyx_t_2;
__pyx_t_2 = 0;
+3730: if not PY2:
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3730, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { /* … */ }
+3731: chrom = str(chrom, 'ascii')
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_chrom); __Pyx_GIVEREF(__pyx_v_chrom); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ascii); __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_chrom, __pyx_t_1); __pyx_t_1 = 0;
+3732: message += ' (%s:%s)' % (chrom, context.pos)
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_context->pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_chrom); __Pyx_GIVEREF(__pyx_v_chrom); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); __pyx_t_2 = 0;
+3733: if context.state == VCFState.CALLDATA:
__pyx_t_4 = ((__pyx_v_context->state == __pyx_e_5allel_3opt_11io_vcf_read_CALLDATA) != 0); if (__pyx_t_4) { /* … */ }
+3734: if context.sample_index >= len(context.headers.samples):
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context->headers, __pyx_n_s_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 3734, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((__pyx_v_context->sample_index >= __pyx_t_5) != 0); if (__pyx_t_4) { /* … */ goto __pyx_L6; }
+3735: sample = 'unknown'
__Pyx_INCREF(__pyx_n_s_unknown);
__pyx_v_sample = __pyx_n_s_unknown;
3736: else:
+3737: sample = context.headers.samples[context.sample_index]
/*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_context->headers, __pyx_n_s_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_context->sample_index, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_sample = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L6:;
+3738: if context.sample_field_index >= context.variant_format_indices.size:
__pyx_t_4 = ((__pyx_v_context->sample_field_index >= __pyx_v_context->variant_format_indices.size) != 0); if (__pyx_t_4) { /* … */ goto __pyx_L7; }
+3739: format = 'unknown'
__Pyx_INCREF(__pyx_n_s_unknown);
__pyx_v_format = __pyx_n_s_unknown;
3740: else:
+3741: format_index = context.variant_format_indices.data[context.sample_field_index]
/*else*/ { __pyx_v_format_index = (__pyx_v_context->variant_format_indices.data[__pyx_v_context->sample_field_index]);
+3742: format = context.formats[format_index]
if (unlikely(__pyx_v_context->formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 3742, __pyx_L1_error) } __pyx_t_1 = PyList_GET_ITEM(__pyx_v_context->formats, __pyx_v_format_index); __Pyx_INCREF(__pyx_t_1); __pyx_v_format = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L7:;
+3743: message += '; sample: %s:%s (%s:%s)' % (context.sample_index,
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_context->sample_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* … */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); __Pyx_INCREF(__pyx_v_sample); __Pyx_GIVEREF(__pyx_v_sample); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_sample); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_format); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_sample_s_s_s_s, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_6); __pyx_t_6 = 0;
+3744: context.sample_field_index,
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_context->sample_field_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2);
3745: sample,
3746: format)
+3747: warnings.warn(message)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_message}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_message}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_message); __Pyx_GIVEREF(__pyx_v_message); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_message); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3748:
3749:
3750: # import sys
3751: #
3752: #
3753: # cdef int debug(message, vars=None) except -1:
3754: # message = '[DEBUG] ' + str(message)
3755: # if vars:
3756: # message = message % vars
3757: # print(message, file=sys.stderr)
3758: # sys.stderr.flush()
3759:
3760:
3761: ##########################################################################################
3762: # EXPERIMENTAL support for multi-threaded parsing
3763: # N.B., this is not used for the moment, because use of object dtype for strings
3764: # requires GIL acquisition, and this may hurt performance in a single-threaded
3765: # context. I'm not completely certain that is the case, but I am out of time to
3766: # explore further.
3767:
3768:
3769: # import itertools
3770: # import time
3771: #
3772: #
3773: # cdef class VCFParallelParser:
3774: #
3775: # cdef:
3776: # FileInputStream stream
3777: # CharVectorInputStream buffer
3778: # VCFContext context
3779: # VCFParser parser
3780: # int chunk_length
3781: # int block_length
3782: # object pool
3783: # object result
3784: #
3785: # def __cinit__(self, stream, parser, chunk_length, block_length, pool, headers, fields):
3786: # self.buffer = CharVectorInputStream(2**14)
3787: # self.context = VCFContext(headers, fields)
3788: # self.stream = stream
3789: # self.parser = parser
3790: # self.chunk_length = chunk_length
3791: # self.block_length = block_length
3792: # self.pool = pool
3793: # self.result = None
3794: #
3795: # def read(self, n_lines):
3796: # self.buffer.clear()
3797: # n_lines_read = self.stream.read_lines_into(&(self.buffer.vector), n_lines)
3798: # self.buffer.advance()
3799: # return n_lines_read
3800: #
3801: # def parse_async(self, block_index, chunk_index):
3802: # self.result = self.pool.apply_async(self.parse, args=(block_index, chunk_index))
3803: #
3804: # def join(self):
3805: # if self.result is not None:
3806: # self.result.get()
3807: #
3808: # def parse(self, block_index, chunk_index):
3809: # before = time.time()
3810: # # set initial state
3811: # self.context.state = VCFState.CHROM
3812: # self.context.chunk_variant_index = block_index * self.block_length - 1
3813: # self.context.variant_index = (chunk_index * self.chunk_length +
3814: # self.context.chunk_variant_index)
3815: # # parse the block of data stored in the buffer
3816: # self.parser.parse(self.buffer, self.context)
3817: # after = time.time()
3818: #
3819: #
3820: # cdef class VCFParallelChunkIterator:
3821: #
3822: # cdef:
3823: # FileInputStream stream
3824: # VCFParser parser
3825: # object pool
3826: # int chunk_length
3827: # int block_length
3828: # int n_threads
3829: # int n_workers
3830: # int chunk_index
3831: # list workers
3832: #
3833: # def __cinit__(self,
3834: # FileInputStream stream,
3835: # int chunk_length, int block_length, int n_threads,
3836: # headers, fields, types, numbers, fills, region, loc_samples):
3837: #
3838: # fields = sorted(fields)
3839: # self.stream = stream
3840: # self.chunk_length = chunk_length
3841: # self.n_threads = n_threads
3842: # self.pool = ThreadPool(n_threads)
3843: # # allow one more worker than number of threads in pool to allow for sync
3844: # # reading of data in the main thread
3845: # self.n_workers = n_threads + 1
3846: # # only makes sense to have block length at most fraction chunk length if we want
3847: # # some parallelism
3848: # self.block_length = min(block_length, chunk_length//self.n_workers)
3849: # if self.block_length < 1:
3850: # self.block_length = 1
3851: # loc_samples = check_samples(loc_samples, headers)
3852: # self.parser = VCFParser(
3853: # fields=fields, types=types, numbers=numbers, chunk_length=chunk_length, loc_samples=loc_samples, fills=fills,
3854: # region=region
3855: # )
3856: # self.chunk_index = -1
3857: # self.workers = [VCFParallelParser(stream=stream, parser=self.parser, chunk_length=self.chunk_length,
3858: # block_length=self.block_length, pool=self.pool, headers=headers,
3859: # fields=fields)
3860: # for _ in range(self.n_workers)]
3861: #
3862: # def __iter__(self):
3863: # return self
3864: #
3865: # def __next__(self):
3866: # cdef:
3867: # int block_index = 0
3868: # int i = 0
3869: # int n_lines
3870: # int n_lines_read = 0
3871: # VCFParallelParser worker
3872: #
3873: # # increment the current chunk index
3874: # self.chunk_index += 1
3875: #
3876: # # allocate arrays for next chunk
3877: # self.parser.malloc_chunk()
3878: #
3879: # # cycle around the workers
3880: # for i in itertools.cycle(list(range(self.n_workers))):
3881: # worker = self.workers[i]
3882: #
3883: # # wait for the result to finish - this ensures we don't overwrite a
3884: # # worker's buffer while it's still parsing
3885: # worker.join()
3886: #
3887: # # read lines into the worker's buffer - this part has to be synchronous
3888: # n_lines = min(self.block_length, self.chunk_length - n_lines_read)
3889: # n_lines_read += worker.read(n_lines)
3890: #
3891: # # launch parsing of the block in parallel
3892: # worker.parse_async(block_index, self.chunk_index)
3893: #
3894: # # increment the current block index
3895: # block_index += 1
3896: #
3897: # # is the chunk done?
3898: # if n_lines_read >= self.chunk_length:
3899: # break
3900: #
3901: # # is the input stream exhausted?
3902: # if self.stream.c == 0:
3903: # break
3904: #
3905: # # wait for all parallel tasks to complete
3906: # for worker in self.workers:
3907: # worker.join()
3908: #
3909: # # obtain the final chunk length via the last worker
3910: # worker = self.workers[i]
3911: # chunk_length = worker.context.chunk_variant_index + 1
3912: #
3913: # # obtain the chunk
3914: # chunk = self.parser.make_chunk(chunk_length)
3915: #
3916: # if chunk is None:
3917: # # clean up thread pool
3918: # self.pool.close()
3919: # self.pool.join()
3920: # self.pool.terminate()
3921: # raise StopIteration
3922: #
3923: # else:
3924: # chrom = CharVector_to_pybytes(&worker.context.chrom)
3925: # pos = worker.context.pos
3926: # return chunk, chunk_length, chrom, pos
3927:
3928:
3929: ###################################################################
3930: # ANN transformer
3931:
3932:
3933: # ANN field indices
+3934: cdef enum ANNFidx:
enum __pyx_t_5allel_3opt_11io_vcf_read_ANNFidx { __pyx_e_5allel_3opt_11io_vcf_read_ALLELE = 0, __pyx_e_5allel_3opt_11io_vcf_read_ANNOTATION = 1, __pyx_e_5allel_3opt_11io_vcf_read_ANNOTATION_IMPACT = 2, __pyx_e_5allel_3opt_11io_vcf_read_GENE_NAME = 3, __pyx_e_5allel_3opt_11io_vcf_read_GENE_ID = 4, __pyx_e_5allel_3opt_11io_vcf_read_FEATURE_TYPE = 5, __pyx_e_5allel_3opt_11io_vcf_read_FEATURE_ID = 6, __pyx_e_5allel_3opt_11io_vcf_read_TRANSCRIPT_BIOTYPE = 7, __pyx_e_5allel_3opt_11io_vcf_read_RANK = 8, __pyx_e_5allel_3opt_11io_vcf_read_HGVS_C = 9, __pyx_e_5allel_3opt_11io_vcf_read_HGVS_P = 10, __pyx_e_5allel_3opt_11io_vcf_read_CDNA = 11, __pyx_e_5allel_3opt_11io_vcf_read_CDS = 12, __pyx_e_5allel_3opt_11io_vcf_read_AA = 13, __pyx_e_5allel_3opt_11io_vcf_read_DISTANCE = 14 };
3935: ALLELE = 0,
3936: ANNOTATION = 1,
3937: ANNOTATION_IMPACT = 2,
3938: GENE_NAME = 3,
3939: GENE_ID = 4,
3940: FEATURE_TYPE = 5,
3941: FEATURE_ID = 6,
3942: TRANSCRIPT_BIOTYPE = 7,
3943: RANK = 8,
3944: HGVS_C = 9,
3945: HGVS_P = 10,
3946: CDNA = 11,
3947: CDS = 12,
3948: AA = 13,
3949: DISTANCE = 14
3950:
3951:
+3952: ANN_FIELD = 'variants/ANN'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_FIELD, __pyx_kp_s_variants_ANN_2) < 0) __PYX_ERR(0, 3952, __pyx_L1_error)
+3953: ANN_ALLELE_FIELD = 'variants/ANN_Allele'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_ALLELE_FIELD, __pyx_kp_s_variants_ANN_Allele) < 0) __PYX_ERR(0, 3953, __pyx_L1_error)
+3954: ANN_ANNOTATION_FIELD = 'variants/ANN_Annotation'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_ANNOTATION_FIELD, __pyx_kp_s_variants_ANN_Annotation) < 0) __PYX_ERR(0, 3954, __pyx_L1_error)
+3955: ANN_ANNOTATION_IMPACT_FIELD = 'variants/ANN_Annotation_Impact'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_ANNOTATION_IMPACT_FIELD, __pyx_kp_s_variants_ANN_Annotation_Impact) < 0) __PYX_ERR(0, 3955, __pyx_L1_error)
+3956: ANN_GENE_NAME_FIELD = 'variants/ANN_Gene_Name'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_GENE_NAME_FIELD, __pyx_kp_s_variants_ANN_Gene_Name) < 0) __PYX_ERR(0, 3956, __pyx_L1_error)
+3957: ANN_GENE_ID_FIELD = 'variants/ANN_Gene_ID'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_GENE_ID_FIELD, __pyx_kp_s_variants_ANN_Gene_ID) < 0) __PYX_ERR(0, 3957, __pyx_L1_error)
+3958: ANN_FEATURE_TYPE_FIELD = 'variants/ANN_Feature_Type'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_FEATURE_TYPE_FIELD, __pyx_kp_s_variants_ANN_Feature_Type) < 0) __PYX_ERR(0, 3958, __pyx_L1_error)
+3959: ANN_FEATURE_ID_FIELD = 'variants/ANN_Feature_ID'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_FEATURE_ID_FIELD, __pyx_kp_s_variants_ANN_Feature_ID) < 0) __PYX_ERR(0, 3959, __pyx_L1_error)
+3960: ANN_TRANSCRIPT_BIOTYPE_FIELD = 'variants/ANN_Transcript_BioType'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_TRANSCRIPT_BIOTYPE_FIELD, __pyx_kp_s_variants_ANN_Transcript_BioType) < 0) __PYX_ERR(0, 3960, __pyx_L1_error)
+3961: ANN_RANK_FIELD = 'variants/ANN_Rank'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_RANK_FIELD, __pyx_kp_s_variants_ANN_Rank) < 0) __PYX_ERR(0, 3961, __pyx_L1_error)
+3962: ANN_HGVS_C_FIELD = 'variants/ANN_HGVS_c'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_HGVS_C_FIELD, __pyx_kp_s_variants_ANN_HGVS_c) < 0) __PYX_ERR(0, 3962, __pyx_L1_error)
+3963: ANN_HGVS_P_FIELD = 'variants/ANN_HGVS_p'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_HGVS_P_FIELD, __pyx_kp_s_variants_ANN_HGVS_p) < 0) __PYX_ERR(0, 3963, __pyx_L1_error)
+3964: ANN_CDNA_FIELD = 'variants/ANN_cDNA'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_CDNA_FIELD, __pyx_kp_s_variants_ANN_cDNA) < 0) __PYX_ERR(0, 3964, __pyx_L1_error)
+3965: ANN_CDNA_POS_FIELD = 'variants/ANN_cDNA_pos'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_CDNA_POS_FIELD, __pyx_kp_s_variants_ANN_cDNA_pos) < 0) __PYX_ERR(0, 3965, __pyx_L1_error)
+3966: ANN_CDNA_LENGTH_FIELD = 'variants/ANN_cDNA_length'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_CDNA_LENGTH_FIELD, __pyx_kp_s_variants_ANN_cDNA_length) < 0) __PYX_ERR(0, 3966, __pyx_L1_error)
+3967: ANN_CDS_FIELD = 'variants/ANN_CDS'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_CDS_FIELD, __pyx_kp_s_variants_ANN_CDS) < 0) __PYX_ERR(0, 3967, __pyx_L1_error)
+3968: ANN_CDS_POS_FIELD = 'variants/ANN_CDS_pos'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_CDS_POS_FIELD, __pyx_kp_s_variants_ANN_CDS_pos) < 0) __PYX_ERR(0, 3968, __pyx_L1_error)
+3969: ANN_CDS_LENGTH_FIELD = 'variants/ANN_CDS_length'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_CDS_LENGTH_FIELD, __pyx_kp_s_variants_ANN_CDS_length) < 0) __PYX_ERR(0, 3969, __pyx_L1_error)
+3970: ANN_AA_FIELD = 'variants/ANN_AA'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_AA_FIELD, __pyx_kp_s_variants_ANN_AA) < 0) __PYX_ERR(0, 3970, __pyx_L1_error)
+3971: ANN_AA_POS_FIELD = 'variants/ANN_AA_pos'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_AA_POS_FIELD, __pyx_kp_s_variants_ANN_AA_pos) < 0) __PYX_ERR(0, 3971, __pyx_L1_error)
+3972: ANN_AA_LENGTH_FIELD = 'variants/ANN_AA_length'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_AA_LENGTH_FIELD, __pyx_kp_s_variants_ANN_AA_length) < 0) __PYX_ERR(0, 3972, __pyx_L1_error)
+3973: ANN_DISTANCE_FIELD = 'variants/ANN_Distance'
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_DISTANCE_FIELD, __pyx_kp_s_variants_ANN_Distance) < 0) __PYX_ERR(0, 3973, __pyx_L1_error)
3974:
3975:
3976: ANN_FIELDS = (
+3977: ANN_ALLELE_FIELD,
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ALLELE_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* … */ __pyx_t_20 = PyTuple_New(18); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_20, 4, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_20, 5, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_20, 6, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_20, 7, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_20, 8, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_20, 9, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_20, 10, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_20, 11, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_20, 12, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_20, 13, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_20, 14, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_20, 15, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 16, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 17, __pyx_t_19); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANN_FIELDS, __pyx_t_20) < 0) __PYX_ERR(0, 3976, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+3978: ANN_ANNOTATION_FIELD,
__pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ANNOTATION_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6);
+3979: ANN_ANNOTATION_IMPACT_FIELD,
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ANNOTATION_IMPACT_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2);
+3980: ANN_GENE_NAME_FIELD,
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_GENE_NAME_FIELD); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+3981: ANN_GENE_ID_FIELD,
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_GENE_ID_FIELD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+3982: ANN_FEATURE_TYPE_FIELD,
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FEATURE_TYPE_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7);
+3983: ANN_FEATURE_ID_FIELD,
__pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FEATURE_ID_FIELD); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8);
+3984: ANN_TRANSCRIPT_BIOTYPE_FIELD,
__pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_TRANSCRIPT_BIOTYPE_FIELD); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9);
+3985: ANN_RANK_FIELD,
__pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_RANK_FIELD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+3986: ANN_HGVS_C_FIELD,
__pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_HGVS_C_FIELD); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11);
+3987: ANN_HGVS_P_FIELD,
__pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_HGVS_P_FIELD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12);
+3988: ANN_CDNA_POS_FIELD,
__pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_POS_FIELD); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+3989: ANN_CDNA_LENGTH_FIELD,
__pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_LENGTH_FIELD); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+3990: ANN_CDS_POS_FIELD,
__pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_POS_FIELD); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15);
+3991: ANN_CDS_LENGTH_FIELD,
__pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_LENGTH_FIELD); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+3992: ANN_AA_POS_FIELD,
__pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_POS_FIELD); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17);
+3993: ANN_AA_LENGTH_FIELD,
__pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_LENGTH_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 3993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18);
3994: ANN_DISTANCE_FIELD
+3995: )
__pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_DISTANCE_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 3995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19);
3996:
3997:
+3998: def _normalize_ann_field_prefix(f):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_5_normalize_ann_field_prefix(PyObject *__pyx_self, PyObject *__pyx_v_f); /*proto*/ static PyMethodDef __pyx_mdef_5allel_3opt_11io_vcf_read_5_normalize_ann_field_prefix = {"_normalize_ann_field_prefix", (PyCFunction)__pyx_pw_5allel_3opt_11io_vcf_read_5_normalize_ann_field_prefix, METH_O, 0}; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_5_normalize_ann_field_prefix(PyObject *__pyx_self, PyObject *__pyx_v_f) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_normalize_ann_field_prefix (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_4_normalize_ann_field_prefix(__pyx_self, ((PyObject *)__pyx_v_f)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_4_normalize_ann_field_prefix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_normalize_ann_field_prefix", 0); __Pyx_INCREF(__pyx_v_f); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("allel.opt.io_vcf_read._normalize_ann_field_prefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__135 = PyTuple_Pack(1, __pyx_n_s_f); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 3998, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); /* … */ __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_5allel_3opt_11io_vcf_read_5_normalize_ann_field_prefix, NULL, __pyx_n_s_allel_opt_io_vcf_read); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 3998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_ann_field_prefix, __pyx_t_20) < 0) __PYX_ERR(0, 3998, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_normalize_ann_field_prefix, 3998, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 3998, __pyx_L1_error)
3999: # normalize prefix
+4000: if f.startswith('variants/ANN_'):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4000, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { goto __pyx_L3; } /* … */ __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_variants_ANN); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 4000, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95);
4001: pass
+4002: elif f.startswith('ANN_'):
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4002, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; } /* … */ __pyx_tuple__96 = PyTuple_Pack(1, __pyx_n_s_ANN); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 4002, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__96); __Pyx_GIVEREF(__pyx_tuple__96);
+4003: f = 'variants/' + f
__pyx_t_1 = PyNumber_Add(__pyx_kp_s_variants_2, __pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_1); __pyx_t_1 = 0;
4004: else:
+4005: f = 'variants/ANN_' + f
/*else*/ { __pyx_t_1 = PyNumber_Add(__pyx_kp_s_variants_ANN, __pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:;
+4006: return f
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_f); __pyx_r = __pyx_v_f; goto __pyx_L0;
4007:
4008:
+4009: def _normalize_ann_fields(fields):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_7_normalize_ann_fields(PyObject *__pyx_self, PyObject *__pyx_v_fields); /*proto*/ static PyMethodDef __pyx_mdef_5allel_3opt_11io_vcf_read_7_normalize_ann_fields = {"_normalize_ann_fields", (PyCFunction)__pyx_pw_5allel_3opt_11io_vcf_read_7_normalize_ann_fields, METH_O, 0}; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_7_normalize_ann_fields(PyObject *__pyx_self, PyObject *__pyx_v_fields) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_normalize_ann_fields (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_6_normalize_ann_fields(__pyx_self, ((PyObject *)__pyx_v_fields)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_6_normalize_ann_fields(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields) { PyObject *__pyx_v_normed_fields = NULL; PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_ff = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_normalize_ann_fields", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("allel.opt.io_vcf_read._normalize_ann_fields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_normed_fields); __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_ff); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__137 = PyTuple_Pack(4, __pyx_n_s_fields, __pyx_n_s_normed_fields, __pyx_n_s_f, __pyx_n_s_ff); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 4009, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); /* … */ __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_5allel_3opt_11io_vcf_read_7_normalize_ann_fields, NULL, __pyx_n_s_allel_opt_io_vcf_read); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_ann_fields, __pyx_t_20) < 0) __PYX_ERR(0, 4009, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_normalize_ann_fields, 4009, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 4009, __pyx_L1_error)
+4010: normed_fields = list()
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_normed_fields = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
4011:
+4012: if fields is None:
__pyx_t_2 = (__pyx_v_fields == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* … */ }
+4013: return list(ANN_FIELDS)
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FIELDS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0;
4014:
4015: else:
+4016: for f in fields:
/*else*/ { if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) { __pyx_t_4 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4016, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4016, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 4016, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4016, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1); __pyx_t_1 = 0; /* … */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; }
+4017: f = _normalize_ann_field_prefix(f)
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_normalize_ann_field_prefix); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_f}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4017, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_f}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4017, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_f); __Pyx_GIVEREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_f); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_1); __pyx_t_1 = 0;
4018: # convenience features
+4019: if f == ANN_CDNA_FIELD:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyObject_RichCompare(__pyx_v_f, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4019, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4019, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L6; }
+4020: for ff in ANN_CDNA_POS_FIELD, ANN_CDNA_LENGTH_FIELD:
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_POS_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_LENGTH_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); __pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_9; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (__pyx_t_10 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4020, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_XDECREF_SET(__pyx_v_ff, __pyx_t_9); __pyx_t_9 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4021: if ff not in normed_fields:
__pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_ff, __pyx_v_normed_fields, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4021, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* … */
}
+4022: normed_fields.append(ff)
__pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normed_fields, __pyx_v_ff); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4022, __pyx_L1_error)
+4023: elif f == ANN_CDS_FIELD:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyObject_RichCompare(__pyx_v_f, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4023, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4023, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L6; }
+4024: for ff in ANN_CDS_POS_FIELD, ANN_CDS_LENGTH_FIELD:
__pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_POS_FIELD); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_LENGTH_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); __pyx_t_9 = 0; __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (__pyx_t_10 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4024, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_XDECREF_SET(__pyx_v_ff, __pyx_t_7); __pyx_t_7 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4025: if ff not in normed_fields:
__pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_ff, __pyx_v_normed_fields, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4025, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* … */
}
+4026: normed_fields.append(ff)
__pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normed_fields, __pyx_v_ff); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4026, __pyx_L1_error)
+4027: elif f == ANN_AA_FIELD:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyObject_RichCompare(__pyx_v_f, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L6; }
+4028: for ff in ANN_AA_POS_FIELD, ANN_AA_LENGTH_FIELD:
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_POS_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_LENGTH_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); __pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_9; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (__pyx_t_10 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 4028, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_XDECREF_SET(__pyx_v_ff, __pyx_t_9); __pyx_t_9 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4029: if ff not in normed_fields:
__pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_ff, __pyx_v_normed_fields, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4029, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* … */
}
+4030: normed_fields.append(ff)
__pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normed_fields, __pyx_v_ff); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4030, __pyx_L1_error)
4031: # all other fields
+4032: elif f is not None and f not in normed_fields:
__pyx_t_3 = (__pyx_v_f != Py_None);
__pyx_t_12 = (__pyx_t_3 != 0);
if (__pyx_t_12) {
} else {
__pyx_t_2 = __pyx_t_12;
goto __pyx_L16_bool_binop_done;
}
__pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_f, __pyx_v_normed_fields, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4032, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_12 != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L16_bool_binop_done:;
if (__pyx_t_2) {
/* … */
}
__pyx_L6:;
+4033: if f not in ANN_FIELDS:
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FIELDS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_f, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4033, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* … */ goto __pyx_L18; }
+4034: warnings.warn('invalid ANN field %r, will be ignored' % f)
__pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_invalid_ANN_field_r_will_be_igno, __pyx_v_f); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4034, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4034, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4034, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4035: else:
+4036: normed_fields.append(f)
/*else*/ {
__pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normed_fields, __pyx_v_f); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 4036, __pyx_L1_error)
}
__pyx_L18:;
4037:
+4038: return normed_fields
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_normed_fields); __pyx_r = __pyx_v_normed_fields; goto __pyx_L0;
4039:
4040:
+4041: default_ann_types = dict()
__pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_ann_types, __pyx_t_20) < 0) __PYX_ERR(0, 4041, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+4042: default_ann_types[ANN_ALLELE_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__139, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ALLELE_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_t_18, __pyx_t_20) < 0)) __PYX_ERR(0, 4042, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__139 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 4042, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__139); __Pyx_GIVEREF(__pyx_tuple__139);
+4043: default_ann_types[ANN_ANNOTATION_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ANNOTATION_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 4043, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__140 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 4043, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__140); __Pyx_GIVEREF(__pyx_tuple__140);
+4044: default_ann_types[ANN_ANNOTATION_IMPACT_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__141, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ANNOTATION_IMPACT_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_t_18, __pyx_t_20) < 0)) __PYX_ERR(0, 4044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__141 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 4044, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141);
+4045: default_ann_types[ANN_GENE_NAME_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_GENE_NAME_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 4045, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__142 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 4045, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__142); __Pyx_GIVEREF(__pyx_tuple__142);
+4046: default_ann_types[ANN_GENE_ID_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_GENE_ID_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_t_18, __pyx_t_20) < 0)) __PYX_ERR(0, 4046, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__143 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 4046, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143);
+4047: default_ann_types[ANN_FEATURE_TYPE_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FEATURE_TYPE_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 4047, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__144 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 4047, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__144); __Pyx_GIVEREF(__pyx_tuple__144);
+4048: default_ann_types[ANN_FEATURE_ID_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__145, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FEATURE_ID_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_t_18, __pyx_t_20) < 0)) __PYX_ERR(0, 4048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 4048, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145);
+4049: default_ann_types[ANN_TRANSCRIPT_BIOTYPE_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_TRANSCRIPT_BIOTYPE_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 4049, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__146 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 4049, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__146); __Pyx_GIVEREF(__pyx_tuple__146);
+4050: default_ann_types[ANN_RANK_FIELD] = np.dtype('int8')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_RANK_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_t_18, __pyx_t_20) < 0)) __PYX_ERR(0, 4050, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__147 = PyTuple_Pack(1, __pyx_n_s_int8); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 4050, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147);
+4051: default_ann_types[ANN_HGVS_C_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_HGVS_C_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 4051, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__148 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 4051, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__148); __Pyx_GIVEREF(__pyx_tuple__148);
+4052: default_ann_types[ANN_HGVS_P_FIELD] = np.dtype('object')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__149, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_HGVS_P_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_t_18, __pyx_t_20) < 0)) __PYX_ERR(0, 4052, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_object); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 4052, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__149); __Pyx_GIVEREF(__pyx_tuple__149);
+4053: default_ann_types[ANN_CDNA_POS_FIELD] = np.dtype('int32')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_POS_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 4053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__150 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 4053, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__150); __Pyx_GIVEREF(__pyx_tuple__150);
+4054: default_ann_types[ANN_CDNA_LENGTH_FIELD] = np.dtype('int32')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__151, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_LENGTH_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_t_18, __pyx_t_20) < 0)) __PYX_ERR(0, 4054, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__151 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 4054, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__151); __Pyx_GIVEREF(__pyx_tuple__151);
+4055: default_ann_types[ANN_CDS_POS_FIELD] = np.dtype('int32')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_POS_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__152 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 4055, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__152); __Pyx_GIVEREF(__pyx_tuple__152);
+4056: default_ann_types[ANN_CDS_LENGTH_FIELD] = np.dtype('int32')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_LENGTH_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_t_18, __pyx_t_20) < 0)) __PYX_ERR(0, 4056, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 4056, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153);
+4057: default_ann_types[ANN_AA_POS_FIELD] = np.dtype('int32')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_POS_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__154 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 4057, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__154); __Pyx_GIVEREF(__pyx_tuple__154);
+4058: default_ann_types[ANN_AA_LENGTH_FIELD] = np.dtype('int32')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__155, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_LENGTH_FIELD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_t_18, __pyx_t_20) < 0)) __PYX_ERR(0, 4058, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__155 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 4058, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__155); __Pyx_GIVEREF(__pyx_tuple__155);
+4059: default_ann_types[ANN_DISTANCE_FIELD] = np.dtype('int32')
__pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__156, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_DISTANCE_FIELD); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 4059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); if (unlikely(PyObject_SetItem(__pyx_t_18, __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 4059, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* … */ __pyx_tuple__156 = PyTuple_Pack(1, __pyx_n_s_int32); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 4059, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__156); __Pyx_GIVEREF(__pyx_tuple__156);
4060:
4061:
+4062: def _normalize_ann_types(fields, types):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9_normalize_ann_types(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_5allel_3opt_11io_vcf_read_9_normalize_ann_types = {"_normalize_ann_types", (PyCFunction)__pyx_pw_5allel_3opt_11io_vcf_read_9_normalize_ann_types, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_9_normalize_ann_types(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_normalize_ann_types (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_normalize_ann_types", 1, 2, 2, 1); __PYX_ERR(0, 4062, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_normalize_ann_types") < 0)) __PYX_ERR(0, 4062, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_normalize_ann_types", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4062, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read._normalize_ann_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_8_normalize_ann_types(__pyx_self, __pyx_v_fields, __pyx_v_types); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_8_normalize_ann_types(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types) { PyObject *__pyx_v_normed_types = NULL; PyObject *__pyx_v_f = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_normalize_ann_types", 0); __Pyx_INCREF(__pyx_v_types); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("allel.opt.io_vcf_read._normalize_ann_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_normed_types); __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_types); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__157 = PyTuple_Pack(4, __pyx_n_s_fields, __pyx_n_s_types, __pyx_n_s_normed_types, __pyx_n_s_f); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 4062, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__157); __Pyx_GIVEREF(__pyx_tuple__157); /* … */ __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_5allel_3opt_11io_vcf_read_9_normalize_ann_types, NULL, __pyx_n_s_allel_opt_io_vcf_read); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_ann_types, __pyx_t_20) < 0) __PYX_ERR(0, 4062, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_normalize_ann_types, 4062, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 4062, __pyx_L1_error)
4063:
+4064: if types is None:
__pyx_t_1 = (__pyx_v_types == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* … */ }
+4065: types = dict()
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_types, __pyx_t_3); __pyx_t_3 = 0;
+4066: types = {_normalize_ann_field_prefix(f): np.dtype(t)
{ /* enter inner scope */ PyObject *__pyx_7genexpr__pyx_v_f = NULL; PyObject *__pyx_7genexpr__pyx_v_t = NULL; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); /* … */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_normalize_ann_field_prefix); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_7genexpr__pyx_v_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_7genexpr__pyx_v_f}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_7genexpr__pyx_v_f}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_7genexpr__pyx_v_f); __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_7genexpr__pyx_v_f); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_7genexpr__pyx_v_t); __Pyx_GIVEREF(__pyx_7genexpr__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_7genexpr__pyx_v_t); __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 4066, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+4067: for f, t in types.items()}
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_types, __pyx_n_s_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4067, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4067, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4067, __pyx_L6_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4067, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4067, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 4067, __pyx_L6_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4067, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 4067, __pyx_L6_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4067, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4067, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 4067, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4067, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4067, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4067, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 4067, __pyx_L6_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 4067, __pyx_L6_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_f, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_t, __pyx_t_9); __pyx_t_9 = 0; /* … */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_f); __Pyx_XDECREF(__pyx_7genexpr__pyx_v_t); goto __pyx_L11_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_f); __Pyx_XDECREF(__pyx_7genexpr__pyx_v_t); goto __pyx_L1_error; __pyx_L11_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_types, __pyx_t_3); __pyx_t_3 = 0;
4068:
+4069: normed_types = dict()
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_normed_types = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0;
+4070: for f in fields:
if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) { __pyx_t_3 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4070, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 4070, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 4070, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4070, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_5); __pyx_t_5 = 0; /* … */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+4071: if f in types:
__pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_f, __pyx_v_types, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4071, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* … */
goto __pyx_L14;
}
+4072: normed_types[f] = types[f]
__pyx_t_5 = PyObject_GetItem(__pyx_v_types, __pyx_v_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(PyDict_SetItem(__pyx_v_normed_types, __pyx_v_f, __pyx_t_5) < 0)) __PYX_ERR(0, 4072, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4073: else:
+4074: normed_types[f] = default_ann_types[f]
/*else*/ { __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_ann_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = PyObject_GetItem(__pyx_t_5, __pyx_v_f); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(PyDict_SetItem(__pyx_v_normed_types, __pyx_v_f, __pyx_t_10) < 0)) __PYX_ERR(0, 4074, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_L14:;
4075:
+4076: return normed_types
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_normed_types); __pyx_r = __pyx_v_normed_types; goto __pyx_L0;
4077:
4078:
+4079: cdef class ANNTransformer:
struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer { PyObject_HEAD PyObject *fields; PyObject *types; int keep_original; };
4080:
4081: cdef:
4082: list fields
4083: object types
4084: bint keep_original
4085:
+4086: def __init__(self, fields=None, types=None, keep_original=False):
/* Python wrapper */ static int __pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_keep_original = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_types,&__pyx_n_s_keep_original,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_types); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keep_original); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4086, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fields = values[0]; __pyx_v_types = values[1]; __pyx_v_keep_original = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4086, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.ANNTransformer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer___init__(((struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *)__pyx_v_self), __pyx_v_fields, __pyx_v_types, __pyx_v_keep_original); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer___init__(struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_types, PyObject *__pyx_v_keep_original) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("allel.opt.io_vcf_read.ANNTransformer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+4087: self.fields = _normalize_ann_fields(fields)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_normalize_ann_fields); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_fields}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4087, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_fields}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4087, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_fields); __Pyx_GIVEREF(__pyx_v_fields); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_fields); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4087, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->fields); __Pyx_DECREF(__pyx_v_self->fields); __pyx_v_self->fields = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+4088: self.types = _normalize_ann_types(self.fields, types)
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_normalize_ann_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self->fields, __pyx_v_types}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4088, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self->fields, __pyx_v_types}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4088, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_self->fields); __Pyx_GIVEREF(__pyx_v_self->fields); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_self->fields); __Pyx_INCREF(__pyx_v_types); __Pyx_GIVEREF(__pyx_v_types); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_types); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->types); __Pyx_DECREF(__pyx_v_self->types); __pyx_v_self->types = __pyx_t_1; __pyx_t_1 = 0;
+4089: self.keep_original = keep_original
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_keep_original); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4089, __pyx_L1_error) __pyx_v_self->keep_original = __pyx_t_6;
4090:
+4091: def transform_fields(self, fields):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_3transform_fields(PyObject *__pyx_v_self, PyObject *__pyx_v_fields); /*proto*/ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_3transform_fields(PyObject *__pyx_v_self, PyObject *__pyx_v_fields) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transform_fields (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer_2transform_fields(((struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *)__pyx_v_self), ((PyObject *)__pyx_v_fields)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer_2transform_fields(struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *__pyx_v_self, PyObject *__pyx_v_fields) { PyObject *__pyx_v_fields_transformed = NULL; PyObject *__pyx_v_f = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transform_fields", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("allel.opt.io_vcf_read.ANNTransformer.transform_fields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fields_transformed); __Pyx_XDECREF(__pyx_v_f); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+4092: fields_transformed = list()
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fields_transformed = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+4093: for f in fields:
if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) { __pyx_t_1 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4093, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4093, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 4093, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 4093, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4); __pyx_t_4 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4094: if f == ANN_FIELD:
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FIELD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_v_f, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4094, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4094, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { /* … */ goto __pyx_L5; }
+4095: if self.keep_original:
__pyx_t_6 = (__pyx_v_self->keep_original != 0); if (__pyx_t_6) { /* … */ }
+4096: fields_transformed.append(f)
__pyx_t_7 = __Pyx_PyList_Append(__pyx_v_fields_transformed, __pyx_v_f); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4096, __pyx_L1_error)
+4097: fields_transformed.extend(self.fields)
__pyx_t_5 = __pyx_v_self->fields; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_fields_transformed, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4097, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4098: else:
+4099: fields_transformed.append(f)
/*else*/ {
__pyx_t_7 = __Pyx_PyList_Append(__pyx_v_fields_transformed, __pyx_v_f); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 4099, __pyx_L1_error)
}
__pyx_L5:;
+4100: return fields_transformed
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_fields_transformed); __pyx_r = __pyx_v_fields_transformed; goto __pyx_L0;
4101:
+4102: def _malloc_string_array(self, field, shape):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_5_malloc_string_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_5_malloc_string_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_shape = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_malloc_string_array (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_shape,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_malloc_string_array", 1, 2, 2, 1); __PYX_ERR(0, 4102, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_malloc_string_array") < 0)) __PYX_ERR(0, 4102, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_shape = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_malloc_string_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4102, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.ANNTransformer._malloc_string_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer_4_malloc_string_array(((struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *)__pyx_v_self), __pyx_v_field, __pyx_v_shape); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer_4_malloc_string_array(struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_shape) { PyObject *__pyx_v_t = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_malloc_string_array", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.ANNTransformer._malloc_string_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_t); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+4103: if field in self.fields:
__pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_field, __pyx_v_self->fields, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4103, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* … */
goto __pyx_L3;
}
+4104: t = check_string_dtype(self.types[field])
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_string_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_GetItem(__pyx_v_self->types, __pyx_v_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4104, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4104, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0;
+4105: a = np.empty(shape, dtype=t)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_v_t) < 0) __PYX_ERR(0, 4105, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_a = __pyx_t_5; __pyx_t_5 = 0;
+4106: if t.kind == 'S':
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_kind); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L4; }
+4107: a.fill(b'')
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* … */ __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_b__4); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 4107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97);
4108: else:
+4109: a.fill('')
/*else*/ { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_fill); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L4:; /* … */ __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 4109, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__98); __Pyx_GIVEREF(__pyx_tuple__98);
4110: else:
+4111: a = None
/*else*/ {
__Pyx_INCREF(Py_None);
__pyx_v_a = Py_None;
}
__pyx_L3:;
+4112: return a
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_a); __pyx_r = __pyx_v_a; goto __pyx_L0;
4113:
+4114: def _malloc_integer_array(self, field, shape):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_7_malloc_integer_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_7_malloc_integer_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_shape = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_malloc_integer_array (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_shape,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_malloc_integer_array", 1, 2, 2, 1); __PYX_ERR(0, 4114, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_malloc_integer_array") < 0)) __PYX_ERR(0, 4114, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_shape = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_malloc_integer_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4114, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("allel.opt.io_vcf_read.ANNTransformer._malloc_integer_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer_6_malloc_integer_array(((struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *)__pyx_v_self), __pyx_v_field, __pyx_v_shape); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer_6_malloc_integer_array(struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_shape) { PyObject *__pyx_v_t = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_malloc_integer_array", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("allel.opt.io_vcf_read.ANNTransformer._malloc_integer_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_t); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+4115: if field in self.fields:
__pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_field, __pyx_v_self->fields, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4115, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* … */
goto __pyx_L3;
}
+4116: t = self.types[field]
__pyx_t_3 = PyObject_GetItem(__pyx_v_self->types, __pyx_v_field); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0;
+4117: if t.kind != 'i':
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_i, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* … */ }
+4118: raise ValueError('only signed integer dtype supported for field %r' % field)
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_only_signed_integer_dtype_suppor, __pyx_v_field); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 4118, __pyx_L1_error)
+4119: a = np.empty(shape, dtype=t)
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_t) < 0) __PYX_ERR(0, 4119, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_a = __pyx_t_6; __pyx_t_6 = 0;
+4120: a.fill(-1)
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* … */ __pyx_tuple__99 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 4120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99);
4121: else:
+4122: a = None
/*else*/ {
__Pyx_INCREF(Py_None);
__pyx_v_a = Py_None;
}
__pyx_L3:;
+4123: return a
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_a); __pyx_r = __pyx_v_a; goto __pyx_L0;
4124:
+4125: def transform_chunk(self, chunk):
/* Python wrapper */ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_9transform_chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_chunk); /*proto*/ static PyObject *__pyx_pw_5allel_3opt_11io_vcf_read_14ANNTransformer_9transform_chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_chunk) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transform_chunk (wrapper)", 0); __pyx_r = __pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer_8transform_chunk(((struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *)__pyx_v_self), ((PyObject *)__pyx_v_chunk)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_5allel_3opt_11io_vcf_read_14ANNTransformer_8transform_chunk(struct __pyx_obj_5allel_3opt_11io_vcf_read_ANNTransformer *__pyx_v_self, PyObject *__pyx_v_chunk) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_chunk_length; int __pyx_v_number; int __pyx_v_n_vals; PyObject *__pyx_v_vals = 0; PyObject *__pyx_v_vv = 0; PyObject *__pyx_v_ann = NULL; PyObject *__pyx_v_shape = NULL; PyObject *__pyx_v_allele = NULL; PyObject *__pyx_v_annotation = NULL; PyObject *__pyx_v_annotation_impact = NULL; PyObject *__pyx_v_gene_name = NULL; PyObject *__pyx_v_gene_id = NULL; PyObject *__pyx_v_feature_type = NULL; PyObject *__pyx_v_feature_id = NULL; PyObject *__pyx_v_transcript_biotype = NULL; PyObject *__pyx_v_rank = NULL; PyObject *__pyx_v_hgvs_c = NULL; PyObject *__pyx_v_hgvs_p = NULL; PyObject *__pyx_v_cdna_pos = NULL; PyObject *__pyx_v_cdna_length = NULL; PyObject *__pyx_v_cds_pos = NULL; PyObject *__pyx_v_cds_length = NULL; PyObject *__pyx_v_aa_pos = NULL; PyObject *__pyx_v_aa_length = NULL; PyObject *__pyx_v_distance = NULL; PyObject *__pyx_v_raw = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_v_ann_chunk = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transform_chunk", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("allel.opt.io_vcf_read.ANNTransformer.transform_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vals); __Pyx_XDECREF(__pyx_v_vv); __Pyx_XDECREF(__pyx_v_ann); __Pyx_XDECREF(__pyx_v_shape); __Pyx_XDECREF(__pyx_v_allele); __Pyx_XDECREF(__pyx_v_annotation); __Pyx_XDECREF(__pyx_v_annotation_impact); __Pyx_XDECREF(__pyx_v_gene_name); __Pyx_XDECREF(__pyx_v_gene_id); __Pyx_XDECREF(__pyx_v_feature_type); __Pyx_XDECREF(__pyx_v_feature_id); __Pyx_XDECREF(__pyx_v_transcript_biotype); __Pyx_XDECREF(__pyx_v_rank); __Pyx_XDECREF(__pyx_v_hgvs_c); __Pyx_XDECREF(__pyx_v_hgvs_p); __Pyx_XDECREF(__pyx_v_cdna_pos); __Pyx_XDECREF(__pyx_v_cdna_length); __Pyx_XDECREF(__pyx_v_cds_pos); __Pyx_XDECREF(__pyx_v_cds_length); __Pyx_XDECREF(__pyx_v_aa_pos); __Pyx_XDECREF(__pyx_v_aa_length); __Pyx_XDECREF(__pyx_v_distance); __Pyx_XDECREF(__pyx_v_raw); __Pyx_XDECREF(__pyx_v_v); __Pyx_XDECREF(__pyx_v_ann_chunk); __Pyx_XDECREF(__pyx_v_k); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
4126: cdef:
4127: int i, j, chunk_length, number, n_vals
4128: list vals
4129: list vv
4130:
4131: # obtain array to be transformed
+4132: ann = chunk[ANN_FIELD]
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetItem(__pyx_v_chunk, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ann = __pyx_t_2; __pyx_t_2 = 0;
+4133: if not self.keep_original:
__pyx_t_3 = ((!(__pyx_v_self->keep_original != 0)) != 0); if (__pyx_t_3) { /* … */ }
+4134: del chunk[ANN_FIELD]
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_DelItem(__pyx_v_chunk, __pyx_t_2) < 0)) __PYX_ERR(0, 4134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4135:
4136: # determine chunk length and number of items
+4137: chunk_length = ann.shape[0]
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_chunk_length = __pyx_t_4;
+4138: if ann.ndim == 1:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* … */ }
+4139: ann = ann[:, np.newaxis]
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_slice__100); __Pyx_GIVEREF(__pyx_slice__100); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__100); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetItem(__pyx_v_ann, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_ann, __pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_slice__100 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__100)) __PYX_ERR(0, 4139, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__100); __Pyx_GIVEREF(__pyx_slice__100);
+4140: number = ann.shape[1]
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_number = __pyx_t_4;
+4141: shape = chunk_length, number
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_chunk_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_v_shape = __pyx_t_5; __pyx_t_5 = 0;
4142:
4143: # allocate output arrays
+4144: allele = self._malloc_string_array(ANN_ALLELE_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ALLELE_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4144, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4144, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_allele = __pyx_t_5; __pyx_t_5 = 0;
+4145: annotation = self._malloc_string_array(ANN_ANNOTATION_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ANNOTATION_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4145, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4145, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_annotation = __pyx_t_5; __pyx_t_5 = 0;
+4146: annotation_impact = self._malloc_string_array(ANN_ANNOTATION_IMPACT_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ANNOTATION_IMPACT_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4146, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4146, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_annotation_impact = __pyx_t_5; __pyx_t_5 = 0;
+4147: gene_name = self._malloc_string_array(ANN_GENE_NAME_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_GENE_NAME_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4147, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4147, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_gene_name = __pyx_t_5; __pyx_t_5 = 0;
+4148: gene_id = self._malloc_string_array(ANN_GENE_ID_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_GENE_ID_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4148, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4148, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_gene_id = __pyx_t_5; __pyx_t_5 = 0;
+4149: feature_type = self._malloc_string_array(ANN_FEATURE_TYPE_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FEATURE_TYPE_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4149, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4149, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_feature_type = __pyx_t_5; __pyx_t_5 = 0;
+4150: feature_id = self._malloc_string_array(ANN_FEATURE_ID_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FEATURE_ID_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4150, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4150, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_feature_id = __pyx_t_5; __pyx_t_5 = 0;
+4151: transcript_biotype = self._malloc_string_array(ANN_TRANSCRIPT_BIOTYPE_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_TRANSCRIPT_BIOTYPE_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4151, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4151, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_transcript_biotype = __pyx_t_5; __pyx_t_5 = 0;
+4152: rank = self._malloc_integer_array(ANN_RANK_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_integer_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_RANK_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4152, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4152, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rank = __pyx_t_5; __pyx_t_5 = 0;
+4153: hgvs_c = self._malloc_string_array(ANN_HGVS_C_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_HGVS_C_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4153, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4153, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_hgvs_c = __pyx_t_5; __pyx_t_5 = 0;
+4154: hgvs_p = self._malloc_string_array(ANN_HGVS_P_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_string_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_HGVS_P_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4154, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4154, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_hgvs_p = __pyx_t_5; __pyx_t_5 = 0;
+4155: cdna_pos = self._malloc_integer_array(ANN_CDNA_POS_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_integer_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_POS_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4155, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4155, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cdna_pos = __pyx_t_5; __pyx_t_5 = 0;
+4156: cdna_length = self._malloc_integer_array(ANN_CDNA_LENGTH_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_integer_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_LENGTH_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4156, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4156, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cdna_length = __pyx_t_5; __pyx_t_5 = 0;
+4157: cds_pos = self._malloc_integer_array(ANN_CDS_POS_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_integer_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_POS_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4157, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4157, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cds_pos = __pyx_t_5; __pyx_t_5 = 0;
+4158: cds_length = self._malloc_integer_array(ANN_CDS_LENGTH_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_integer_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_LENGTH_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4158, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4158, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_cds_length = __pyx_t_5; __pyx_t_5 = 0;
+4159: aa_pos = self._malloc_integer_array(ANN_AA_POS_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_integer_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_POS_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4159, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4159, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_aa_pos = __pyx_t_5; __pyx_t_5 = 0;
+4160: aa_length = self._malloc_integer_array(ANN_AA_LENGTH_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_integer_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_LENGTH_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4160, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4160, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_aa_length = __pyx_t_5; __pyx_t_5 = 0;
+4161: distance = self._malloc_integer_array(ANN_DISTANCE_FIELD, shape)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_malloc_integer_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_DISTANCE_FIELD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4161, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_shape}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4161, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_shape); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_distance = __pyx_t_5; __pyx_t_5 = 0;
4162:
4163: # start working
+4164: for i in range(chunk_length):
__pyx_t_4 = __pyx_v_chunk_length; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_4; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8;
+4165: for j in range(number):
__pyx_t_9 = __pyx_v_number; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_j = __pyx_t_10;
4166:
4167: # obtain raw string value
+4168: raw = ann[i, j]
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetItem(__pyx_v_ann, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_raw, __pyx_t_1); __pyx_t_1 = 0;
+4169: if not PY2 and isinstance(raw, bytes):
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 4169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = ((!__pyx_t_11) != 0); if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L10_bool_binop_done; } __pyx_t_12 = PyBytes_Check(__pyx_v_raw); __pyx_t_11 = (__pyx_t_12 != 0); __pyx_t_3 = __pyx_t_11; __pyx_L10_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4170: raw = str(raw, 'ascii')
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_raw); __Pyx_GIVEREF(__pyx_v_raw); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_raw); __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ascii); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_raw, __pyx_t_2); __pyx_t_2 = 0;
4171:
4172: # bail early if no content
+4173: if raw == '' or raw == '.':
__pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_raw, __pyx_kp_s__4, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 4173, __pyx_L1_error) if (!__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L13_bool_binop_done; } __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_raw, __pyx_kp_s__29, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 4173, __pyx_L1_error) __pyx_t_3 = __pyx_t_11; __pyx_L13_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4174: continue
goto __pyx_L7_continue;
4175:
4176: # split fields
+4177: vals = raw.split('|')
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_raw, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 4177, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_vals, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* … */ __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s__101); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 4177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102);
+4178: n_vals = len(vals)
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 4178, __pyx_L1_error) } __pyx_t_13 = PyList_GET_SIZE(__pyx_v_vals); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 4178, __pyx_L1_error) __pyx_v_n_vals = __pyx_t_13;
4179:
4180: # convert and store values
+4181: if allele is not None and n_vals > ANNFidx.ALLELE:
__pyx_t_11 = (__pyx_v_allele != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L16_bool_binop_done; } __pyx_t_12 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_ALLELE) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4182: allele[i, j] = vals[ANNFidx.ALLELE]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4182, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_ALLELE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetItem(__pyx_v_vals, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_allele, __pyx_t_6, __pyx_t_2) < 0)) __PYX_ERR(0, 4182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4183: if annotation is not None and n_vals > ANNFidx.ANNOTATION:
__pyx_t_12 = (__pyx_v_annotation != Py_None); __pyx_t_11 = (__pyx_t_12 != 0); if (__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L19_bool_binop_done; } __pyx_t_11 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_ANNOTATION) != 0); __pyx_t_3 = __pyx_t_11; __pyx_L19_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4184: annotation[i, j] = vals[ANNFidx.ANNOTATION]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4184, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_ANNOTATION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyObject_GetItem(__pyx_v_vals, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_annotation, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 4184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4185: if annotation_impact is not None and n_vals > ANNFidx.ANNOTATION_IMPACT:
__pyx_t_11 = (__pyx_v_annotation_impact != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L22_bool_binop_done; } __pyx_t_12 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_ANNOTATION_IMPACT) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4186: annotation_impact[i, j] = vals[ANNFidx.ANNOTATION_IMPACT]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4186, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_ANNOTATION_IMPACT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyObject_GetItem(__pyx_v_vals, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_annotation_impact, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 4186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4187: if gene_name is not None and n_vals > ANNFidx.GENE_NAME:
__pyx_t_12 = (__pyx_v_gene_name != Py_None); __pyx_t_11 = (__pyx_t_12 != 0); if (__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L25_bool_binop_done; } __pyx_t_11 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_GENE_NAME) != 0); __pyx_t_3 = __pyx_t_11; __pyx_L25_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4188: gene_name[i, j] = vals[ANNFidx.GENE_NAME]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4188, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_GENE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetItem(__pyx_v_vals, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_gene_name, __pyx_t_6, __pyx_t_2) < 0)) __PYX_ERR(0, 4188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4189: if gene_id is not None and n_vals > ANNFidx.GENE_ID:
__pyx_t_11 = (__pyx_v_gene_id != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L28_bool_binop_done; } __pyx_t_12 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_GENE_ID) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4190: gene_id[i, j] = vals[ANNFidx.GENE_ID]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4190, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_GENE_ID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyObject_GetItem(__pyx_v_vals, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_gene_id, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 4190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4191: if feature_type is not None and n_vals > ANNFidx.FEATURE_TYPE:
__pyx_t_12 = (__pyx_v_feature_type != Py_None); __pyx_t_11 = (__pyx_t_12 != 0); if (__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L31_bool_binop_done; } __pyx_t_11 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_FEATURE_TYPE) != 0); __pyx_t_3 = __pyx_t_11; __pyx_L31_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4192: feature_type[i, j] = vals[ANNFidx.FEATURE_TYPE]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4192, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_FEATURE_TYPE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyObject_GetItem(__pyx_v_vals, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_feature_type, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 4192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4193: if feature_id is not None and n_vals > ANNFidx.FEATURE_ID:
__pyx_t_11 = (__pyx_v_feature_id != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L34_bool_binop_done; } __pyx_t_12 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_FEATURE_ID) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L34_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4194: feature_id[i, j] = vals[ANNFidx.FEATURE_ID]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4194, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_FEATURE_ID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetItem(__pyx_v_vals, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_feature_id, __pyx_t_6, __pyx_t_2) < 0)) __PYX_ERR(0, 4194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4195: if transcript_biotype is not None and n_vals > ANNFidx.TRANSCRIPT_BIOTYPE:
__pyx_t_12 = (__pyx_v_transcript_biotype != Py_None); __pyx_t_11 = (__pyx_t_12 != 0); if (__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L37_bool_binop_done; } __pyx_t_11 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_TRANSCRIPT_BIOTYPE) != 0); __pyx_t_3 = __pyx_t_11; __pyx_L37_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4196: transcript_biotype[i, j] = vals[ANNFidx.TRANSCRIPT_BIOTYPE]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4196, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_TRANSCRIPT_BIOTYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyObject_GetItem(__pyx_v_vals, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_transcript_biotype, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 4196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4197: if rank is not None and n_vals > ANNFidx.RANK:
__pyx_t_11 = (__pyx_v_rank != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L40_bool_binop_done; } __pyx_t_12 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_RANK) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4198: v = vals[ANNFidx.RANK]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4198, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_RANK); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyObject_GetItem(__pyx_v_vals, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); __pyx_t_1 = 0;
+4199: if v:
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4199, __pyx_L1_error)
if (__pyx_t_3) {
/* … */
}
+4200: vv = v.split('/')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_vv, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; /* … */ __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 4200, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103);
4201: # ignore second part of rank
+4202: rank[i, j] = int(vv[0])
if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4202, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyNumber_Int(PyList_GET_ITEM(__pyx_v_vv, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_rank, __pyx_t_2, __pyx_t_6) < 0)) __PYX_ERR(0, 4202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4203: if hgvs_c is not None and n_vals > ANNFidx.HGVS_C:
__pyx_t_12 = (__pyx_v_hgvs_c != Py_None); __pyx_t_11 = (__pyx_t_12 != 0); if (__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L44_bool_binop_done; } __pyx_t_11 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_HGVS_C) != 0); __pyx_t_3 = __pyx_t_11; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { /* … */ }
4204: # strip of leading 'n.' as redundant information
+4205: hgvs_c[i, j] = vals[ANNFidx.HGVS_C][2:]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4205, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_HGVS_C); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_GetItem(__pyx_v_vals, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_2, 2, 0, NULL, NULL, &__pyx_slice__104, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_hgvs_c, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* … */ __pyx_slice__104 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__104)) __PYX_ERR(0, 4205, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__104); __Pyx_GIVEREF(__pyx_slice__104);
+4206: if hgvs_p is not None and n_vals > ANNFidx.HGVS_P:
__pyx_t_11 = (__pyx_v_hgvs_p != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L47_bool_binop_done; } __pyx_t_12 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_HGVS_P) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L47_bool_binop_done:; if (__pyx_t_3) { /* … */ }
4207: # strip of leading 'p.' as redundant information
+4208: hgvs_p[i, j] = vals[ANNFidx.HGVS_P][2:]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4208, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_HGVS_P); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyObject_GetItem(__pyx_v_vals, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_1, 2, 0, NULL, NULL, &__pyx_slice__105, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_hgvs_p, __pyx_t_2, __pyx_t_6) < 0)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* … */ __pyx_slice__105 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__105)) __PYX_ERR(0, 4208, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__105); __Pyx_GIVEREF(__pyx_slice__105);
+4209: if cdna_pos is not None or cdna_length is not None and n_vals > ANNFidx.CDNA:
__pyx_t_12 = (__pyx_v_cdna_pos != Py_None); __pyx_t_11 = (__pyx_t_12 != 0); if (!__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L50_bool_binop_done; } __pyx_t_11 = (__pyx_v_cdna_length != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L50_bool_binop_done; } __pyx_t_12 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_CDNA) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L50_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4210: v = vals[ANNFidx.CDNA]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4210, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_CDNA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_GetItem(__pyx_v_vals, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); __pyx_t_2 = 0;
+4211: if v:
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4211, __pyx_L1_error)
if (__pyx_t_3) {
/* … */
}
+4212: vv = v.split('/')
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 4212, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_vv, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; /* … */ __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 4212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__106); __Pyx_GIVEREF(__pyx_tuple__106);
+4213: if cdna_pos is not None:
__pyx_t_3 = (__pyx_v_cdna_pos != Py_None); __pyx_t_12 = (__pyx_t_3 != 0); if (__pyx_t_12) { /* … */ }
+4214: cdna_pos[i, j] = int(vv[0])
if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4214, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyNumber_Int(PyList_GET_ITEM(__pyx_v_vv, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_cdna_pos, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 4214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4215: if cdna_length is not None and len(vv) > 1:
__pyx_t_3 = (__pyx_v_cdna_length != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L56_bool_binop_done; } if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 4215, __pyx_L1_error) } __pyx_t_13 = PyList_GET_SIZE(__pyx_v_vv); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 4215, __pyx_L1_error) __pyx_t_11 = ((__pyx_t_13 > 1) != 0); __pyx_t_12 = __pyx_t_11; __pyx_L56_bool_binop_done:; if (__pyx_t_12) { /* … */ }
+4216: cdna_length[i, j] = int(vv[1])
if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4216, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyNumber_Int(PyList_GET_ITEM(__pyx_v_vv, 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_cdna_length, __pyx_t_2, __pyx_t_6) < 0)) __PYX_ERR(0, 4216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4217: if cds_pos is not None or cds_length is not None and n_vals > ANNFidx.CDS:
__pyx_t_11 = (__pyx_v_cds_pos != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (!__pyx_t_3) { } else { __pyx_t_12 = __pyx_t_3; goto __pyx_L59_bool_binop_done; } __pyx_t_3 = (__pyx_v_cds_length != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L59_bool_binop_done; } __pyx_t_11 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_CDS) != 0); __pyx_t_12 = __pyx_t_11; __pyx_L59_bool_binop_done:; if (__pyx_t_12) { /* … */ }
+4218: v = vals[ANNFidx.CDS]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4218, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_CDS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_GetItem(__pyx_v_vals, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); __pyx_t_2 = 0;
+4219: if v:
__pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 4219, __pyx_L1_error)
if (__pyx_t_12) {
/* … */
}
+4220: vv = v.split('/')
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_vv, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; /* … */ __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 4220, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107);
+4221: if cds_pos is not None:
__pyx_t_12 = (__pyx_v_cds_pos != Py_None); __pyx_t_11 = (__pyx_t_12 != 0); if (__pyx_t_11) { /* … */ }
+4222: cds_pos[i, j] = int(vv[0])
if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4222, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyNumber_Int(PyList_GET_ITEM(__pyx_v_vv, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_cds_pos, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 4222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4223: if cds_length is not None and len(vv) > 1:
__pyx_t_12 = (__pyx_v_cds_length != Py_None); __pyx_t_3 = (__pyx_t_12 != 0); if (__pyx_t_3) { } else { __pyx_t_11 = __pyx_t_3; goto __pyx_L65_bool_binop_done; } if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 4223, __pyx_L1_error) } __pyx_t_13 = PyList_GET_SIZE(__pyx_v_vv); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 4223, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_13 > 1) != 0); __pyx_t_11 = __pyx_t_3; __pyx_L65_bool_binop_done:; if (__pyx_t_11) { /* … */ }
+4224: cds_length[i, j] = int(vv[1])
if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4224, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyNumber_Int(PyList_GET_ITEM(__pyx_v_vv, 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_cds_length, __pyx_t_2, __pyx_t_6) < 0)) __PYX_ERR(0, 4224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4225: if aa_pos is not None or aa_length is not None and n_vals > ANNFidx.AA:
__pyx_t_3 = (__pyx_v_aa_pos != Py_None); __pyx_t_12 = (__pyx_t_3 != 0); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L68_bool_binop_done; } __pyx_t_12 = (__pyx_v_aa_length != Py_None); __pyx_t_3 = (__pyx_t_12 != 0); if (__pyx_t_3) { } else { __pyx_t_11 = __pyx_t_3; goto __pyx_L68_bool_binop_done; } __pyx_t_3 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_AA) != 0); __pyx_t_11 = __pyx_t_3; __pyx_L68_bool_binop_done:; if (__pyx_t_11) { /* … */ }
+4226: v = vals[ANNFidx.AA]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4226, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_AA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_GetItem(__pyx_v_vals, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); __pyx_t_2 = 0;
+4227: if v:
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 4227, __pyx_L1_error)
if (__pyx_t_11) {
/* … */
}
+4228: vv = v.split('/')
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 4228, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_vv, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; /* … */ __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 4228, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108);
+4229: if aa_pos is not None:
__pyx_t_11 = (__pyx_v_aa_pos != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4230: aa_pos[i, j] = int(vv[0])
if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4230, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyNumber_Int(PyList_GET_ITEM(__pyx_v_vv, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_aa_pos, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 4230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4231: if aa_length is not None and len(vv) > 1:
__pyx_t_11 = (__pyx_v_aa_length != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L74_bool_binop_done; } if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 4231, __pyx_L1_error) } __pyx_t_13 = PyList_GET_SIZE(__pyx_v_vv); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 4231, __pyx_L1_error) __pyx_t_12 = ((__pyx_t_13 > 1) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L74_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+4232: aa_length[i, j] = int(vv[1])
if (unlikely(__pyx_v_vv == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4232, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyNumber_Int(PyList_GET_ITEM(__pyx_v_vv, 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_aa_length, __pyx_t_2, __pyx_t_6) < 0)) __PYX_ERR(0, 4232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+4233: if distance is not None and n_vals > ANNFidx.DISTANCE:
__pyx_t_12 = (__pyx_v_distance != Py_None); __pyx_t_11 = (__pyx_t_12 != 0); if (__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L77_bool_binop_done; } __pyx_t_11 = ((__pyx_v_n_vals > __pyx_e_5allel_3opt_11io_vcf_read_DISTANCE) != 0); __pyx_t_3 = __pyx_t_11; __pyx_L77_bool_binop_done:; if (__pyx_t_3) { /* … */ } __pyx_L7_continue:; } }
+4234: v = vals[ANNFidx.DISTANCE]
if (unlikely(__pyx_v_vals == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 4234, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_5allel_3opt_11io_vcf_read_ANNFidx(__pyx_e_5allel_3opt_11io_vcf_read_DISTANCE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_GetItem(__pyx_v_vals, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); __pyx_t_2 = 0;
+4235: if v:
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4235, __pyx_L1_error)
if (__pyx_t_3) {
/* … */
}
+4236: distance[i, j] = int(v)
__pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(PyObject_SetItem(__pyx_v_distance, __pyx_t_1, __pyx_t_2) < 0)) __PYX_ERR(0, 4236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4237:
+4238: ann_chunk = dict()
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ann_chunk = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
+4239: if allele is not None:
__pyx_t_3 = (__pyx_v_allele != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { /* … */ }
+4240: ann_chunk[ANN_ALLELE_FIELD] = allele
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ALLELE_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_allele) < 0)) __PYX_ERR(0, 4240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4241: if annotation is not None:
__pyx_t_11 = (__pyx_v_annotation != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4242: ann_chunk[ANN_ANNOTATION_FIELD] = annotation
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ANNOTATION_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_annotation) < 0)) __PYX_ERR(0, 4242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4243: if annotation_impact is not None:
__pyx_t_3 = (__pyx_v_annotation_impact != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { /* … */ }
+4244: ann_chunk[ANN_ANNOTATION_IMPACT_FIELD] = annotation_impact
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_ANNOTATION_IMPACT_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_annotation_impact) < 0)) __PYX_ERR(0, 4244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4245: if gene_name is not None:
__pyx_t_11 = (__pyx_v_gene_name != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4246: ann_chunk[ANN_GENE_NAME_FIELD] = gene_name
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_GENE_NAME_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_gene_name) < 0)) __PYX_ERR(0, 4246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4247: if gene_id is not None:
__pyx_t_3 = (__pyx_v_gene_id != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { /* … */ }
+4248: ann_chunk[ANN_GENE_ID_FIELD] = gene_id
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_GENE_ID_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_gene_id) < 0)) __PYX_ERR(0, 4248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4249: if feature_type is not None:
__pyx_t_11 = (__pyx_v_feature_type != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4250: ann_chunk[ANN_FEATURE_TYPE_FIELD] = feature_type
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FEATURE_TYPE_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_feature_type) < 0)) __PYX_ERR(0, 4250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4251: if feature_id is not None:
__pyx_t_3 = (__pyx_v_feature_id != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { /* … */ }
+4252: ann_chunk[ANN_FEATURE_ID_FIELD] = feature_id
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_FEATURE_ID_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_feature_id) < 0)) __PYX_ERR(0, 4252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4253: if transcript_biotype is not None:
__pyx_t_11 = (__pyx_v_transcript_biotype != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4254: ann_chunk[ANN_TRANSCRIPT_BIOTYPE_FIELD] = transcript_biotype
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_TRANSCRIPT_BIOTYPE_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_transcript_biotype) < 0)) __PYX_ERR(0, 4254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4255: if rank is not None:
__pyx_t_3 = (__pyx_v_rank != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { /* … */ }
+4256: ann_chunk[ANN_RANK_FIELD] = rank
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_RANK_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_rank) < 0)) __PYX_ERR(0, 4256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4257: if hgvs_c is not None:
__pyx_t_11 = (__pyx_v_hgvs_c != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4258: ann_chunk[ANN_HGVS_C_FIELD] = hgvs_c
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_HGVS_C_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_hgvs_c) < 0)) __PYX_ERR(0, 4258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4259: if hgvs_p is not None:
__pyx_t_3 = (__pyx_v_hgvs_p != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { /* … */ }
+4260: ann_chunk[ANN_HGVS_P_FIELD] = hgvs_p
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_HGVS_P_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_hgvs_p) < 0)) __PYX_ERR(0, 4260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4261: if cdna_pos is not None:
__pyx_t_11 = (__pyx_v_cdna_pos != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4262: ann_chunk[ANN_CDNA_POS_FIELD] = cdna_pos
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_POS_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_cdna_pos) < 0)) __PYX_ERR(0, 4262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4263: if cdna_length is not None:
__pyx_t_3 = (__pyx_v_cdna_length != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { /* … */ }
+4264: ann_chunk[ANN_CDNA_LENGTH_FIELD] = cdna_length
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDNA_LENGTH_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_cdna_length) < 0)) __PYX_ERR(0, 4264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4265: if cds_pos is not None:
__pyx_t_11 = (__pyx_v_cds_pos != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4266: ann_chunk[ANN_CDS_POS_FIELD] = cds_pos
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_POS_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_cds_pos) < 0)) __PYX_ERR(0, 4266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4267: if cds_length is not None:
__pyx_t_3 = (__pyx_v_cds_length != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { /* … */ }
+4268: ann_chunk[ANN_CDS_LENGTH_FIELD] = cds_length
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_CDS_LENGTH_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_cds_length) < 0)) __PYX_ERR(0, 4268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4269: if aa_pos is not None:
__pyx_t_11 = (__pyx_v_aa_pos != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4270: ann_chunk[ANN_AA_POS_FIELD] = aa_pos
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_POS_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_aa_pos) < 0)) __PYX_ERR(0, 4270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4271: if aa_length is not None:
__pyx_t_3 = (__pyx_v_aa_length != Py_None); __pyx_t_11 = (__pyx_t_3 != 0); if (__pyx_t_11) { /* … */ }
+4272: ann_chunk[ANN_AA_LENGTH_FIELD] = aa_length
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_AA_LENGTH_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_aa_length) < 0)) __PYX_ERR(0, 4272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4273: if distance is not None:
__pyx_t_11 = (__pyx_v_distance != Py_None); __pyx_t_3 = (__pyx_t_11 != 0); if (__pyx_t_3) { /* … */ }
+4274: ann_chunk[ANN_DISTANCE_FIELD] = distance
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ANN_DISTANCE_FIELD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_t_2, __pyx_v_distance) < 0)) __PYX_ERR(0, 4274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4275:
+4276: if number == 1:
__pyx_t_3 = ((__pyx_v_number == 1) != 0); if (__pyx_t_3) { /* … */ }
+4277: for k in list(ann_chunk.keys()):
__pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_ann_chunk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 4277, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; /* … */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+4278: ann_chunk[k] = ann_chunk[k].squeeze(axis=1)
__pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_ann_chunk, __pyx_v_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 4278, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyDict_SetItem(__pyx_v_ann_chunk, __pyx_v_k, __pyx_t_6) < 0)) __PYX_ERR(0, 4278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4279:
+4280: chunk.update(ann_chunk)
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_ann_chunk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_ann_chunk}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4280, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_ann_chunk}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4280, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_ann_chunk); __Pyx_GIVEREF(__pyx_v_ann_chunk); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_ann_chunk); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;