Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pysam/libcvcf.c @ 69:33d812a61356
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 17:55:14 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 69:33d812a61356 |
---|---|
1 /* Generated by Cython 3.0.11 */ | |
2 | |
3 /* BEGIN: Cython Metadata | |
4 { | |
5 "distutils": { | |
6 "define_macros": [ | |
7 [ | |
8 "BUILDING_WHEEL", | |
9 null | |
10 ] | |
11 ], | |
12 "depends": [ | |
13 "/project/htslib/htslib/bgzf.h", | |
14 "/project/htslib/htslib/cram.h", | |
15 "/project/htslib/htslib/faidx.h", | |
16 "/project/htslib/htslib/hfile.h", | |
17 "/project/htslib/htslib/hts.h", | |
18 "/project/htslib/htslib/kstring.h", | |
19 "/project/htslib/htslib/sam.h", | |
20 "/project/htslib/htslib/tbx.h", | |
21 "/project/htslib/htslib/vcf.h", | |
22 "/project/htslib/htslib/vcfutils.h", | |
23 "/project/pysam/htslib_util.h", | |
24 "/project/pysam/pysam_stream.h" | |
25 ], | |
26 "extra_compile_args": [ | |
27 "-Wno-unused", | |
28 "-Wno-strict-prototypes", | |
29 "-Wno-sign-compare", | |
30 "-Wno-error=declaration-after-statement" | |
31 ], | |
32 "extra_link_args": [ | |
33 "-Wl,-rpath,$ORIGIN" | |
34 ], | |
35 "include_dirs": [ | |
36 "pysam", | |
37 "/project/pysam", | |
38 "/project/htslib", | |
39 "/project/samtools", | |
40 "/project/samtools/lz4", | |
41 "/project/bcftools", | |
42 "/project" | |
43 ], | |
44 "language": "c", | |
45 "libraries": [ | |
46 "z", | |
47 "lzma", | |
48 "bz2", | |
49 "z", | |
50 "m", | |
51 "curl", | |
52 "crypto", | |
53 "chtslib.cpython-37m-x86_64-linux-gnu", | |
54 "cutils.cpython-37m-x86_64-linux-gnu" | |
55 ], | |
56 "library_dirs": [ | |
57 "/project/pysam", | |
58 "/project", | |
59 "build/lib.linux-x86_64-cpython-37/pysam", | |
60 "build/lib.linux-x86_64-cpython-37/pysam", | |
61 "build/lib.linux-x86_64-cpython-37/pysam", | |
62 "build/lib.linux-x86_64-cpython-37/pysam", | |
63 "build/lib.linux-x86_64-cpython-37/pysam", | |
64 "build/lib.linux-x86_64-cpython-37/pysam", | |
65 "build/lib.linux-x86_64-cpython-37/pysam", | |
66 "build/lib.linux-x86_64-cpython-37/pysam", | |
67 "build/lib.linux-x86_64-cpython-37/pysam", | |
68 "build/lib.linux-x86_64-cpython-37/pysam", | |
69 "build/lib.linux-x86_64-cpython-37/pysam", | |
70 "build/lib.linux-x86_64-cpython-37/pysam", | |
71 "build/lib.linux-x86_64-cpython-37/pysam" | |
72 ], | |
73 "name": "pysam.libcvcf", | |
74 "sources": [ | |
75 "pysam/libcvcf.pyx" | |
76 ] | |
77 }, | |
78 "module_name": "pysam.libcvcf" | |
79 } | |
80 END: Cython Metadata */ | |
81 | |
82 #ifndef PY_SSIZE_T_CLEAN | |
83 #define PY_SSIZE_T_CLEAN | |
84 #endif /* PY_SSIZE_T_CLEAN */ | |
85 #if defined(CYTHON_LIMITED_API) && 0 | |
86 #ifndef Py_LIMITED_API | |
87 #if CYTHON_LIMITED_API+0 > 0x03030000 | |
88 #define Py_LIMITED_API CYTHON_LIMITED_API | |
89 #else | |
90 #define Py_LIMITED_API 0x03030000 | |
91 #endif | |
92 #endif | |
93 #endif | |
94 | |
95 #include "Python.h" | |
96 | |
97 #if PY_MAJOR_VERSION >= 3 | |
98 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) | |
99 #else | |
100 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) | |
101 #endif | |
102 | |
103 | |
104 #if PY_MAJOR_VERSION <= 2 | |
105 #define PyDict_GetItemWithError _PyDict_GetItemWithError | |
106 #endif | |
107 | |
108 | |
109 #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) | |
110 #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) | |
111 #endif | |
112 | |
113 #ifndef Py_PYTHON_H | |
114 #error Python headers needed to compile C extensions, please install development version of Python. | |
115 #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) | |
116 #error Cython requires Python 2.7+ or Python 3.3+. | |
117 #else | |
118 #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API | |
119 #define __PYX_EXTRA_ABI_MODULE_NAME "limited" | |
120 #else | |
121 #define __PYX_EXTRA_ABI_MODULE_NAME "" | |
122 #endif | |
123 #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME | |
124 #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI | |
125 #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." | |
126 #define CYTHON_HEX_VERSION 0x03000BF0 | |
127 #define CYTHON_FUTURE_DIVISION 1 | |
128 #include <stddef.h> | |
129 #ifndef offsetof | |
130 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) | |
131 #endif | |
132 #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) | |
133 #ifndef __stdcall | |
134 #define __stdcall | |
135 #endif | |
136 #ifndef __cdecl | |
137 #define __cdecl | |
138 #endif | |
139 #ifndef __fastcall | |
140 #define __fastcall | |
141 #endif | |
142 #endif | |
143 #ifndef DL_IMPORT | |
144 #define DL_IMPORT(t) t | |
145 #endif | |
146 #ifndef DL_EXPORT | |
147 #define DL_EXPORT(t) t | |
148 #endif | |
149 #define __PYX_COMMA , | |
150 #ifndef HAVE_LONG_LONG | |
151 #define HAVE_LONG_LONG | |
152 #endif | |
153 #ifndef PY_LONG_LONG | |
154 #define PY_LONG_LONG LONG_LONG | |
155 #endif | |
156 #ifndef Py_HUGE_VAL | |
157 #define Py_HUGE_VAL HUGE_VAL | |
158 #endif | |
159 #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX | |
160 #if defined(GRAALVM_PYTHON) | |
161 /* For very preliminary testing purposes. Most variables are set the same as PyPy. | |
162 The existence of this section does not imply that anything works or is even tested */ | |
163 #define CYTHON_COMPILING_IN_PYPY 0 | |
164 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
165 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
166 #define CYTHON_COMPILING_IN_GRAAL 1 | |
167 #define CYTHON_COMPILING_IN_NOGIL 0 | |
168 #undef CYTHON_USE_TYPE_SLOTS | |
169 #define CYTHON_USE_TYPE_SLOTS 0 | |
170 #undef CYTHON_USE_TYPE_SPECS | |
171 #define CYTHON_USE_TYPE_SPECS 0 | |
172 #undef CYTHON_USE_PYTYPE_LOOKUP | |
173 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
174 #if PY_VERSION_HEX < 0x03050000 | |
175 #undef CYTHON_USE_ASYNC_SLOTS | |
176 #define CYTHON_USE_ASYNC_SLOTS 0 | |
177 #elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
178 #define CYTHON_USE_ASYNC_SLOTS 1 | |
179 #endif | |
180 #undef CYTHON_USE_PYLIST_INTERNALS | |
181 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
182 #undef CYTHON_USE_UNICODE_INTERNALS | |
183 #define CYTHON_USE_UNICODE_INTERNALS 0 | |
184 #undef CYTHON_USE_UNICODE_WRITER | |
185 #define CYTHON_USE_UNICODE_WRITER 0 | |
186 #undef CYTHON_USE_PYLONG_INTERNALS | |
187 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
188 #undef CYTHON_AVOID_BORROWED_REFS | |
189 #define CYTHON_AVOID_BORROWED_REFS 1 | |
190 #undef CYTHON_ASSUME_SAFE_MACROS | |
191 #define CYTHON_ASSUME_SAFE_MACROS 0 | |
192 #undef CYTHON_UNPACK_METHODS | |
193 #define CYTHON_UNPACK_METHODS 0 | |
194 #undef CYTHON_FAST_THREAD_STATE | |
195 #define CYTHON_FAST_THREAD_STATE 0 | |
196 #undef CYTHON_FAST_GIL | |
197 #define CYTHON_FAST_GIL 0 | |
198 #undef CYTHON_METH_FASTCALL | |
199 #define CYTHON_METH_FASTCALL 0 | |
200 #undef CYTHON_FAST_PYCALL | |
201 #define CYTHON_FAST_PYCALL 0 | |
202 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
203 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) | |
204 #endif | |
205 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
206 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
207 #undef CYTHON_USE_MODULE_STATE | |
208 #define CYTHON_USE_MODULE_STATE 0 | |
209 #undef CYTHON_USE_TP_FINALIZE | |
210 #define CYTHON_USE_TP_FINALIZE 0 | |
211 #undef CYTHON_USE_DICT_VERSIONS | |
212 #define CYTHON_USE_DICT_VERSIONS 0 | |
213 #undef CYTHON_USE_EXC_INFO_STACK | |
214 #define CYTHON_USE_EXC_INFO_STACK 0 | |
215 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
216 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 | |
217 #endif | |
218 #undef CYTHON_USE_FREELISTS | |
219 #define CYTHON_USE_FREELISTS 0 | |
220 #elif defined(PYPY_VERSION) | |
221 #define CYTHON_COMPILING_IN_PYPY 1 | |
222 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
223 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
224 #define CYTHON_COMPILING_IN_GRAAL 0 | |
225 #define CYTHON_COMPILING_IN_NOGIL 0 | |
226 #undef CYTHON_USE_TYPE_SLOTS | |
227 #define CYTHON_USE_TYPE_SLOTS 0 | |
228 #ifndef CYTHON_USE_TYPE_SPECS | |
229 #define CYTHON_USE_TYPE_SPECS 0 | |
230 #endif | |
231 #undef CYTHON_USE_PYTYPE_LOOKUP | |
232 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
233 #if PY_VERSION_HEX < 0x03050000 | |
234 #undef CYTHON_USE_ASYNC_SLOTS | |
235 #define CYTHON_USE_ASYNC_SLOTS 0 | |
236 #elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
237 #define CYTHON_USE_ASYNC_SLOTS 1 | |
238 #endif | |
239 #undef CYTHON_USE_PYLIST_INTERNALS | |
240 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
241 #undef CYTHON_USE_UNICODE_INTERNALS | |
242 #define CYTHON_USE_UNICODE_INTERNALS 0 | |
243 #undef CYTHON_USE_UNICODE_WRITER | |
244 #define CYTHON_USE_UNICODE_WRITER 0 | |
245 #undef CYTHON_USE_PYLONG_INTERNALS | |
246 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
247 #undef CYTHON_AVOID_BORROWED_REFS | |
248 #define CYTHON_AVOID_BORROWED_REFS 1 | |
249 #undef CYTHON_ASSUME_SAFE_MACROS | |
250 #define CYTHON_ASSUME_SAFE_MACROS 0 | |
251 #undef CYTHON_UNPACK_METHODS | |
252 #define CYTHON_UNPACK_METHODS 0 | |
253 #undef CYTHON_FAST_THREAD_STATE | |
254 #define CYTHON_FAST_THREAD_STATE 0 | |
255 #undef CYTHON_FAST_GIL | |
256 #define CYTHON_FAST_GIL 0 | |
257 #undef CYTHON_METH_FASTCALL | |
258 #define CYTHON_METH_FASTCALL 0 | |
259 #undef CYTHON_FAST_PYCALL | |
260 #define CYTHON_FAST_PYCALL 0 | |
261 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
262 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) | |
263 #endif | |
264 #if PY_VERSION_HEX < 0x03090000 | |
265 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
266 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
267 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) | |
268 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
269 #endif | |
270 #undef CYTHON_USE_MODULE_STATE | |
271 #define CYTHON_USE_MODULE_STATE 0 | |
272 #undef CYTHON_USE_TP_FINALIZE | |
273 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) | |
274 #undef CYTHON_USE_DICT_VERSIONS | |
275 #define CYTHON_USE_DICT_VERSIONS 0 | |
276 #undef CYTHON_USE_EXC_INFO_STACK | |
277 #define CYTHON_USE_EXC_INFO_STACK 0 | |
278 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
279 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 | |
280 #endif | |
281 #undef CYTHON_USE_FREELISTS | |
282 #define CYTHON_USE_FREELISTS 0 | |
283 #elif defined(CYTHON_LIMITED_API) | |
284 #ifdef Py_LIMITED_API | |
285 #undef __PYX_LIMITED_VERSION_HEX | |
286 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API | |
287 #endif | |
288 #define CYTHON_COMPILING_IN_PYPY 0 | |
289 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
290 #define CYTHON_COMPILING_IN_LIMITED_API 1 | |
291 #define CYTHON_COMPILING_IN_GRAAL 0 | |
292 #define CYTHON_COMPILING_IN_NOGIL 0 | |
293 #undef CYTHON_CLINE_IN_TRACEBACK | |
294 #define CYTHON_CLINE_IN_TRACEBACK 0 | |
295 #undef CYTHON_USE_TYPE_SLOTS | |
296 #define CYTHON_USE_TYPE_SLOTS 0 | |
297 #undef CYTHON_USE_TYPE_SPECS | |
298 #define CYTHON_USE_TYPE_SPECS 1 | |
299 #undef CYTHON_USE_PYTYPE_LOOKUP | |
300 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
301 #undef CYTHON_USE_ASYNC_SLOTS | |
302 #define CYTHON_USE_ASYNC_SLOTS 0 | |
303 #undef CYTHON_USE_PYLIST_INTERNALS | |
304 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
305 #undef CYTHON_USE_UNICODE_INTERNALS | |
306 #define CYTHON_USE_UNICODE_INTERNALS 0 | |
307 #ifndef CYTHON_USE_UNICODE_WRITER | |
308 #define CYTHON_USE_UNICODE_WRITER 0 | |
309 #endif | |
310 #undef CYTHON_USE_PYLONG_INTERNALS | |
311 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
312 #ifndef CYTHON_AVOID_BORROWED_REFS | |
313 #define CYTHON_AVOID_BORROWED_REFS 0 | |
314 #endif | |
315 #undef CYTHON_ASSUME_SAFE_MACROS | |
316 #define CYTHON_ASSUME_SAFE_MACROS 0 | |
317 #undef CYTHON_UNPACK_METHODS | |
318 #define CYTHON_UNPACK_METHODS 0 | |
319 #undef CYTHON_FAST_THREAD_STATE | |
320 #define CYTHON_FAST_THREAD_STATE 0 | |
321 #undef CYTHON_FAST_GIL | |
322 #define CYTHON_FAST_GIL 0 | |
323 #undef CYTHON_METH_FASTCALL | |
324 #define CYTHON_METH_FASTCALL 0 | |
325 #undef CYTHON_FAST_PYCALL | |
326 #define CYTHON_FAST_PYCALL 0 | |
327 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
328 #define CYTHON_PEP487_INIT_SUBCLASS 1 | |
329 #endif | |
330 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
331 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
332 #undef CYTHON_USE_MODULE_STATE | |
333 #define CYTHON_USE_MODULE_STATE 1 | |
334 #ifndef CYTHON_USE_TP_FINALIZE | |
335 #define CYTHON_USE_TP_FINALIZE 0 | |
336 #endif | |
337 #undef CYTHON_USE_DICT_VERSIONS | |
338 #define CYTHON_USE_DICT_VERSIONS 0 | |
339 #undef CYTHON_USE_EXC_INFO_STACK | |
340 #define CYTHON_USE_EXC_INFO_STACK 0 | |
341 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
342 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 | |
343 #endif | |
344 #undef CYTHON_USE_FREELISTS | |
345 #define CYTHON_USE_FREELISTS 0 | |
346 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) | |
347 #define CYTHON_COMPILING_IN_PYPY 0 | |
348 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
349 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
350 #define CYTHON_COMPILING_IN_GRAAL 0 | |
351 #define CYTHON_COMPILING_IN_NOGIL 1 | |
352 #ifndef CYTHON_USE_TYPE_SLOTS | |
353 #define CYTHON_USE_TYPE_SLOTS 1 | |
354 #endif | |
355 #ifndef CYTHON_USE_TYPE_SPECS | |
356 #define CYTHON_USE_TYPE_SPECS 0 | |
357 #endif | |
358 #undef CYTHON_USE_PYTYPE_LOOKUP | |
359 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
360 #ifndef CYTHON_USE_ASYNC_SLOTS | |
361 #define CYTHON_USE_ASYNC_SLOTS 1 | |
362 #endif | |
363 #ifndef CYTHON_USE_PYLONG_INTERNALS | |
364 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
365 #endif | |
366 #undef CYTHON_USE_PYLIST_INTERNALS | |
367 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
368 #ifndef CYTHON_USE_UNICODE_INTERNALS | |
369 #define CYTHON_USE_UNICODE_INTERNALS 1 | |
370 #endif | |
371 #undef CYTHON_USE_UNICODE_WRITER | |
372 #define CYTHON_USE_UNICODE_WRITER 0 | |
373 #ifndef CYTHON_AVOID_BORROWED_REFS | |
374 #define CYTHON_AVOID_BORROWED_REFS 0 | |
375 #endif | |
376 #ifndef CYTHON_ASSUME_SAFE_MACROS | |
377 #define CYTHON_ASSUME_SAFE_MACROS 1 | |
378 #endif | |
379 #ifndef CYTHON_UNPACK_METHODS | |
380 #define CYTHON_UNPACK_METHODS 1 | |
381 #endif | |
382 #undef CYTHON_FAST_THREAD_STATE | |
383 #define CYTHON_FAST_THREAD_STATE 0 | |
384 #undef CYTHON_FAST_GIL | |
385 #define CYTHON_FAST_GIL 0 | |
386 #ifndef CYTHON_METH_FASTCALL | |
387 #define CYTHON_METH_FASTCALL 1 | |
388 #endif | |
389 #undef CYTHON_FAST_PYCALL | |
390 #define CYTHON_FAST_PYCALL 0 | |
391 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
392 #define CYTHON_PEP487_INIT_SUBCLASS 1 | |
393 #endif | |
394 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT | |
395 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
396 #endif | |
397 #ifndef CYTHON_USE_MODULE_STATE | |
398 #define CYTHON_USE_MODULE_STATE 0 | |
399 #endif | |
400 #ifndef CYTHON_USE_TP_FINALIZE | |
401 #define CYTHON_USE_TP_FINALIZE 1 | |
402 #endif | |
403 #undef CYTHON_USE_DICT_VERSIONS | |
404 #define CYTHON_USE_DICT_VERSIONS 0 | |
405 #undef CYTHON_USE_EXC_INFO_STACK | |
406 #define CYTHON_USE_EXC_INFO_STACK 0 | |
407 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
408 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 | |
409 #endif | |
410 #ifndef CYTHON_USE_FREELISTS | |
411 #define CYTHON_USE_FREELISTS 0 | |
412 #endif | |
413 #else | |
414 #define CYTHON_COMPILING_IN_PYPY 0 | |
415 #define CYTHON_COMPILING_IN_CPYTHON 1 | |
416 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
417 #define CYTHON_COMPILING_IN_GRAAL 0 | |
418 #define CYTHON_COMPILING_IN_NOGIL 0 | |
419 #ifndef CYTHON_USE_TYPE_SLOTS | |
420 #define CYTHON_USE_TYPE_SLOTS 1 | |
421 #endif | |
422 #ifndef CYTHON_USE_TYPE_SPECS | |
423 #define CYTHON_USE_TYPE_SPECS 0 | |
424 #endif | |
425 #ifndef CYTHON_USE_PYTYPE_LOOKUP | |
426 #define CYTHON_USE_PYTYPE_LOOKUP 1 | |
427 #endif | |
428 #if PY_MAJOR_VERSION < 3 | |
429 #undef CYTHON_USE_ASYNC_SLOTS | |
430 #define CYTHON_USE_ASYNC_SLOTS 0 | |
431 #elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
432 #define CYTHON_USE_ASYNC_SLOTS 1 | |
433 #endif | |
434 #ifndef CYTHON_USE_PYLONG_INTERNALS | |
435 #define CYTHON_USE_PYLONG_INTERNALS 1 | |
436 #endif | |
437 #ifndef CYTHON_USE_PYLIST_INTERNALS | |
438 #define CYTHON_USE_PYLIST_INTERNALS 1 | |
439 #endif | |
440 #ifndef CYTHON_USE_UNICODE_INTERNALS | |
441 #define CYTHON_USE_UNICODE_INTERNALS 1 | |
442 #endif | |
443 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 | |
444 #undef CYTHON_USE_UNICODE_WRITER | |
445 #define CYTHON_USE_UNICODE_WRITER 0 | |
446 #elif !defined(CYTHON_USE_UNICODE_WRITER) | |
447 #define CYTHON_USE_UNICODE_WRITER 1 | |
448 #endif | |
449 #ifndef CYTHON_AVOID_BORROWED_REFS | |
450 #define CYTHON_AVOID_BORROWED_REFS 0 | |
451 #endif | |
452 #ifndef CYTHON_ASSUME_SAFE_MACROS | |
453 #define CYTHON_ASSUME_SAFE_MACROS 1 | |
454 #endif | |
455 #ifndef CYTHON_UNPACK_METHODS | |
456 #define CYTHON_UNPACK_METHODS 1 | |
457 #endif | |
458 #ifndef CYTHON_FAST_THREAD_STATE | |
459 #define CYTHON_FAST_THREAD_STATE 1 | |
460 #endif | |
461 #ifndef CYTHON_FAST_GIL | |
462 #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) | |
463 #endif | |
464 #ifndef CYTHON_METH_FASTCALL | |
465 #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) | |
466 #endif | |
467 #ifndef CYTHON_FAST_PYCALL | |
468 #define CYTHON_FAST_PYCALL 1 | |
469 #endif | |
470 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
471 #define CYTHON_PEP487_INIT_SUBCLASS 1 | |
472 #endif | |
473 #if PY_VERSION_HEX < 0x03050000 | |
474 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
475 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
476 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) | |
477 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
478 #endif | |
479 #ifndef CYTHON_USE_MODULE_STATE | |
480 #define CYTHON_USE_MODULE_STATE 0 | |
481 #endif | |
482 #if PY_VERSION_HEX < 0x030400a1 | |
483 #undef CYTHON_USE_TP_FINALIZE | |
484 #define CYTHON_USE_TP_FINALIZE 0 | |
485 #elif !defined(CYTHON_USE_TP_FINALIZE) | |
486 #define CYTHON_USE_TP_FINALIZE 1 | |
487 #endif | |
488 #if PY_VERSION_HEX < 0x030600B1 | |
489 #undef CYTHON_USE_DICT_VERSIONS | |
490 #define CYTHON_USE_DICT_VERSIONS 0 | |
491 #elif !defined(CYTHON_USE_DICT_VERSIONS) | |
492 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) | |
493 #endif | |
494 #if PY_VERSION_HEX < 0x030700A3 | |
495 #undef CYTHON_USE_EXC_INFO_STACK | |
496 #define CYTHON_USE_EXC_INFO_STACK 0 | |
497 #elif !defined(CYTHON_USE_EXC_INFO_STACK) | |
498 #define CYTHON_USE_EXC_INFO_STACK 1 | |
499 #endif | |
500 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
501 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 | |
502 #endif | |
503 #ifndef CYTHON_USE_FREELISTS | |
504 #define CYTHON_USE_FREELISTS 1 | |
505 #endif | |
506 #endif | |
507 #if !defined(CYTHON_FAST_PYCCALL) | |
508 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) | |
509 #endif | |
510 #if !defined(CYTHON_VECTORCALL) | |
511 #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) | |
512 #endif | |
513 #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) | |
514 #if CYTHON_USE_PYLONG_INTERNALS | |
515 #if PY_MAJOR_VERSION < 3 | |
516 #include "longintrepr.h" | |
517 #endif | |
518 #undef SHIFT | |
519 #undef BASE | |
520 #undef MASK | |
521 #ifdef SIZEOF_VOID_P | |
522 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; | |
523 #endif | |
524 #endif | |
525 #ifndef __has_attribute | |
526 #define __has_attribute(x) 0 | |
527 #endif | |
528 #ifndef __has_cpp_attribute | |
529 #define __has_cpp_attribute(x) 0 | |
530 #endif | |
531 #ifndef CYTHON_RESTRICT | |
532 #if defined(__GNUC__) | |
533 #define CYTHON_RESTRICT __restrict__ | |
534 #elif defined(_MSC_VER) && _MSC_VER >= 1400 | |
535 #define CYTHON_RESTRICT __restrict | |
536 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
537 #define CYTHON_RESTRICT restrict | |
538 #else | |
539 #define CYTHON_RESTRICT | |
540 #endif | |
541 #endif | |
542 #ifndef CYTHON_UNUSED | |
543 #if defined(__cplusplus) | |
544 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 | |
545 * but leads to warnings with -pedantic, since it is a C++17 feature */ | |
546 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) | |
547 #if __has_cpp_attribute(maybe_unused) | |
548 #define CYTHON_UNUSED [[maybe_unused]] | |
549 #endif | |
550 #endif | |
551 #endif | |
552 #endif | |
553 #ifndef CYTHON_UNUSED | |
554 # if defined(__GNUC__) | |
555 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) | |
556 # define CYTHON_UNUSED __attribute__ ((__unused__)) | |
557 # else | |
558 # define CYTHON_UNUSED | |
559 # endif | |
560 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) | |
561 # define CYTHON_UNUSED __attribute__ ((__unused__)) | |
562 # else | |
563 # define CYTHON_UNUSED | |
564 # endif | |
565 #endif | |
566 #ifndef CYTHON_UNUSED_VAR | |
567 # if defined(__cplusplus) | |
568 template<class T> void CYTHON_UNUSED_VAR( const T& ) { } | |
569 # else | |
570 # define CYTHON_UNUSED_VAR(x) (void)(x) | |
571 # endif | |
572 #endif | |
573 #ifndef CYTHON_MAYBE_UNUSED_VAR | |
574 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) | |
575 #endif | |
576 #ifndef CYTHON_NCP_UNUSED | |
577 # if CYTHON_COMPILING_IN_CPYTHON | |
578 # define CYTHON_NCP_UNUSED | |
579 # else | |
580 # define CYTHON_NCP_UNUSED CYTHON_UNUSED | |
581 # endif | |
582 #endif | |
583 #ifndef CYTHON_USE_CPP_STD_MOVE | |
584 #if defined(__cplusplus) && (\ | |
585 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) | |
586 #define CYTHON_USE_CPP_STD_MOVE 1 | |
587 #else | |
588 #define CYTHON_USE_CPP_STD_MOVE 0 | |
589 #endif | |
590 #endif | |
591 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) | |
592 #ifdef _MSC_VER | |
593 #ifndef _MSC_STDINT_H_ | |
594 #if _MSC_VER < 1300 | |
595 typedef unsigned char uint8_t; | |
596 typedef unsigned short uint16_t; | |
597 typedef unsigned int uint32_t; | |
598 #else | |
599 typedef unsigned __int8 uint8_t; | |
600 typedef unsigned __int16 uint16_t; | |
601 typedef unsigned __int32 uint32_t; | |
602 #endif | |
603 #endif | |
604 #if _MSC_VER < 1300 | |
605 #ifdef _WIN64 | |
606 typedef unsigned long long __pyx_uintptr_t; | |
607 #else | |
608 typedef unsigned int __pyx_uintptr_t; | |
609 #endif | |
610 #else | |
611 #ifdef _WIN64 | |
612 typedef unsigned __int64 __pyx_uintptr_t; | |
613 #else | |
614 typedef unsigned __int32 __pyx_uintptr_t; | |
615 #endif | |
616 #endif | |
617 #else | |
618 #include <stdint.h> | |
619 typedef uintptr_t __pyx_uintptr_t; | |
620 #endif | |
621 #ifndef CYTHON_FALLTHROUGH | |
622 #if defined(__cplusplus) | |
623 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 | |
624 * but leads to warnings with -pedantic, since it is a C++17 feature */ | |
625 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) | |
626 #if __has_cpp_attribute(fallthrough) | |
627 #define CYTHON_FALLTHROUGH [[fallthrough]] | |
628 #endif | |
629 #endif | |
630 #ifndef CYTHON_FALLTHROUGH | |
631 #if __has_cpp_attribute(clang::fallthrough) | |
632 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] | |
633 #elif __has_cpp_attribute(gnu::fallthrough) | |
634 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] | |
635 #endif | |
636 #endif | |
637 #endif | |
638 #ifndef CYTHON_FALLTHROUGH | |
639 #if __has_attribute(fallthrough) | |
640 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) | |
641 #else | |
642 #define CYTHON_FALLTHROUGH | |
643 #endif | |
644 #endif | |
645 #if defined(__clang__) && defined(__apple_build_version__) | |
646 #if __apple_build_version__ < 7000000 | |
647 #undef CYTHON_FALLTHROUGH | |
648 #define CYTHON_FALLTHROUGH | |
649 #endif | |
650 #endif | |
651 #endif | |
652 #ifdef __cplusplus | |
653 template <typename T> | |
654 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; | |
655 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value) | |
656 #else | |
657 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) | |
658 #endif | |
659 #if CYTHON_COMPILING_IN_PYPY == 1 | |
660 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) | |
661 #else | |
662 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) | |
663 #endif | |
664 #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) | |
665 | |
666 #ifndef CYTHON_INLINE | |
667 #if defined(__clang__) | |
668 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) | |
669 #elif defined(__GNUC__) | |
670 #define CYTHON_INLINE __inline__ | |
671 #elif defined(_MSC_VER) | |
672 #define CYTHON_INLINE __inline | |
673 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
674 #define CYTHON_INLINE inline | |
675 #else | |
676 #define CYTHON_INLINE | |
677 #endif | |
678 #endif | |
679 | |
680 #define __PYX_BUILD_PY_SSIZE_T "n" | |
681 #define CYTHON_FORMAT_SSIZE_T "z" | |
682 #if PY_MAJOR_VERSION < 3 | |
683 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" | |
684 #define __Pyx_DefaultClassType PyClass_Type | |
685 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
686 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
687 #else | |
688 #define __Pyx_BUILTIN_MODULE_NAME "builtins" | |
689 #define __Pyx_DefaultClassType PyType_Type | |
690 #if CYTHON_COMPILING_IN_LIMITED_API | |
691 static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, | |
692 PyObject *code, PyObject *c, PyObject* n, PyObject *v, | |
693 PyObject *fv, PyObject *cell, PyObject* fn, | |
694 PyObject *name, int fline, PyObject *lnos) { | |
695 PyObject *exception_table = NULL; | |
696 PyObject *types_module=NULL, *code_type=NULL, *result=NULL; | |
697 #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 | |
698 PyObject *version_info; | |
699 PyObject *py_minor_version = NULL; | |
700 #endif | |
701 long minor_version = 0; | |
702 PyObject *type, *value, *traceback; | |
703 PyErr_Fetch(&type, &value, &traceback); | |
704 #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 | |
705 minor_version = 11; | |
706 #else | |
707 if (!(version_info = PySys_GetObject("version_info"))) goto end; | |
708 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; | |
709 minor_version = PyLong_AsLong(py_minor_version); | |
710 Py_DECREF(py_minor_version); | |
711 if (minor_version == -1 && PyErr_Occurred()) goto end; | |
712 #endif | |
713 if (!(types_module = PyImport_ImportModule("types"))) goto end; | |
714 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; | |
715 if (minor_version <= 7) { | |
716 (void)p; | |
717 result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, | |
718 c, n, v, fn, name, fline, lnos, fv, cell); | |
719 } else if (minor_version <= 10) { | |
720 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, | |
721 c, n, v, fn, name, fline, lnos, fv, cell); | |
722 } else { | |
723 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; | |
724 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, | |
725 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); | |
726 } | |
727 end: | |
728 Py_XDECREF(code_type); | |
729 Py_XDECREF(exception_table); | |
730 Py_XDECREF(types_module); | |
731 if (type) { | |
732 PyErr_Restore(type, value, traceback); | |
733 } | |
734 return result; | |
735 } | |
736 #ifndef CO_OPTIMIZED | |
737 #define CO_OPTIMIZED 0x0001 | |
738 #endif | |
739 #ifndef CO_NEWLOCALS | |
740 #define CO_NEWLOCALS 0x0002 | |
741 #endif | |
742 #ifndef CO_VARARGS | |
743 #define CO_VARARGS 0x0004 | |
744 #endif | |
745 #ifndef CO_VARKEYWORDS | |
746 #define CO_VARKEYWORDS 0x0008 | |
747 #endif | |
748 #ifndef CO_ASYNC_GENERATOR | |
749 #define CO_ASYNC_GENERATOR 0x0200 | |
750 #endif | |
751 #ifndef CO_GENERATOR | |
752 #define CO_GENERATOR 0x0020 | |
753 #endif | |
754 #ifndef CO_COROUTINE | |
755 #define CO_COROUTINE 0x0080 | |
756 #endif | |
757 #elif PY_VERSION_HEX >= 0x030B0000 | |
758 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, | |
759 PyObject *code, PyObject *c, PyObject* n, PyObject *v, | |
760 PyObject *fv, PyObject *cell, PyObject* fn, | |
761 PyObject *name, int fline, PyObject *lnos) { | |
762 PyCodeObject *result; | |
763 PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); | |
764 if (!empty_bytes) return NULL; | |
765 result = | |
766 #if PY_VERSION_HEX >= 0x030C0000 | |
767 PyUnstable_Code_NewWithPosOnlyArgs | |
768 #else | |
769 PyCode_NewWithPosOnlyArgs | |
770 #endif | |
771 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); | |
772 Py_DECREF(empty_bytes); | |
773 return result; | |
774 } | |
775 #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY | |
776 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
777 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
778 #else | |
779 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
780 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
781 #endif | |
782 #endif | |
783 #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) | |
784 #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) | |
785 #else | |
786 #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) | |
787 #endif | |
788 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) | |
789 #define __Pyx_Py_Is(x, y) Py_Is(x, y) | |
790 #else | |
791 #define __Pyx_Py_Is(x, y) ((x) == (y)) | |
792 #endif | |
793 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) | |
794 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) | |
795 #else | |
796 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) | |
797 #endif | |
798 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) | |
799 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) | |
800 #else | |
801 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) | |
802 #endif | |
803 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) | |
804 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) | |
805 #else | |
806 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) | |
807 #endif | |
808 #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) | |
809 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY | |
810 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) | |
811 #else | |
812 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) | |
813 #endif | |
814 #ifndef CO_COROUTINE | |
815 #define CO_COROUTINE 0x80 | |
816 #endif | |
817 #ifndef CO_ASYNC_GENERATOR | |
818 #define CO_ASYNC_GENERATOR 0x200 | |
819 #endif | |
820 #ifndef Py_TPFLAGS_CHECKTYPES | |
821 #define Py_TPFLAGS_CHECKTYPES 0 | |
822 #endif | |
823 #ifndef Py_TPFLAGS_HAVE_INDEX | |
824 #define Py_TPFLAGS_HAVE_INDEX 0 | |
825 #endif | |
826 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER | |
827 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 | |
828 #endif | |
829 #ifndef Py_TPFLAGS_HAVE_FINALIZE | |
830 #define Py_TPFLAGS_HAVE_FINALIZE 0 | |
831 #endif | |
832 #ifndef Py_TPFLAGS_SEQUENCE | |
833 #define Py_TPFLAGS_SEQUENCE 0 | |
834 #endif | |
835 #ifndef Py_TPFLAGS_MAPPING | |
836 #define Py_TPFLAGS_MAPPING 0 | |
837 #endif | |
838 #ifndef METH_STACKLESS | |
839 #define METH_STACKLESS 0 | |
840 #endif | |
841 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) | |
842 #ifndef METH_FASTCALL | |
843 #define METH_FASTCALL 0x80 | |
844 #endif | |
845 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); | |
846 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, | |
847 Py_ssize_t nargs, PyObject *kwnames); | |
848 #else | |
849 #if PY_VERSION_HEX >= 0x030d00A4 | |
850 # define __Pyx_PyCFunctionFast PyCFunctionFast | |
851 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords | |
852 #else | |
853 # define __Pyx_PyCFunctionFast _PyCFunctionFast | |
854 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords | |
855 #endif | |
856 #endif | |
857 #if CYTHON_METH_FASTCALL | |
858 #define __Pyx_METH_FASTCALL METH_FASTCALL | |
859 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast | |
860 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords | |
861 #else | |
862 #define __Pyx_METH_FASTCALL METH_VARARGS | |
863 #define __Pyx_PyCFunction_FastCall PyCFunction | |
864 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords | |
865 #endif | |
866 #if CYTHON_VECTORCALL | |
867 #define __pyx_vectorcallfunc vectorcallfunc | |
868 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET | |
869 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) | |
870 #elif CYTHON_BACKPORT_VECTORCALL | |
871 typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, | |
872 size_t nargsf, PyObject *kwnames); | |
873 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) | |
874 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) | |
875 #else | |
876 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 | |
877 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) | |
878 #endif | |
879 #if PY_MAJOR_VERSION >= 0x030900B1 | |
880 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) | |
881 #else | |
882 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) | |
883 #endif | |
884 #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) | |
885 #if CYTHON_COMPILING_IN_CPYTHON | |
886 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) | |
887 #elif !CYTHON_COMPILING_IN_LIMITED_API | |
888 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) | |
889 #endif | |
890 #if CYTHON_COMPILING_IN_CPYTHON | |
891 #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) | |
892 static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { | |
893 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; | |
894 } | |
895 #endif | |
896 static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { | |
897 #if CYTHON_COMPILING_IN_LIMITED_API | |
898 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; | |
899 #else | |
900 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; | |
901 #endif | |
902 } | |
903 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) | |
904 #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 | |
905 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) | |
906 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); | |
907 #else | |
908 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) | |
909 #define __Pyx_PyCMethod PyCMethod | |
910 #endif | |
911 #ifndef METH_METHOD | |
912 #define METH_METHOD 0x200 | |
913 #endif | |
914 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) | |
915 #define PyObject_Malloc(s) PyMem_Malloc(s) | |
916 #define PyObject_Free(p) PyMem_Free(p) | |
917 #define PyObject_Realloc(p) PyMem_Realloc(p) | |
918 #endif | |
919 #if CYTHON_COMPILING_IN_LIMITED_API | |
920 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) | |
921 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) | |
922 #else | |
923 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) | |
924 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) | |
925 #endif | |
926 #if CYTHON_COMPILING_IN_LIMITED_API | |
927 #define __Pyx_PyThreadState_Current PyThreadState_Get() | |
928 #elif !CYTHON_FAST_THREAD_STATE | |
929 #define __Pyx_PyThreadState_Current PyThreadState_GET() | |
930 #elif PY_VERSION_HEX >= 0x030d00A1 | |
931 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() | |
932 #elif PY_VERSION_HEX >= 0x03060000 | |
933 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() | |
934 #elif PY_VERSION_HEX >= 0x03000000 | |
935 #define __Pyx_PyThreadState_Current PyThreadState_GET() | |
936 #else | |
937 #define __Pyx_PyThreadState_Current _PyThreadState_Current | |
938 #endif | |
939 #if CYTHON_COMPILING_IN_LIMITED_API | |
940 static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) | |
941 { | |
942 void *result; | |
943 result = PyModule_GetState(op); | |
944 if (!result) | |
945 Py_FatalError("Couldn't find the module state"); | |
946 return result; | |
947 } | |
948 #endif | |
949 #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) | |
950 #if CYTHON_COMPILING_IN_LIMITED_API | |
951 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) | |
952 #else | |
953 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) | |
954 #endif | |
955 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) | |
956 #include "pythread.h" | |
957 #define Py_tss_NEEDS_INIT 0 | |
958 typedef int Py_tss_t; | |
959 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { | |
960 *key = PyThread_create_key(); | |
961 return 0; | |
962 } | |
963 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { | |
964 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); | |
965 *key = Py_tss_NEEDS_INIT; | |
966 return key; | |
967 } | |
968 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { | |
969 PyObject_Free(key); | |
970 } | |
971 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { | |
972 return *key != Py_tss_NEEDS_INIT; | |
973 } | |
974 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { | |
975 PyThread_delete_key(*key); | |
976 *key = Py_tss_NEEDS_INIT; | |
977 } | |
978 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { | |
979 return PyThread_set_key_value(*key, value); | |
980 } | |
981 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { | |
982 return PyThread_get_key_value(*key); | |
983 } | |
984 #endif | |
985 #if PY_MAJOR_VERSION < 3 | |
986 #if CYTHON_COMPILING_IN_PYPY | |
987 #if PYPY_VERSION_NUM < 0x07030600 | |
988 #if defined(__cplusplus) && __cplusplus >= 201402L | |
989 [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] | |
990 #elif defined(__GNUC__) || defined(__clang__) | |
991 __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) | |
992 #elif defined(_MSC_VER) | |
993 __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) | |
994 #endif | |
995 static CYTHON_INLINE int PyGILState_Check(void) { | |
996 return 0; | |
997 } | |
998 #else // PYPY_VERSION_NUM < 0x07030600 | |
999 #endif // PYPY_VERSION_NUM < 0x07030600 | |
1000 #else | |
1001 static CYTHON_INLINE int PyGILState_Check(void) { | |
1002 PyThreadState * tstate = _PyThreadState_Current; | |
1003 return tstate && (tstate == PyGILState_GetThisThreadState()); | |
1004 } | |
1005 #endif | |
1006 #endif | |
1007 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) | |
1008 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) | |
1009 #else | |
1010 #define __Pyx_PyDict_NewPresized(n) PyDict_New() | |
1011 #endif | |
1012 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION | |
1013 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) | |
1014 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) | |
1015 #else | |
1016 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) | |
1017 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) | |
1018 #endif | |
1019 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS | |
1020 #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) | |
1021 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { | |
1022 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); | |
1023 if (res == NULL) PyErr_Clear(); | |
1024 return res; | |
1025 } | |
1026 #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) | |
1027 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError | |
1028 #define __Pyx_PyDict_GetItemStr PyDict_GetItem | |
1029 #else | |
1030 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { | |
1031 #if CYTHON_COMPILING_IN_PYPY | |
1032 return PyDict_GetItem(dict, name); | |
1033 #else | |
1034 PyDictEntry *ep; | |
1035 PyDictObject *mp = (PyDictObject*) dict; | |
1036 long hash = ((PyStringObject *) name)->ob_shash; | |
1037 assert(hash != -1); | |
1038 ep = (mp->ma_lookup)(mp, name, hash); | |
1039 if (ep == NULL) { | |
1040 return NULL; | |
1041 } | |
1042 return ep->me_value; | |
1043 #endif | |
1044 } | |
1045 #define __Pyx_PyDict_GetItemStr PyDict_GetItem | |
1046 #endif | |
1047 #if CYTHON_USE_TYPE_SLOTS | |
1048 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) | |
1049 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) | |
1050 #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) | |
1051 #else | |
1052 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) | |
1053 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) | |
1054 #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next | |
1055 #endif | |
1056 #if CYTHON_COMPILING_IN_LIMITED_API | |
1057 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) | |
1058 #else | |
1059 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) | |
1060 #endif | |
1061 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 | |
1062 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ | |
1063 PyTypeObject *type = Py_TYPE((PyObject*)obj);\ | |
1064 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ | |
1065 PyObject_GC_Del(obj);\ | |
1066 Py_DECREF(type);\ | |
1067 } | |
1068 #else | |
1069 #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) | |
1070 #endif | |
1071 #if CYTHON_COMPILING_IN_LIMITED_API | |
1072 #define CYTHON_PEP393_ENABLED 1 | |
1073 #define __Pyx_PyUnicode_READY(op) (0) | |
1074 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) | |
1075 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) | |
1076 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) | |
1077 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) | |
1078 #define __Pyx_PyUnicode_DATA(u) ((void*)u) | |
1079 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) | |
1080 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) | |
1081 #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) | |
1082 #define CYTHON_PEP393_ENABLED 1 | |
1083 #if PY_VERSION_HEX >= 0x030C0000 | |
1084 #define __Pyx_PyUnicode_READY(op) (0) | |
1085 #else | |
1086 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ | |
1087 0 : _PyUnicode_Ready((PyObject *)(op))) | |
1088 #endif | |
1089 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) | |
1090 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) | |
1091 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) | |
1092 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) | |
1093 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) | |
1094 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) | |
1095 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) | |
1096 #if PY_VERSION_HEX >= 0x030C0000 | |
1097 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) | |
1098 #else | |
1099 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 | |
1100 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) | |
1101 #else | |
1102 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) | |
1103 #endif | |
1104 #endif | |
1105 #else | |
1106 #define CYTHON_PEP393_ENABLED 0 | |
1107 #define PyUnicode_1BYTE_KIND 1 | |
1108 #define PyUnicode_2BYTE_KIND 2 | |
1109 #define PyUnicode_4BYTE_KIND 4 | |
1110 #define __Pyx_PyUnicode_READY(op) (0) | |
1111 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) | |
1112 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) | |
1113 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) | |
1114 #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) | |
1115 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) | |
1116 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) | |
1117 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) | |
1118 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) | |
1119 #endif | |
1120 #if CYTHON_COMPILING_IN_PYPY | |
1121 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) | |
1122 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) | |
1123 #else | |
1124 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) | |
1125 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ | |
1126 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) | |
1127 #endif | |
1128 #if CYTHON_COMPILING_IN_PYPY | |
1129 #if !defined(PyUnicode_DecodeUnicodeEscape) | |
1130 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) | |
1131 #endif | |
1132 #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) | |
1133 #undef PyUnicode_Contains | |
1134 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) | |
1135 #endif | |
1136 #if !defined(PyByteArray_Check) | |
1137 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) | |
1138 #endif | |
1139 #if !defined(PyObject_Format) | |
1140 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) | |
1141 #endif | |
1142 #endif | |
1143 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) | |
1144 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) | |
1145 #if PY_MAJOR_VERSION >= 3 | |
1146 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) | |
1147 #else | |
1148 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) | |
1149 #endif | |
1150 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) | |
1151 #define PyObject_ASCII(o) PyObject_Repr(o) | |
1152 #endif | |
1153 #if PY_MAJOR_VERSION >= 3 | |
1154 #define PyBaseString_Type PyUnicode_Type | |
1155 #define PyStringObject PyUnicodeObject | |
1156 #define PyString_Type PyUnicode_Type | |
1157 #define PyString_Check PyUnicode_Check | |
1158 #define PyString_CheckExact PyUnicode_CheckExact | |
1159 #ifndef PyObject_Unicode | |
1160 #define PyObject_Unicode PyObject_Str | |
1161 #endif | |
1162 #endif | |
1163 #if PY_MAJOR_VERSION >= 3 | |
1164 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) | |
1165 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) | |
1166 #else | |
1167 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) | |
1168 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) | |
1169 #endif | |
1170 #if CYTHON_COMPILING_IN_CPYTHON | |
1171 #define __Pyx_PySequence_ListKeepNew(obj)\ | |
1172 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) | |
1173 #else | |
1174 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) | |
1175 #endif | |
1176 #ifndef PySet_CheckExact | |
1177 #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) | |
1178 #endif | |
1179 #if PY_VERSION_HEX >= 0x030900A4 | |
1180 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) | |
1181 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) | |
1182 #else | |
1183 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) | |
1184 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) | |
1185 #endif | |
1186 #if CYTHON_ASSUME_SAFE_MACROS | |
1187 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) | |
1188 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) | |
1189 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) | |
1190 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) | |
1191 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) | |
1192 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) | |
1193 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) | |
1194 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) | |
1195 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) | |
1196 #else | |
1197 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) | |
1198 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) | |
1199 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) | |
1200 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) | |
1201 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) | |
1202 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) | |
1203 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) | |
1204 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) | |
1205 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) | |
1206 #endif | |
1207 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 | |
1208 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) | |
1209 #else | |
1210 static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { | |
1211 PyObject *module = PyImport_AddModule(name); | |
1212 Py_XINCREF(module); | |
1213 return module; | |
1214 } | |
1215 #endif | |
1216 #if PY_MAJOR_VERSION >= 3 | |
1217 #define PyIntObject PyLongObject | |
1218 #define PyInt_Type PyLong_Type | |
1219 #define PyInt_Check(op) PyLong_Check(op) | |
1220 #define PyInt_CheckExact(op) PyLong_CheckExact(op) | |
1221 #define __Pyx_Py3Int_Check(op) PyLong_Check(op) | |
1222 #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) | |
1223 #define PyInt_FromString PyLong_FromString | |
1224 #define PyInt_FromUnicode PyLong_FromUnicode | |
1225 #define PyInt_FromLong PyLong_FromLong | |
1226 #define PyInt_FromSize_t PyLong_FromSize_t | |
1227 #define PyInt_FromSsize_t PyLong_FromSsize_t | |
1228 #define PyInt_AsLong PyLong_AsLong | |
1229 #define PyInt_AS_LONG PyLong_AS_LONG | |
1230 #define PyInt_AsSsize_t PyLong_AsSsize_t | |
1231 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask | |
1232 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask | |
1233 #define PyNumber_Int PyNumber_Long | |
1234 #else | |
1235 #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) | |
1236 #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) | |
1237 #endif | |
1238 #if PY_MAJOR_VERSION >= 3 | |
1239 #define PyBoolObject PyLongObject | |
1240 #endif | |
1241 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY | |
1242 #ifndef PyUnicode_InternFromString | |
1243 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) | |
1244 #endif | |
1245 #endif | |
1246 #if PY_VERSION_HEX < 0x030200A4 | |
1247 typedef long Py_hash_t; | |
1248 #define __Pyx_PyInt_FromHash_t PyInt_FromLong | |
1249 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t | |
1250 #else | |
1251 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t | |
1252 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t | |
1253 #endif | |
1254 #if CYTHON_USE_ASYNC_SLOTS | |
1255 #if PY_VERSION_HEX >= 0x030500B1 | |
1256 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods | |
1257 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) | |
1258 #else | |
1259 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) | |
1260 #endif | |
1261 #else | |
1262 #define __Pyx_PyType_AsAsync(obj) NULL | |
1263 #endif | |
1264 #ifndef __Pyx_PyAsyncMethodsStruct | |
1265 typedef struct { | |
1266 unaryfunc am_await; | |
1267 unaryfunc am_aiter; | |
1268 unaryfunc am_anext; | |
1269 } __Pyx_PyAsyncMethodsStruct; | |
1270 #endif | |
1271 | |
1272 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) | |
1273 #if !defined(_USE_MATH_DEFINES) | |
1274 #define _USE_MATH_DEFINES | |
1275 #endif | |
1276 #endif | |
1277 #include <math.h> | |
1278 #ifdef NAN | |
1279 #define __PYX_NAN() ((float) NAN) | |
1280 #else | |
1281 static CYTHON_INLINE float __PYX_NAN() { | |
1282 float value; | |
1283 memset(&value, 0xFF, sizeof(value)); | |
1284 return value; | |
1285 } | |
1286 #endif | |
1287 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) | |
1288 #define __Pyx_truncl trunc | |
1289 #else | |
1290 #define __Pyx_truncl truncl | |
1291 #endif | |
1292 | |
1293 #define __PYX_MARK_ERR_POS(f_index, lineno) \ | |
1294 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } | |
1295 #define __PYX_ERR(f_index, lineno, Ln_error) \ | |
1296 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } | |
1297 | |
1298 #ifdef CYTHON_EXTERN_C | |
1299 #undef __PYX_EXTERN_C | |
1300 #define __PYX_EXTERN_C CYTHON_EXTERN_C | |
1301 #elif defined(__PYX_EXTERN_C) | |
1302 #ifdef _MSC_VER | |
1303 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") | |
1304 #else | |
1305 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. | |
1306 #endif | |
1307 #else | |
1308 #ifdef __cplusplus | |
1309 #define __PYX_EXTERN_C extern "C" | |
1310 #else | |
1311 #define __PYX_EXTERN_C extern | |
1312 #endif | |
1313 #endif | |
1314 | |
1315 #define __PYX_HAVE__pysam__libcvcf | |
1316 #define __PYX_HAVE_API__pysam__libcvcf | |
1317 /* Early includes */ | |
1318 #include <string.h> | |
1319 #include <stdlib.h> | |
1320 #include <stdint.h> | |
1321 #include <stdio.h> | |
1322 #include "fcntl.h" | |
1323 #include "unistd.h" | |
1324 #include <sys/types.h> | |
1325 #include "stdarg.h" | |
1326 #include "htslib/kstring.h" | |
1327 #include "htslib_util.h" | |
1328 #include "htslib/hfile.h" | |
1329 #include "htslib/bgzf.h" | |
1330 #include "htslib/hts.h" | |
1331 #include "htslib/sam.h" | |
1332 #include "htslib/faidx.h" | |
1333 #include "htslib/tbx.h" | |
1334 #include "htslib/vcf.h" | |
1335 #include "htslib/vcfutils.h" | |
1336 #include "htslib/cram.h" | |
1337 #include "pysam_stream.h" | |
1338 #include <stddef.h> | |
1339 #include "pythread.h" | |
1340 | |
1341 #if CYTHON_COMPILING_IN_PYPY | |
1342 #ifdef _MSC_VER | |
1343 #pragma message ("This module uses CPython specific internals of 'array.array', which are not available in PyPy.") | |
1344 #else | |
1345 #warning This module uses CPython specific internals of 'array.array', which are not available in PyPy. | |
1346 #endif | |
1347 #endif | |
1348 | |
1349 #ifdef _OPENMP | |
1350 #include <omp.h> | |
1351 #endif /* _OPENMP */ | |
1352 | |
1353 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) | |
1354 #define CYTHON_WITHOUT_ASSERTIONS | |
1355 #endif | |
1356 | |
1357 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; | |
1358 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; | |
1359 | |
1360 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 | |
1361 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 | |
1362 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) | |
1363 #define __PYX_DEFAULT_STRING_ENCODING "" | |
1364 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString | |
1365 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
1366 #define __Pyx_uchar_cast(c) ((unsigned char)c) | |
1367 #define __Pyx_long_cast(x) ((long)x) | |
1368 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ | |
1369 (sizeof(type) < sizeof(Py_ssize_t)) ||\ | |
1370 (sizeof(type) > sizeof(Py_ssize_t) &&\ | |
1371 likely(v < (type)PY_SSIZE_T_MAX ||\ | |
1372 v == (type)PY_SSIZE_T_MAX) &&\ | |
1373 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ | |
1374 v == (type)PY_SSIZE_T_MIN))) ||\ | |
1375 (sizeof(type) == sizeof(Py_ssize_t) &&\ | |
1376 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ | |
1377 v == (type)PY_SSIZE_T_MAX))) ) | |
1378 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { | |
1379 return (size_t) i < (size_t) limit; | |
1380 } | |
1381 #if defined (__cplusplus) && __cplusplus >= 201103L | |
1382 #include <cstdlib> | |
1383 #define __Pyx_sst_abs(value) std::abs(value) | |
1384 #elif SIZEOF_INT >= SIZEOF_SIZE_T | |
1385 #define __Pyx_sst_abs(value) abs(value) | |
1386 #elif SIZEOF_LONG >= SIZEOF_SIZE_T | |
1387 #define __Pyx_sst_abs(value) labs(value) | |
1388 #elif defined (_MSC_VER) | |
1389 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) | |
1390 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
1391 #define __Pyx_sst_abs(value) llabs(value) | |
1392 #elif defined (__GNUC__) | |
1393 #define __Pyx_sst_abs(value) __builtin_llabs(value) | |
1394 #else | |
1395 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) | |
1396 #endif | |
1397 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); | |
1398 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); | |
1399 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); | |
1400 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); | |
1401 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) | |
1402 #define __Pyx_PyBytes_FromString PyBytes_FromString | |
1403 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize | |
1404 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); | |
1405 #if PY_MAJOR_VERSION < 3 | |
1406 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString | |
1407 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
1408 #else | |
1409 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString | |
1410 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize | |
1411 #endif | |
1412 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) | |
1413 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) | |
1414 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) | |
1415 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) | |
1416 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) | |
1417 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) | |
1418 #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) | |
1419 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) | |
1420 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) | |
1421 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) | |
1422 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) | |
1423 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) | |
1424 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) | |
1425 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) | |
1426 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) | |
1427 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) | |
1428 #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) | |
1429 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode | |
1430 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) | |
1431 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) | |
1432 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); | |
1433 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); | |
1434 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); | |
1435 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); | |
1436 #define __Pyx_PySequence_Tuple(obj)\ | |
1437 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) | |
1438 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); | |
1439 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); | |
1440 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); | |
1441 #if CYTHON_ASSUME_SAFE_MACROS | |
1442 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) | |
1443 #else | |
1444 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) | |
1445 #endif | |
1446 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) | |
1447 #if PY_MAJOR_VERSION >= 3 | |
1448 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) | |
1449 #else | |
1450 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) | |
1451 #endif | |
1452 #if CYTHON_USE_PYLONG_INTERNALS | |
1453 #if PY_VERSION_HEX >= 0x030C00A7 | |
1454 #ifndef _PyLong_SIGN_MASK | |
1455 #define _PyLong_SIGN_MASK 3 | |
1456 #endif | |
1457 #ifndef _PyLong_NON_SIZE_BITS | |
1458 #define _PyLong_NON_SIZE_BITS 3 | |
1459 #endif | |
1460 #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) | |
1461 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) | |
1462 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) | |
1463 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) | |
1464 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) | |
1465 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) | |
1466 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) | |
1467 #define __Pyx_PyLong_SignedDigitCount(x)\ | |
1468 ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) | |
1469 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) | |
1470 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) | |
1471 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) | |
1472 #else | |
1473 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) | |
1474 #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) | |
1475 #endif | |
1476 typedef Py_ssize_t __Pyx_compact_pylong; | |
1477 typedef size_t __Pyx_compact_upylong; | |
1478 #else | |
1479 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) | |
1480 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) | |
1481 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) | |
1482 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) | |
1483 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) | |
1484 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) | |
1485 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) | |
1486 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) | |
1487 #define __Pyx_PyLong_CompactValue(x)\ | |
1488 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) | |
1489 typedef sdigit __Pyx_compact_pylong; | |
1490 typedef digit __Pyx_compact_upylong; | |
1491 #endif | |
1492 #if PY_VERSION_HEX >= 0x030C00A5 | |
1493 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) | |
1494 #else | |
1495 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) | |
1496 #endif | |
1497 #endif | |
1498 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
1499 #include <string.h> | |
1500 static int __Pyx_sys_getdefaultencoding_not_ascii; | |
1501 static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
1502 PyObject* sys; | |
1503 PyObject* default_encoding = NULL; | |
1504 PyObject* ascii_chars_u = NULL; | |
1505 PyObject* ascii_chars_b = NULL; | |
1506 const char* default_encoding_c; | |
1507 sys = PyImport_ImportModule("sys"); | |
1508 if (!sys) goto bad; | |
1509 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); | |
1510 Py_DECREF(sys); | |
1511 if (!default_encoding) goto bad; | |
1512 default_encoding_c = PyBytes_AsString(default_encoding); | |
1513 if (!default_encoding_c) goto bad; | |
1514 if (strcmp(default_encoding_c, "ascii") == 0) { | |
1515 __Pyx_sys_getdefaultencoding_not_ascii = 0; | |
1516 } else { | |
1517 char ascii_chars[128]; | |
1518 int c; | |
1519 for (c = 0; c < 128; c++) { | |
1520 ascii_chars[c] = (char) c; | |
1521 } | |
1522 __Pyx_sys_getdefaultencoding_not_ascii = 1; | |
1523 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); | |
1524 if (!ascii_chars_u) goto bad; | |
1525 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); | |
1526 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { | |
1527 PyErr_Format( | |
1528 PyExc_ValueError, | |
1529 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", | |
1530 default_encoding_c); | |
1531 goto bad; | |
1532 } | |
1533 Py_DECREF(ascii_chars_u); | |
1534 Py_DECREF(ascii_chars_b); | |
1535 } | |
1536 Py_DECREF(default_encoding); | |
1537 return 0; | |
1538 bad: | |
1539 Py_XDECREF(default_encoding); | |
1540 Py_XDECREF(ascii_chars_u); | |
1541 Py_XDECREF(ascii_chars_b); | |
1542 return -1; | |
1543 } | |
1544 #endif | |
1545 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 | |
1546 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) | |
1547 #else | |
1548 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) | |
1549 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
1550 #include <string.h> | |
1551 static char* __PYX_DEFAULT_STRING_ENCODING; | |
1552 static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
1553 PyObject* sys; | |
1554 PyObject* default_encoding = NULL; | |
1555 char* default_encoding_c; | |
1556 sys = PyImport_ImportModule("sys"); | |
1557 if (!sys) goto bad; | |
1558 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); | |
1559 Py_DECREF(sys); | |
1560 if (!default_encoding) goto bad; | |
1561 default_encoding_c = PyBytes_AsString(default_encoding); | |
1562 if (!default_encoding_c) goto bad; | |
1563 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); | |
1564 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; | |
1565 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); | |
1566 Py_DECREF(default_encoding); | |
1567 return 0; | |
1568 bad: | |
1569 Py_XDECREF(default_encoding); | |
1570 return -1; | |
1571 } | |
1572 #endif | |
1573 #endif | |
1574 | |
1575 | |
1576 /* Test for GCC > 2.95 */ | |
1577 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) | |
1578 #define likely(x) __builtin_expect(!!(x), 1) | |
1579 #define unlikely(x) __builtin_expect(!!(x), 0) | |
1580 #else /* !__GNUC__ or GCC < 2.95 */ | |
1581 #define likely(x) (x) | |
1582 #define unlikely(x) (x) | |
1583 #endif /* __GNUC__ */ | |
1584 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } | |
1585 | |
1586 #if !CYTHON_USE_MODULE_STATE | |
1587 static PyObject *__pyx_m = NULL; | |
1588 #endif | |
1589 static int __pyx_lineno; | |
1590 static int __pyx_clineno = 0; | |
1591 static const char * __pyx_cfilenm = __FILE__; | |
1592 static const char *__pyx_filename; | |
1593 | |
1594 /* #### Code section: filename_table ### */ | |
1595 | |
1596 static const char *__pyx_f[] = { | |
1597 "pysam/libcvcf.pyx", | |
1598 "<stringsource>", | |
1599 "contextvars.pxd", | |
1600 "array.pxd", | |
1601 "pysam/libchtslib.pxd", | |
1602 "pysam/libctabix.pxd", | |
1603 "pysam/libctabixproxies.pxd", | |
1604 "type.pxd", | |
1605 "bool.pxd", | |
1606 "complex.pxd", | |
1607 }; | |
1608 /* #### Code section: utility_code_proto_before_types ### */ | |
1609 /* ForceInitThreads.proto */ | |
1610 #ifndef __PYX_FORCE_INIT_THREADS | |
1611 #define __PYX_FORCE_INIT_THREADS 0 | |
1612 #endif | |
1613 | |
1614 /* #### Code section: numeric_typedefs ### */ | |
1615 /* #### Code section: complex_type_declarations ### */ | |
1616 /* #### Code section: type_declarations ### */ | |
1617 | |
1618 /*--- Type declarations ---*/ | |
1619 #ifndef _ARRAYARRAY_H | |
1620 struct arrayobject; | |
1621 typedef struct arrayobject arrayobject; | |
1622 #endif | |
1623 struct __pyx_obj_5pysam_10libchtslib_HTSFile; | |
1624 struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator; | |
1625 struct __pyx_obj_5pysam_9libctabix_TabixFile; | |
1626 struct __pyx_obj_5pysam_9libctabix_Parser; | |
1627 struct __pyx_obj_5pysam_9libctabix_asTuple; | |
1628 struct __pyx_obj_5pysam_9libctabix_asGTF; | |
1629 struct __pyx_obj_5pysam_9libctabix_asGFF3; | |
1630 struct __pyx_obj_5pysam_9libctabix_asBed; | |
1631 struct __pyx_obj_5pysam_9libctabix_asVCF; | |
1632 struct __pyx_obj_5pysam_9libctabix_TabixIterator; | |
1633 struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed; | |
1634 struct __pyx_obj_5pysam_9libctabix_GZIterator; | |
1635 struct __pyx_obj_5pysam_9libctabix_GZIteratorHead; | |
1636 struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed; | |
1637 struct __pyx_obj_5pysam_9libctabix_Tabixfile; | |
1638 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy; | |
1639 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxyIterator; | |
1640 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy; | |
1641 struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy; | |
1642 struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy; | |
1643 struct __pyx_obj_5pysam_16libctabixproxies_BedProxy; | |
1644 struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy; | |
1645 struct __pyx_obj_5pysam_7libcvcf_VCFRecord; | |
1646 struct __pyx_obj_5pysam_7libcvcf_asVCFRecord; | |
1647 struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse; | |
1648 struct __pyx_opt_args_5pysam_16libctabixproxies_10TupleProxy_copy; | |
1649 | |
1650 /* "pysam/libctabixproxies.pxd":23 | |
1651 * cdef take(self, char * buffer, size_t nbytes) | |
1652 * cdef present(self, char * buffer, size_t nbytes) | |
1653 * cdef copy(self, char * buffer, size_t nbytes, bint reset=*) # <<<<<<<<<<<<<< | |
1654 * cdef update(self, char * buffer, size_t nbytes) | |
1655 * | |
1656 */ | |
1657 struct __pyx_opt_args_5pysam_16libctabixproxies_10TupleProxy_copy { | |
1658 int __pyx_n; | |
1659 int reset; | |
1660 }; | |
1661 struct __pyx_opt_args_7cpython_11contextvars_get_value; | |
1662 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; | |
1663 | |
1664 /* "cpython/contextvars.pxd":112 | |
1665 * | |
1666 * | |
1667 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< | |
1668 * """Return a new reference to the value of the context variable, | |
1669 * or the default value of the context variable, | |
1670 */ | |
1671 struct __pyx_opt_args_7cpython_11contextvars_get_value { | |
1672 int __pyx_n; | |
1673 PyObject *default_value; | |
1674 }; | |
1675 | |
1676 /* "cpython/contextvars.pxd":129 | |
1677 * | |
1678 * | |
1679 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< | |
1680 * """Return a new reference to the value of the context variable, | |
1681 * or the provided default value if no such value was found. | |
1682 */ | |
1683 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { | |
1684 int __pyx_n; | |
1685 PyObject *default_value; | |
1686 }; | |
1687 struct __pyx_opt_args_5pysam_9libcutils_parse_region; | |
1688 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array; | |
1689 struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring; | |
1690 struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring; | |
1691 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str; | |
1692 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes; | |
1693 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len; | |
1694 struct __pyx_opt_args_5pysam_9libcutils_force_str; | |
1695 struct __pyx_opt_args_5pysam_9libcutils_force_bytes; | |
1696 struct __pyx_opt_args_5pysam_9libcutils_decode_bytes; | |
1697 | |
1698 /* "pysam/libcutils.pxd":8 | |
1699 * from cpython cimport array as c_array | |
1700 * | |
1701 * cpdef parse_region(contig=*, start=*, stop=*, region=*, reference=*, end=*) # <<<<<<<<<<<<<< | |
1702 * | |
1703 * cdef int libc_whence_from_io(int whence) | |
1704 */ | |
1705 struct __pyx_opt_args_5pysam_9libcutils_parse_region { | |
1706 int __pyx_n; | |
1707 PyObject *contig; | |
1708 PyObject *start; | |
1709 PyObject *stop; | |
1710 PyObject *region; | |
1711 PyObject *reference; | |
1712 PyObject *end; | |
1713 }; | |
1714 | |
1715 /* "pysam/libcutils.pxd":15 | |
1716 * # Utility functions for quality string conversions | |
1717 * | |
1718 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) # <<<<<<<<<<<<<< | |
1719 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) | |
1720 * cpdef qualities_to_qualitystring(qualities, int offset=*) | |
1721 */ | |
1722 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array { | |
1723 int __pyx_n; | |
1724 int offset; | |
1725 }; | |
1726 | |
1727 /* "pysam/libcutils.pxd":16 | |
1728 * | |
1729 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) | |
1730 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) # <<<<<<<<<<<<<< | |
1731 * cpdef qualities_to_qualitystring(qualities, int offset=*) | |
1732 * | |
1733 */ | |
1734 struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring { | |
1735 int __pyx_n; | |
1736 int offset; | |
1737 }; | |
1738 | |
1739 /* "pysam/libcutils.pxd":17 | |
1740 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) | |
1741 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) | |
1742 * cpdef qualities_to_qualitystring(qualities, int offset=*) # <<<<<<<<<<<<<< | |
1743 * | |
1744 * ######################################################################## | |
1745 */ | |
1746 struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring { | |
1747 int __pyx_n; | |
1748 int offset; | |
1749 }; | |
1750 | |
1751 /* "pysam/libcutils.pxd":29 | |
1752 * ## Python 3 compatibility functions | |
1753 * ######################################################################## | |
1754 * cdef charptr_to_str(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1755 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) | |
1756 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1757 */ | |
1758 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str { | |
1759 int __pyx_n; | |
1760 PyObject *encoding; | |
1761 PyObject *errors; | |
1762 }; | |
1763 | |
1764 /* "pysam/libcutils.pxd":30 | |
1765 * ######################################################################## | |
1766 * cdef charptr_to_str(const char *s, encoding=*, errors=*) | |
1767 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1768 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1769 * cdef force_str(object s, encoding=*, errors=*) | |
1770 */ | |
1771 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes { | |
1772 int __pyx_n; | |
1773 PyObject *encoding; | |
1774 PyObject *errors; | |
1775 }; | |
1776 | |
1777 /* "pysam/libcutils.pxd":31 | |
1778 * cdef charptr_to_str(const char *s, encoding=*, errors=*) | |
1779 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) | |
1780 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1781 * cdef force_str(object s, encoding=*, errors=*) | |
1782 * cdef bytes force_bytes(object s, encoding=*, errors=*) | |
1783 */ | |
1784 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len { | |
1785 int __pyx_n; | |
1786 PyObject *encoding; | |
1787 PyObject *errors; | |
1788 }; | |
1789 | |
1790 /* "pysam/libcutils.pxd":32 | |
1791 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) | |
1792 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1793 * cdef force_str(object s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1794 * cdef bytes force_bytes(object s, encoding=*, errors=*) | |
1795 * cdef decode_bytes(bytes s, encoding=*, errors=*) | |
1796 */ | |
1797 struct __pyx_opt_args_5pysam_9libcutils_force_str { | |
1798 int __pyx_n; | |
1799 PyObject *encoding; | |
1800 PyObject *errors; | |
1801 }; | |
1802 | |
1803 /* "pysam/libcutils.pxd":33 | |
1804 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1805 * cdef force_str(object s, encoding=*, errors=*) | |
1806 * cdef bytes force_bytes(object s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1807 * cdef decode_bytes(bytes s, encoding=*, errors=*) | |
1808 * cdef bytes encode_filename(object filename) | |
1809 */ | |
1810 struct __pyx_opt_args_5pysam_9libcutils_force_bytes { | |
1811 int __pyx_n; | |
1812 PyObject *encoding; | |
1813 PyObject *errors; | |
1814 }; | |
1815 | |
1816 /* "pysam/libcutils.pxd":34 | |
1817 * cdef force_str(object s, encoding=*, errors=*) | |
1818 * cdef bytes force_bytes(object s, encoding=*, errors=*) | |
1819 * cdef decode_bytes(bytes s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1820 * cdef bytes encode_filename(object filename) | |
1821 * cdef from_string_and_size(const char *s, size_t length) | |
1822 */ | |
1823 struct __pyx_opt_args_5pysam_9libcutils_decode_bytes { | |
1824 int __pyx_n; | |
1825 PyObject *encoding; | |
1826 PyObject *errors; | |
1827 }; | |
1828 | |
1829 /* "pysam/libchtslib.pxd":2706 | |
1830 * | |
1831 * | |
1832 * cdef class HTSFile(object): # <<<<<<<<<<<<<< | |
1833 * cdef htsFile *htsfile # pointer to htsFile structure | |
1834 * cdef int64_t start_offset # BGZF offset of first record | |
1835 */ | |
1836 struct __pyx_obj_5pysam_10libchtslib_HTSFile { | |
1837 PyObject_HEAD | |
1838 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtab; | |
1839 htsFile *htsfile; | |
1840 int64_t start_offset; | |
1841 PyObject *filename; | |
1842 PyObject *mode; | |
1843 PyObject *threads; | |
1844 PyObject *index_filename; | |
1845 int is_stream; | |
1846 int is_remote; | |
1847 int duplicate_filehandle; | |
1848 }; | |
1849 | |
1850 | |
1851 /* "pysam/libctabix.pxd":48 | |
1852 * | |
1853 * | |
1854 * cdef class tabix_file_iterator: # <<<<<<<<<<<<<< | |
1855 * cdef BGZF * fh | |
1856 * cdef kstream_t * kstream | |
1857 */ | |
1858 struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator { | |
1859 PyObject_HEAD | |
1860 struct __pyx_vtabstruct_5pysam_9libctabix_tabix_file_iterator *__pyx_vtab; | |
1861 BGZF *fh; | |
1862 kstream_t *kstream; | |
1863 kstring_t buffer; | |
1864 size_t size; | |
1865 struct __pyx_obj_5pysam_9libctabix_Parser *parser; | |
1866 int fd; | |
1867 int duplicated_fd; | |
1868 PyObject *infile; | |
1869 }; | |
1870 | |
1871 | |
1872 /* "pysam/libctabix.pxd":61 | |
1873 * | |
1874 * | |
1875 * cdef class TabixFile(HTSFile): # <<<<<<<<<<<<<< | |
1876 * # pointer to index structure | |
1877 * cdef tbx_t * index | |
1878 */ | |
1879 struct __pyx_obj_5pysam_9libctabix_TabixFile { | |
1880 struct __pyx_obj_5pysam_10libchtslib_HTSFile __pyx_base; | |
1881 tbx_t *index; | |
1882 PyObject *filename_index; | |
1883 struct __pyx_obj_5pysam_9libctabix_Parser *parser; | |
1884 PyObject *encoding; | |
1885 }; | |
1886 | |
1887 | |
1888 /* "pysam/libctabix.pxd":72 | |
1889 * | |
1890 * | |
1891 * cdef class Parser: # <<<<<<<<<<<<<< | |
1892 * cdef encoding | |
1893 * cdef parse(self, char * buffer, int len) | |
1894 */ | |
1895 struct __pyx_obj_5pysam_9libctabix_Parser { | |
1896 PyObject_HEAD | |
1897 struct __pyx_vtabstruct_5pysam_9libctabix_Parser *__pyx_vtab; | |
1898 PyObject *encoding; | |
1899 }; | |
1900 | |
1901 | |
1902 /* "pysam/libctabix.pxd":77 | |
1903 * | |
1904 * | |
1905 * cdef class asTuple(Parser): # <<<<<<<<<<<<<< | |
1906 * cdef parse(self, char * buffer, int len) | |
1907 * | |
1908 */ | |
1909 struct __pyx_obj_5pysam_9libctabix_asTuple { | |
1910 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
1911 }; | |
1912 | |
1913 | |
1914 /* "pysam/libctabix.pxd":81 | |
1915 * | |
1916 * | |
1917 * cdef class asGTF(Parser): # <<<<<<<<<<<<<< | |
1918 * pass | |
1919 * | |
1920 */ | |
1921 struct __pyx_obj_5pysam_9libctabix_asGTF { | |
1922 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
1923 }; | |
1924 | |
1925 | |
1926 /* "pysam/libctabix.pxd":85 | |
1927 * | |
1928 * | |
1929 * cdef class asGFF3(Parser): # <<<<<<<<<<<<<< | |
1930 * pass | |
1931 * | |
1932 */ | |
1933 struct __pyx_obj_5pysam_9libctabix_asGFF3 { | |
1934 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
1935 }; | |
1936 | |
1937 | |
1938 /* "pysam/libctabix.pxd":89 | |
1939 * | |
1940 * | |
1941 * cdef class asBed(Parser): # <<<<<<<<<<<<<< | |
1942 * pass | |
1943 * | |
1944 */ | |
1945 struct __pyx_obj_5pysam_9libctabix_asBed { | |
1946 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
1947 }; | |
1948 | |
1949 | |
1950 /* "pysam/libctabix.pxd":93 | |
1951 * | |
1952 * | |
1953 * cdef class asVCF(Parser): # <<<<<<<<<<<<<< | |
1954 * pass | |
1955 * | |
1956 */ | |
1957 struct __pyx_obj_5pysam_9libctabix_asVCF { | |
1958 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
1959 }; | |
1960 | |
1961 | |
1962 /* "pysam/libctabix.pxd":97 | |
1963 * | |
1964 * | |
1965 * cdef class TabixIterator: # <<<<<<<<<<<<<< | |
1966 * cdef hts_itr_t * iterator | |
1967 * cdef TabixFile tabixfile | |
1968 */ | |
1969 struct __pyx_obj_5pysam_9libctabix_TabixIterator { | |
1970 PyObject_HEAD | |
1971 struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator *__pyx_vtab; | |
1972 hts_itr_t *iterator; | |
1973 struct __pyx_obj_5pysam_9libctabix_TabixFile *tabixfile; | |
1974 kstring_t buffer; | |
1975 PyObject *encoding; | |
1976 }; | |
1977 | |
1978 | |
1979 /* "pysam/libctabix.pxd":105 | |
1980 * | |
1981 * | |
1982 * cdef class TabixIteratorParsed(TabixIterator): # <<<<<<<<<<<<<< | |
1983 * cdef Parser parser | |
1984 * | |
1985 */ | |
1986 struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed { | |
1987 struct __pyx_obj_5pysam_9libctabix_TabixIterator __pyx_base; | |
1988 struct __pyx_obj_5pysam_9libctabix_Parser *parser; | |
1989 }; | |
1990 | |
1991 | |
1992 /* "pysam/libctabix.pxd":109 | |
1993 * | |
1994 * | |
1995 * cdef class GZIterator: # <<<<<<<<<<<<<< | |
1996 * cdef object _filename | |
1997 * cdef BGZF * gzipfile | |
1998 */ | |
1999 struct __pyx_obj_5pysam_9libctabix_GZIterator { | |
2000 PyObject_HEAD | |
2001 struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator *__pyx_vtab; | |
2002 PyObject *_filename; | |
2003 BGZF *gzipfile; | |
2004 kstream_t *kstream; | |
2005 kstring_t buffer; | |
2006 PyObject *encoding; | |
2007 }; | |
2008 | |
2009 | |
2010 /* "pysam/libctabix.pxd":118 | |
2011 * | |
2012 * | |
2013 * cdef class GZIteratorHead(GZIterator): # <<<<<<<<<<<<<< | |
2014 * pass | |
2015 * | |
2016 */ | |
2017 struct __pyx_obj_5pysam_9libctabix_GZIteratorHead { | |
2018 struct __pyx_obj_5pysam_9libctabix_GZIterator __pyx_base; | |
2019 }; | |
2020 | |
2021 | |
2022 /* "pysam/libctabix.pxd":122 | |
2023 * | |
2024 * | |
2025 * cdef class GZIteratorParsed(GZIterator): # <<<<<<<<<<<<<< | |
2026 * cdef Parser parser | |
2027 * | |
2028 */ | |
2029 struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed { | |
2030 struct __pyx_obj_5pysam_9libctabix_GZIterator __pyx_base; | |
2031 struct __pyx_obj_5pysam_9libctabix_Parser *parser; | |
2032 }; | |
2033 | |
2034 | |
2035 /* "pysam/libctabix.pxd":127 | |
2036 * | |
2037 * # Compatibility Layer for pysam < 0.8 | |
2038 * cdef class Tabixfile(TabixFile): # <<<<<<<<<<<<<< | |
2039 * pass | |
2040 */ | |
2041 struct __pyx_obj_5pysam_9libctabix_Tabixfile { | |
2042 struct __pyx_obj_5pysam_9libctabix_TabixFile __pyx_base; | |
2043 }; | |
2044 | |
2045 | |
2046 /* "pysam/libctabixproxies.pxd":5 | |
2047 * from libc.stdint cimport uint8_t, int32_t, uint32_t, int64_t, uint64_t | |
2048 * | |
2049 * cdef class TupleProxy: # <<<<<<<<<<<<<< | |
2050 * | |
2051 * cdef: | |
2052 */ | |
2053 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy { | |
2054 PyObject_HEAD | |
2055 struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy *__pyx_vtab; | |
2056 char *data; | |
2057 char **fields; | |
2058 int nfields; | |
2059 int nbytes; | |
2060 int offset; | |
2061 int is_modified; | |
2062 PyObject *encoding; | |
2063 }; | |
2064 | |
2065 | |
2066 /* "pysam/libctabixproxies.pxd":27 | |
2067 * | |
2068 * | |
2069 * cdef class TupleProxyIterator: # <<<<<<<<<<<<<< | |
2070 * cdef TupleProxy proxy | |
2071 * cdef int index | |
2072 */ | |
2073 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxyIterator { | |
2074 PyObject_HEAD | |
2075 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *proxy; | |
2076 int index; | |
2077 }; | |
2078 | |
2079 | |
2080 /* "pysam/libctabixproxies.pxd":32 | |
2081 * | |
2082 * | |
2083 * cdef class NamedTupleProxy(TupleProxy): # <<<<<<<<<<<<<< | |
2084 * pass | |
2085 * | |
2086 */ | |
2087 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy { | |
2088 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy __pyx_base; | |
2089 }; | |
2090 | |
2091 | |
2092 /* "pysam/libctabixproxies.pxd":36 | |
2093 * | |
2094 * | |
2095 * cdef class GTFProxy(NamedTupleProxy): # <<<<<<<<<<<<<< | |
2096 * cdef object attribute_dict | |
2097 * cpdef int getMaxFields(self) | |
2098 */ | |
2099 struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy { | |
2100 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
2101 PyObject *attribute_dict; | |
2102 }; | |
2103 | |
2104 | |
2105 /* "pysam/libctabixproxies.pxd":42 | |
2106 * | |
2107 * | |
2108 * cdef class GFF3Proxy(GTFProxy): # <<<<<<<<<<<<<< | |
2109 * pass | |
2110 * | |
2111 */ | |
2112 struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy { | |
2113 struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy __pyx_base; | |
2114 }; | |
2115 | |
2116 | |
2117 /* "pysam/libctabixproxies.pxd":46 | |
2118 * | |
2119 * | |
2120 * cdef class BedProxy(NamedTupleProxy): # <<<<<<<<<<<<<< | |
2121 * | |
2122 * cdef: | |
2123 */ | |
2124 struct __pyx_obj_5pysam_16libctabixproxies_BedProxy { | |
2125 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
2126 char *contig; | |
2127 uint32_t start; | |
2128 uint32_t end; | |
2129 int bedfields; | |
2130 }; | |
2131 | |
2132 | |
2133 /* "pysam/libctabixproxies.pxd":58 | |
2134 * cdef update(self, char * buffer, size_t nbytes) | |
2135 * | |
2136 * cdef class VCFProxy(NamedTupleProxy) : # <<<<<<<<<<<<<< | |
2137 * | |
2138 * cdef: | |
2139 */ | |
2140 struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy { | |
2141 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
2142 char *contig; | |
2143 uint32_t pos; | |
2144 }; | |
2145 | |
2146 | |
2147 /* "pysam/libcvcf.pyx":104 | |
2148 * ########################################################################################################### | |
2149 * | |
2150 * cdef class VCFRecord(libctabixproxies.TupleProxy): # <<<<<<<<<<<<<< | |
2151 * '''vcf record. | |
2152 * | |
2153 */ | |
2154 struct __pyx_obj_5pysam_7libcvcf_VCFRecord { | |
2155 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy __pyx_base; | |
2156 PyObject *vcf; | |
2157 char *contig; | |
2158 uint32_t pos; | |
2159 }; | |
2160 | |
2161 | |
2162 /* "pysam/libcvcf.pyx":241 | |
2163 * | |
2164 * | |
2165 * cdef class asVCFRecord(libctabix.Parser): # <<<<<<<<<<<<<< | |
2166 * '''converts a :term:`tabix row` into a VCF record.''' | |
2167 * cdef vcffile | |
2168 */ | |
2169 struct __pyx_obj_5pysam_7libcvcf_asVCFRecord { | |
2170 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
2171 PyObject *vcffile; | |
2172 }; | |
2173 | |
2174 | |
2175 /* "pysam/libcvcf.pyx":929 | |
2176 * return line | |
2177 * | |
2178 * def _parse(self, line, stream): # <<<<<<<<<<<<<< | |
2179 * # deal with files with header only | |
2180 * if line.startswith("##"): return | |
2181 */ | |
2182 struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse { | |
2183 PyObject_HEAD | |
2184 PyObject *__pyx_v_d; | |
2185 PyObject *__pyx_v_line; | |
2186 PyObject *__pyx_v_self; | |
2187 PyObject *__pyx_v_stream; | |
2188 PyObject *__pyx_t_0; | |
2189 Py_ssize_t __pyx_t_1; | |
2190 PyObject *(*__pyx_t_2)(PyObject *); | |
2191 }; | |
2192 | |
2193 | |
2194 | |
2195 /* "pysam/libchtslib.pxd":2706 | |
2196 * | |
2197 * | |
2198 * cdef class HTSFile(object): # <<<<<<<<<<<<<< | |
2199 * cdef htsFile *htsfile # pointer to htsFile structure | |
2200 * cdef int64_t start_offset # BGZF offset of first record | |
2201 */ | |
2202 | |
2203 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile { | |
2204 htsFile *(*_open_htsfile)(struct __pyx_obj_5pysam_10libchtslib_HTSFile *); | |
2205 }; | |
2206 static struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtabptr_5pysam_10libchtslib_HTSFile; | |
2207 | |
2208 | |
2209 /* "pysam/libctabix.pxd":48 | |
2210 * | |
2211 * | |
2212 * cdef class tabix_file_iterator: # <<<<<<<<<<<<<< | |
2213 * cdef BGZF * fh | |
2214 * cdef kstream_t * kstream | |
2215 */ | |
2216 | |
2217 struct __pyx_vtabstruct_5pysam_9libctabix_tabix_file_iterator { | |
2218 PyObject *(*__pyx___cnext__)(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *); | |
2219 }; | |
2220 static struct __pyx_vtabstruct_5pysam_9libctabix_tabix_file_iterator *__pyx_vtabptr_5pysam_9libctabix_tabix_file_iterator; | |
2221 | |
2222 | |
2223 /* "pysam/libctabix.pxd":61 | |
2224 * | |
2225 * | |
2226 * cdef class TabixFile(HTSFile): # <<<<<<<<<<<<<< | |
2227 * # pointer to index structure | |
2228 * cdef tbx_t * index | |
2229 */ | |
2230 | |
2231 struct __pyx_vtabstruct_5pysam_9libctabix_TabixFile { | |
2232 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile __pyx_base; | |
2233 }; | |
2234 static struct __pyx_vtabstruct_5pysam_9libctabix_TabixFile *__pyx_vtabptr_5pysam_9libctabix_TabixFile; | |
2235 | |
2236 | |
2237 /* "pysam/libctabix.pxd":72 | |
2238 * | |
2239 * | |
2240 * cdef class Parser: # <<<<<<<<<<<<<< | |
2241 * cdef encoding | |
2242 * cdef parse(self, char * buffer, int len) | |
2243 */ | |
2244 | |
2245 struct __pyx_vtabstruct_5pysam_9libctabix_Parser { | |
2246 PyObject *(*parse)(struct __pyx_obj_5pysam_9libctabix_Parser *, char *, int); | |
2247 }; | |
2248 static struct __pyx_vtabstruct_5pysam_9libctabix_Parser *__pyx_vtabptr_5pysam_9libctabix_Parser; | |
2249 | |
2250 | |
2251 /* "pysam/libctabix.pxd":77 | |
2252 * | |
2253 * | |
2254 * cdef class asTuple(Parser): # <<<<<<<<<<<<<< | |
2255 * cdef parse(self, char * buffer, int len) | |
2256 * | |
2257 */ | |
2258 | |
2259 struct __pyx_vtabstruct_5pysam_9libctabix_asTuple { | |
2260 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2261 }; | |
2262 static struct __pyx_vtabstruct_5pysam_9libctabix_asTuple *__pyx_vtabptr_5pysam_9libctabix_asTuple; | |
2263 | |
2264 | |
2265 /* "pysam/libctabix.pxd":81 | |
2266 * | |
2267 * | |
2268 * cdef class asGTF(Parser): # <<<<<<<<<<<<<< | |
2269 * pass | |
2270 * | |
2271 */ | |
2272 | |
2273 struct __pyx_vtabstruct_5pysam_9libctabix_asGTF { | |
2274 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2275 }; | |
2276 static struct __pyx_vtabstruct_5pysam_9libctabix_asGTF *__pyx_vtabptr_5pysam_9libctabix_asGTF; | |
2277 | |
2278 | |
2279 /* "pysam/libctabix.pxd":85 | |
2280 * | |
2281 * | |
2282 * cdef class asGFF3(Parser): # <<<<<<<<<<<<<< | |
2283 * pass | |
2284 * | |
2285 */ | |
2286 | |
2287 struct __pyx_vtabstruct_5pysam_9libctabix_asGFF3 { | |
2288 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2289 }; | |
2290 static struct __pyx_vtabstruct_5pysam_9libctabix_asGFF3 *__pyx_vtabptr_5pysam_9libctabix_asGFF3; | |
2291 | |
2292 | |
2293 /* "pysam/libctabix.pxd":89 | |
2294 * | |
2295 * | |
2296 * cdef class asBed(Parser): # <<<<<<<<<<<<<< | |
2297 * pass | |
2298 * | |
2299 */ | |
2300 | |
2301 struct __pyx_vtabstruct_5pysam_9libctabix_asBed { | |
2302 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2303 }; | |
2304 static struct __pyx_vtabstruct_5pysam_9libctabix_asBed *__pyx_vtabptr_5pysam_9libctabix_asBed; | |
2305 | |
2306 | |
2307 /* "pysam/libctabix.pxd":93 | |
2308 * | |
2309 * | |
2310 * cdef class asVCF(Parser): # <<<<<<<<<<<<<< | |
2311 * pass | |
2312 * | |
2313 */ | |
2314 | |
2315 struct __pyx_vtabstruct_5pysam_9libctabix_asVCF { | |
2316 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2317 }; | |
2318 static struct __pyx_vtabstruct_5pysam_9libctabix_asVCF *__pyx_vtabptr_5pysam_9libctabix_asVCF; | |
2319 | |
2320 | |
2321 /* "pysam/libctabix.pxd":97 | |
2322 * | |
2323 * | |
2324 * cdef class TabixIterator: # <<<<<<<<<<<<<< | |
2325 * cdef hts_itr_t * iterator | |
2326 * cdef TabixFile tabixfile | |
2327 */ | |
2328 | |
2329 struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator { | |
2330 int (*__pyx___cnext__)(struct __pyx_obj_5pysam_9libctabix_TabixIterator *); | |
2331 }; | |
2332 static struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator *__pyx_vtabptr_5pysam_9libctabix_TabixIterator; | |
2333 | |
2334 | |
2335 /* "pysam/libctabix.pxd":105 | |
2336 * | |
2337 * | |
2338 * cdef class TabixIteratorParsed(TabixIterator): # <<<<<<<<<<<<<< | |
2339 * cdef Parser parser | |
2340 * | |
2341 */ | |
2342 | |
2343 struct __pyx_vtabstruct_5pysam_9libctabix_TabixIteratorParsed { | |
2344 struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator __pyx_base; | |
2345 }; | |
2346 static struct __pyx_vtabstruct_5pysam_9libctabix_TabixIteratorParsed *__pyx_vtabptr_5pysam_9libctabix_TabixIteratorParsed; | |
2347 | |
2348 | |
2349 /* "pysam/libctabix.pxd":109 | |
2350 * | |
2351 * | |
2352 * cdef class GZIterator: # <<<<<<<<<<<<<< | |
2353 * cdef object _filename | |
2354 * cdef BGZF * gzipfile | |
2355 */ | |
2356 | |
2357 struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator { | |
2358 int (*__pyx___cnext__)(struct __pyx_obj_5pysam_9libctabix_GZIterator *); | |
2359 }; | |
2360 static struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator *__pyx_vtabptr_5pysam_9libctabix_GZIterator; | |
2361 | |
2362 | |
2363 /* "pysam/libctabix.pxd":118 | |
2364 * | |
2365 * | |
2366 * cdef class GZIteratorHead(GZIterator): # <<<<<<<<<<<<<< | |
2367 * pass | |
2368 * | |
2369 */ | |
2370 | |
2371 struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorHead { | |
2372 struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator __pyx_base; | |
2373 }; | |
2374 static struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorHead *__pyx_vtabptr_5pysam_9libctabix_GZIteratorHead; | |
2375 | |
2376 | |
2377 /* "pysam/libctabix.pxd":122 | |
2378 * | |
2379 * | |
2380 * cdef class GZIteratorParsed(GZIterator): # <<<<<<<<<<<<<< | |
2381 * cdef Parser parser | |
2382 * | |
2383 */ | |
2384 | |
2385 struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorParsed { | |
2386 struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator __pyx_base; | |
2387 }; | |
2388 static struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorParsed *__pyx_vtabptr_5pysam_9libctabix_GZIteratorParsed; | |
2389 | |
2390 | |
2391 /* "pysam/libctabix.pxd":127 | |
2392 * | |
2393 * # Compatibility Layer for pysam < 0.8 | |
2394 * cdef class Tabixfile(TabixFile): # <<<<<<<<<<<<<< | |
2395 * pass | |
2396 */ | |
2397 | |
2398 struct __pyx_vtabstruct_5pysam_9libctabix_Tabixfile { | |
2399 struct __pyx_vtabstruct_5pysam_9libctabix_TabixFile __pyx_base; | |
2400 }; | |
2401 static struct __pyx_vtabstruct_5pysam_9libctabix_Tabixfile *__pyx_vtabptr_5pysam_9libctabix_Tabixfile; | |
2402 | |
2403 | |
2404 /* "pysam/libctabixproxies.pxd":5 | |
2405 * from libc.stdint cimport uint8_t, int32_t, uint32_t, int64_t, uint64_t | |
2406 * | |
2407 * cdef class TupleProxy: # <<<<<<<<<<<<<< | |
2408 * | |
2409 * cdef: | |
2410 */ | |
2411 | |
2412 struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy { | |
2413 int (*getMaxFields)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, int __pyx_skip_dispatch); | |
2414 int (*getMinFields)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, int __pyx_skip_dispatch); | |
2415 PyObject *(*take)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, char *, size_t); | |
2416 PyObject *(*present)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, char *, size_t); | |
2417 PyObject *(*copy)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, char *, size_t, struct __pyx_opt_args_5pysam_16libctabixproxies_10TupleProxy_copy *__pyx_optional_args); | |
2418 PyObject *(*update)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, char *, size_t); | |
2419 }; | |
2420 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy *__pyx_vtabptr_5pysam_16libctabixproxies_TupleProxy; | |
2421 | |
2422 | |
2423 /* "pysam/libctabixproxies.pxd":32 | |
2424 * | |
2425 * | |
2426 * cdef class NamedTupleProxy(TupleProxy): # <<<<<<<<<<<<<< | |
2427 * pass | |
2428 * | |
2429 */ | |
2430 | |
2431 struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy { | |
2432 struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy __pyx_base; | |
2433 }; | |
2434 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy *__pyx_vtabptr_5pysam_16libctabixproxies_NamedTupleProxy; | |
2435 | |
2436 | |
2437 /* "pysam/libctabixproxies.pxd":36 | |
2438 * | |
2439 * | |
2440 * cdef class GTFProxy(NamedTupleProxy): # <<<<<<<<<<<<<< | |
2441 * cdef object attribute_dict | |
2442 * cpdef int getMaxFields(self) | |
2443 */ | |
2444 | |
2445 struct __pyx_vtabstruct_5pysam_16libctabixproxies_GTFProxy { | |
2446 struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
2447 }; | |
2448 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_GTFProxy *__pyx_vtabptr_5pysam_16libctabixproxies_GTFProxy; | |
2449 | |
2450 | |
2451 /* "pysam/libctabixproxies.pxd":42 | |
2452 * | |
2453 * | |
2454 * cdef class GFF3Proxy(GTFProxy): # <<<<<<<<<<<<<< | |
2455 * pass | |
2456 * | |
2457 */ | |
2458 | |
2459 struct __pyx_vtabstruct_5pysam_16libctabixproxies_GFF3Proxy { | |
2460 struct __pyx_vtabstruct_5pysam_16libctabixproxies_GTFProxy __pyx_base; | |
2461 }; | |
2462 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_GFF3Proxy *__pyx_vtabptr_5pysam_16libctabixproxies_GFF3Proxy; | |
2463 | |
2464 | |
2465 /* "pysam/libctabixproxies.pxd":46 | |
2466 * | |
2467 * | |
2468 * cdef class BedProxy(NamedTupleProxy): # <<<<<<<<<<<<<< | |
2469 * | |
2470 * cdef: | |
2471 */ | |
2472 | |
2473 struct __pyx_vtabstruct_5pysam_16libctabixproxies_BedProxy { | |
2474 struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
2475 }; | |
2476 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_BedProxy *__pyx_vtabptr_5pysam_16libctabixproxies_BedProxy; | |
2477 | |
2478 | |
2479 /* "pysam/libctabixproxies.pxd":58 | |
2480 * cdef update(self, char * buffer, size_t nbytes) | |
2481 * | |
2482 * cdef class VCFProxy(NamedTupleProxy) : # <<<<<<<<<<<<<< | |
2483 * | |
2484 * cdef: | |
2485 */ | |
2486 | |
2487 struct __pyx_vtabstruct_5pysam_16libctabixproxies_VCFProxy { | |
2488 struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
2489 }; | |
2490 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_VCFProxy *__pyx_vtabptr_5pysam_16libctabixproxies_VCFProxy; | |
2491 | |
2492 | |
2493 /* "pysam/libcvcf.pyx":104 | |
2494 * ########################################################################################################### | |
2495 * | |
2496 * cdef class VCFRecord(libctabixproxies.TupleProxy): # <<<<<<<<<<<<<< | |
2497 * '''vcf record. | |
2498 * | |
2499 */ | |
2500 | |
2501 struct __pyx_vtabstruct_5pysam_7libcvcf_VCFRecord { | |
2502 struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy __pyx_base; | |
2503 }; | |
2504 static struct __pyx_vtabstruct_5pysam_7libcvcf_VCFRecord *__pyx_vtabptr_5pysam_7libcvcf_VCFRecord; | |
2505 | |
2506 | |
2507 /* "pysam/libcvcf.pyx":241 | |
2508 * | |
2509 * | |
2510 * cdef class asVCFRecord(libctabix.Parser): # <<<<<<<<<<<<<< | |
2511 * '''converts a :term:`tabix row` into a VCF record.''' | |
2512 * cdef vcffile | |
2513 */ | |
2514 | |
2515 struct __pyx_vtabstruct_5pysam_7libcvcf_asVCFRecord { | |
2516 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2517 }; | |
2518 static struct __pyx_vtabstruct_5pysam_7libcvcf_asVCFRecord *__pyx_vtabptr_5pysam_7libcvcf_asVCFRecord; | |
2519 /* #### Code section: utility_code_proto ### */ | |
2520 | |
2521 /* --- Runtime support code (head) --- */ | |
2522 /* Refnanny.proto */ | |
2523 #ifndef CYTHON_REFNANNY | |
2524 #define CYTHON_REFNANNY 0 | |
2525 #endif | |
2526 #if CYTHON_REFNANNY | |
2527 typedef struct { | |
2528 void (*INCREF)(void*, PyObject*, Py_ssize_t); | |
2529 void (*DECREF)(void*, PyObject*, Py_ssize_t); | |
2530 void (*GOTREF)(void*, PyObject*, Py_ssize_t); | |
2531 void (*GIVEREF)(void*, PyObject*, Py_ssize_t); | |
2532 void* (*SetupContext)(const char*, Py_ssize_t, const char*); | |
2533 void (*FinishContext)(void**); | |
2534 } __Pyx_RefNannyAPIStruct; | |
2535 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; | |
2536 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); | |
2537 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; | |
2538 #ifdef WITH_THREAD | |
2539 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ | |
2540 if (acquire_gil) {\ | |
2541 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
2542 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ | |
2543 PyGILState_Release(__pyx_gilstate_save);\ | |
2544 } else {\ | |
2545 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ | |
2546 } | |
2547 #define __Pyx_RefNannyFinishContextNogil() {\ | |
2548 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
2549 __Pyx_RefNannyFinishContext();\ | |
2550 PyGILState_Release(__pyx_gilstate_save);\ | |
2551 } | |
2552 #else | |
2553 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ | |
2554 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) | |
2555 #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() | |
2556 #endif | |
2557 #define __Pyx_RefNannyFinishContextNogil() {\ | |
2558 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
2559 __Pyx_RefNannyFinishContext();\ | |
2560 PyGILState_Release(__pyx_gilstate_save);\ | |
2561 } | |
2562 #define __Pyx_RefNannyFinishContext()\ | |
2563 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) | |
2564 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2565 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2566 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2567 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2568 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) | |
2569 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) | |
2570 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) | |
2571 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) | |
2572 #else | |
2573 #define __Pyx_RefNannyDeclarations | |
2574 #define __Pyx_RefNannySetupContext(name, acquire_gil) | |
2575 #define __Pyx_RefNannyFinishContextNogil() | |
2576 #define __Pyx_RefNannyFinishContext() | |
2577 #define __Pyx_INCREF(r) Py_INCREF(r) | |
2578 #define __Pyx_DECREF(r) Py_DECREF(r) | |
2579 #define __Pyx_GOTREF(r) | |
2580 #define __Pyx_GIVEREF(r) | |
2581 #define __Pyx_XINCREF(r) Py_XINCREF(r) | |
2582 #define __Pyx_XDECREF(r) Py_XDECREF(r) | |
2583 #define __Pyx_XGOTREF(r) | |
2584 #define __Pyx_XGIVEREF(r) | |
2585 #endif | |
2586 #define __Pyx_Py_XDECREF_SET(r, v) do {\ | |
2587 PyObject *tmp = (PyObject *) r;\ | |
2588 r = v; Py_XDECREF(tmp);\ | |
2589 } while (0) | |
2590 #define __Pyx_XDECREF_SET(r, v) do {\ | |
2591 PyObject *tmp = (PyObject *) r;\ | |
2592 r = v; __Pyx_XDECREF(tmp);\ | |
2593 } while (0) | |
2594 #define __Pyx_DECREF_SET(r, v) do {\ | |
2595 PyObject *tmp = (PyObject *) r;\ | |
2596 r = v; __Pyx_DECREF(tmp);\ | |
2597 } while (0) | |
2598 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) | |
2599 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) | |
2600 | |
2601 /* PyErrExceptionMatches.proto */ | |
2602 #if CYTHON_FAST_THREAD_STATE | |
2603 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) | |
2604 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); | |
2605 #else | |
2606 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) | |
2607 #endif | |
2608 | |
2609 /* PyThreadStateGet.proto */ | |
2610 #if CYTHON_FAST_THREAD_STATE | |
2611 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; | |
2612 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; | |
2613 #if PY_VERSION_HEX >= 0x030C00A6 | |
2614 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) | |
2615 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) | |
2616 #else | |
2617 #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) | |
2618 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) | |
2619 #endif | |
2620 #else | |
2621 #define __Pyx_PyThreadState_declare | |
2622 #define __Pyx_PyThreadState_assign | |
2623 #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) | |
2624 #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() | |
2625 #endif | |
2626 | |
2627 /* PyErrFetchRestore.proto */ | |
2628 #if CYTHON_FAST_THREAD_STATE | |
2629 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) | |
2630 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) | |
2631 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) | |
2632 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) | |
2633 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) | |
2634 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); | |
2635 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
2636 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 | |
2637 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) | |
2638 #else | |
2639 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) | |
2640 #endif | |
2641 #else | |
2642 #define __Pyx_PyErr_Clear() PyErr_Clear() | |
2643 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) | |
2644 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) | |
2645 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) | |
2646 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) | |
2647 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) | |
2648 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) | |
2649 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) | |
2650 #endif | |
2651 | |
2652 /* PyObjectGetAttrStr.proto */ | |
2653 #if CYTHON_USE_TYPE_SLOTS | |
2654 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); | |
2655 #else | |
2656 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) | |
2657 #endif | |
2658 | |
2659 /* PyObjectGetAttrStrNoError.proto */ | |
2660 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); | |
2661 | |
2662 /* GetBuiltinName.proto */ | |
2663 static PyObject *__Pyx_GetBuiltinName(PyObject *name); | |
2664 | |
2665 /* TupleAndListFromArray.proto */ | |
2666 #if CYTHON_COMPILING_IN_CPYTHON | |
2667 static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); | |
2668 static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); | |
2669 #endif | |
2670 | |
2671 /* IncludeStringH.proto */ | |
2672 #include <string.h> | |
2673 | |
2674 /* BytesEquals.proto */ | |
2675 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); | |
2676 | |
2677 /* UnicodeEquals.proto */ | |
2678 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); | |
2679 | |
2680 /* fastcall.proto */ | |
2681 #if CYTHON_AVOID_BORROWED_REFS | |
2682 #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) | |
2683 #elif CYTHON_ASSUME_SAFE_MACROS | |
2684 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) | |
2685 #else | |
2686 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) | |
2687 #endif | |
2688 #if CYTHON_AVOID_BORROWED_REFS | |
2689 #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) | |
2690 #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) | |
2691 #else | |
2692 #define __Pyx_Arg_NewRef_VARARGS(arg) arg | |
2693 #define __Pyx_Arg_XDECREF_VARARGS(arg) | |
2694 #endif | |
2695 #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) | |
2696 #define __Pyx_KwValues_VARARGS(args, nargs) NULL | |
2697 #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) | |
2698 #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) | |
2699 #if CYTHON_METH_FASTCALL | |
2700 #define __Pyx_Arg_FASTCALL(args, i) args[i] | |
2701 #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) | |
2702 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) | |
2703 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); | |
2704 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
2705 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); | |
2706 #else | |
2707 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) | |
2708 #endif | |
2709 #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs | |
2710 to have the same reference counting */ | |
2711 #define __Pyx_Arg_XDECREF_FASTCALL(arg) | |
2712 #else | |
2713 #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS | |
2714 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS | |
2715 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS | |
2716 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS | |
2717 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS | |
2718 #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) | |
2719 #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) | |
2720 #endif | |
2721 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
2722 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) | |
2723 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) | |
2724 #else | |
2725 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) | |
2726 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) | |
2727 #endif | |
2728 | |
2729 /* RaiseArgTupleInvalid.proto */ | |
2730 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, | |
2731 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); | |
2732 | |
2733 /* RaiseDoubleKeywords.proto */ | |
2734 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); | |
2735 | |
2736 /* ParseKeywords.proto */ | |
2737 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, | |
2738 PyObject **argnames[], | |
2739 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, | |
2740 const char* function_name); | |
2741 | |
2742 /* PyDictVersioning.proto */ | |
2743 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS | |
2744 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) | |
2745 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) | |
2746 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ | |
2747 (version_var) = __PYX_GET_DICT_VERSION(dict);\ | |
2748 (cache_var) = (value); | |
2749 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ | |
2750 static PY_UINT64_T __pyx_dict_version = 0;\ | |
2751 static PyObject *__pyx_dict_cached_value = NULL;\ | |
2752 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ | |
2753 (VAR) = __pyx_dict_cached_value;\ | |
2754 } else {\ | |
2755 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ | |
2756 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ | |
2757 }\ | |
2758 } | |
2759 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); | |
2760 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); | |
2761 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); | |
2762 #else | |
2763 #define __PYX_GET_DICT_VERSION(dict) (0) | |
2764 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) | |
2765 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); | |
2766 #endif | |
2767 | |
2768 /* GetModuleGlobalName.proto */ | |
2769 #if CYTHON_USE_DICT_VERSIONS | |
2770 #define __Pyx_GetModuleGlobalName(var, name) do {\ | |
2771 static PY_UINT64_T __pyx_dict_version = 0;\ | |
2772 static PyObject *__pyx_dict_cached_value = NULL;\ | |
2773 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ | |
2774 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ | |
2775 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ | |
2776 } while(0) | |
2777 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ | |
2778 PY_UINT64_T __pyx_dict_version;\ | |
2779 PyObject *__pyx_dict_cached_value;\ | |
2780 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ | |
2781 } while(0) | |
2782 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); | |
2783 #else | |
2784 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) | |
2785 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) | |
2786 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); | |
2787 #endif | |
2788 | |
2789 /* PyFunctionFastCall.proto */ | |
2790 #if CYTHON_FAST_PYCALL | |
2791 #if !CYTHON_VECTORCALL | |
2792 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ | |
2793 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) | |
2794 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); | |
2795 #endif | |
2796 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ | |
2797 (sizeof(char [1 - 2*!(cond)]) - 1) | |
2798 #ifndef Py_MEMBER_SIZE | |
2799 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) | |
2800 #endif | |
2801 #if !CYTHON_VECTORCALL | |
2802 #if PY_VERSION_HEX >= 0x03080000 | |
2803 #include "frameobject.h" | |
2804 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API | |
2805 #ifndef Py_BUILD_CORE | |
2806 #define Py_BUILD_CORE 1 | |
2807 #endif | |
2808 #include "internal/pycore_frame.h" | |
2809 #endif | |
2810 #define __Pxy_PyFrame_Initialize_Offsets() | |
2811 #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) | |
2812 #else | |
2813 static size_t __pyx_pyframe_localsplus_offset = 0; | |
2814 #include "frameobject.h" | |
2815 #define __Pxy_PyFrame_Initialize_Offsets()\ | |
2816 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ | |
2817 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) | |
2818 #define __Pyx_PyFrame_GetLocalsplus(frame)\ | |
2819 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) | |
2820 #endif | |
2821 #endif | |
2822 #endif | |
2823 | |
2824 /* PyObjectCall.proto */ | |
2825 #if CYTHON_COMPILING_IN_CPYTHON | |
2826 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); | |
2827 #else | |
2828 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) | |
2829 #endif | |
2830 | |
2831 /* PyObjectCallMethO.proto */ | |
2832 #if CYTHON_COMPILING_IN_CPYTHON | |
2833 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); | |
2834 #endif | |
2835 | |
2836 /* PyObjectFastCall.proto */ | |
2837 #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) | |
2838 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); | |
2839 | |
2840 /* GetItemInt.proto */ | |
2841 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
2842 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
2843 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ | |
2844 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ | |
2845 __Pyx_GetItemInt_Generic(o, to_py_func(i)))) | |
2846 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
2847 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
2848 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ | |
2849 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) | |
2850 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, | |
2851 int wraparound, int boundscheck); | |
2852 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
2853 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
2854 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ | |
2855 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) | |
2856 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, | |
2857 int wraparound, int boundscheck); | |
2858 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); | |
2859 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, | |
2860 int is_list, int wraparound, int boundscheck); | |
2861 | |
2862 /* PyObjectCallOneArg.proto */ | |
2863 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); | |
2864 | |
2865 /* PyIntBinop.proto */ | |
2866 #if !CYTHON_COMPILING_IN_PYPY | |
2867 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); | |
2868 #else | |
2869 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ | |
2870 (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) | |
2871 #endif | |
2872 | |
2873 /* GetTopmostException.proto */ | |
2874 #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE | |
2875 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); | |
2876 #endif | |
2877 | |
2878 /* SaveResetException.proto */ | |
2879 #if CYTHON_FAST_THREAD_STATE | |
2880 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) | |
2881 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
2882 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) | |
2883 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); | |
2884 #else | |
2885 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) | |
2886 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) | |
2887 #endif | |
2888 | |
2889 /* GetException.proto */ | |
2890 #if CYTHON_FAST_THREAD_STATE | |
2891 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) | |
2892 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
2893 #else | |
2894 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); | |
2895 #endif | |
2896 | |
2897 /* RaiseException.proto */ | |
2898 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); | |
2899 | |
2900 /* ListAppend.proto */ | |
2901 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS | |
2902 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { | |
2903 PyListObject* L = (PyListObject*) list; | |
2904 Py_ssize_t len = Py_SIZE(list); | |
2905 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { | |
2906 Py_INCREF(x); | |
2907 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
2908 L->ob_item[len] = x; | |
2909 #else | |
2910 PyList_SET_ITEM(list, len, x); | |
2911 #endif | |
2912 __Pyx_SET_SIZE(list, len + 1); | |
2913 return 0; | |
2914 } | |
2915 return PyList_Append(list, x); | |
2916 } | |
2917 #else | |
2918 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) | |
2919 #endif | |
2920 | |
2921 /* pybytes_as_double.proto */ | |
2922 static double __Pyx_SlowPyString_AsDouble(PyObject *obj); | |
2923 static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length); | |
2924 static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) { | |
2925 char* as_c_string; | |
2926 Py_ssize_t size; | |
2927 #if CYTHON_ASSUME_SAFE_MACROS | |
2928 as_c_string = PyBytes_AS_STRING(obj); | |
2929 size = PyBytes_GET_SIZE(obj); | |
2930 #else | |
2931 if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) { | |
2932 return (double)-1; | |
2933 } | |
2934 #endif | |
2935 return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); | |
2936 } | |
2937 static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) { | |
2938 char* as_c_string; | |
2939 Py_ssize_t size; | |
2940 #if CYTHON_ASSUME_SAFE_MACROS | |
2941 as_c_string = PyByteArray_AS_STRING(obj); | |
2942 size = PyByteArray_GET_SIZE(obj); | |
2943 #else | |
2944 as_c_string = PyByteArray_AsString(obj); | |
2945 if (as_c_string == NULL) { | |
2946 return (double)-1; | |
2947 } | |
2948 size = PyByteArray_Size(obj); | |
2949 #endif | |
2950 return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); | |
2951 } | |
2952 | |
2953 /* pyunicode_as_double.proto */ | |
2954 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS | |
2955 static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) { | |
2956 int last_was_punctuation; | |
2957 Py_ssize_t i; | |
2958 last_was_punctuation = 1; | |
2959 for (i=start; i <= end; i++) { | |
2960 Py_UCS4 chr = PyUnicode_READ(kind, data, i); | |
2961 int is_punctuation = (chr == '_') | (chr == '.'); | |
2962 *buffer = (char)chr; | |
2963 buffer += (chr != '_'); | |
2964 if (unlikely(chr > 127)) goto parse_failure; | |
2965 if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; | |
2966 last_was_punctuation = is_punctuation; | |
2967 } | |
2968 if (unlikely(last_was_punctuation)) goto parse_failure; | |
2969 *buffer = '\0'; | |
2970 return buffer; | |
2971 parse_failure: | |
2972 return NULL; | |
2973 } | |
2974 static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) { | |
2975 int matches = 1; | |
2976 Py_UCS4 chr; | |
2977 Py_UCS4 sign = PyUnicode_READ(kind, data, start); | |
2978 int is_signed = (sign == '-') | (sign == '+'); | |
2979 start += is_signed; | |
2980 length -= is_signed; | |
2981 switch (PyUnicode_READ(kind, data, start)) { | |
2982 #ifdef Py_NAN | |
2983 case 'n': | |
2984 case 'N': | |
2985 if (unlikely(length != 3)) goto parse_failure; | |
2986 chr = PyUnicode_READ(kind, data, start+1); | |
2987 matches &= (chr == 'a') | (chr == 'A'); | |
2988 chr = PyUnicode_READ(kind, data, start+2); | |
2989 matches &= (chr == 'n') | (chr == 'N'); | |
2990 if (unlikely(!matches)) goto parse_failure; | |
2991 return (sign == '-') ? -Py_NAN : Py_NAN; | |
2992 #endif | |
2993 case 'i': | |
2994 case 'I': | |
2995 if (unlikely(length < 3)) goto parse_failure; | |
2996 chr = PyUnicode_READ(kind, data, start+1); | |
2997 matches &= (chr == 'n') | (chr == 'N'); | |
2998 chr = PyUnicode_READ(kind, data, start+2); | |
2999 matches &= (chr == 'f') | (chr == 'F'); | |
3000 if (likely(length == 3 && matches)) | |
3001 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; | |
3002 if (unlikely(length != 8)) goto parse_failure; | |
3003 chr = PyUnicode_READ(kind, data, start+3); | |
3004 matches &= (chr == 'i') | (chr == 'I'); | |
3005 chr = PyUnicode_READ(kind, data, start+4); | |
3006 matches &= (chr == 'n') | (chr == 'N'); | |
3007 chr = PyUnicode_READ(kind, data, start+5); | |
3008 matches &= (chr == 'i') | (chr == 'I'); | |
3009 chr = PyUnicode_READ(kind, data, start+6); | |
3010 matches &= (chr == 't') | (chr == 'T'); | |
3011 chr = PyUnicode_READ(kind, data, start+7); | |
3012 matches &= (chr == 'y') | (chr == 'Y'); | |
3013 if (unlikely(!matches)) goto parse_failure; | |
3014 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; | |
3015 case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': | |
3016 break; | |
3017 default: | |
3018 goto parse_failure; | |
3019 } | |
3020 return 0.0; | |
3021 parse_failure: | |
3022 return -1.0; | |
3023 } | |
3024 static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) { | |
3025 double value; | |
3026 const char *last; | |
3027 char *end; | |
3028 Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj); | |
3029 const int kind = PyUnicode_KIND(obj); | |
3030 const void* data = PyUnicode_DATA(obj); | |
3031 start = 0; | |
3032 while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start))) | |
3033 start++; | |
3034 while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1))) | |
3035 length--; | |
3036 length -= start; | |
3037 if (unlikely(length <= 0)) goto fallback; | |
3038 value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length); | |
3039 if (unlikely(value == -1.0)) goto fallback; | |
3040 if (value != 0.0) return value; | |
3041 if (length < 40) { | |
3042 char number[40]; | |
3043 last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); | |
3044 if (unlikely(!last)) goto fallback; | |
3045 value = PyOS_string_to_double(number, &end, NULL); | |
3046 } else { | |
3047 char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char)); | |
3048 if (unlikely(!number)) goto fallback; | |
3049 last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); | |
3050 if (unlikely(!last)) { | |
3051 PyMem_Free(number); | |
3052 goto fallback; | |
3053 } | |
3054 value = PyOS_string_to_double(number, &end, NULL); | |
3055 PyMem_Free(number); | |
3056 } | |
3057 if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { | |
3058 return value; | |
3059 } | |
3060 fallback: | |
3061 return __Pyx_SlowPyString_AsDouble(obj); | |
3062 } | |
3063 #endif | |
3064 static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) { | |
3065 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS | |
3066 if (unlikely(__Pyx_PyUnicode_READY(obj) == -1)) | |
3067 return (double)-1; | |
3068 if (likely(PyUnicode_IS_ASCII(obj))) { | |
3069 const char *s; | |
3070 Py_ssize_t length; | |
3071 s = PyUnicode_AsUTF8AndSize(obj, &length); | |
3072 return __Pyx__PyBytes_AsDouble(obj, s, length); | |
3073 } | |
3074 return __Pyx_PyUnicode_AsDouble_WithSpaces(obj); | |
3075 #else | |
3076 return __Pyx_SlowPyString_AsDouble(obj); | |
3077 #endif | |
3078 } | |
3079 | |
3080 /* pynumber_float.proto */ | |
3081 static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj); | |
3082 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x)) | |
3083 | |
3084 /* PyObject_Unicode.proto */ | |
3085 #if PY_MAJOR_VERSION >= 3 | |
3086 #define __Pyx_PyObject_Unicode(obj)\ | |
3087 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) | |
3088 #else | |
3089 #define __Pyx_PyObject_Unicode(obj)\ | |
3090 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj)) | |
3091 #endif | |
3092 | |
3093 /* RaiseUnboundLocalError.proto */ | |
3094 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); | |
3095 | |
3096 /* ObjectGetItem.proto */ | |
3097 #if CYTHON_USE_TYPE_SLOTS | |
3098 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); | |
3099 #else | |
3100 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) | |
3101 #endif | |
3102 | |
3103 /* GCCDiagnostics.proto */ | |
3104 #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |
3105 #define __Pyx_HAS_GCC_DIAGNOSTIC | |
3106 #endif | |
3107 | |
3108 /* BuildPyUnicode.proto */ | |
3109 static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, | |
3110 int prepend_sign, char padding_char); | |
3111 | |
3112 /* CIntToPyUnicode.proto */ | |
3113 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char); | |
3114 | |
3115 /* PyObjectFormatAndDecref.proto */ | |
3116 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); | |
3117 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); | |
3118 | |
3119 /* JoinPyUnicode.proto */ | |
3120 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, | |
3121 Py_UCS4 max_char); | |
3122 | |
3123 /* PyIntCompare.proto */ | |
3124 static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); | |
3125 | |
3126 /* PyIntCompare.proto */ | |
3127 static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); | |
3128 | |
3129 /* DictGetItem.proto */ | |
3130 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY | |
3131 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); | |
3132 #define __Pyx_PyObject_Dict_GetItem(obj, name)\ | |
3133 (likely(PyDict_CheckExact(obj)) ?\ | |
3134 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) | |
3135 #else | |
3136 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) | |
3137 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) | |
3138 #endif | |
3139 | |
3140 /* SliceObject.proto */ | |
3141 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( | |
3142 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, | |
3143 PyObject** py_start, PyObject** py_stop, PyObject** py_slice, | |
3144 int has_cstart, int has_cstop, int wraparound); | |
3145 | |
3146 /* KeywordStringCheck.proto */ | |
3147 static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); | |
3148 | |
3149 /* GetAttr3.proto */ | |
3150 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); | |
3151 | |
3152 /* RaiseUnexpectedTypeError.proto */ | |
3153 static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); | |
3154 | |
3155 /* IterFinish.proto */ | |
3156 static CYTHON_INLINE int __Pyx_IterFinish(void); | |
3157 | |
3158 /* PyObjectCallNoArg.proto */ | |
3159 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); | |
3160 | |
3161 /* PyObjectGetMethod.proto */ | |
3162 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); | |
3163 | |
3164 /* PyObjectCallMethod0.proto */ | |
3165 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); | |
3166 | |
3167 /* RaiseNeedMoreValuesToUnpack.proto */ | |
3168 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); | |
3169 | |
3170 /* RaiseTooManyValuesToUnpack.proto */ | |
3171 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); | |
3172 | |
3173 /* UnpackItemEndCheck.proto */ | |
3174 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); | |
3175 | |
3176 /* RaiseNoneIterError.proto */ | |
3177 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); | |
3178 | |
3179 /* UnpackTupleError.proto */ | |
3180 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); | |
3181 | |
3182 /* UnpackTuple2.proto */ | |
3183 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ | |
3184 (likely(is_tuple || PyTuple_Check(tuple)) ?\ | |
3185 (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ | |
3186 __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ | |
3187 (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ | |
3188 __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) | |
3189 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( | |
3190 PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); | |
3191 static int __Pyx_unpack_tuple2_generic( | |
3192 PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); | |
3193 | |
3194 /* dict_iter.proto */ | |
3195 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, | |
3196 Py_ssize_t* p_orig_length, int* p_is_dict); | |
3197 static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, | |
3198 PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); | |
3199 | |
3200 /* PyObjectSetAttrStr.proto */ | |
3201 #if CYTHON_USE_TYPE_SLOTS | |
3202 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) | |
3203 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); | |
3204 #else | |
3205 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) | |
3206 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) | |
3207 #endif | |
3208 | |
3209 /* PySequenceContains.proto */ | |
3210 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { | |
3211 int result = PySequence_Contains(seq, item); | |
3212 return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); | |
3213 } | |
3214 | |
3215 /* unicode_tailmatch.proto */ | |
3216 static int __Pyx_PyUnicode_Tailmatch( | |
3217 PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); | |
3218 | |
3219 /* PyUnicode_Substring.proto */ | |
3220 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring( | |
3221 PyObject* text, Py_ssize_t start, Py_ssize_t stop); | |
3222 | |
3223 /* PyIntBinop.proto */ | |
3224 #if !CYTHON_COMPILING_IN_PYPY | |
3225 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); | |
3226 #else | |
3227 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ | |
3228 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) | |
3229 #endif | |
3230 | |
3231 /* PyDictContains.proto */ | |
3232 static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { | |
3233 int result = PyDict_Contains(dict, item); | |
3234 return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); | |
3235 } | |
3236 | |
3237 /* ListCompAppend.proto */ | |
3238 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS | |
3239 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { | |
3240 PyListObject* L = (PyListObject*) list; | |
3241 Py_ssize_t len = Py_SIZE(list); | |
3242 if (likely(L->allocated > len)) { | |
3243 Py_INCREF(x); | |
3244 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
3245 L->ob_item[len] = x; | |
3246 #else | |
3247 PyList_SET_ITEM(list, len, x); | |
3248 #endif | |
3249 __Pyx_SET_SIZE(list, len + 1); | |
3250 return 0; | |
3251 } | |
3252 return PyList_Append(list, x); | |
3253 } | |
3254 #else | |
3255 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) | |
3256 #endif | |
3257 | |
3258 /* UnicodeConcatInPlace.proto */ | |
3259 # if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
3260 #if CYTHON_REFNANNY | |
3261 #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) | |
3262 #else | |
3263 #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) | |
3264 #endif | |
3265 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right | |
3266 #if CYTHON_REFNANNY | |
3267 , void* __pyx_refnanny | |
3268 #endif | |
3269 ); | |
3270 #else | |
3271 #define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat | |
3272 #endif | |
3273 #define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ | |
3274 PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) | |
3275 | |
3276 /* DivInt[Py_ssize_t].proto */ | |
3277 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); | |
3278 | |
3279 /* SliceTupleAndList.proto */ | |
3280 #if CYTHON_COMPILING_IN_CPYTHON | |
3281 static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); | |
3282 static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); | |
3283 #else | |
3284 #define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) | |
3285 #define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) | |
3286 #endif | |
3287 | |
3288 /* AssertionsEnabled.proto */ | |
3289 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) | |
3290 #define __Pyx_init_assertions_enabled() (0) | |
3291 #define __pyx_assertions_enabled() (1) | |
3292 #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) | |
3293 static int __pyx_assertions_enabled_flag; | |
3294 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) | |
3295 static int __Pyx_init_assertions_enabled(void) { | |
3296 PyObject *builtins, *debug, *debug_str; | |
3297 int flag; | |
3298 builtins = PyEval_GetBuiltins(); | |
3299 if (!builtins) goto bad; | |
3300 debug_str = PyUnicode_FromStringAndSize("__debug__", 9); | |
3301 if (!debug_str) goto bad; | |
3302 debug = PyObject_GetItem(builtins, debug_str); | |
3303 Py_DECREF(debug_str); | |
3304 if (!debug) goto bad; | |
3305 flag = PyObject_IsTrue(debug); | |
3306 Py_DECREF(debug); | |
3307 if (flag == -1) goto bad; | |
3308 __pyx_assertions_enabled_flag = flag; | |
3309 return 0; | |
3310 bad: | |
3311 __pyx_assertions_enabled_flag = 1; | |
3312 return -1; | |
3313 } | |
3314 #else | |
3315 #define __Pyx_init_assertions_enabled() (0) | |
3316 #define __pyx_assertions_enabled() (!Py_OptimizeFlag) | |
3317 #endif | |
3318 | |
3319 /* PyObjectCall2Args.proto */ | |
3320 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); | |
3321 | |
3322 /* PyObjectCallMethod1.proto */ | |
3323 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); | |
3324 | |
3325 /* append.proto */ | |
3326 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); | |
3327 | |
3328 /* PyIntBinop.proto */ | |
3329 #if !CYTHON_COMPILING_IN_PYPY | |
3330 static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); | |
3331 #else | |
3332 #define __Pyx_PyInt_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check)\ | |
3333 (inplace ? PyNumber_InPlaceFloorDivide(op1, op2) : PyNumber_FloorDivide(op1, op2)) | |
3334 #endif | |
3335 | |
3336 /* PyIntBinop.proto */ | |
3337 #if !CYTHON_COMPILING_IN_PYPY | |
3338 static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); | |
3339 #else | |
3340 #define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace, zerodivision_check)\ | |
3341 (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2)) | |
3342 #endif | |
3343 | |
3344 /* SetItemInt.proto */ | |
3345 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
3346 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
3347 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ | |
3348 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ | |
3349 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) | |
3350 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); | |
3351 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, | |
3352 int is_list, int wraparound, int boundscheck); | |
3353 | |
3354 /* PyUnicodeContains.proto */ | |
3355 static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) { | |
3356 int result = PyUnicode_Contains(text, substring); | |
3357 return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); | |
3358 } | |
3359 | |
3360 /* pyobject_as_double.proto */ | |
3361 static double __Pyx__PyObject_AsDouble(PyObject* obj); | |
3362 #if CYTHON_COMPILING_IN_PYPY | |
3363 #define __Pyx_PyObject_AsDouble(obj)\ | |
3364 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ | |
3365 likely(PyInt_CheckExact(obj)) ?\ | |
3366 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) | |
3367 #else | |
3368 #define __Pyx_PyObject_AsDouble(obj)\ | |
3369 ((likely(PyFloat_CheckExact(obj))) ? PyFloat_AS_DOUBLE(obj) :\ | |
3370 likely(PyLong_CheckExact(obj)) ?\ | |
3371 PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) | |
3372 #endif | |
3373 | |
3374 /* PySequenceMultiply.proto */ | |
3375 #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul) | |
3376 static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul); | |
3377 | |
3378 /* pep479.proto */ | |
3379 static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); | |
3380 | |
3381 /* Import.proto */ | |
3382 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); | |
3383 | |
3384 /* ImportFrom.proto */ | |
3385 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); | |
3386 | |
3387 /* GetAttr.proto */ | |
3388 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); | |
3389 | |
3390 /* HasAttr.proto */ | |
3391 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); | |
3392 | |
3393 /* CallNextTpDealloc.proto */ | |
3394 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); | |
3395 | |
3396 /* CallNextTpTraverse.proto */ | |
3397 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); | |
3398 | |
3399 /* CallNextTpClear.proto */ | |
3400 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear); | |
3401 | |
3402 /* TypeImport.proto */ | |
3403 #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11 | |
3404 #define __PYX_HAVE_RT_ImportType_proto_3_0_11 | |
3405 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L | |
3406 #include <stdalign.h> | |
3407 #endif | |
3408 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L | |
3409 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s) | |
3410 #else | |
3411 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*) | |
3412 #endif | |
3413 enum __Pyx_ImportType_CheckSize_3_0_11 { | |
3414 __Pyx_ImportType_CheckSize_Error_3_0_11 = 0, | |
3415 __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1, | |
3416 __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2 | |
3417 }; | |
3418 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size); | |
3419 #endif | |
3420 | |
3421 /* GetVTable.proto */ | |
3422 static void* __Pyx_GetVtable(PyTypeObject *type); | |
3423 | |
3424 /* IncludeStructmemberH.proto */ | |
3425 #include <structmember.h> | |
3426 | |
3427 /* FixUpExtensionType.proto */ | |
3428 #if CYTHON_USE_TYPE_SPECS | |
3429 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); | |
3430 #endif | |
3431 | |
3432 /* ValidateBasesTuple.proto */ | |
3433 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS | |
3434 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); | |
3435 #endif | |
3436 | |
3437 /* PyType_Ready.proto */ | |
3438 CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); | |
3439 | |
3440 /* PyObject_GenericGetAttrNoDict.proto */ | |
3441 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
3442 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); | |
3443 #else | |
3444 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr | |
3445 #endif | |
3446 | |
3447 /* PyObject_GenericGetAttr.proto */ | |
3448 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
3449 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); | |
3450 #else | |
3451 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr | |
3452 #endif | |
3453 | |
3454 /* SetVTable.proto */ | |
3455 static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); | |
3456 | |
3457 /* MergeVTables.proto */ | |
3458 #if !CYTHON_COMPILING_IN_LIMITED_API | |
3459 static int __Pyx_MergeVtables(PyTypeObject *type); | |
3460 #endif | |
3461 | |
3462 /* SetupReduce.proto */ | |
3463 #if !CYTHON_COMPILING_IN_LIMITED_API | |
3464 static int __Pyx_setup_reduce(PyObject* type_obj); | |
3465 #endif | |
3466 | |
3467 /* ImportDottedModule.proto */ | |
3468 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); | |
3469 #if PY_MAJOR_VERSION >= 3 | |
3470 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); | |
3471 #endif | |
3472 | |
3473 /* FetchSharedCythonModule.proto */ | |
3474 static PyObject *__Pyx_FetchSharedCythonABIModule(void); | |
3475 | |
3476 /* FetchCommonType.proto */ | |
3477 #if !CYTHON_USE_TYPE_SPECS | |
3478 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); | |
3479 #else | |
3480 static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); | |
3481 #endif | |
3482 | |
3483 /* PyMethodNew.proto */ | |
3484 #if CYTHON_COMPILING_IN_LIMITED_API | |
3485 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { | |
3486 PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; | |
3487 CYTHON_UNUSED_VAR(typ); | |
3488 if (!self) | |
3489 return __Pyx_NewRef(func); | |
3490 typesModule = PyImport_ImportModule("types"); | |
3491 if (!typesModule) return NULL; | |
3492 methodType = PyObject_GetAttrString(typesModule, "MethodType"); | |
3493 Py_DECREF(typesModule); | |
3494 if (!methodType) return NULL; | |
3495 result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); | |
3496 Py_DECREF(methodType); | |
3497 return result; | |
3498 } | |
3499 #elif PY_MAJOR_VERSION >= 3 | |
3500 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { | |
3501 CYTHON_UNUSED_VAR(typ); | |
3502 if (!self) | |
3503 return __Pyx_NewRef(func); | |
3504 return PyMethod_New(func, self); | |
3505 } | |
3506 #else | |
3507 #define __Pyx_PyMethod_New PyMethod_New | |
3508 #endif | |
3509 | |
3510 /* PyVectorcallFastCallDict.proto */ | |
3511 #if CYTHON_METH_FASTCALL | |
3512 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); | |
3513 #endif | |
3514 | |
3515 /* CythonFunctionShared.proto */ | |
3516 #define __Pyx_CyFunction_USED | |
3517 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 | |
3518 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 | |
3519 #define __Pyx_CYFUNCTION_CCLASS 0x04 | |
3520 #define __Pyx_CYFUNCTION_COROUTINE 0x08 | |
3521 #define __Pyx_CyFunction_GetClosure(f)\ | |
3522 (((__pyx_CyFunctionObject *) (f))->func_closure) | |
3523 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
3524 #define __Pyx_CyFunction_GetClassObj(f)\ | |
3525 (((__pyx_CyFunctionObject *) (f))->func_classobj) | |
3526 #else | |
3527 #define __Pyx_CyFunction_GetClassObj(f)\ | |
3528 ((PyObject*) ((PyCMethodObject *) (f))->mm_class) | |
3529 #endif | |
3530 #define __Pyx_CyFunction_SetClassObj(f, classobj)\ | |
3531 __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) | |
3532 #define __Pyx_CyFunction_Defaults(type, f)\ | |
3533 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) | |
3534 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ | |
3535 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) | |
3536 typedef struct { | |
3537 #if CYTHON_COMPILING_IN_LIMITED_API | |
3538 PyObject_HEAD | |
3539 PyObject *func; | |
3540 #elif PY_VERSION_HEX < 0x030900B1 | |
3541 PyCFunctionObject func; | |
3542 #else | |
3543 PyCMethodObject func; | |
3544 #endif | |
3545 #if CYTHON_BACKPORT_VECTORCALL | |
3546 __pyx_vectorcallfunc func_vectorcall; | |
3547 #endif | |
3548 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API | |
3549 PyObject *func_weakreflist; | |
3550 #endif | |
3551 PyObject *func_dict; | |
3552 PyObject *func_name; | |
3553 PyObject *func_qualname; | |
3554 PyObject *func_doc; | |
3555 PyObject *func_globals; | |
3556 PyObject *func_code; | |
3557 PyObject *func_closure; | |
3558 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
3559 PyObject *func_classobj; | |
3560 #endif | |
3561 void *defaults; | |
3562 int defaults_pyobjects; | |
3563 size_t defaults_size; | |
3564 int flags; | |
3565 PyObject *defaults_tuple; | |
3566 PyObject *defaults_kwdict; | |
3567 PyObject *(*defaults_getter)(PyObject *); | |
3568 PyObject *func_annotations; | |
3569 PyObject *func_is_coroutine; | |
3570 } __pyx_CyFunctionObject; | |
3571 #undef __Pyx_CyOrPyCFunction_Check | |
3572 #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) | |
3573 #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) | |
3574 #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) | |
3575 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); | |
3576 #undef __Pyx_IsSameCFunction | |
3577 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) | |
3578 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, | |
3579 int flags, PyObject* qualname, | |
3580 PyObject *closure, | |
3581 PyObject *module, PyObject *globals, | |
3582 PyObject* code); | |
3583 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); | |
3584 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, | |
3585 size_t size, | |
3586 int pyobjects); | |
3587 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, | |
3588 PyObject *tuple); | |
3589 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, | |
3590 PyObject *dict); | |
3591 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, | |
3592 PyObject *dict); | |
3593 static int __pyx_CyFunction_init(PyObject *module); | |
3594 #if CYTHON_METH_FASTCALL | |
3595 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
3596 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
3597 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
3598 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
3599 #if CYTHON_BACKPORT_VECTORCALL | |
3600 #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) | |
3601 #else | |
3602 #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) | |
3603 #endif | |
3604 #endif | |
3605 | |
3606 /* CythonFunction.proto */ | |
3607 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, | |
3608 int flags, PyObject* qualname, | |
3609 PyObject *closure, | |
3610 PyObject *module, PyObject *globals, | |
3611 PyObject* code); | |
3612 | |
3613 /* Py3UpdateBases.proto */ | |
3614 static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); | |
3615 | |
3616 /* CalculateMetaclass.proto */ | |
3617 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); | |
3618 | |
3619 /* SetNameInClass.proto */ | |
3620 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 | |
3621 #define __Pyx_SetNameInClass(ns, name, value)\ | |
3622 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) | |
3623 #elif CYTHON_COMPILING_IN_CPYTHON | |
3624 #define __Pyx_SetNameInClass(ns, name, value)\ | |
3625 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) | |
3626 #else | |
3627 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) | |
3628 #endif | |
3629 | |
3630 /* PyObjectLookupSpecial.proto */ | |
3631 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
3632 #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) | |
3633 #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) | |
3634 static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); | |
3635 #else | |
3636 #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) | |
3637 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) | |
3638 #endif | |
3639 | |
3640 /* Py3ClassCreate.proto */ | |
3641 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, | |
3642 PyObject *mkw, PyObject *modname, PyObject *doc); | |
3643 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, | |
3644 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); | |
3645 | |
3646 /* CLineInTraceback.proto */ | |
3647 #ifdef CYTHON_CLINE_IN_TRACEBACK | |
3648 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) | |
3649 #else | |
3650 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); | |
3651 #endif | |
3652 | |
3653 /* CodeObjectCache.proto */ | |
3654 #if !CYTHON_COMPILING_IN_LIMITED_API | |
3655 typedef struct { | |
3656 PyCodeObject* code_object; | |
3657 int code_line; | |
3658 } __Pyx_CodeObjectCacheEntry; | |
3659 struct __Pyx_CodeObjectCache { | |
3660 int count; | |
3661 int max_count; | |
3662 __Pyx_CodeObjectCacheEntry* entries; | |
3663 }; | |
3664 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; | |
3665 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); | |
3666 static PyCodeObject *__pyx_find_code_object(int code_line); | |
3667 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); | |
3668 #endif | |
3669 | |
3670 /* AddTraceback.proto */ | |
3671 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
3672 int py_line, const char *filename); | |
3673 | |
3674 /* ArrayAPI.proto */ | |
3675 #ifndef _ARRAYARRAY_H | |
3676 #define _ARRAYARRAY_H | |
3677 typedef struct arraydescr { | |
3678 int typecode; | |
3679 int itemsize; | |
3680 PyObject * (*getitem)(struct arrayobject *, Py_ssize_t); | |
3681 int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *); | |
3682 #if PY_MAJOR_VERSION >= 3 | |
3683 char *formats; | |
3684 #endif | |
3685 } arraydescr; | |
3686 struct arrayobject { | |
3687 PyObject_HEAD | |
3688 Py_ssize_t ob_size; | |
3689 union { | |
3690 char *ob_item; | |
3691 float *as_floats; | |
3692 double *as_doubles; | |
3693 int *as_ints; | |
3694 unsigned int *as_uints; | |
3695 unsigned char *as_uchars; | |
3696 signed char *as_schars; | |
3697 char *as_chars; | |
3698 unsigned long *as_ulongs; | |
3699 long *as_longs; | |
3700 #if PY_MAJOR_VERSION >= 3 | |
3701 unsigned long long *as_ulonglongs; | |
3702 long long *as_longlongs; | |
3703 #endif | |
3704 short *as_shorts; | |
3705 unsigned short *as_ushorts; | |
3706 Py_UNICODE *as_pyunicodes; | |
3707 void *as_voidptr; | |
3708 } data; | |
3709 Py_ssize_t allocated; | |
3710 struct arraydescr *ob_descr; | |
3711 PyObject *weakreflist; | |
3712 #if PY_MAJOR_VERSION >= 3 | |
3713 int ob_exports; | |
3714 #endif | |
3715 }; | |
3716 #ifndef NO_NEWARRAY_INLINE | |
3717 static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size, | |
3718 struct arraydescr *descr) { | |
3719 arrayobject *op; | |
3720 size_t nbytes; | |
3721 if (size < 0) { | |
3722 PyErr_BadInternalCall(); | |
3723 return NULL; | |
3724 } | |
3725 nbytes = size * descr->itemsize; | |
3726 if (nbytes / descr->itemsize != (size_t)size) { | |
3727 return PyErr_NoMemory(); | |
3728 } | |
3729 op = (arrayobject *) type->tp_alloc(type, 0); | |
3730 if (op == NULL) { | |
3731 return NULL; | |
3732 } | |
3733 op->ob_descr = descr; | |
3734 op->allocated = size; | |
3735 op->weakreflist = NULL; | |
3736 __Pyx_SET_SIZE(op, size); | |
3737 if (size <= 0) { | |
3738 op->data.ob_item = NULL; | |
3739 } | |
3740 else { | |
3741 op->data.ob_item = PyMem_NEW(char, nbytes); | |
3742 if (op->data.ob_item == NULL) { | |
3743 Py_DECREF(op); | |
3744 return PyErr_NoMemory(); | |
3745 } | |
3746 } | |
3747 return (PyObject *) op; | |
3748 } | |
3749 #else | |
3750 PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size, | |
3751 struct arraydescr *descr); | |
3752 #endif | |
3753 static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) { | |
3754 void *items = (void*) self->data.ob_item; | |
3755 PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize)); | |
3756 if (items == NULL) { | |
3757 PyErr_NoMemory(); | |
3758 return -1; | |
3759 } | |
3760 self->data.ob_item = (char*) items; | |
3761 __Pyx_SET_SIZE(self, n); | |
3762 self->allocated = n; | |
3763 return 0; | |
3764 } | |
3765 static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) { | |
3766 void *items = (void*) self->data.ob_item; | |
3767 Py_ssize_t newsize; | |
3768 if (n < self->allocated && n*4 > self->allocated) { | |
3769 __Pyx_SET_SIZE(self, n); | |
3770 return 0; | |
3771 } | |
3772 newsize = n + (n / 2) + 1; | |
3773 if (newsize <= n) { | |
3774 PyErr_NoMemory(); | |
3775 return -1; | |
3776 } | |
3777 PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize)); | |
3778 if (items == NULL) { | |
3779 PyErr_NoMemory(); | |
3780 return -1; | |
3781 } | |
3782 self->data.ob_item = (char*) items; | |
3783 __Pyx_SET_SIZE(self, n); | |
3784 self->allocated = newsize; | |
3785 return 0; | |
3786 } | |
3787 #endif | |
3788 | |
3789 /* CIntFromPy.proto */ | |
3790 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); | |
3791 | |
3792 /* CIntToPy.proto */ | |
3793 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); | |
3794 | |
3795 /* CIntToPy.proto */ | |
3796 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); | |
3797 | |
3798 /* CIntFromPy.proto */ | |
3799 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); | |
3800 | |
3801 /* FormatTypeName.proto */ | |
3802 #if CYTHON_COMPILING_IN_LIMITED_API | |
3803 typedef PyObject *__Pyx_TypeName; | |
3804 #define __Pyx_FMT_TYPENAME "%U" | |
3805 static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); | |
3806 #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) | |
3807 #else | |
3808 typedef const char *__Pyx_TypeName; | |
3809 #define __Pyx_FMT_TYPENAME "%.200s" | |
3810 #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) | |
3811 #define __Pyx_DECREF_TypeName(obj) | |
3812 #endif | |
3813 | |
3814 /* FastTypeChecks.proto */ | |
3815 #if CYTHON_COMPILING_IN_CPYTHON | |
3816 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) | |
3817 #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) | |
3818 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); | |
3819 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); | |
3820 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); | |
3821 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); | |
3822 #else | |
3823 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) | |
3824 #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) | |
3825 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) | |
3826 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) | |
3827 #endif | |
3828 #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) | |
3829 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) | |
3830 | |
3831 /* SwapException.proto */ | |
3832 #if CYTHON_FAST_THREAD_STATE | |
3833 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) | |
3834 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
3835 #else | |
3836 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); | |
3837 #endif | |
3838 | |
3839 /* CoroutineBase.proto */ | |
3840 struct __pyx_CoroutineObject; | |
3841 typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); | |
3842 #if CYTHON_USE_EXC_INFO_STACK | |
3843 #define __Pyx_ExcInfoStruct _PyErr_StackItem | |
3844 #else | |
3845 typedef struct { | |
3846 PyObject *exc_type; | |
3847 PyObject *exc_value; | |
3848 PyObject *exc_traceback; | |
3849 } __Pyx_ExcInfoStruct; | |
3850 #endif | |
3851 typedef struct __pyx_CoroutineObject { | |
3852 PyObject_HEAD | |
3853 __pyx_coroutine_body_t body; | |
3854 PyObject *closure; | |
3855 __Pyx_ExcInfoStruct gi_exc_state; | |
3856 PyObject *gi_weakreflist; | |
3857 PyObject *classobj; | |
3858 PyObject *yieldfrom; | |
3859 PyObject *gi_name; | |
3860 PyObject *gi_qualname; | |
3861 PyObject *gi_modulename; | |
3862 PyObject *gi_code; | |
3863 PyObject *gi_frame; | |
3864 int resume_label; | |
3865 char is_running; | |
3866 } __pyx_CoroutineObject; | |
3867 static __pyx_CoroutineObject *__Pyx__Coroutine_New( | |
3868 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, | |
3869 PyObject *name, PyObject *qualname, PyObject *module_name); | |
3870 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( | |
3871 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, | |
3872 PyObject *name, PyObject *qualname, PyObject *module_name); | |
3873 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); | |
3874 static int __Pyx_Coroutine_clear(PyObject *self); | |
3875 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); | |
3876 static PyObject *__Pyx_Coroutine_Close(PyObject *self); | |
3877 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); | |
3878 #if CYTHON_USE_EXC_INFO_STACK | |
3879 #define __Pyx_Coroutine_SwapException(self) | |
3880 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) | |
3881 #else | |
3882 #define __Pyx_Coroutine_SwapException(self) {\ | |
3883 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ | |
3884 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ | |
3885 } | |
3886 #define __Pyx_Coroutine_ResetAndClearException(self) {\ | |
3887 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ | |
3888 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ | |
3889 } | |
3890 #endif | |
3891 #if CYTHON_FAST_THREAD_STATE | |
3892 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ | |
3893 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) | |
3894 #else | |
3895 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ | |
3896 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) | |
3897 #endif | |
3898 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); | |
3899 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); | |
3900 | |
3901 /* PatchModuleWithCoroutine.proto */ | |
3902 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); | |
3903 | |
3904 /* PatchGeneratorABC.proto */ | |
3905 static int __Pyx_patch_abc(void); | |
3906 | |
3907 /* Generator.proto */ | |
3908 #define __Pyx_Generator_USED | |
3909 #define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) | |
3910 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ | |
3911 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) | |
3912 static PyObject *__Pyx_Generator_Next(PyObject *self); | |
3913 static int __pyx_Generator_init(PyObject *module); | |
3914 | |
3915 /* CheckBinaryVersion.proto */ | |
3916 static unsigned long __Pyx_get_runtime_version(void); | |
3917 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); | |
3918 | |
3919 /* FunctionImport.proto */ | |
3920 static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig); | |
3921 | |
3922 /* InitStrings.proto */ | |
3923 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); | |
3924 | |
3925 /* #### Code section: module_declarations ### */ | |
3926 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ | |
3927 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ | |
3928 static PyObject *__pyx_f_5pysam_7libcvcf_9VCFRecord_update(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes); /* proto*/ | |
3929 static PyObject *__pyx_f_5pysam_7libcvcf_11asVCFRecord_parse(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len); /* proto*/ | |
3930 | |
3931 /* Module declarations from "libc.string" */ | |
3932 | |
3933 /* Module declarations from "libc.stdlib" */ | |
3934 | |
3935 /* Module declarations from "libc.stdint" */ | |
3936 | |
3937 /* Module declarations from "libc.stdio" */ | |
3938 | |
3939 /* Module declarations from "posix.types" */ | |
3940 | |
3941 /* Module declarations from "pysam.libchtslib" */ | |
3942 | |
3943 /* Module declarations from "pysam.libctabix" */ | |
3944 | |
3945 /* Module declarations from "pysam.libctabixproxies" */ | |
3946 | |
3947 /* Module declarations from "cython" */ | |
3948 | |
3949 /* Module declarations from "cpython.version" */ | |
3950 | |
3951 /* Module declarations from "__builtin__" */ | |
3952 | |
3953 /* Module declarations from "cpython.type" */ | |
3954 | |
3955 /* Module declarations from "cpython.object" */ | |
3956 | |
3957 /* Module declarations from "cpython.ref" */ | |
3958 | |
3959 /* Module declarations from "cpython.exc" */ | |
3960 | |
3961 /* Module declarations from "cpython.module" */ | |
3962 | |
3963 /* Module declarations from "cpython.mem" */ | |
3964 | |
3965 /* Module declarations from "cpython.tuple" */ | |
3966 | |
3967 /* Module declarations from "cpython.list" */ | |
3968 | |
3969 /* Module declarations from "cpython.sequence" */ | |
3970 | |
3971 /* Module declarations from "cpython.mapping" */ | |
3972 | |
3973 /* Module declarations from "cpython.iterator" */ | |
3974 | |
3975 /* Module declarations from "cpython.number" */ | |
3976 | |
3977 /* Module declarations from "cpython.int" */ | |
3978 | |
3979 /* Module declarations from "__builtin__" */ | |
3980 | |
3981 /* Module declarations from "cpython.bool" */ | |
3982 | |
3983 /* Module declarations from "cpython.long" */ | |
3984 | |
3985 /* Module declarations from "cpython.float" */ | |
3986 | |
3987 /* Module declarations from "__builtin__" */ | |
3988 | |
3989 /* Module declarations from "cpython.complex" */ | |
3990 | |
3991 /* Module declarations from "cpython.string" */ | |
3992 | |
3993 /* Module declarations from "libc.stddef" */ | |
3994 | |
3995 /* Module declarations from "cpython.unicode" */ | |
3996 | |
3997 /* Module declarations from "cpython.pyport" */ | |
3998 | |
3999 /* Module declarations from "cpython.dict" */ | |
4000 | |
4001 /* Module declarations from "cpython.instance" */ | |
4002 | |
4003 /* Module declarations from "cpython.function" */ | |
4004 | |
4005 /* Module declarations from "cpython.method" */ | |
4006 | |
4007 /* Module declarations from "cpython.weakref" */ | |
4008 | |
4009 /* Module declarations from "cpython.getargs" */ | |
4010 | |
4011 /* Module declarations from "cpython.pythread" */ | |
4012 | |
4013 /* Module declarations from "cpython.pystate" */ | |
4014 | |
4015 /* Module declarations from "cpython.cobject" */ | |
4016 | |
4017 /* Module declarations from "cpython.oldbuffer" */ | |
4018 | |
4019 /* Module declarations from "cpython.set" */ | |
4020 | |
4021 /* Module declarations from "cpython.buffer" */ | |
4022 | |
4023 /* Module declarations from "cpython.bytes" */ | |
4024 | |
4025 /* Module declarations from "cpython.pycapsule" */ | |
4026 | |
4027 /* Module declarations from "cpython.contextvars" */ | |
4028 | |
4029 /* Module declarations from "cpython" */ | |
4030 | |
4031 /* Module declarations from "array" */ | |
4032 | |
4033 /* Module declarations from "cpython.array" */ | |
4034 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/ | |
4035 | |
4036 /* Module declarations from "pysam.libcutils" */ | |
4037 static PyObject *(*__pyx_f_5pysam_9libcutils_force_str)(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args); /*proto*/ | |
4038 | |
4039 /* Module declarations from "pysam.libcvcf" */ | |
4040 static PyObject *__pyx_f_5pysam_7libcvcf___pyx_unpickle_asVCFRecord__set_state(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *, PyObject *); /*proto*/ | |
4041 /* #### Code section: typeinfo ### */ | |
4042 /* #### Code section: before_global_var ### */ | |
4043 #define __Pyx_MODULE_NAME "pysam.libcvcf" | |
4044 extern int __pyx_module_is_main_pysam__libcvcf; | |
4045 int __pyx_module_is_main_pysam__libcvcf = 0; | |
4046 | |
4047 /* Implementation of "pysam.libcvcf" */ | |
4048 /* #### Code section: global_var ### */ | |
4049 static PyObject *__pyx_builtin_object; | |
4050 static PyObject *__pyx_builtin_ValueError; | |
4051 static PyObject *__pyx_builtin_range; | |
4052 static PyObject *__pyx_builtin_TypeError; | |
4053 static PyObject *__pyx_builtin_enumerate; | |
4054 static PyObject *__pyx_builtin_map; | |
4055 static PyObject *__pyx_builtin_AssertionError; | |
4056 static PyObject *__pyx_builtin_min; | |
4057 static PyObject *__pyx_builtin_zip; | |
4058 static PyObject *__pyx_builtin_StopIteration; | |
4059 static PyObject *__pyx_builtin_KeyError; | |
4060 static PyObject *__pyx_builtin_NotImplementedError; | |
4061 static PyObject *__pyx_builtin_MemoryError; | |
4062 /* #### Code section: string_decls ### */ | |
4063 static const char __pyx_k_[] = ""; | |
4064 static const char __pyx_k_0[] = "0"; | |
4065 static const char __pyx_k_A[] = "A"; | |
4066 static const char __pyx_k_D[] = "D"; | |
4067 static const char __pyx_k_G[] = "G"; | |
4068 static const char __pyx_k_I[] = "I"; | |
4069 static const char __pyx_k_N[] = "N"; | |
4070 static const char __pyx_k_a[] = "a"; | |
4071 static const char __pyx_k_c[] = "c"; | |
4072 static const char __pyx_k_d[] = "d"; | |
4073 static const char __pyx_k_f[] = "f"; | |
4074 static const char __pyx_k_i[] = "i"; | |
4075 static const char __pyx_k_k[] = "k"; | |
4076 static const char __pyx_k_l[] = "l"; | |
4077 static const char __pyx_k_n[] = "n"; | |
4078 static const char __pyx_k_r[] = "r"; | |
4079 static const char __pyx_k_s[] = "s"; | |
4080 static const char __pyx_k_t[] = "t"; | |
4081 static const char __pyx_k_v[] = "v"; | |
4082 static const char __pyx_k_x[] = "x"; | |
4083 static const char __pyx_k_y[] = "y"; | |
4084 static const char __pyx_k_DP[] = "DP"; | |
4085 static const char __pyx_k_EC[] = "EC"; | |
4086 static const char __pyx_k_FT[] = "FT"; | |
4087 static const char __pyx_k_GL[] = "GL"; | |
4088 static const char __pyx_k_GP[] = "GP"; | |
4089 static const char __pyx_k_GQ[] = "GQ"; | |
4090 static const char __pyx_k_GT[] = "GT"; | |
4091 static const char __pyx_k_HQ[] = "HQ"; | |
4092 static const char __pyx_k_ID[] = "ID="; | |
4093 static const char __pyx_k_MQ[] = "MQ"; | |
4094 static const char __pyx_k_PL[] = "PL"; | |
4095 static const char __pyx_k_PQ[] = "PQ"; | |
4096 static const char __pyx_k_PS[] = "PS"; | |
4097 static const char __pyx_k__2[] = ","; | |
4098 static const char __pyx_k__3[] = ":"; | |
4099 static const char __pyx_k__4[] = "-"; | |
4100 static const char __pyx_k__5[] = "."; | |
4101 static const char __pyx_k__6[] = ";"; | |
4102 static const char __pyx_k__7[] = "="; | |
4103 static const char __pyx_k__8[] = ")"; | |
4104 static const char __pyx_k_fa[] = "fa"; | |
4105 static const char __pyx_k_gc[] = "gc"; | |
4106 static const char __pyx_k_id[] = "id="; | |
4107 static const char __pyx_k_na[] = "na"; | |
4108 static const char __pyx_k_re[] = "re"; | |
4109 static const char __pyx_k_ALT[] = "ALT"; | |
4110 static const char __pyx_k_GLE[] = "GLE"; | |
4111 static const char __pyx_k_POS[] = "POS"; | |
4112 static const char __pyx_k_REF[] = "REF"; | |
4113 static const char __pyx_k_VCF[] = "VCF"; | |
4114 static const char __pyx_k__10[] = ": '"; | |
4115 static const char __pyx_k__11[] = "'\n"; | |
4116 static const char __pyx_k__12[] = " "; | |
4117 static const char __pyx_k__13[] = ": "; | |
4118 static const char __pyx_k__14[] = "\n"; | |
4119 static const char __pyx_k__15[] = "<"; | |
4120 static const char __pyx_k__16[] = ">"; | |
4121 static const char __pyx_k__19[] = "\""; | |
4122 static const char __pyx_k__23[] = "##"; | |
4123 static const char __pyx_k__24[] = "#"; | |
4124 static const char __pyx_k__25[] = "\t"; | |
4125 static const char __pyx_k__27[] = "|"; | |
4126 static const char __pyx_k__33[] = "*"; | |
4127 static const char __pyx_k__34[] = "[|/\\\\]"; | |
4128 static const char __pyx_k_add[] = "add"; | |
4129 static const char __pyx_k_all[] = "__all__"; | |
4130 static const char __pyx_k_alt[] = "alt"; | |
4131 static const char __pyx_k_del[] = "__del__"; | |
4132 static const char __pyx_k_doc[] = "__doc__"; | |
4133 static const char __pyx_k_end[] = "end"; | |
4134 static const char __pyx_k_err[] = "err"; | |
4135 static const char __pyx_k_fmt[] = "fmt"; | |
4136 static const char __pyx_k_for[] = " for "; | |
4137 static const char __pyx_k_get[] = "get"; | |
4138 static const char __pyx_k_got[] = "), got "; | |
4139 static const char __pyx_k_gts[] = "gts"; | |
4140 static const char __pyx_k_idx[] = "idx"; | |
4141 static const char __pyx_k_key[] = "key"; | |
4142 static const char __pyx_k_map[] = "map"; | |
4143 static const char __pyx_k_min[] = "min"; | |
4144 static const char __pyx_k_new[] = "__new__"; | |
4145 static const char __pyx_k_nmb[] = "nmb"; | |
4146 static const char __pyx_k_opt[] = "opt"; | |
4147 static const char __pyx_k_pos[] = "pos"; | |
4148 static const char __pyx_k_ref[] = "ref"; | |
4149 static const char __pyx_k_sys[] = "sys"; | |
4150 static const char __pyx_k_var[] = "var"; | |
4151 static const char __pyx_k_vcf[] = "vcf"; | |
4152 static const char __pyx_k_zip[] = "zip"; | |
4153 static const char __pyx_k_Flag[] = "Flag"; | |
4154 static const char __pyx_k_ID_2[] = "ID"; | |
4155 static const char __pyx_k_INFO[] = "INFO"; | |
4156 static const char __pyx_k_PASS[] = "PASS"; | |
4157 static const char __pyx_k_QUAL[] = "QUAL"; | |
4158 static const char __pyx_k_Type[] = "Type="; | |
4159 static const char __pyx_k__139[] = "?"; | |
4160 static const char __pyx_k_addn[] = "addn"; | |
4161 static const char __pyx_k_alt1[] = "alt1"; | |
4162 static const char __pyx_k_alt2[] = "alt2"; | |
4163 static const char __pyx_k_args[] = "args"; | |
4164 static const char __pyx_k_cols[] = "cols"; | |
4165 static const char __pyx_k_copy[] = "_copy"; | |
4166 static const char __pyx_k_data[] = "data"; | |
4167 static const char __pyx_k_dict[] = "__dict__"; | |
4168 static const char __pyx_k_elts[] = "elts"; | |
4169 static const char __pyx_k_find[] = "find"; | |
4170 static const char __pyx_k_id_2[] = "id"; | |
4171 static const char __pyx_k_info[] = "_info"; | |
4172 static const char __pyx_k_init[] = "__init__"; | |
4173 static const char __pyx_k_join[] = "join"; | |
4174 static const char __pyx_k_keys[] = "keys"; | |
4175 static const char __pyx_k_last[] = "last"; | |
4176 static const char __pyx_k_left[] = "left"; | |
4177 static const char __pyx_k_line[] = "line"; | |
4178 static const char __pyx_k_main[] = "__main__"; | |
4179 static const char __pyx_k_name[] = "__name__"; | |
4180 static const char __pyx_k_pos1[] = "pos1"; | |
4181 static const char __pyx_k_pos2[] = "pos2"; | |
4182 static const char __pyx_k_qual[] = "qual"; | |
4183 static const char __pyx_k_ref1[] = "ref1"; | |
4184 static const char __pyx_k_ref2[] = "ref2"; | |
4185 static const char __pyx_k_rest[] = "rest"; | |
4186 static const char __pyx_k_self[] = "self"; | |
4187 static const char __pyx_k_send[] = "send"; | |
4188 static const char __pyx_k_spec[] = "__spec__"; | |
4189 static const char __pyx_k_test[] = "__test__"; | |
4190 static const char __pyx_k_type[] = "type"; | |
4191 static const char __pyx_k_ACGTN[] = "ACGTN"; | |
4192 static const char __pyx_k_CHROM[] = "CHROM"; | |
4193 static const char __pyx_k_Error[] = "Error"; | |
4194 static const char __pyx_k_Float[] = "Float"; | |
4195 static const char __pyx_k_addns[] = "addns"; | |
4196 static const char __pyx_k_ascii[] = "ascii"; | |
4197 static const char __pyx_k_blurp[] = "blurp"; | |
4198 static const char __pyx_k_chrom[] = "chrom"; | |
4199 static const char __pyx_k_close[] = "close"; | |
4200 static const char __pyx_k_descr[] = "descr"; | |
4201 static const char __pyx_k_error[] = "error"; | |
4202 static const char __pyx_k_faref[] = "faref"; | |
4203 static const char __pyx_k_fetch[] = "fetch"; | |
4204 static const char __pyx_k_first[] = "first"; | |
4205 static const char __pyx_k_found[] = "(found "; | |
4206 static const char __pyx_k_ielts[] = "ielts"; | |
4207 static const char __pyx_k_label[] = "label"; | |
4208 static const char __pyx_k_lines[] = "lines"; | |
4209 static const char __pyx_k_match[] = "match"; | |
4210 static const char __pyx_k_parse[] = "_parse"; | |
4211 static const char __pyx_k_pysam[] = "pysam"; | |
4212 static const char __pyx_k_range[] = "range"; | |
4213 static const char __pyx_k_sdata[] = "sdata"; | |
4214 static const char __pyx_k_split[] = "split"; | |
4215 static const char __pyx_k_start[] = "start"; | |
4216 static const char __pyx_k_state[] = "state"; | |
4217 static const char __pyx_k_strip[] = "strip"; | |
4218 static const char __pyx_k_super[] = "super"; | |
4219 static const char __pyx_k_throw[] = "throw"; | |
4220 static const char __pyx_k_upper[] = "upper"; | |
4221 static const char __pyx_k_value[] = "value"; | |
4222 static const char __pyx_k_write[] = "write"; | |
4223 static const char __pyx_k_FILTER[] = "FILTER"; | |
4224 static const char __pyx_k_FORMAT[] = "FORMAT"; | |
4225 static const char __pyx_k_GTdata[] = "GTdata"; | |
4226 static const char __pyx_k_Number[] = "Number="; | |
4227 static const char __pyx_k_String[] = "String"; | |
4228 static const char __pyx_k_Type_2[] = "Type"; | |
4229 static const char __pyx_k_allele[] = "allele"; | |
4230 static const char __pyx_k_append[] = "append"; | |
4231 static const char __pyx_k_bisect[] = "bisect"; | |
4232 static const char __pyx_k_copy_2[] = "copy"; | |
4233 static const char __pyx_k_dict_2[] = "_dict"; | |
4234 static const char __pyx_k_dict_3[] = "dict"; | |
4235 static const char __pyx_k_enable[] = "enable"; | |
4236 static const char __pyx_k_errors[] = "_errors"; | |
4237 static const char __pyx_k_filter[] = "_filter"; | |
4238 static const char __pyx_k_format[] = "format"; | |
4239 static const char __pyx_k_header[] = "_header"; | |
4240 static const char __pyx_k_import[] = "__import__"; | |
4241 static const char __pyx_k_info_2[] = "info"; | |
4242 static const char __pyx_k_line_2[] = "_line"; | |
4243 static const char __pyx_k_lineno[] = "_lineno"; | |
4244 static const char __pyx_k_module[] = "__module__"; | |
4245 static const char __pyx_k_number[] = "number"; | |
4246 static const char __pyx_k_object[] = "object"; | |
4247 static const char __pyx_k_output[] = "(output)"; | |
4248 static const char __pyx_k_parser[] = "parser"; | |
4249 static const char __pyx_k_pickle[] = "pickle"; | |
4250 static const char __pyx_k_record[] = "record"; | |
4251 static const char __pyx_k_reduce[] = "__reduce__"; | |
4252 static const char __pyx_k_region[] = "region"; | |
4253 static const char __pyx_k_result[] = "result"; | |
4254 static const char __pyx_k_sample[] = "sample"; | |
4255 static const char __pyx_k_stream[] = "stream"; | |
4256 static const char __pyx_k_string[] = "string"; | |
4257 static const char __pyx_k_update[] = "update"; | |
4258 static const char __pyx_k_values[] = "values"; | |
4259 static const char __pyx_k_ACGTN_2[] = "^[ACGTN]+$"; | |
4260 static const char __pyx_k_Integer[] = "Integer"; | |
4261 static const char __pyx_k_VCFv3_3[] = "VCFv3.3"; | |
4262 static const char __pyx_k_VCFv4_0[] = "VCFv4.0"; | |
4263 static const char __pyx_k_VCFv4_1[] = "VCFv4.1"; | |
4264 static const char __pyx_k_VCFv4_2[] = "VCFv4.2"; | |
4265 static const char __pyx_k_Warning[] = "Warning"; | |
4266 static const char __pyx_k_alleles[] = "#alleles"; | |
4267 static const char __pyx_k_compile[] = "compile"; | |
4268 static const char __pyx_k_connect[] = "connect"; | |
4269 static const char __pyx_k_disable[] = "disable"; | |
4270 static const char __pyx_k_errwarn[] = "errwarn"; | |
4271 static const char __pyx_k_getinfo[] = "getinfo"; | |
4272 static const char __pyx_k_in_line[] = " in line "; | |
4273 static const char __pyx_k_lines_2[] = "_lines"; | |
4274 static const char __pyx_k_longest[] = "longest"; | |
4275 static const char __pyx_k_missing[] = "missing"; | |
4276 static const char __pyx_k_movable[] = "movable"; | |
4277 static const char __pyx_k_newalts[] = "newalts"; | |
4278 static const char __pyx_k_parse_2[] = "parse"; | |
4279 static const char __pyx_k_prepare[] = "__prepare__"; | |
4280 static const char __pyx_k_regions[] = "regions"; | |
4281 static const char __pyx_k_replace[] = "replace"; | |
4282 static const char __pyx_k_samples[] = "_samples"; | |
4283 static const char __pyx_k_setinfo[] = "setinfo"; | |
4284 static const char __pyx_k_vcffile[] = "vcffile"; | |
4285 static const char __pyx_k_version[] = "_version"; | |
4286 static const char __pyx_k_GTstring[] = "GTstring"; | |
4287 static const char __pyx_k_Genotype[] = "Genotype"; | |
4288 static const char __pyx_k_KeyError[] = "KeyError"; | |
4289 static const char __pyx_k_Number_2[] = "Number"; | |
4290 static const char __pyx_k_VCF_says[] = ", VCF says "; | |
4291 static const char __pyx_k_deepcopy[] = "deepcopy"; | |
4292 static const char __pyx_k_encoding[] = "encoding"; | |
4293 static const char __pyx_k_endswith[] = "endswith"; | |
4294 static const char __pyx_k_expected[] = "; expected "; | |
4295 static const char __pyx_k_filename[] = "filename"; | |
4296 static const char __pyx_k_filter_2[] = "filter"; | |
4297 static const char __pyx_k_format_2[] = "_format"; | |
4298 static const char __pyx_k_getstate[] = "__getstate__"; | |
4299 static const char __pyx_k_gtsRegEx[] = "gtsRegEx"; | |
4300 static const char __pyx_k_header_2[] = "header"; | |
4301 static const char __pyx_k_headings[] = "headings"; | |
4302 static const char __pyx_k_inregion[] = "inregion"; | |
4303 static const char __pyx_k_operator[] = "operator"; | |
4304 static const char __pyx_k_output_2[] = "output"; | |
4305 static const char __pyx_k_pyx_type[] = "__pyx_type"; | |
4306 static const char __pyx_k_qualname[] = "__qualname__"; | |
4307 static const char __pyx_k_required[] = "_required"; | |
4308 static const char __pyx_k_sequence[] = "sequence"; | |
4309 static const char __pyx_k_set_name[] = "__set_name__"; | |
4310 static const char __pyx_k_setstate[] = "__setstate__"; | |
4311 static const char __pyx_k_shortest[] = "shortest"; | |
4312 static const char __pyx_k_validate[] = "validate"; | |
4313 static const char __pyx_k_Character[] = "Character"; | |
4314 static const char __pyx_k_NT_NUMBER[] = "NT_NUMBER"; | |
4315 static const char __pyx_k_Phase_set[] = "Phase set"; | |
4316 static const char __pyx_k_Tabixfile[] = "Tabixfile"; | |
4317 static const char __pyx_k_TypeError[] = "TypeError"; | |
4318 static const char __pyx_k_VCFRecord[] = "VCFRecord"; | |
4319 static const char __pyx_k_VCF___del[] = "VCF.__del__"; | |
4320 static const char __pyx_k_VCF_close[] = "VCF.close"; | |
4321 static const char __pyx_k_VCF_error[] = "VCF.error"; | |
4322 static const char __pyx_k_VCF_fetch[] = "VCF.fetch"; | |
4323 static const char __pyx_k_VCF_parse[] = "VCF.parse"; | |
4324 static const char __pyx_k_VCF_write[] = "VCF.write"; | |
4325 static const char __pyx_k_WRONG_REF[] = "WRONG_REF"; | |
4326 static const char __pyx_k_convertGT[] = "convertGT"; | |
4327 static const char __pyx_k_enumerate[] = "enumerate"; | |
4328 static const char __pyx_k_genotypes[] = "#genotypes"; | |
4329 static const char __pyx_k_getfilter[] = "getfilter"; | |
4330 static const char __pyx_k_getformat[] = "getformat"; | |
4331 static const char __pyx_k_getheader[] = "getheader"; | |
4332 static const char __pyx_k_isenabled[] = "isenabled"; | |
4333 static const char __pyx_k_last_line[] = "last_line"; | |
4334 static const char __pyx_k_leftalign[] = "leftalign"; | |
4335 static const char __pyx_k_lineparse[] = "lineparse"; | |
4336 static const char __pyx_k_metaclass[] = "__metaclass__"; | |
4337 static const char __pyx_k_pyx_state[] = "__pyx_state"; | |
4338 static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; | |
4339 static const char __pyx_k_reference[] = "reference"; | |
4340 static const char __pyx_k_regions_2[] = "_regions"; | |
4341 static const char __pyx_k_samples_2[] = " samples ("; | |
4342 static const char __pyx_k_samples_3[] = "samples"; | |
4343 static const char __pyx_k_separator[] = "separator"; | |
4344 static const char __pyx_k_setfilter[] = "setfilter"; | |
4345 static const char __pyx_k_setformat[] = "setformat"; | |
4346 static const char __pyx_k_setheader[] = "setheader"; | |
4347 static const char __pyx_k_tabixfile[] = "tabixfile"; | |
4348 static const char __pyx_k_version_2[] = "version"; | |
4349 static const char __pyx_k_warnerror[] = "warnerror"; | |
4350 static const char __pyx_k_NT_ALLELES[] = "NT_ALLELES"; | |
4351 static const char __pyx_k_NT_UNKNOWN[] = "NT_UNKNOWN"; | |
4352 static const char __pyx_k_VCF___init[] = "VCF.__init__"; | |
4353 static const char __pyx_k_VCF__parse[] = "VCF._parse"; | |
4354 static const char __pyx_k_ValueError[] = "ValueError"; | |
4355 static const char __pyx_k_errorlabel[] = "errorlabel"; | |
4356 static const char __pyx_k_expected_2[] = ", expected "; | |
4357 static const char __pyx_k_expected_3[] = "expected "; | |
4358 static const char __pyx_k_expected_4[] = "expected"; | |
4359 static const char __pyx_k_fileformat[] = "fileformat"; | |
4360 static const char __pyx_k_formatdict[] = "formatdict"; | |
4361 static const char __pyx_k_getsamples[] = "getsamples"; | |
4362 static const char __pyx_k_itemgetter[] = "itemgetter"; | |
4363 static const char __pyx_k_itervalues[] = "itervalues"; | |
4364 static const char __pyx_k_namedtuple[] = "namedtuple"; | |
4365 static const char __pyx_k_numbertype[] = "numbertype"; | |
4366 static const char __pyx_k_parse_data[] = "parse_data"; | |
4367 static const char __pyx_k_pyx_result[] = "__pyx_result"; | |
4368 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; | |
4369 static const char __pyx_k_required_2[] = "required"; | |
4370 static const char __pyx_k_setregions[] = "setregions"; | |
4371 static const char __pyx_k_setsamples[] = "setsamples"; | |
4372 static const char __pyx_k_setversion[] = "setversion"; | |
4373 static const char __pyx_k_startswith[] = "startswith"; | |
4374 static const char __pyx_k_write_data[] = "write_data"; | |
4375 static const char __pyx_k_Description[] = "Description="; | |
4376 static const char __pyx_k_MISSING_REF[] = "MISSING_REF"; | |
4377 static const char __pyx_k_MemoryError[] = "MemoryError"; | |
4378 static const char __pyx_k_PickleError[] = "PickleError"; | |
4379 static const char __pyx_k_V33_BAD_REF[] = "V33_BAD_REF"; | |
4380 static const char __pyx_k_VCF_connect[] = "VCF.connect"; | |
4381 static const char __pyx_k_VCF_getinfo[] = "VCF.getinfo"; | |
4382 static const char __pyx_k_VCF_setinfo[] = "VCF.setinfo"; | |
4383 static const char __pyx_k_alleleRegEx[] = "alleleRegEx"; | |
4384 static const char __pyx_k_asVCFRecord[] = "asVCFRecord"; | |
4385 static const char __pyx_k_collections[] = "collections"; | |
4386 static const char __pyx_k_defaultdict[] = "defaultdict"; | |
4387 static const char __pyx_k_deletion_is[] = "(deletion is "; | |
4388 static const char __pyx_k_description[] = "description"; | |
4389 static const char __pyx_k_errorstring[] = "errorstring"; | |
4390 static const char __pyx_k_ignoreerror[] = "ignoreerror"; | |
4391 static const char __pyx_k_leftalign_2[] = "_leftalign"; | |
4392 static const char __pyx_k_mro_entries[] = "__mro_entries__"; | |
4393 static const char __pyx_k_reference_2[] = "_reference"; | |
4394 static const char __pyx_k_warn_errors[] = "_warn_errors"; | |
4395 static const char __pyx_k_writeheader[] = "writeheader"; | |
4396 static const char __pyx_k_BAD_GENOTYPE[] = "BAD_GENOTYPE"; | |
4397 static const char __pyx_k_NT_GENOTYPES[] = "NT_GENOTYPES"; | |
4398 static const char __pyx_k_VCF_inregion[] = "VCF.inregion"; | |
4399 static const char __pyx_k_VCF_validate[] = "VCF.validate"; | |
4400 static const char __pyx_k_get_expected[] = "get_expected"; | |
4401 static const char __pyx_k_get_sequence[] = "get_sequence"; | |
4402 static const char __pyx_k_initializing[] = "_initializing"; | |
4403 static const char __pyx_k_is_coroutine[] = "_is_coroutine"; | |
4404 static const char __pyx_k_missingvalue[] = "missingvalue"; | |
4405 static const char __pyx_k_parse_format[] = "parse_format"; | |
4406 static const char __pyx_k_parse_header[] = "parse_header"; | |
4407 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; | |
4408 static const char __pyx_k_reference_is[] = "(reference is "; | |
4409 static const char __pyx_k_setreference[] = "setreference"; | |
4410 static const char __pyx_k_stringsource[] = "<stringsource>"; | |
4411 static const char __pyx_k_use_setstate[] = "use_setstate"; | |
4412 static const char __pyx_k_write_header[] = "write_header"; | |
4413 static const char __pyx_k_Description_2[] = "Description"; | |
4414 static const char __pyx_k_NT_NR_ALLELES[] = "NT_NR_ALLELES"; | |
4415 static const char __pyx_k_StopIteration[] = "StopIteration"; | |
4416 static const char __pyx_k_Undefined_tag[] = "(Undefined tag)"; | |
4417 static const char __pyx_k_VCF_convertGT[] = "VCF.convertGT"; | |
4418 static const char __pyx_k_VCF_getfilter[] = "VCF.getfilter"; | |
4419 static const char __pyx_k_VCF_getformat[] = "VCF.getformat"; | |
4420 static const char __pyx_k_VCF_getheader[] = "VCF.getheader"; | |
4421 static const char __pyx_k_VCF_setfilter[] = "VCF.setfilter"; | |
4422 static const char __pyx_k_VCF_setformat[] = "VCF.setformat"; | |
4423 static const char __pyx_k_VCF_setheader[] = "VCF.setheader"; | |
4424 static const char __pyx_k_VCF_warnerror[] = "VCF.warnerror"; | |
4425 static const char __pyx_k_class_getitem[] = "__class_getitem__"; | |
4426 static const char __pyx_k_compare_calls[] = "compare_calls"; | |
4427 static const char __pyx_k_convertGTback[] = "convertGTback"; | |
4428 static const char __pyx_k_datagenerator[] = "datagenerator"; | |
4429 static const char __pyx_k_format_format[] = "format_format"; | |
4430 static const char __pyx_k_init_subclass[] = "__init_subclass__"; | |
4431 static const char __pyx_k_parse_heading[] = "parse_heading"; | |
4432 static const char __pyx_k_parse_regions[] = "parse_regions"; | |
4433 static const char __pyx_k_pysam_libcvcf[] = "pysam.libcvcf"; | |
4434 static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; | |
4435 static const char __pyx_k_sample2column[] = "_sample2column"; | |
4436 static const char __pyx_k_write_heading[] = "write_heading"; | |
4437 static const char __pyx_k_AssertionError[] = "AssertionError"; | |
4438 static const char __pyx_k_V33_BAD_ALLELE[] = "V33_BAD_ALLELE"; | |
4439 static const char __pyx_k_V40_BAD_ALLELE[] = "V40_BAD_ALLELE"; | |
4440 static const char __pyx_k_VCF_getsamples[] = "VCF.getsamples"; | |
4441 static const char __pyx_k_VCF_parse_data[] = "VCF.parse_data"; | |
4442 static const char __pyx_k_VCF_setregions[] = "VCF.setregions"; | |
4443 static const char __pyx_k_VCF_setsamples[] = "VCF.setsamples"; | |
4444 static const char __pyx_k_VCF_setversion[] = "VCF.setversion"; | |
4445 static const char __pyx_k_VCF_write_data[] = "VCF.write_data"; | |
4446 static const char __pyx_k_add_definition[] = "_add_definition"; | |
4447 static const char __pyx_k_have_deletions[] = "have_deletions"; | |
4448 static const char __pyx_k_ignored_errors[] = "_ignored_errors"; | |
4449 static const char __pyx_k_nonref_alleles[] = "#nonref_alleles"; | |
4450 static const char __pyx_k_parameters_got[] = " parameters, got "; | |
4451 static const char __pyx_k_parse_header_2[] = "_parse_header"; | |
4452 static const char __pyx_k_reference_is_2[] = ", reference is "; | |
4453 static const char __pyx_k_Phasing_quality[] = "Phasing quality"; | |
4454 static const char __pyx_k_VCFRecord_error[] = "VCFRecord.error"; | |
4455 static const char __pyx_k_VCF_ignoreerror[] = "VCF.ignoreerror"; | |
4456 static const char __pyx_k_VCF_writeheader[] = "VCF.writeheader"; | |
4457 static const char __pyx_k_faref_leftflank[] = "faref_leftflank"; | |
4458 static const char __pyx_k_fileformat_VCFv[] = "##fileformat=VCFv"; | |
4459 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; | |
4460 static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; | |
4461 static const char __pyx_k_Genotype_Quality[] = "Genotype Quality"; | |
4462 static const char __pyx_k_POS_NOT_POSITIVE[] = "POS_NOT_POSITIVE"; | |
4463 static const char __pyx_k_VCF_get_expected[] = "VCF.get_expected"; | |
4464 static const char __pyx_k_VCF_parse_format[] = "VCF.parse_format"; | |
4465 static const char __pyx_k_VCF_parse_header[] = "VCF.parse_header"; | |
4466 static const char __pyx_k_VCF_setreference[] = "VCF.setreference"; | |
4467 static const char __pyx_k_VCF_write_header[] = "VCF.write_header"; | |
4468 static const char __pyx_k_parse_formatdata[] = "parse_formatdata"; | |
4469 static const char __pyx_k_phased_genotypes[] = "#phased_genotypes"; | |
4470 static const char __pyx_k_ERROR_INFO_STRING[] = "ERROR_INFO_STRING"; | |
4471 static const char __pyx_k_ERROR_UNKNOWN_KEY[] = "ERROR_UNKNOWN_KEY"; | |
4472 static const char __pyx_k_Haplotype_Quality[] = "Haplotype Quality"; | |
4473 static const char __pyx_k_POS_NOT_NUMERICAL[] = "POS_NOT_NUMERICAL"; | |
4474 static const char __pyx_k_VCF__parse_header[] = "VCF._parse_header"; | |
4475 static const char __pyx_k_VCF_compare_calls[] = "VCF.compare_calls"; | |
4476 static const char __pyx_k_VCF_convertGTback[] = "VCF.convertGTback"; | |
4477 static const char __pyx_k_VCF_format_format[] = "VCF.format_format"; | |
4478 static const char __pyx_k_VCF_parse_heading[] = "VCF.parse_heading"; | |
4479 static const char __pyx_k_VCF_write_heading[] = "VCF.write_heading"; | |
4480 static const char __pyx_k_format_formatdata[] = "format_formatdata"; | |
4481 static const char __pyx_k_pysam_libcvcf_pyx[] = "pysam/libcvcf.pyx"; | |
4482 static const char __pyx_k_values_in_element[] = " values in element "; | |
4483 static const char __pyx_k_FILTER_NOT_DEFINED[] = "FILTER_NOT_DEFINED"; | |
4484 static const char __pyx_k_FORMAT_NOT_DEFINED[] = "FORMAT_NOT_DEFINED"; | |
4485 static const char __pyx_k_QUAL_NOT_NUMERICAL[] = "QUAL_NOT_NUMERICAL"; | |
4486 static const char __pyx_k_ZERO_LENGTH_ALLELE[] = "ZERO_LENGTH_ALLELE"; | |
4487 static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; | |
4488 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; | |
4489 static const char __pyx_k_ERROR_TRAILING_DATA[] = "ERROR_TRAILING_DATA"; | |
4490 static const char __pyx_k_NT_PHASED_GENOTYPES[] = "NT_PHASED_GENOTYPES"; | |
4491 static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; | |
4492 static const char __pyx_k_RMS_mapping_quality[] = "RMS mapping quality"; | |
4493 static const char __pyx_k_UNKNOWN_CHAR_IN_REF[] = "UNKNOWN_CHAR_IN_REF"; | |
4494 static const char __pyx_k_VCF__add_definition[] = "VCF._add_definition"; | |
4495 static const char __pyx_k_needs_to_be_checked[] = "needs to be checked"; | |
4496 static const char __pyx_k_sth_entry_not_found[] = "(%sth entry not found)"; | |
4497 static const char __pyx_k_BAD_NUMBER_OF_VALUES[] = "BAD_NUMBER_OF_VALUES"; | |
4498 static const char __pyx_k_ERROR_FLAG_HAS_VALUE[] = "ERROR_FLAG_HAS_VALUE"; | |
4499 static const char __pyx_k_Genotype_likelihoods[] = "Genotype likelihoods"; | |
4500 static const char __pyx_k_VCF_parse_formatdata[] = "VCF.parse_formatdata"; | |
4501 static const char __pyx_k_enter_default_format[] = "enter_default_format"; | |
4502 static const char __pyx_k_BAD_NUMBER_OF_COLUMNS[] = "BAD_NUMBER_OF_COLUMNS"; | |
4503 static const char __pyx_k_ERROR_FORMAT_NOT_CHAR[] = "ERROR_FORMAT_NOT_CHAR"; | |
4504 static const char __pyx_k_FORMAT_MISSING_QUOTES[] = "FORMAT_MISSING_QUOTES"; | |
4505 static const char __pyx_k_UNKNOWN_FORMAT_STRING[] = "UNKNOWN_FORMAT_STRING"; | |
4506 static const char __pyx_k_VCF_format_formatdata[] = "VCF.format_formatdata"; | |
4507 static const char __pyx_k_Invalid_error_string_s[] = "Invalid error string: %s"; | |
4508 static const char __pyx_k_Sample_Genotype_Filter[] = "Sample Genotype Filter"; | |
4509 static const char __pyx_k_V33_UNMATCHED_DELETION[] = "V33_UNMATCHED_DELETION"; | |
4510 static const char __pyx_k_BADLY_FORMATTED_HEADING[] = "BADLY_FORMATTED_HEADING"; | |
4511 static const char __pyx_k_ZERO_FOR_NON_FLAG_FIELD[] = "ZERO_FOR_NON_FLAG_FIELD"; | |
4512 static const char __pyx_k_BAD_NUMBER_OF_PARAMETERS[] = "BAD_NUMBER_OF_PARAMETERS"; | |
4513 static const char __pyx_k_ERROR_FORMAT_NOT_INTEGER[] = "ERROR_FORMAT_NOT_INTEGER"; | |
4514 static const char __pyx_k_VCF_enter_default_format[] = "VCF.enter_default_format"; | |
4515 static const char __pyx_k_pyx_unpickle_asVCFRecord[] = "__pyx_unpickle_asVCFRecord"; | |
4516 static const char __pyx_k_VCFRecord___reduce_cython[] = "VCFRecord.__reduce_cython__"; | |
4517 static const char __pyx_k_ERROR_FORMAT_NOT_NUMERICAL[] = "ERROR_FORMAT_NOT_NUMERICAL"; | |
4518 static const char __pyx_k_V40_MISSING_ANGLE_BRACKETS[] = "V40_MISSING_ANGLE_BRACKETS"; | |
4519 static const char __pyx_k_VCFRecord___setstate_cython[] = "VCFRecord.__setstate_cython__"; | |
4520 static const char __pyx_k_WRONG_REF_Wrong_reference_s[] = "WRONG_REF:Wrong reference %s"; | |
4521 static const char __pyx_k_asVCFRecord___reduce_cython[] = "asVCFRecord.__reduce_cython__"; | |
4522 static const char __pyx_k_Conditional_genotype_quality[] = "Conditional genotype quality"; | |
4523 static const char __pyx_k_BADLY_FORMATTED_FORMAT_STRING[] = "BADLY_FORMATTED_FORMAT_STRING"; | |
4524 static const char __pyx_k_HEADING_NOT_SEPARATED_BY_TABS[] = "HEADING_NOT_SEPARATED_BY_TABS"; | |
4525 static const char __pyx_k_MISSING_INDEL_ALLELE_REF_BASE[] = "MISSING_INDEL_ALLELE_REF_BASE"; | |
4526 static const char __pyx_k_asVCFRecord___setstate_cython[] = "asVCFRecord.__setstate_cython__"; | |
4527 static const char __pyx_k_BADLY_FORMATTED_HEADING_Did_not[] = "BADLY_FORMATTED_HEADING:Did not find 9 required headings (CHROM, POS, ..., FORMAT) %s"; | |
4528 static const char __pyx_k_ERROR_FORMAT_NOT_CHAR_Eexpected[] = "ERROR_FORMAT_NOT_CHAR:Eexpected character in formatted field; got string"; | |
4529 static const char __pyx_k_ERROR_UNKNOWN_KEY_Unknown_key_s[] = "ERROR_UNKNOWN_KEY:Unknown key (%s) found in formatted field (info; format; or filter)"; | |
4530 static const char __pyx_k_Expected_alternate_allel_counts[] = "Expected alternate allel counts"; | |
4531 static const char __pyx_k_FILTER_NOT_DEFINED_Identifier_s[] = "FILTER_NOT_DEFINED:Identifier (%s) in filter found which was not defined in header"; | |
4532 static const char __pyx_k_FORMAT_NOT_DEFINED_Identifier_s[] = "FORMAT_NOT_DEFINED:Identifier (%s) in format found which was not defined in header"; | |
4533 static const char __pyx_k_POS_NOT_POSITIVE_Position_field[] = "POS_NOT_POSITIVE:Position field must be >0"; | |
4534 static const char __pyx_k_Read_depth_at_this_position_for[] = "Read depth at this position for this sample"; | |
4535 static const char __pyx_k_Unknown_number_type_encountered[] = "Unknown number type encountered: %s"; | |
4536 static const char __pyx_k_V33_BAD_ALLELE_Cannot_interpret[] = "V33_BAD_ALLELE:Cannot interpret allele for v3.3 VCF"; | |
4537 static const char __pyx_k_V33_BAD_REF_Reference_should_be[] = "V33_BAD_REF:Reference should be single-character in v3.3 VCF"; | |
4538 static const char __pyx_k_V40_BAD_ALLELE_Bad_allele_found[] = "V40_BAD_ALLELE:Bad allele found for v4.0 VCF (%s)"; | |
4539 static const char __pyx_k_BADLY_FORMATTED_FORMAT_STRING_Fo[] = "BADLY_FORMATTED_FORMAT_STRING:Formatting error in the format string"; | |
4540 static const char __pyx_k_BAD_CHR_TAG_Error_calculating_ch[] = "BAD_CHR_TAG:Error calculating chr tag for %s"; | |
4541 static const char __pyx_k_BAD_GENOTYPE_Cannot_parse_genoty[] = "BAD_GENOTYPE:Cannot parse genotype (%s)"; | |
4542 static const char __pyx_k_BAD_NUMBER_OF_COLUMNS_Wrong_numb[] = "BAD_NUMBER_OF_COLUMNS:Wrong number of columns found (%s)"; | |
4543 static const char __pyx_k_BAD_NUMBER_OF_PARAMETERS_Found_u[] = "BAD_NUMBER_OF_PARAMETERS:Found unexpected number of parameters (%s)"; | |
4544 static const char __pyx_k_BAD_NUMBER_OF_VALUES_Found_too_m[] = "BAD_NUMBER_OF_VALUES:Found too many of values in sample column (%s)"; | |
4545 static const char __pyx_k_Can_only_handle_v3_3_and_v4_0_VC[] = "Can only handle v3.3 and v4.0 VCF files"; | |
4546 static const char __pyx_k_Don_t_understand_region_string_s[] = "Don't understand region string '%s'"; | |
4547 static const char __pyx_k_ERROR_FLAG_HAS_VALUE_Flag_fields[] = "ERROR_FLAG_HAS_VALUE:Flag fields should not have a value"; | |
4548 static const char __pyx_k_ERROR_FORMAT_NOT_INTEGER_Expecte[] = "ERROR_FORMAT_NOT_INTEGER:Expected integer in formatted field; got %s"; | |
4549 static const char __pyx_k_ERROR_FORMAT_NOT_NUMERICAL_Expec[] = "ERROR_FORMAT_NOT_NUMERICAL:Expected integer or float in formatted field; got %s"; | |
4550 static const char __pyx_k_ERROR_INFO_STRING_Error_while_pa[] = "ERROR_INFO_STRING:Error while parsing info field"; | |
4551 static const char __pyx_k_ERROR_TRAILING_DATA_Numerical_fi[] = "ERROR_TRAILING_DATA:Numerical field ('%s') has semicolon-separated trailing data"; | |
4552 static const char __pyx_k_FORMAT_MISSING_QUOTES_Descriptio[] = "FORMAT_MISSING_QUOTES:Description field in format definition is not surrounded by quotes"; | |
4553 static const char __pyx_k_Genotype_posterior_probabilities[] = "Genotype posterior probabilities"; | |
4554 static const char __pyx_k_HEADING_NOT_SEPARATED_BY_TABS_He[] = "HEADING_NOT_SEPARATED_BY_TABS:Heading line appears separated by spaces, not tabs"; | |
4555 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xe48d6d5, 0xcc3d7cd, 0x1c28f48) = (encoding, vcffile))"; | |
4556 static const char __pyx_k_MISSING_INDEL_ALLELE_REF_BASE_In[] = "MISSING_INDEL_ALLELE_REF_BASE:Indel alleles must begin with single reference base"; | |
4557 static const char __pyx_k_MISSING_REF_Reference_allele_mis[] = "MISSING_REF:Reference allele missing"; | |
4558 static const char __pyx_k_POS_NOT_NUMERICAL_Position_colum[] = "POS_NOT_NUMERICAL:Position column is not numerical"; | |
4559 static const char __pyx_k_Phred_scaled_genotype_likelihood[] = "Phred-scaled genotype likelihoods"; | |
4560 static const char __pyx_k_QUAL_NOT_NUMERICAL_Quality_field[] = "QUAL_NOT_NUMERICAL:Quality field must be numerical, or '.'"; | |
4561 static const char __pyx_k_Required_key_s_not_found_in_data[] = "Required key %s not found in data"; | |
4562 static const char __pyx_k_UNKNOWN_CHAR_IN_REF_Unknown_char[] = "UNKNOWN_CHAR_IN_REF:Unknown character in reference field"; | |
4563 static const char __pyx_k_UNKNOWN_FORMAT_STRING_Unknown_fi[] = "UNKNOWN_FORMAT_STRING:Unknown file format identifier"; | |
4564 static const char __pyx_k_V33_UNMATCHED_DELETION_Deleted_s[] = "V33_UNMATCHED_DELETION:Deleted sequence does not match reference (%s)"; | |
4565 static const char __pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD[] = "V40_FORMAT_MUST_HAVE_NAMED_FIELDS"; | |
4566 static const char __pyx_k_V40_MISSING_ANGLE_BRACKETS_Forma[] = "V40_MISSING_ANGLE_BRACKETS:Format definition is not deliminted by angular brackets"; | |
4567 static const char __pyx_k_ZERO_FOR_NON_FLAG_FIELD_number_s[] = "ZERO_FOR_NON_FLAG_FIELD: number set to 0, but type is not 'FLAG'"; | |
4568 static const char __pyx_k_ZERO_LENGTH_ALLELE_Found_zero_le[] = "ZERO_LENGTH_ALLELE:Found zero-length allele"; | |
4569 static const char __pyx_k_id_numbertype_number_type_descri[] = "id numbertype number type description missingvalue"; | |
4570 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; | |
4571 static const char __pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2[] = "V40_FORMAT_MUST_HAVE_NAMED_FIELDS:Fields in v4.0 VCF format definition must have named fields"; | |
4572 /* #### Code section: decls ### */ | |
4573 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */ | |
4574 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ | |
4575 static PyObject *__pyx_pf_5pysam_7libcvcf_get_sequence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_fa); /* proto */ | |
4576 static PyObject *__pyx_pf_5pysam_7libcvcf_2parse_regions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string); /* proto */ | |
4577 static int __pyx_pf_5pysam_7libcvcf_9VCFRecord___init__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_vcf); /* proto */ | |
4578 static int __pyx_pf_5pysam_7libcvcf_9VCFRecord_2__cinit__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_vcf); /* proto */ | |
4579 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_4error(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_error, PyObject *__pyx_v_opt); /* proto */ | |
4580 static Py_ssize_t __pyx_pf_5pysam_7libcvcf_9VCFRecord_6__len__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4581 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_6contig___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4582 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_3pos___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4583 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_2id___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4584 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_3ref___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4585 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_3alt___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4586 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_4qual___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4587 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_6filter___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4588 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_4info___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4589 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_6format___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4590 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_7samples___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4591 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_8__getitem__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ | |
4592 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self); /* proto */ | |
4593 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
4594 static int __pyx_pf_5pysam_7libcvcf_11asVCFRecord___init__(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *__pyx_v_self, PyObject *__pyx_v_vcffile); /* proto */ | |
4595 static PyObject *__pyx_pf_5pysam_7libcvcf_11asVCFRecord_2__reduce_cython__(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *__pyx_v_self); /* proto */ | |
4596 static PyObject *__pyx_pf_5pysam_7libcvcf_11asVCFRecord_4__setstate_cython__(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
4597 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v__copy, PyObject *__pyx_v_reference, PyObject *__pyx_v_regions, PyObject *__pyx_v_lines, PyObject *__pyx_v_leftalign); /* proto */ | |
4598 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_2error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_error, PyObject *__pyx_v_opt); /* proto */ | |
4599 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_4parse_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_format, PyObject *__pyx_v_filter); /* proto */ | |
4600 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_6format_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fmt, PyObject *__pyx_v_filter); /* proto */ | |
4601 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_8get_expected(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_alt); /* proto */ | |
4602 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_10_add_definition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_key, PyObject *__pyx_v_data, PyObject *__pyx_v_line); /* proto */ | |
4603 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_12format_formatdata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_format, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_separator); /* proto */ | |
4604 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_14enter_default_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4605 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_16parse_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line); /* proto */ | |
4606 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_18write_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */ | |
4607 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_20parse_heading(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line); /* proto */ | |
4608 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_22write_heading(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */ | |
4609 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_24convertGT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_GTstring); /* proto */ | |
4610 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_26convertGTback(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_GTdata); /* proto */ | |
4611 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_28parse_formatdata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_line); /* proto */ | |
4612 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_30inregion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_pos); /* proto */ | |
4613 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_32parse_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_lineparse); /* proto */ | |
4614 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_34write_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_data); /* proto */ | |
4615 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_36_parse_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */ | |
4616 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_38_parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_stream); /* proto */ | |
4617 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_41getsamples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4618 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_43setsamples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_samples); /* proto */ | |
4619 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_45getheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4620 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_47setheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_header); /* proto */ | |
4621 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_49getinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4622 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_51setinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_info); /* proto */ | |
4623 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_53getformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4624 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_55setformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */ | |
4625 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_57getfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4626 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_59setfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filter); /* proto */ | |
4627 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_61setversion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_version); /* proto */ | |
4628 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_63setregions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_regions); /* proto */ | |
4629 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_65setreference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ref); /* proto */ | |
4630 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_67ignoreerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errorstring); /* proto */ | |
4631 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_69warnerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errorstring); /* proto */ | |
4632 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_71parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */ | |
4633 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_73write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_datagenerator); /* proto */ | |
4634 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_75writeheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */ | |
4635 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_77compare_calls(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_pos1, PyObject *__pyx_v_ref1, PyObject *__pyx_v_alt1, PyObject *__pyx_v_pos2, PyObject *__pyx_v_ref2, PyObject *__pyx_v_alt2); /* proto */ | |
4636 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_79connect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_encoding); /* proto */ | |
4637 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_81__del__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4638 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_83close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4639 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_85fetch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region); /* proto */ | |
4640 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_87validate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_record); /* proto */ | |
4641 static PyObject *__pyx_pf_5pysam_7libcvcf_4__pyx_unpickle_asVCFRecord(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
4642 static PyObject *__pyx_tp_new_5pysam_7libcvcf_VCFRecord(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4643 static PyObject *__pyx_tp_new_5pysam_7libcvcf_asVCFRecord(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4644 static PyObject *__pyx_tp_new_5pysam_7libcvcf___pyx_scope_struct___parse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4645 /* #### Code section: late_includes ### */ | |
4646 /* #### Code section: module_state ### */ | |
4647 typedef struct { | |
4648 PyObject *__pyx_d; | |
4649 PyObject *__pyx_b; | |
4650 PyObject *__pyx_cython_runtime; | |
4651 PyObject *__pyx_empty_tuple; | |
4652 PyObject *__pyx_empty_bytes; | |
4653 PyObject *__pyx_empty_unicode; | |
4654 #ifdef __Pyx_CyFunction_USED | |
4655 PyTypeObject *__pyx_CyFunctionType; | |
4656 #endif | |
4657 #ifdef __Pyx_FusedFunction_USED | |
4658 PyTypeObject *__pyx_FusedFunctionType; | |
4659 #endif | |
4660 #ifdef __Pyx_Generator_USED | |
4661 PyTypeObject *__pyx_GeneratorType; | |
4662 #endif | |
4663 #ifdef __Pyx_IterableCoroutine_USED | |
4664 PyTypeObject *__pyx_IterableCoroutineType; | |
4665 #endif | |
4666 #ifdef __Pyx_Coroutine_USED | |
4667 PyTypeObject *__pyx_CoroutineAwaitType; | |
4668 #endif | |
4669 #ifdef __Pyx_Coroutine_USED | |
4670 PyTypeObject *__pyx_CoroutineType; | |
4671 #endif | |
4672 #if CYTHON_USE_MODULE_STATE | |
4673 #endif | |
4674 #if CYTHON_USE_MODULE_STATE | |
4675 #endif | |
4676 #if CYTHON_USE_MODULE_STATE | |
4677 #endif | |
4678 #if CYTHON_USE_MODULE_STATE | |
4679 #endif | |
4680 #if CYTHON_USE_MODULE_STATE | |
4681 #endif | |
4682 #if CYTHON_USE_MODULE_STATE | |
4683 #endif | |
4684 PyTypeObject *__pyx_ptype_5pysam_10libchtslib_HTSFile; | |
4685 #if CYTHON_USE_MODULE_STATE | |
4686 #endif | |
4687 PyTypeObject *__pyx_ptype_5pysam_9libctabix_tabix_file_iterator; | |
4688 PyTypeObject *__pyx_ptype_5pysam_9libctabix_TabixFile; | |
4689 PyTypeObject *__pyx_ptype_5pysam_9libctabix_Parser; | |
4690 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asTuple; | |
4691 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asGTF; | |
4692 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asGFF3; | |
4693 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asBed; | |
4694 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asVCF; | |
4695 PyTypeObject *__pyx_ptype_5pysam_9libctabix_TabixIterator; | |
4696 PyTypeObject *__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed; | |
4697 PyTypeObject *__pyx_ptype_5pysam_9libctabix_GZIterator; | |
4698 PyTypeObject *__pyx_ptype_5pysam_9libctabix_GZIteratorHead; | |
4699 PyTypeObject *__pyx_ptype_5pysam_9libctabix_GZIteratorParsed; | |
4700 PyTypeObject *__pyx_ptype_5pysam_9libctabix_Tabixfile; | |
4701 #if CYTHON_USE_MODULE_STATE | |
4702 #endif | |
4703 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_TupleProxy; | |
4704 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator; | |
4705 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy; | |
4706 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_GTFProxy; | |
4707 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy; | |
4708 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_BedProxy; | |
4709 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_VCFProxy; | |
4710 #if CYTHON_USE_MODULE_STATE | |
4711 #endif | |
4712 #if CYTHON_USE_MODULE_STATE | |
4713 #endif | |
4714 #if CYTHON_USE_MODULE_STATE | |
4715 #endif | |
4716 #if CYTHON_USE_MODULE_STATE | |
4717 #endif | |
4718 PyTypeObject *__pyx_ptype_7cpython_4type_type; | |
4719 #if CYTHON_USE_MODULE_STATE | |
4720 #endif | |
4721 #if CYTHON_USE_MODULE_STATE | |
4722 #endif | |
4723 #if CYTHON_USE_MODULE_STATE | |
4724 #endif | |
4725 #if CYTHON_USE_MODULE_STATE | |
4726 #endif | |
4727 #if CYTHON_USE_MODULE_STATE | |
4728 #endif | |
4729 #if CYTHON_USE_MODULE_STATE | |
4730 #endif | |
4731 #if CYTHON_USE_MODULE_STATE | |
4732 #endif | |
4733 #if CYTHON_USE_MODULE_STATE | |
4734 #endif | |
4735 #if CYTHON_USE_MODULE_STATE | |
4736 #endif | |
4737 #if CYTHON_USE_MODULE_STATE | |
4738 #endif | |
4739 #if CYTHON_USE_MODULE_STATE | |
4740 #endif | |
4741 #if CYTHON_USE_MODULE_STATE | |
4742 #endif | |
4743 #if CYTHON_USE_MODULE_STATE | |
4744 #endif | |
4745 #if CYTHON_USE_MODULE_STATE | |
4746 #endif | |
4747 PyTypeObject *__pyx_ptype_7cpython_4bool_bool; | |
4748 #if CYTHON_USE_MODULE_STATE | |
4749 #endif | |
4750 #if CYTHON_USE_MODULE_STATE | |
4751 #endif | |
4752 #if CYTHON_USE_MODULE_STATE | |
4753 #endif | |
4754 #if CYTHON_USE_MODULE_STATE | |
4755 #endif | |
4756 PyTypeObject *__pyx_ptype_7cpython_7complex_complex; | |
4757 #if CYTHON_USE_MODULE_STATE | |
4758 #endif | |
4759 #if CYTHON_USE_MODULE_STATE | |
4760 #endif | |
4761 #if CYTHON_USE_MODULE_STATE | |
4762 #endif | |
4763 #if CYTHON_USE_MODULE_STATE | |
4764 #endif | |
4765 #if CYTHON_USE_MODULE_STATE | |
4766 #endif | |
4767 #if CYTHON_USE_MODULE_STATE | |
4768 #endif | |
4769 #if CYTHON_USE_MODULE_STATE | |
4770 #endif | |
4771 #if CYTHON_USE_MODULE_STATE | |
4772 #endif | |
4773 #if CYTHON_USE_MODULE_STATE | |
4774 #endif | |
4775 #if CYTHON_USE_MODULE_STATE | |
4776 #endif | |
4777 #if CYTHON_USE_MODULE_STATE | |
4778 #endif | |
4779 #if CYTHON_USE_MODULE_STATE | |
4780 #endif | |
4781 #if CYTHON_USE_MODULE_STATE | |
4782 #endif | |
4783 #if CYTHON_USE_MODULE_STATE | |
4784 #endif | |
4785 #if CYTHON_USE_MODULE_STATE | |
4786 #endif | |
4787 #if CYTHON_USE_MODULE_STATE | |
4788 #endif | |
4789 #if CYTHON_USE_MODULE_STATE | |
4790 #endif | |
4791 #if CYTHON_USE_MODULE_STATE | |
4792 #endif | |
4793 #if CYTHON_USE_MODULE_STATE | |
4794 #endif | |
4795 #if CYTHON_USE_MODULE_STATE | |
4796 #endif | |
4797 #if CYTHON_USE_MODULE_STATE | |
4798 #endif | |
4799 #if CYTHON_USE_MODULE_STATE | |
4800 #endif | |
4801 PyTypeObject *__pyx_ptype_7cpython_5array_array; | |
4802 #if CYTHON_USE_MODULE_STATE | |
4803 #endif | |
4804 #if CYTHON_USE_MODULE_STATE | |
4805 PyObject *__pyx_type_5pysam_7libcvcf_VCFRecord; | |
4806 PyObject *__pyx_type_5pysam_7libcvcf_asVCFRecord; | |
4807 PyObject *__pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse; | |
4808 #endif | |
4809 PyTypeObject *__pyx_ptype_5pysam_7libcvcf_VCFRecord; | |
4810 PyTypeObject *__pyx_ptype_5pysam_7libcvcf_asVCFRecord; | |
4811 PyTypeObject *__pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse; | |
4812 PyObject *__pyx_kp_u_; | |
4813 PyObject *__pyx_kp_b_0; | |
4814 PyObject *__pyx_kp_u_0; | |
4815 PyObject *__pyx_n_u_A; | |
4816 PyObject *__pyx_n_u_ACGTN; | |
4817 PyObject *__pyx_kp_u_ACGTN_2; | |
4818 PyObject *__pyx_n_u_ALT; | |
4819 PyObject *__pyx_n_s_AssertionError; | |
4820 PyObject *__pyx_n_s_BADLY_FORMATTED_FORMAT_STRING; | |
4821 PyObject *__pyx_kp_u_BADLY_FORMATTED_FORMAT_STRING_Fo; | |
4822 PyObject *__pyx_n_s_BADLY_FORMATTED_HEADING; | |
4823 PyObject *__pyx_kp_u_BADLY_FORMATTED_HEADING_Did_not; | |
4824 PyObject *__pyx_kp_u_BAD_CHR_TAG_Error_calculating_ch; | |
4825 PyObject *__pyx_n_s_BAD_GENOTYPE; | |
4826 PyObject *__pyx_kp_u_BAD_GENOTYPE_Cannot_parse_genoty; | |
4827 PyObject *__pyx_n_s_BAD_NUMBER_OF_COLUMNS; | |
4828 PyObject *__pyx_kp_u_BAD_NUMBER_OF_COLUMNS_Wrong_numb; | |
4829 PyObject *__pyx_n_s_BAD_NUMBER_OF_PARAMETERS; | |
4830 PyObject *__pyx_kp_u_BAD_NUMBER_OF_PARAMETERS_Found_u; | |
4831 PyObject *__pyx_n_s_BAD_NUMBER_OF_VALUES; | |
4832 PyObject *__pyx_kp_u_BAD_NUMBER_OF_VALUES_Found_too_m; | |
4833 PyObject *__pyx_n_u_CHROM; | |
4834 PyObject *__pyx_kp_u_Can_only_handle_v3_3_and_v4_0_VC; | |
4835 PyObject *__pyx_n_u_Character; | |
4836 PyObject *__pyx_kp_u_Conditional_genotype_quality; | |
4837 PyObject *__pyx_n_u_D; | |
4838 PyObject *__pyx_n_u_DP; | |
4839 PyObject *__pyx_kp_u_Description; | |
4840 PyObject *__pyx_n_u_Description_2; | |
4841 PyObject *__pyx_kp_u_Don_t_understand_region_string_s; | |
4842 PyObject *__pyx_n_u_EC; | |
4843 PyObject *__pyx_n_s_ERROR_FLAG_HAS_VALUE; | |
4844 PyObject *__pyx_kp_u_ERROR_FLAG_HAS_VALUE_Flag_fields; | |
4845 PyObject *__pyx_n_s_ERROR_FORMAT_NOT_CHAR; | |
4846 PyObject *__pyx_kp_u_ERROR_FORMAT_NOT_CHAR_Eexpected; | |
4847 PyObject *__pyx_n_s_ERROR_FORMAT_NOT_INTEGER; | |
4848 PyObject *__pyx_kp_u_ERROR_FORMAT_NOT_INTEGER_Expecte; | |
4849 PyObject *__pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL; | |
4850 PyObject *__pyx_kp_u_ERROR_FORMAT_NOT_NUMERICAL_Expec; | |
4851 PyObject *__pyx_n_s_ERROR_INFO_STRING; | |
4852 PyObject *__pyx_kp_u_ERROR_INFO_STRING_Error_while_pa; | |
4853 PyObject *__pyx_n_s_ERROR_TRAILING_DATA; | |
4854 PyObject *__pyx_kp_u_ERROR_TRAILING_DATA_Numerical_fi; | |
4855 PyObject *__pyx_n_s_ERROR_UNKNOWN_KEY; | |
4856 PyObject *__pyx_kp_u_ERROR_UNKNOWN_KEY_Unknown_key_s; | |
4857 PyObject *__pyx_n_u_Error; | |
4858 PyObject *__pyx_kp_u_Expected_alternate_allel_counts; | |
4859 PyObject *__pyx_n_u_FILTER; | |
4860 PyObject *__pyx_n_s_FILTER_NOT_DEFINED; | |
4861 PyObject *__pyx_kp_u_FILTER_NOT_DEFINED_Identifier_s; | |
4862 PyObject *__pyx_n_s_FORMAT; | |
4863 PyObject *__pyx_n_u_FORMAT; | |
4864 PyObject *__pyx_n_s_FORMAT_MISSING_QUOTES; | |
4865 PyObject *__pyx_kp_u_FORMAT_MISSING_QUOTES_Descriptio; | |
4866 PyObject *__pyx_n_s_FORMAT_NOT_DEFINED; | |
4867 PyObject *__pyx_kp_u_FORMAT_NOT_DEFINED_Identifier_s; | |
4868 PyObject *__pyx_n_u_FT; | |
4869 PyObject *__pyx_n_u_Flag; | |
4870 PyObject *__pyx_n_u_Float; | |
4871 PyObject *__pyx_n_u_G; | |
4872 PyObject *__pyx_n_u_GL; | |
4873 PyObject *__pyx_n_u_GLE; | |
4874 PyObject *__pyx_n_u_GP; | |
4875 PyObject *__pyx_n_u_GQ; | |
4876 PyObject *__pyx_n_u_GT; | |
4877 PyObject *__pyx_n_s_GTdata; | |
4878 PyObject *__pyx_n_s_GTstring; | |
4879 PyObject *__pyx_n_u_Genotype; | |
4880 PyObject *__pyx_kp_u_Genotype_Quality; | |
4881 PyObject *__pyx_kp_u_Genotype_likelihoods; | |
4882 PyObject *__pyx_kp_u_Genotype_posterior_probabilities; | |
4883 PyObject *__pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS; | |
4884 PyObject *__pyx_kp_u_HEADING_NOT_SEPARATED_BY_TABS_He; | |
4885 PyObject *__pyx_n_u_HQ; | |
4886 PyObject *__pyx_kp_u_Haplotype_Quality; | |
4887 PyObject *__pyx_n_u_I; | |
4888 PyObject *__pyx_kp_u_ID; | |
4889 PyObject *__pyx_n_u_ID_2; | |
4890 PyObject *__pyx_n_u_INFO; | |
4891 PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; | |
4892 PyObject *__pyx_n_u_Integer; | |
4893 PyObject *__pyx_kp_u_Invalid_error_string_s; | |
4894 PyObject *__pyx_n_s_KeyError; | |
4895 PyObject *__pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE; | |
4896 PyObject *__pyx_kp_u_MISSING_INDEL_ALLELE_REF_BASE_In; | |
4897 PyObject *__pyx_n_s_MISSING_REF; | |
4898 PyObject *__pyx_kp_u_MISSING_REF_Reference_allele_mis; | |
4899 PyObject *__pyx_n_u_MQ; | |
4900 PyObject *__pyx_n_s_MemoryError; | |
4901 PyObject *__pyx_n_u_N; | |
4902 PyObject *__pyx_n_s_NT_ALLELES; | |
4903 PyObject *__pyx_n_s_NT_GENOTYPES; | |
4904 PyObject *__pyx_n_s_NT_NR_ALLELES; | |
4905 PyObject *__pyx_n_s_NT_NUMBER; | |
4906 PyObject *__pyx_n_s_NT_PHASED_GENOTYPES; | |
4907 PyObject *__pyx_n_s_NT_UNKNOWN; | |
4908 PyObject *__pyx_n_s_NotImplementedError; | |
4909 PyObject *__pyx_kp_u_Number; | |
4910 PyObject *__pyx_n_u_Number_2; | |
4911 PyObject *__pyx_n_b_PASS; | |
4912 PyObject *__pyx_n_u_PASS; | |
4913 PyObject *__pyx_n_u_PL; | |
4914 PyObject *__pyx_n_u_POS; | |
4915 PyObject *__pyx_n_s_POS_NOT_NUMERICAL; | |
4916 PyObject *__pyx_kp_u_POS_NOT_NUMERICAL_Position_colum; | |
4917 PyObject *__pyx_n_s_POS_NOT_POSITIVE; | |
4918 PyObject *__pyx_kp_u_POS_NOT_POSITIVE_Position_field; | |
4919 PyObject *__pyx_n_u_PQ; | |
4920 PyObject *__pyx_n_u_PS; | |
4921 PyObject *__pyx_kp_u_Phase_set; | |
4922 PyObject *__pyx_kp_u_Phasing_quality; | |
4923 PyObject *__pyx_kp_u_Phred_scaled_genotype_likelihood; | |
4924 PyObject *__pyx_n_s_PickleError; | |
4925 PyObject *__pyx_n_u_QUAL; | |
4926 PyObject *__pyx_n_s_QUAL_NOT_NUMERICAL; | |
4927 PyObject *__pyx_kp_u_QUAL_NOT_NUMERICAL_Quality_field; | |
4928 PyObject *__pyx_n_u_REF; | |
4929 PyObject *__pyx_kp_u_RMS_mapping_quality; | |
4930 PyObject *__pyx_kp_u_Read_depth_at_this_position_for; | |
4931 PyObject *__pyx_kp_u_Required_key_s_not_found_in_data; | |
4932 PyObject *__pyx_kp_u_Sample_Genotype_Filter; | |
4933 PyObject *__pyx_n_s_StopIteration; | |
4934 PyObject *__pyx_n_u_String; | |
4935 PyObject *__pyx_n_s_Tabixfile; | |
4936 PyObject *__pyx_kp_u_Type; | |
4937 PyObject *__pyx_n_s_TypeError; | |
4938 PyObject *__pyx_n_u_Type_2; | |
4939 PyObject *__pyx_n_s_UNKNOWN_CHAR_IN_REF; | |
4940 PyObject *__pyx_kp_u_UNKNOWN_CHAR_IN_REF_Unknown_char; | |
4941 PyObject *__pyx_n_s_UNKNOWN_FORMAT_STRING; | |
4942 PyObject *__pyx_kp_u_UNKNOWN_FORMAT_STRING_Unknown_fi; | |
4943 PyObject *__pyx_kp_u_Undefined_tag; | |
4944 PyObject *__pyx_kp_u_Unknown_number_type_encountered; | |
4945 PyObject *__pyx_n_s_V33_BAD_ALLELE; | |
4946 PyObject *__pyx_kp_u_V33_BAD_ALLELE_Cannot_interpret; | |
4947 PyObject *__pyx_n_s_V33_BAD_REF; | |
4948 PyObject *__pyx_kp_u_V33_BAD_REF_Reference_should_be; | |
4949 PyObject *__pyx_n_s_V33_UNMATCHED_DELETION; | |
4950 PyObject *__pyx_kp_u_V33_UNMATCHED_DELETION_Deleted_s; | |
4951 PyObject *__pyx_n_s_V40_BAD_ALLELE; | |
4952 PyObject *__pyx_kp_u_V40_BAD_ALLELE_Bad_allele_found; | |
4953 PyObject *__pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD; | |
4954 PyObject *__pyx_kp_u_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2; | |
4955 PyObject *__pyx_n_s_V40_MISSING_ANGLE_BRACKETS; | |
4956 PyObject *__pyx_kp_u_V40_MISSING_ANGLE_BRACKETS_Forma; | |
4957 PyObject *__pyx_n_s_VCF; | |
4958 PyObject *__pyx_n_u_VCF; | |
4959 PyObject *__pyx_n_s_VCFRecord; | |
4960 PyObject *__pyx_n_u_VCFRecord; | |
4961 PyObject *__pyx_n_s_VCFRecord___reduce_cython; | |
4962 PyObject *__pyx_n_s_VCFRecord___setstate_cython; | |
4963 PyObject *__pyx_n_s_VCFRecord_error; | |
4964 PyObject *__pyx_n_s_VCF___del; | |
4965 PyObject *__pyx_n_s_VCF___init; | |
4966 PyObject *__pyx_n_s_VCF__add_definition; | |
4967 PyObject *__pyx_n_s_VCF__parse; | |
4968 PyObject *__pyx_n_s_VCF__parse_header; | |
4969 PyObject *__pyx_n_s_VCF_close; | |
4970 PyObject *__pyx_n_s_VCF_compare_calls; | |
4971 PyObject *__pyx_n_s_VCF_connect; | |
4972 PyObject *__pyx_n_s_VCF_convertGT; | |
4973 PyObject *__pyx_n_s_VCF_convertGTback; | |
4974 PyObject *__pyx_n_s_VCF_enter_default_format; | |
4975 PyObject *__pyx_n_s_VCF_error; | |
4976 PyObject *__pyx_n_s_VCF_fetch; | |
4977 PyObject *__pyx_n_s_VCF_format_format; | |
4978 PyObject *__pyx_n_s_VCF_format_formatdata; | |
4979 PyObject *__pyx_n_s_VCF_get_expected; | |
4980 PyObject *__pyx_n_s_VCF_getfilter; | |
4981 PyObject *__pyx_n_s_VCF_getformat; | |
4982 PyObject *__pyx_n_s_VCF_getheader; | |
4983 PyObject *__pyx_n_s_VCF_getinfo; | |
4984 PyObject *__pyx_n_s_VCF_getsamples; | |
4985 PyObject *__pyx_n_s_VCF_ignoreerror; | |
4986 PyObject *__pyx_n_s_VCF_inregion; | |
4987 PyObject *__pyx_n_s_VCF_parse; | |
4988 PyObject *__pyx_n_s_VCF_parse_data; | |
4989 PyObject *__pyx_n_s_VCF_parse_format; | |
4990 PyObject *__pyx_n_s_VCF_parse_formatdata; | |
4991 PyObject *__pyx_n_s_VCF_parse_header; | |
4992 PyObject *__pyx_n_s_VCF_parse_heading; | |
4993 PyObject *__pyx_kp_u_VCF_says; | |
4994 PyObject *__pyx_n_s_VCF_setfilter; | |
4995 PyObject *__pyx_n_s_VCF_setformat; | |
4996 PyObject *__pyx_n_s_VCF_setheader; | |
4997 PyObject *__pyx_n_s_VCF_setinfo; | |
4998 PyObject *__pyx_n_s_VCF_setreference; | |
4999 PyObject *__pyx_n_s_VCF_setregions; | |
5000 PyObject *__pyx_n_s_VCF_setsamples; | |
5001 PyObject *__pyx_n_s_VCF_setversion; | |
5002 PyObject *__pyx_n_s_VCF_validate; | |
5003 PyObject *__pyx_n_s_VCF_warnerror; | |
5004 PyObject *__pyx_n_s_VCF_write; | |
5005 PyObject *__pyx_n_s_VCF_write_data; | |
5006 PyObject *__pyx_n_s_VCF_write_header; | |
5007 PyObject *__pyx_n_s_VCF_write_heading; | |
5008 PyObject *__pyx_n_s_VCF_writeheader; | |
5009 PyObject *__pyx_kp_u_VCFv3_3; | |
5010 PyObject *__pyx_kp_u_VCFv4_0; | |
5011 PyObject *__pyx_kp_u_VCFv4_1; | |
5012 PyObject *__pyx_kp_u_VCFv4_2; | |
5013 PyObject *__pyx_n_s_ValueError; | |
5014 PyObject *__pyx_n_s_WRONG_REF; | |
5015 PyObject *__pyx_kp_u_WRONG_REF_Wrong_reference_s; | |
5016 PyObject *__pyx_n_u_Warning; | |
5017 PyObject *__pyx_n_s_ZERO_FOR_NON_FLAG_FIELD; | |
5018 PyObject *__pyx_kp_u_ZERO_FOR_NON_FLAG_FIELD_number_s; | |
5019 PyObject *__pyx_n_s_ZERO_LENGTH_ALLELE; | |
5020 PyObject *__pyx_kp_u_ZERO_LENGTH_ALLELE_Found_zero_le; | |
5021 PyObject *__pyx_kp_u__10; | |
5022 PyObject *__pyx_kp_u__11; | |
5023 PyObject *__pyx_kp_u__12; | |
5024 PyObject *__pyx_kp_u__13; | |
5025 PyObject *__pyx_n_s__139; | |
5026 PyObject *__pyx_kp_u__14; | |
5027 PyObject *__pyx_kp_u__15; | |
5028 PyObject *__pyx_kp_u__16; | |
5029 PyObject *__pyx_kp_u__19; | |
5030 PyObject *__pyx_kp_u__2; | |
5031 PyObject *__pyx_kp_u__23; | |
5032 PyObject *__pyx_kp_u__24; | |
5033 PyObject *__pyx_kp_u__25; | |
5034 PyObject *__pyx_kp_u__27; | |
5035 PyObject *__pyx_kp_u__3; | |
5036 PyObject *__pyx_n_s__33; | |
5037 PyObject *__pyx_kp_u__34; | |
5038 PyObject *__pyx_kp_u__4; | |
5039 PyObject *__pyx_kp_b__5; | |
5040 PyObject *__pyx_kp_u__5; | |
5041 PyObject *__pyx_kp_u__6; | |
5042 PyObject *__pyx_kp_u__7; | |
5043 PyObject *__pyx_kp_u__8; | |
5044 PyObject *__pyx_n_s_a; | |
5045 PyObject *__pyx_n_s_add; | |
5046 PyObject *__pyx_n_s_add_definition; | |
5047 PyObject *__pyx_n_s_addn; | |
5048 PyObject *__pyx_n_s_addns; | |
5049 PyObject *__pyx_n_s_all; | |
5050 PyObject *__pyx_n_s_allele; | |
5051 PyObject *__pyx_n_s_alleleRegEx; | |
5052 PyObject *__pyx_kp_u_alleles; | |
5053 PyObject *__pyx_n_s_alt; | |
5054 PyObject *__pyx_n_u_alt; | |
5055 PyObject *__pyx_n_s_alt1; | |
5056 PyObject *__pyx_n_s_alt2; | |
5057 PyObject *__pyx_n_s_append; | |
5058 PyObject *__pyx_n_s_args; | |
5059 PyObject *__pyx_n_s_asVCFRecord; | |
5060 PyObject *__pyx_n_s_asVCFRecord___reduce_cython; | |
5061 PyObject *__pyx_n_s_asVCFRecord___setstate_cython; | |
5062 PyObject *__pyx_n_u_ascii; | |
5063 PyObject *__pyx_n_s_asyncio_coroutines; | |
5064 PyObject *__pyx_n_s_bisect; | |
5065 PyObject *__pyx_n_s_blurp; | |
5066 PyObject *__pyx_n_s_c; | |
5067 PyObject *__pyx_n_s_chrom; | |
5068 PyObject *__pyx_n_u_chrom; | |
5069 PyObject *__pyx_n_s_class_getitem; | |
5070 PyObject *__pyx_n_s_cline_in_traceback; | |
5071 PyObject *__pyx_n_s_close; | |
5072 PyObject *__pyx_n_s_collections; | |
5073 PyObject *__pyx_n_s_cols; | |
5074 PyObject *__pyx_n_s_compare_calls; | |
5075 PyObject *__pyx_n_s_compile; | |
5076 PyObject *__pyx_n_s_connect; | |
5077 PyObject *__pyx_n_s_convertGT; | |
5078 PyObject *__pyx_n_s_convertGTback; | |
5079 PyObject *__pyx_n_s_copy; | |
5080 PyObject *__pyx_n_s_copy_2; | |
5081 PyObject *__pyx_n_s_d; | |
5082 PyObject *__pyx_n_s_data; | |
5083 PyObject *__pyx_n_s_datagenerator; | |
5084 PyObject *__pyx_n_s_deepcopy; | |
5085 PyObject *__pyx_n_s_defaultdict; | |
5086 PyObject *__pyx_n_s_del; | |
5087 PyObject *__pyx_kp_u_deletion_is; | |
5088 PyObject *__pyx_n_u_descr; | |
5089 PyObject *__pyx_n_s_description; | |
5090 PyObject *__pyx_n_s_dict; | |
5091 PyObject *__pyx_n_s_dict_2; | |
5092 PyObject *__pyx_n_s_dict_3; | |
5093 PyObject *__pyx_kp_u_disable; | |
5094 PyObject *__pyx_n_s_doc; | |
5095 PyObject *__pyx_n_s_elts; | |
5096 PyObject *__pyx_kp_u_enable; | |
5097 PyObject *__pyx_n_s_encoding; | |
5098 PyObject *__pyx_n_s_end; | |
5099 PyObject *__pyx_n_s_endswith; | |
5100 PyObject *__pyx_n_s_enter_default_format; | |
5101 PyObject *__pyx_n_s_enumerate; | |
5102 PyObject *__pyx_n_s_err; | |
5103 PyObject *__pyx_n_s_error; | |
5104 PyObject *__pyx_n_s_errorlabel; | |
5105 PyObject *__pyx_n_s_errors; | |
5106 PyObject *__pyx_n_s_errorstring; | |
5107 PyObject *__pyx_n_s_errwarn; | |
5108 PyObject *__pyx_kp_u_expected; | |
5109 PyObject *__pyx_kp_u_expected_2; | |
5110 PyObject *__pyx_kp_u_expected_3; | |
5111 PyObject *__pyx_n_s_expected_4; | |
5112 PyObject *__pyx_n_s_f; | |
5113 PyObject *__pyx_n_s_fa; | |
5114 PyObject *__pyx_n_s_faref; | |
5115 PyObject *__pyx_n_s_faref_leftflank; | |
5116 PyObject *__pyx_n_s_fetch; | |
5117 PyObject *__pyx_n_u_fileformat; | |
5118 PyObject *__pyx_kp_u_fileformat_VCFv; | |
5119 PyObject *__pyx_n_s_filename; | |
5120 PyObject *__pyx_n_s_filter; | |
5121 PyObject *__pyx_n_s_filter_2; | |
5122 PyObject *__pyx_n_u_filter_2; | |
5123 PyObject *__pyx_n_s_find; | |
5124 PyObject *__pyx_n_s_first; | |
5125 PyObject *__pyx_n_s_fmt; | |
5126 PyObject *__pyx_kp_u_for; | |
5127 PyObject *__pyx_n_s_format; | |
5128 PyObject *__pyx_n_u_format; | |
5129 PyObject *__pyx_n_s_format_2; | |
5130 PyObject *__pyx_n_s_format_format; | |
5131 PyObject *__pyx_n_s_format_formatdata; | |
5132 PyObject *__pyx_n_s_formatdict; | |
5133 PyObject *__pyx_kp_u_found; | |
5134 PyObject *__pyx_kp_u_gc; | |
5135 PyObject *__pyx_kp_u_genotypes; | |
5136 PyObject *__pyx_n_s_get; | |
5137 PyObject *__pyx_n_s_get_expected; | |
5138 PyObject *__pyx_n_s_get_sequence; | |
5139 PyObject *__pyx_n_s_getfilter; | |
5140 PyObject *__pyx_n_s_getformat; | |
5141 PyObject *__pyx_n_s_getheader; | |
5142 PyObject *__pyx_n_s_getinfo; | |
5143 PyObject *__pyx_n_s_getsamples; | |
5144 PyObject *__pyx_n_s_getstate; | |
5145 PyObject *__pyx_kp_u_got; | |
5146 PyObject *__pyx_n_s_gts; | |
5147 PyObject *__pyx_n_s_gtsRegEx; | |
5148 PyObject *__pyx_n_s_have_deletions; | |
5149 PyObject *__pyx_n_s_header; | |
5150 PyObject *__pyx_n_s_header_2; | |
5151 PyObject *__pyx_n_s_headings; | |
5152 PyObject *__pyx_n_s_i; | |
5153 PyObject *__pyx_kp_u_id; | |
5154 PyObject *__pyx_n_s_id_2; | |
5155 PyObject *__pyx_n_u_id_2; | |
5156 PyObject *__pyx_kp_u_id_numbertype_number_type_descri; | |
5157 PyObject *__pyx_n_s_idx; | |
5158 PyObject *__pyx_n_s_ielts; | |
5159 PyObject *__pyx_n_s_ignored_errors; | |
5160 PyObject *__pyx_n_s_ignoreerror; | |
5161 PyObject *__pyx_n_s_import; | |
5162 PyObject *__pyx_kp_u_in_line; | |
5163 PyObject *__pyx_n_s_info; | |
5164 PyObject *__pyx_n_s_info_2; | |
5165 PyObject *__pyx_n_u_info_2; | |
5166 PyObject *__pyx_n_s_init; | |
5167 PyObject *__pyx_n_s_init_subclass; | |
5168 PyObject *__pyx_n_s_initializing; | |
5169 PyObject *__pyx_n_s_inregion; | |
5170 PyObject *__pyx_n_s_is_coroutine; | |
5171 PyObject *__pyx_kp_u_isenabled; | |
5172 PyObject *__pyx_n_s_itemgetter; | |
5173 PyObject *__pyx_n_s_itervalues; | |
5174 PyObject *__pyx_n_s_join; | |
5175 PyObject *__pyx_n_s_k; | |
5176 PyObject *__pyx_n_s_key; | |
5177 PyObject *__pyx_n_s_keys; | |
5178 PyObject *__pyx_n_s_l; | |
5179 PyObject *__pyx_n_s_label; | |
5180 PyObject *__pyx_n_s_last; | |
5181 PyObject *__pyx_n_s_last_line; | |
5182 PyObject *__pyx_n_s_left; | |
5183 PyObject *__pyx_n_s_leftalign; | |
5184 PyObject *__pyx_n_s_leftalign_2; | |
5185 PyObject *__pyx_n_s_line; | |
5186 PyObject *__pyx_n_s_line_2; | |
5187 PyObject *__pyx_n_s_lineno; | |
5188 PyObject *__pyx_n_s_lineparse; | |
5189 PyObject *__pyx_n_s_lines; | |
5190 PyObject *__pyx_n_s_lines_2; | |
5191 PyObject *__pyx_n_s_longest; | |
5192 PyObject *__pyx_n_s_main; | |
5193 PyObject *__pyx_n_s_map; | |
5194 PyObject *__pyx_n_s_match; | |
5195 PyObject *__pyx_n_s_metaclass; | |
5196 PyObject *__pyx_n_s_min; | |
5197 PyObject *__pyx_n_u_missing; | |
5198 PyObject *__pyx_n_s_missingvalue; | |
5199 PyObject *__pyx_n_s_module; | |
5200 PyObject *__pyx_n_s_movable; | |
5201 PyObject *__pyx_n_s_mro_entries; | |
5202 PyObject *__pyx_n_s_n; | |
5203 PyObject *__pyx_n_s_na; | |
5204 PyObject *__pyx_n_s_name; | |
5205 PyObject *__pyx_n_s_namedtuple; | |
5206 PyObject *__pyx_kp_u_needs_to_be_checked; | |
5207 PyObject *__pyx_n_s_new; | |
5208 PyObject *__pyx_n_s_newalts; | |
5209 PyObject *__pyx_n_s_nmb; | |
5210 PyObject *__pyx_kp_s_no_default___reduce___due_to_non; | |
5211 PyObject *__pyx_kp_u_nonref_alleles; | |
5212 PyObject *__pyx_n_s_number; | |
5213 PyObject *__pyx_n_u_number; | |
5214 PyObject *__pyx_n_s_numbertype; | |
5215 PyObject *__pyx_n_s_object; | |
5216 PyObject *__pyx_n_s_operator; | |
5217 PyObject *__pyx_n_s_opt; | |
5218 PyObject *__pyx_kp_u_output; | |
5219 PyObject *__pyx_n_s_output_2; | |
5220 PyObject *__pyx_kp_u_parameters_got; | |
5221 PyObject *__pyx_n_s_parse; | |
5222 PyObject *__pyx_n_s_parse_2; | |
5223 PyObject *__pyx_n_s_parse_data; | |
5224 PyObject *__pyx_n_s_parse_format; | |
5225 PyObject *__pyx_n_s_parse_formatdata; | |
5226 PyObject *__pyx_n_s_parse_header; | |
5227 PyObject *__pyx_n_s_parse_header_2; | |
5228 PyObject *__pyx_n_s_parse_heading; | |
5229 PyObject *__pyx_n_s_parse_regions; | |
5230 PyObject *__pyx_n_s_parser; | |
5231 PyObject *__pyx_kp_u_phased_genotypes; | |
5232 PyObject *__pyx_n_s_pickle; | |
5233 PyObject *__pyx_n_s_pos; | |
5234 PyObject *__pyx_n_u_pos; | |
5235 PyObject *__pyx_n_s_pos1; | |
5236 PyObject *__pyx_n_s_pos2; | |
5237 PyObject *__pyx_n_s_prepare; | |
5238 PyObject *__pyx_n_s_pysam; | |
5239 PyObject *__pyx_n_s_pysam_libcvcf; | |
5240 PyObject *__pyx_kp_s_pysam_libcvcf_pyx; | |
5241 PyObject *__pyx_n_s_pyx_PickleError; | |
5242 PyObject *__pyx_n_s_pyx_checksum; | |
5243 PyObject *__pyx_n_s_pyx_result; | |
5244 PyObject *__pyx_n_s_pyx_state; | |
5245 PyObject *__pyx_n_s_pyx_type; | |
5246 PyObject *__pyx_n_s_pyx_unpickle_asVCFRecord; | |
5247 PyObject *__pyx_n_s_pyx_vtable; | |
5248 PyObject *__pyx_n_s_qual; | |
5249 PyObject *__pyx_n_u_qual; | |
5250 PyObject *__pyx_n_s_qualname; | |
5251 PyObject *__pyx_n_s_r; | |
5252 PyObject *__pyx_n_s_range; | |
5253 PyObject *__pyx_n_s_re; | |
5254 PyObject *__pyx_n_s_record; | |
5255 PyObject *__pyx_n_s_reduce; | |
5256 PyObject *__pyx_n_s_reduce_cython; | |
5257 PyObject *__pyx_n_s_reduce_ex; | |
5258 PyObject *__pyx_n_s_ref; | |
5259 PyObject *__pyx_n_u_ref; | |
5260 PyObject *__pyx_n_s_ref1; | |
5261 PyObject *__pyx_n_s_ref2; | |
5262 PyObject *__pyx_n_s_reference; | |
5263 PyObject *__pyx_n_s_reference_2; | |
5264 PyObject *__pyx_kp_u_reference_is; | |
5265 PyObject *__pyx_kp_u_reference_is_2; | |
5266 PyObject *__pyx_n_s_region; | |
5267 PyObject *__pyx_n_s_regions; | |
5268 PyObject *__pyx_n_s_regions_2; | |
5269 PyObject *__pyx_n_s_replace; | |
5270 PyObject *__pyx_n_s_required; | |
5271 PyObject *__pyx_n_s_required_2; | |
5272 PyObject *__pyx_n_s_rest; | |
5273 PyObject *__pyx_n_s_result; | |
5274 PyObject *__pyx_n_s_s; | |
5275 PyObject *__pyx_n_s_sample; | |
5276 PyObject *__pyx_n_s_sample2column; | |
5277 PyObject *__pyx_n_s_samples; | |
5278 PyObject *__pyx_kp_u_samples_2; | |
5279 PyObject *__pyx_n_s_samples_3; | |
5280 PyObject *__pyx_n_s_sdata; | |
5281 PyObject *__pyx_n_s_self; | |
5282 PyObject *__pyx_n_s_send; | |
5283 PyObject *__pyx_n_s_separator; | |
5284 PyObject *__pyx_n_s_sequence; | |
5285 PyObject *__pyx_n_s_set_name; | |
5286 PyObject *__pyx_n_s_setfilter; | |
5287 PyObject *__pyx_n_s_setformat; | |
5288 PyObject *__pyx_n_s_setheader; | |
5289 PyObject *__pyx_n_s_setinfo; | |
5290 PyObject *__pyx_n_s_setreference; | |
5291 PyObject *__pyx_n_s_setregions; | |
5292 PyObject *__pyx_n_s_setsamples; | |
5293 PyObject *__pyx_n_s_setstate; | |
5294 PyObject *__pyx_n_s_setstate_cython; | |
5295 PyObject *__pyx_n_s_setversion; | |
5296 PyObject *__pyx_n_s_shortest; | |
5297 PyObject *__pyx_n_s_spec; | |
5298 PyObject *__pyx_n_s_split; | |
5299 PyObject *__pyx_n_s_start; | |
5300 PyObject *__pyx_n_s_startswith; | |
5301 PyObject *__pyx_n_s_state; | |
5302 PyObject *__pyx_kp_u_sth_entry_not_found; | |
5303 PyObject *__pyx_n_s_stream; | |
5304 PyObject *__pyx_n_s_string; | |
5305 PyObject *__pyx_kp_s_stringsource; | |
5306 PyObject *__pyx_n_s_strip; | |
5307 PyObject *__pyx_n_s_super; | |
5308 PyObject *__pyx_n_s_sys; | |
5309 PyObject *__pyx_n_s_t; | |
5310 PyObject *__pyx_n_s_tabixfile; | |
5311 PyObject *__pyx_n_s_test; | |
5312 PyObject *__pyx_n_s_throw; | |
5313 PyObject *__pyx_n_s_type; | |
5314 PyObject *__pyx_n_u_type; | |
5315 PyObject *__pyx_n_s_update; | |
5316 PyObject *__pyx_n_s_upper; | |
5317 PyObject *__pyx_n_s_use_setstate; | |
5318 PyObject *__pyx_n_s_v; | |
5319 PyObject *__pyx_n_s_validate; | |
5320 PyObject *__pyx_n_s_value; | |
5321 PyObject *__pyx_n_s_values; | |
5322 PyObject *__pyx_kp_u_values_in_element; | |
5323 PyObject *__pyx_n_s_var; | |
5324 PyObject *__pyx_n_s_vcf; | |
5325 PyObject *__pyx_n_s_vcffile; | |
5326 PyObject *__pyx_n_s_version; | |
5327 PyObject *__pyx_n_s_version_2; | |
5328 PyObject *__pyx_n_s_warn_errors; | |
5329 PyObject *__pyx_n_s_warnerror; | |
5330 PyObject *__pyx_n_s_write; | |
5331 PyObject *__pyx_n_s_write_data; | |
5332 PyObject *__pyx_n_s_write_header; | |
5333 PyObject *__pyx_n_s_write_heading; | |
5334 PyObject *__pyx_n_s_writeheader; | |
5335 PyObject *__pyx_n_s_x; | |
5336 PyObject *__pyx_n_s_y; | |
5337 PyObject *__pyx_n_s_zip; | |
5338 PyObject *__pyx_float_0_0; | |
5339 PyObject *__pyx_int_0; | |
5340 PyObject *__pyx_int_1; | |
5341 PyObject *__pyx_int_2; | |
5342 PyObject *__pyx_int_3; | |
5343 PyObject *__pyx_int_4; | |
5344 PyObject *__pyx_int_5; | |
5345 PyObject *__pyx_int_6; | |
5346 PyObject *__pyx_int_7; | |
5347 PyObject *__pyx_int_8; | |
5348 PyObject *__pyx_int_9; | |
5349 PyObject *__pyx_int_10; | |
5350 PyObject *__pyx_int_11; | |
5351 PyObject *__pyx_int_12; | |
5352 PyObject *__pyx_int_13; | |
5353 PyObject *__pyx_int_14; | |
5354 PyObject *__pyx_int_15; | |
5355 PyObject *__pyx_int_16; | |
5356 PyObject *__pyx_int_17; | |
5357 PyObject *__pyx_int_18; | |
5358 PyObject *__pyx_int_19; | |
5359 PyObject *__pyx_int_20; | |
5360 PyObject *__pyx_int_21; | |
5361 PyObject *__pyx_int_22; | |
5362 PyObject *__pyx_int_23; | |
5363 PyObject *__pyx_int_24; | |
5364 PyObject *__pyx_int_25; | |
5365 PyObject *__pyx_int_26; | |
5366 PyObject *__pyx_int_27; | |
5367 PyObject *__pyx_int_28; | |
5368 PyObject *__pyx_int_29; | |
5369 PyObject *__pyx_int_30; | |
5370 PyObject *__pyx_int_31; | |
5371 PyObject *__pyx_int_32; | |
5372 PyObject *__pyx_int_33; | |
5373 PyObject *__pyx_int_40; | |
5374 PyObject *__pyx_int_100; | |
5375 PyObject *__pyx_int_29527880; | |
5376 PyObject *__pyx_int_214161357; | |
5377 PyObject *__pyx_int_239654613; | |
5378 PyObject *__pyx_int_3000000000; | |
5379 PyObject *__pyx_int_neg_1; | |
5380 PyObject *__pyx_slice__9; | |
5381 PyObject *__pyx_slice__17; | |
5382 PyObject *__pyx_slice__18; | |
5383 PyObject *__pyx_slice__20; | |
5384 PyObject *__pyx_slice__26; | |
5385 PyObject *__pyx_slice__28; | |
5386 PyObject *__pyx_tuple__21; | |
5387 PyObject *__pyx_tuple__22; | |
5388 PyObject *__pyx_tuple__30; | |
5389 PyObject *__pyx_tuple__31; | |
5390 PyObject *__pyx_tuple__32; | |
5391 PyObject *__pyx_tuple__35; | |
5392 PyObject *__pyx_tuple__36; | |
5393 PyObject *__pyx_tuple__37; | |
5394 PyObject *__pyx_tuple__39; | |
5395 PyObject *__pyx_tuple__41; | |
5396 PyObject *__pyx_tuple__42; | |
5397 PyObject *__pyx_tuple__44; | |
5398 PyObject *__pyx_tuple__45; | |
5399 PyObject *__pyx_tuple__47; | |
5400 PyObject *__pyx_tuple__49; | |
5401 PyObject *__pyx_tuple__52; | |
5402 PyObject *__pyx_tuple__53; | |
5403 PyObject *__pyx_tuple__54; | |
5404 PyObject *__pyx_tuple__56; | |
5405 PyObject *__pyx_tuple__57; | |
5406 PyObject *__pyx_tuple__59; | |
5407 PyObject *__pyx_tuple__61; | |
5408 PyObject *__pyx_tuple__62; | |
5409 PyObject *__pyx_tuple__64; | |
5410 PyObject *__pyx_tuple__66; | |
5411 PyObject *__pyx_tuple__68; | |
5412 PyObject *__pyx_tuple__70; | |
5413 PyObject *__pyx_tuple__71; | |
5414 PyObject *__pyx_tuple__73; | |
5415 PyObject *__pyx_tuple__75; | |
5416 PyObject *__pyx_tuple__77; | |
5417 PyObject *__pyx_tuple__79; | |
5418 PyObject *__pyx_tuple__81; | |
5419 PyObject *__pyx_tuple__83; | |
5420 PyObject *__pyx_tuple__85; | |
5421 PyObject *__pyx_tuple__87; | |
5422 PyObject *__pyx_tuple__89; | |
5423 PyObject *__pyx_tuple__91; | |
5424 PyObject *__pyx_tuple__93; | |
5425 PyObject *__pyx_tuple__95; | |
5426 PyObject *__pyx_tuple__97; | |
5427 PyObject *__pyx_tuple__100; | |
5428 PyObject *__pyx_tuple__103; | |
5429 PyObject *__pyx_tuple__106; | |
5430 PyObject *__pyx_tuple__109; | |
5431 PyObject *__pyx_tuple__111; | |
5432 PyObject *__pyx_tuple__113; | |
5433 PyObject *__pyx_tuple__115; | |
5434 PyObject *__pyx_tuple__117; | |
5435 PyObject *__pyx_tuple__120; | |
5436 PyObject *__pyx_tuple__122; | |
5437 PyObject *__pyx_tuple__125; | |
5438 PyObject *__pyx_tuple__127; | |
5439 PyObject *__pyx_tuple__129; | |
5440 PyObject *__pyx_tuple__132; | |
5441 PyObject *__pyx_tuple__134; | |
5442 PyObject *__pyx_tuple__135; | |
5443 PyObject *__pyx_tuple__137; | |
5444 PyObject *__pyx_codeobj__29; | |
5445 PyObject *__pyx_codeobj__38; | |
5446 PyObject *__pyx_codeobj__40; | |
5447 PyObject *__pyx_codeobj__43; | |
5448 PyObject *__pyx_codeobj__46; | |
5449 PyObject *__pyx_codeobj__48; | |
5450 PyObject *__pyx_codeobj__50; | |
5451 PyObject *__pyx_codeobj__51; | |
5452 PyObject *__pyx_codeobj__55; | |
5453 PyObject *__pyx_codeobj__58; | |
5454 PyObject *__pyx_codeobj__60; | |
5455 PyObject *__pyx_codeobj__63; | |
5456 PyObject *__pyx_codeobj__65; | |
5457 PyObject *__pyx_codeobj__67; | |
5458 PyObject *__pyx_codeobj__69; | |
5459 PyObject *__pyx_codeobj__72; | |
5460 PyObject *__pyx_codeobj__74; | |
5461 PyObject *__pyx_codeobj__76; | |
5462 PyObject *__pyx_codeobj__78; | |
5463 PyObject *__pyx_codeobj__80; | |
5464 PyObject *__pyx_codeobj__82; | |
5465 PyObject *__pyx_codeobj__84; | |
5466 PyObject *__pyx_codeobj__86; | |
5467 PyObject *__pyx_codeobj__88; | |
5468 PyObject *__pyx_codeobj__90; | |
5469 PyObject *__pyx_codeobj__92; | |
5470 PyObject *__pyx_codeobj__94; | |
5471 PyObject *__pyx_codeobj__96; | |
5472 PyObject *__pyx_codeobj__98; | |
5473 PyObject *__pyx_codeobj__99; | |
5474 PyObject *__pyx_codeobj__101; | |
5475 PyObject *__pyx_codeobj__102; | |
5476 PyObject *__pyx_codeobj__104; | |
5477 PyObject *__pyx_codeobj__105; | |
5478 PyObject *__pyx_codeobj__107; | |
5479 PyObject *__pyx_codeobj__108; | |
5480 PyObject *__pyx_codeobj__110; | |
5481 PyObject *__pyx_codeobj__112; | |
5482 PyObject *__pyx_codeobj__114; | |
5483 PyObject *__pyx_codeobj__116; | |
5484 PyObject *__pyx_codeobj__118; | |
5485 PyObject *__pyx_codeobj__119; | |
5486 PyObject *__pyx_codeobj__121; | |
5487 PyObject *__pyx_codeobj__123; | |
5488 PyObject *__pyx_codeobj__124; | |
5489 PyObject *__pyx_codeobj__126; | |
5490 PyObject *__pyx_codeobj__128; | |
5491 PyObject *__pyx_codeobj__130; | |
5492 PyObject *__pyx_codeobj__131; | |
5493 PyObject *__pyx_codeobj__133; | |
5494 PyObject *__pyx_codeobj__136; | |
5495 PyObject *__pyx_codeobj__138; | |
5496 } __pyx_mstate; | |
5497 | |
5498 #if CYTHON_USE_MODULE_STATE | |
5499 #ifdef __cplusplus | |
5500 namespace { | |
5501 extern struct PyModuleDef __pyx_moduledef; | |
5502 } /* anonymous namespace */ | |
5503 #else | |
5504 static struct PyModuleDef __pyx_moduledef; | |
5505 #endif | |
5506 | |
5507 #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) | |
5508 | |
5509 #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) | |
5510 | |
5511 #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) | |
5512 #else | |
5513 static __pyx_mstate __pyx_mstate_global_static = | |
5514 #ifdef __cplusplus | |
5515 {}; | |
5516 #else | |
5517 {0}; | |
5518 #endif | |
5519 static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; | |
5520 #endif | |
5521 /* #### Code section: module_state_clear ### */ | |
5522 #if CYTHON_USE_MODULE_STATE | |
5523 static int __pyx_m_clear(PyObject *m) { | |
5524 __pyx_mstate *clear_module_state = __pyx_mstate(m); | |
5525 if (!clear_module_state) return 0; | |
5526 Py_CLEAR(clear_module_state->__pyx_d); | |
5527 Py_CLEAR(clear_module_state->__pyx_b); | |
5528 Py_CLEAR(clear_module_state->__pyx_cython_runtime); | |
5529 Py_CLEAR(clear_module_state->__pyx_empty_tuple); | |
5530 Py_CLEAR(clear_module_state->__pyx_empty_bytes); | |
5531 Py_CLEAR(clear_module_state->__pyx_empty_unicode); | |
5532 #ifdef __Pyx_CyFunction_USED | |
5533 Py_CLEAR(clear_module_state->__pyx_CyFunctionType); | |
5534 #endif | |
5535 #ifdef __Pyx_FusedFunction_USED | |
5536 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); | |
5537 #endif | |
5538 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile); | |
5539 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_tabix_file_iterator); | |
5540 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_TabixFile); | |
5541 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_Parser); | |
5542 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asTuple); | |
5543 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asGTF); | |
5544 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asGFF3); | |
5545 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asBed); | |
5546 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asVCF); | |
5547 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_TabixIterator); | |
5548 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed); | |
5549 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_GZIterator); | |
5550 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_GZIteratorHead); | |
5551 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_GZIteratorParsed); | |
5552 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_Tabixfile); | |
5553 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_TupleProxy); | |
5554 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator); | |
5555 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy); | |
5556 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_GTFProxy); | |
5557 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy); | |
5558 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_BedProxy); | |
5559 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_VCFProxy); | |
5560 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); | |
5561 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); | |
5562 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); | |
5563 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_5array_array); | |
5564 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_7libcvcf_VCFRecord); | |
5565 Py_CLEAR(clear_module_state->__pyx_type_5pysam_7libcvcf_VCFRecord); | |
5566 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_7libcvcf_asVCFRecord); | |
5567 Py_CLEAR(clear_module_state->__pyx_type_5pysam_7libcvcf_asVCFRecord); | |
5568 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse); | |
5569 Py_CLEAR(clear_module_state->__pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse); | |
5570 Py_CLEAR(clear_module_state->__pyx_kp_u_); | |
5571 Py_CLEAR(clear_module_state->__pyx_kp_b_0); | |
5572 Py_CLEAR(clear_module_state->__pyx_kp_u_0); | |
5573 Py_CLEAR(clear_module_state->__pyx_n_u_A); | |
5574 Py_CLEAR(clear_module_state->__pyx_n_u_ACGTN); | |
5575 Py_CLEAR(clear_module_state->__pyx_kp_u_ACGTN_2); | |
5576 Py_CLEAR(clear_module_state->__pyx_n_u_ALT); | |
5577 Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); | |
5578 Py_CLEAR(clear_module_state->__pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); | |
5579 Py_CLEAR(clear_module_state->__pyx_kp_u_BADLY_FORMATTED_FORMAT_STRING_Fo); | |
5580 Py_CLEAR(clear_module_state->__pyx_n_s_BADLY_FORMATTED_HEADING); | |
5581 Py_CLEAR(clear_module_state->__pyx_kp_u_BADLY_FORMATTED_HEADING_Did_not); | |
5582 Py_CLEAR(clear_module_state->__pyx_kp_u_BAD_CHR_TAG_Error_calculating_ch); | |
5583 Py_CLEAR(clear_module_state->__pyx_n_s_BAD_GENOTYPE); | |
5584 Py_CLEAR(clear_module_state->__pyx_kp_u_BAD_GENOTYPE_Cannot_parse_genoty); | |
5585 Py_CLEAR(clear_module_state->__pyx_n_s_BAD_NUMBER_OF_COLUMNS); | |
5586 Py_CLEAR(clear_module_state->__pyx_kp_u_BAD_NUMBER_OF_COLUMNS_Wrong_numb); | |
5587 Py_CLEAR(clear_module_state->__pyx_n_s_BAD_NUMBER_OF_PARAMETERS); | |
5588 Py_CLEAR(clear_module_state->__pyx_kp_u_BAD_NUMBER_OF_PARAMETERS_Found_u); | |
5589 Py_CLEAR(clear_module_state->__pyx_n_s_BAD_NUMBER_OF_VALUES); | |
5590 Py_CLEAR(clear_module_state->__pyx_kp_u_BAD_NUMBER_OF_VALUES_Found_too_m); | |
5591 Py_CLEAR(clear_module_state->__pyx_n_u_CHROM); | |
5592 Py_CLEAR(clear_module_state->__pyx_kp_u_Can_only_handle_v3_3_and_v4_0_VC); | |
5593 Py_CLEAR(clear_module_state->__pyx_n_u_Character); | |
5594 Py_CLEAR(clear_module_state->__pyx_kp_u_Conditional_genotype_quality); | |
5595 Py_CLEAR(clear_module_state->__pyx_n_u_D); | |
5596 Py_CLEAR(clear_module_state->__pyx_n_u_DP); | |
5597 Py_CLEAR(clear_module_state->__pyx_kp_u_Description); | |
5598 Py_CLEAR(clear_module_state->__pyx_n_u_Description_2); | |
5599 Py_CLEAR(clear_module_state->__pyx_kp_u_Don_t_understand_region_string_s); | |
5600 Py_CLEAR(clear_module_state->__pyx_n_u_EC); | |
5601 Py_CLEAR(clear_module_state->__pyx_n_s_ERROR_FLAG_HAS_VALUE); | |
5602 Py_CLEAR(clear_module_state->__pyx_kp_u_ERROR_FLAG_HAS_VALUE_Flag_fields); | |
5603 Py_CLEAR(clear_module_state->__pyx_n_s_ERROR_FORMAT_NOT_CHAR); | |
5604 Py_CLEAR(clear_module_state->__pyx_kp_u_ERROR_FORMAT_NOT_CHAR_Eexpected); | |
5605 Py_CLEAR(clear_module_state->__pyx_n_s_ERROR_FORMAT_NOT_INTEGER); | |
5606 Py_CLEAR(clear_module_state->__pyx_kp_u_ERROR_FORMAT_NOT_INTEGER_Expecte); | |
5607 Py_CLEAR(clear_module_state->__pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL); | |
5608 Py_CLEAR(clear_module_state->__pyx_kp_u_ERROR_FORMAT_NOT_NUMERICAL_Expec); | |
5609 Py_CLEAR(clear_module_state->__pyx_n_s_ERROR_INFO_STRING); | |
5610 Py_CLEAR(clear_module_state->__pyx_kp_u_ERROR_INFO_STRING_Error_while_pa); | |
5611 Py_CLEAR(clear_module_state->__pyx_n_s_ERROR_TRAILING_DATA); | |
5612 Py_CLEAR(clear_module_state->__pyx_kp_u_ERROR_TRAILING_DATA_Numerical_fi); | |
5613 Py_CLEAR(clear_module_state->__pyx_n_s_ERROR_UNKNOWN_KEY); | |
5614 Py_CLEAR(clear_module_state->__pyx_kp_u_ERROR_UNKNOWN_KEY_Unknown_key_s); | |
5615 Py_CLEAR(clear_module_state->__pyx_n_u_Error); | |
5616 Py_CLEAR(clear_module_state->__pyx_kp_u_Expected_alternate_allel_counts); | |
5617 Py_CLEAR(clear_module_state->__pyx_n_u_FILTER); | |
5618 Py_CLEAR(clear_module_state->__pyx_n_s_FILTER_NOT_DEFINED); | |
5619 Py_CLEAR(clear_module_state->__pyx_kp_u_FILTER_NOT_DEFINED_Identifier_s); | |
5620 Py_CLEAR(clear_module_state->__pyx_n_s_FORMAT); | |
5621 Py_CLEAR(clear_module_state->__pyx_n_u_FORMAT); | |
5622 Py_CLEAR(clear_module_state->__pyx_n_s_FORMAT_MISSING_QUOTES); | |
5623 Py_CLEAR(clear_module_state->__pyx_kp_u_FORMAT_MISSING_QUOTES_Descriptio); | |
5624 Py_CLEAR(clear_module_state->__pyx_n_s_FORMAT_NOT_DEFINED); | |
5625 Py_CLEAR(clear_module_state->__pyx_kp_u_FORMAT_NOT_DEFINED_Identifier_s); | |
5626 Py_CLEAR(clear_module_state->__pyx_n_u_FT); | |
5627 Py_CLEAR(clear_module_state->__pyx_n_u_Flag); | |
5628 Py_CLEAR(clear_module_state->__pyx_n_u_Float); | |
5629 Py_CLEAR(clear_module_state->__pyx_n_u_G); | |
5630 Py_CLEAR(clear_module_state->__pyx_n_u_GL); | |
5631 Py_CLEAR(clear_module_state->__pyx_n_u_GLE); | |
5632 Py_CLEAR(clear_module_state->__pyx_n_u_GP); | |
5633 Py_CLEAR(clear_module_state->__pyx_n_u_GQ); | |
5634 Py_CLEAR(clear_module_state->__pyx_n_u_GT); | |
5635 Py_CLEAR(clear_module_state->__pyx_n_s_GTdata); | |
5636 Py_CLEAR(clear_module_state->__pyx_n_s_GTstring); | |
5637 Py_CLEAR(clear_module_state->__pyx_n_u_Genotype); | |
5638 Py_CLEAR(clear_module_state->__pyx_kp_u_Genotype_Quality); | |
5639 Py_CLEAR(clear_module_state->__pyx_kp_u_Genotype_likelihoods); | |
5640 Py_CLEAR(clear_module_state->__pyx_kp_u_Genotype_posterior_probabilities); | |
5641 Py_CLEAR(clear_module_state->__pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS); | |
5642 Py_CLEAR(clear_module_state->__pyx_kp_u_HEADING_NOT_SEPARATED_BY_TABS_He); | |
5643 Py_CLEAR(clear_module_state->__pyx_n_u_HQ); | |
5644 Py_CLEAR(clear_module_state->__pyx_kp_u_Haplotype_Quality); | |
5645 Py_CLEAR(clear_module_state->__pyx_n_u_I); | |
5646 Py_CLEAR(clear_module_state->__pyx_kp_u_ID); | |
5647 Py_CLEAR(clear_module_state->__pyx_n_u_ID_2); | |
5648 Py_CLEAR(clear_module_state->__pyx_n_u_INFO); | |
5649 Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); | |
5650 Py_CLEAR(clear_module_state->__pyx_n_u_Integer); | |
5651 Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_error_string_s); | |
5652 Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); | |
5653 Py_CLEAR(clear_module_state->__pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE); | |
5654 Py_CLEAR(clear_module_state->__pyx_kp_u_MISSING_INDEL_ALLELE_REF_BASE_In); | |
5655 Py_CLEAR(clear_module_state->__pyx_n_s_MISSING_REF); | |
5656 Py_CLEAR(clear_module_state->__pyx_kp_u_MISSING_REF_Reference_allele_mis); | |
5657 Py_CLEAR(clear_module_state->__pyx_n_u_MQ); | |
5658 Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); | |
5659 Py_CLEAR(clear_module_state->__pyx_n_u_N); | |
5660 Py_CLEAR(clear_module_state->__pyx_n_s_NT_ALLELES); | |
5661 Py_CLEAR(clear_module_state->__pyx_n_s_NT_GENOTYPES); | |
5662 Py_CLEAR(clear_module_state->__pyx_n_s_NT_NR_ALLELES); | |
5663 Py_CLEAR(clear_module_state->__pyx_n_s_NT_NUMBER); | |
5664 Py_CLEAR(clear_module_state->__pyx_n_s_NT_PHASED_GENOTYPES); | |
5665 Py_CLEAR(clear_module_state->__pyx_n_s_NT_UNKNOWN); | |
5666 Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); | |
5667 Py_CLEAR(clear_module_state->__pyx_kp_u_Number); | |
5668 Py_CLEAR(clear_module_state->__pyx_n_u_Number_2); | |
5669 Py_CLEAR(clear_module_state->__pyx_n_b_PASS); | |
5670 Py_CLEAR(clear_module_state->__pyx_n_u_PASS); | |
5671 Py_CLEAR(clear_module_state->__pyx_n_u_PL); | |
5672 Py_CLEAR(clear_module_state->__pyx_n_u_POS); | |
5673 Py_CLEAR(clear_module_state->__pyx_n_s_POS_NOT_NUMERICAL); | |
5674 Py_CLEAR(clear_module_state->__pyx_kp_u_POS_NOT_NUMERICAL_Position_colum); | |
5675 Py_CLEAR(clear_module_state->__pyx_n_s_POS_NOT_POSITIVE); | |
5676 Py_CLEAR(clear_module_state->__pyx_kp_u_POS_NOT_POSITIVE_Position_field); | |
5677 Py_CLEAR(clear_module_state->__pyx_n_u_PQ); | |
5678 Py_CLEAR(clear_module_state->__pyx_n_u_PS); | |
5679 Py_CLEAR(clear_module_state->__pyx_kp_u_Phase_set); | |
5680 Py_CLEAR(clear_module_state->__pyx_kp_u_Phasing_quality); | |
5681 Py_CLEAR(clear_module_state->__pyx_kp_u_Phred_scaled_genotype_likelihood); | |
5682 Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); | |
5683 Py_CLEAR(clear_module_state->__pyx_n_u_QUAL); | |
5684 Py_CLEAR(clear_module_state->__pyx_n_s_QUAL_NOT_NUMERICAL); | |
5685 Py_CLEAR(clear_module_state->__pyx_kp_u_QUAL_NOT_NUMERICAL_Quality_field); | |
5686 Py_CLEAR(clear_module_state->__pyx_n_u_REF); | |
5687 Py_CLEAR(clear_module_state->__pyx_kp_u_RMS_mapping_quality); | |
5688 Py_CLEAR(clear_module_state->__pyx_kp_u_Read_depth_at_this_position_for); | |
5689 Py_CLEAR(clear_module_state->__pyx_kp_u_Required_key_s_not_found_in_data); | |
5690 Py_CLEAR(clear_module_state->__pyx_kp_u_Sample_Genotype_Filter); | |
5691 Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration); | |
5692 Py_CLEAR(clear_module_state->__pyx_n_u_String); | |
5693 Py_CLEAR(clear_module_state->__pyx_n_s_Tabixfile); | |
5694 Py_CLEAR(clear_module_state->__pyx_kp_u_Type); | |
5695 Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); | |
5696 Py_CLEAR(clear_module_state->__pyx_n_u_Type_2); | |
5697 Py_CLEAR(clear_module_state->__pyx_n_s_UNKNOWN_CHAR_IN_REF); | |
5698 Py_CLEAR(clear_module_state->__pyx_kp_u_UNKNOWN_CHAR_IN_REF_Unknown_char); | |
5699 Py_CLEAR(clear_module_state->__pyx_n_s_UNKNOWN_FORMAT_STRING); | |
5700 Py_CLEAR(clear_module_state->__pyx_kp_u_UNKNOWN_FORMAT_STRING_Unknown_fi); | |
5701 Py_CLEAR(clear_module_state->__pyx_kp_u_Undefined_tag); | |
5702 Py_CLEAR(clear_module_state->__pyx_kp_u_Unknown_number_type_encountered); | |
5703 Py_CLEAR(clear_module_state->__pyx_n_s_V33_BAD_ALLELE); | |
5704 Py_CLEAR(clear_module_state->__pyx_kp_u_V33_BAD_ALLELE_Cannot_interpret); | |
5705 Py_CLEAR(clear_module_state->__pyx_n_s_V33_BAD_REF); | |
5706 Py_CLEAR(clear_module_state->__pyx_kp_u_V33_BAD_REF_Reference_should_be); | |
5707 Py_CLEAR(clear_module_state->__pyx_n_s_V33_UNMATCHED_DELETION); | |
5708 Py_CLEAR(clear_module_state->__pyx_kp_u_V33_UNMATCHED_DELETION_Deleted_s); | |
5709 Py_CLEAR(clear_module_state->__pyx_n_s_V40_BAD_ALLELE); | |
5710 Py_CLEAR(clear_module_state->__pyx_kp_u_V40_BAD_ALLELE_Bad_allele_found); | |
5711 Py_CLEAR(clear_module_state->__pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD); | |
5712 Py_CLEAR(clear_module_state->__pyx_kp_u_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2); | |
5713 Py_CLEAR(clear_module_state->__pyx_n_s_V40_MISSING_ANGLE_BRACKETS); | |
5714 Py_CLEAR(clear_module_state->__pyx_kp_u_V40_MISSING_ANGLE_BRACKETS_Forma); | |
5715 Py_CLEAR(clear_module_state->__pyx_n_s_VCF); | |
5716 Py_CLEAR(clear_module_state->__pyx_n_u_VCF); | |
5717 Py_CLEAR(clear_module_state->__pyx_n_s_VCFRecord); | |
5718 Py_CLEAR(clear_module_state->__pyx_n_u_VCFRecord); | |
5719 Py_CLEAR(clear_module_state->__pyx_n_s_VCFRecord___reduce_cython); | |
5720 Py_CLEAR(clear_module_state->__pyx_n_s_VCFRecord___setstate_cython); | |
5721 Py_CLEAR(clear_module_state->__pyx_n_s_VCFRecord_error); | |
5722 Py_CLEAR(clear_module_state->__pyx_n_s_VCF___del); | |
5723 Py_CLEAR(clear_module_state->__pyx_n_s_VCF___init); | |
5724 Py_CLEAR(clear_module_state->__pyx_n_s_VCF__add_definition); | |
5725 Py_CLEAR(clear_module_state->__pyx_n_s_VCF__parse); | |
5726 Py_CLEAR(clear_module_state->__pyx_n_s_VCF__parse_header); | |
5727 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_close); | |
5728 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_compare_calls); | |
5729 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_connect); | |
5730 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_convertGT); | |
5731 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_convertGTback); | |
5732 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_enter_default_format); | |
5733 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_error); | |
5734 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_fetch); | |
5735 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_format_format); | |
5736 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_format_formatdata); | |
5737 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_get_expected); | |
5738 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_getfilter); | |
5739 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_getformat); | |
5740 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_getheader); | |
5741 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_getinfo); | |
5742 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_getsamples); | |
5743 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_ignoreerror); | |
5744 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_inregion); | |
5745 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_parse); | |
5746 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_parse_data); | |
5747 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_parse_format); | |
5748 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_parse_formatdata); | |
5749 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_parse_header); | |
5750 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_parse_heading); | |
5751 Py_CLEAR(clear_module_state->__pyx_kp_u_VCF_says); | |
5752 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_setfilter); | |
5753 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_setformat); | |
5754 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_setheader); | |
5755 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_setinfo); | |
5756 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_setreference); | |
5757 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_setregions); | |
5758 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_setsamples); | |
5759 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_setversion); | |
5760 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_validate); | |
5761 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_warnerror); | |
5762 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_write); | |
5763 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_write_data); | |
5764 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_write_header); | |
5765 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_write_heading); | |
5766 Py_CLEAR(clear_module_state->__pyx_n_s_VCF_writeheader); | |
5767 Py_CLEAR(clear_module_state->__pyx_kp_u_VCFv3_3); | |
5768 Py_CLEAR(clear_module_state->__pyx_kp_u_VCFv4_0); | |
5769 Py_CLEAR(clear_module_state->__pyx_kp_u_VCFv4_1); | |
5770 Py_CLEAR(clear_module_state->__pyx_kp_u_VCFv4_2); | |
5771 Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); | |
5772 Py_CLEAR(clear_module_state->__pyx_n_s_WRONG_REF); | |
5773 Py_CLEAR(clear_module_state->__pyx_kp_u_WRONG_REF_Wrong_reference_s); | |
5774 Py_CLEAR(clear_module_state->__pyx_n_u_Warning); | |
5775 Py_CLEAR(clear_module_state->__pyx_n_s_ZERO_FOR_NON_FLAG_FIELD); | |
5776 Py_CLEAR(clear_module_state->__pyx_kp_u_ZERO_FOR_NON_FLAG_FIELD_number_s); | |
5777 Py_CLEAR(clear_module_state->__pyx_n_s_ZERO_LENGTH_ALLELE); | |
5778 Py_CLEAR(clear_module_state->__pyx_kp_u_ZERO_LENGTH_ALLELE_Found_zero_le); | |
5779 Py_CLEAR(clear_module_state->__pyx_kp_u__10); | |
5780 Py_CLEAR(clear_module_state->__pyx_kp_u__11); | |
5781 Py_CLEAR(clear_module_state->__pyx_kp_u__12); | |
5782 Py_CLEAR(clear_module_state->__pyx_kp_u__13); | |
5783 Py_CLEAR(clear_module_state->__pyx_n_s__139); | |
5784 Py_CLEAR(clear_module_state->__pyx_kp_u__14); | |
5785 Py_CLEAR(clear_module_state->__pyx_kp_u__15); | |
5786 Py_CLEAR(clear_module_state->__pyx_kp_u__16); | |
5787 Py_CLEAR(clear_module_state->__pyx_kp_u__19); | |
5788 Py_CLEAR(clear_module_state->__pyx_kp_u__2); | |
5789 Py_CLEAR(clear_module_state->__pyx_kp_u__23); | |
5790 Py_CLEAR(clear_module_state->__pyx_kp_u__24); | |
5791 Py_CLEAR(clear_module_state->__pyx_kp_u__25); | |
5792 Py_CLEAR(clear_module_state->__pyx_kp_u__27); | |
5793 Py_CLEAR(clear_module_state->__pyx_kp_u__3); | |
5794 Py_CLEAR(clear_module_state->__pyx_n_s__33); | |
5795 Py_CLEAR(clear_module_state->__pyx_kp_u__34); | |
5796 Py_CLEAR(clear_module_state->__pyx_kp_u__4); | |
5797 Py_CLEAR(clear_module_state->__pyx_kp_b__5); | |
5798 Py_CLEAR(clear_module_state->__pyx_kp_u__5); | |
5799 Py_CLEAR(clear_module_state->__pyx_kp_u__6); | |
5800 Py_CLEAR(clear_module_state->__pyx_kp_u__7); | |
5801 Py_CLEAR(clear_module_state->__pyx_kp_u__8); | |
5802 Py_CLEAR(clear_module_state->__pyx_n_s_a); | |
5803 Py_CLEAR(clear_module_state->__pyx_n_s_add); | |
5804 Py_CLEAR(clear_module_state->__pyx_n_s_add_definition); | |
5805 Py_CLEAR(clear_module_state->__pyx_n_s_addn); | |
5806 Py_CLEAR(clear_module_state->__pyx_n_s_addns); | |
5807 Py_CLEAR(clear_module_state->__pyx_n_s_all); | |
5808 Py_CLEAR(clear_module_state->__pyx_n_s_allele); | |
5809 Py_CLEAR(clear_module_state->__pyx_n_s_alleleRegEx); | |
5810 Py_CLEAR(clear_module_state->__pyx_kp_u_alleles); | |
5811 Py_CLEAR(clear_module_state->__pyx_n_s_alt); | |
5812 Py_CLEAR(clear_module_state->__pyx_n_u_alt); | |
5813 Py_CLEAR(clear_module_state->__pyx_n_s_alt1); | |
5814 Py_CLEAR(clear_module_state->__pyx_n_s_alt2); | |
5815 Py_CLEAR(clear_module_state->__pyx_n_s_append); | |
5816 Py_CLEAR(clear_module_state->__pyx_n_s_args); | |
5817 Py_CLEAR(clear_module_state->__pyx_n_s_asVCFRecord); | |
5818 Py_CLEAR(clear_module_state->__pyx_n_s_asVCFRecord___reduce_cython); | |
5819 Py_CLEAR(clear_module_state->__pyx_n_s_asVCFRecord___setstate_cython); | |
5820 Py_CLEAR(clear_module_state->__pyx_n_u_ascii); | |
5821 Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); | |
5822 Py_CLEAR(clear_module_state->__pyx_n_s_bisect); | |
5823 Py_CLEAR(clear_module_state->__pyx_n_s_blurp); | |
5824 Py_CLEAR(clear_module_state->__pyx_n_s_c); | |
5825 Py_CLEAR(clear_module_state->__pyx_n_s_chrom); | |
5826 Py_CLEAR(clear_module_state->__pyx_n_u_chrom); | |
5827 Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); | |
5828 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); | |
5829 Py_CLEAR(clear_module_state->__pyx_n_s_close); | |
5830 Py_CLEAR(clear_module_state->__pyx_n_s_collections); | |
5831 Py_CLEAR(clear_module_state->__pyx_n_s_cols); | |
5832 Py_CLEAR(clear_module_state->__pyx_n_s_compare_calls); | |
5833 Py_CLEAR(clear_module_state->__pyx_n_s_compile); | |
5834 Py_CLEAR(clear_module_state->__pyx_n_s_connect); | |
5835 Py_CLEAR(clear_module_state->__pyx_n_s_convertGT); | |
5836 Py_CLEAR(clear_module_state->__pyx_n_s_convertGTback); | |
5837 Py_CLEAR(clear_module_state->__pyx_n_s_copy); | |
5838 Py_CLEAR(clear_module_state->__pyx_n_s_copy_2); | |
5839 Py_CLEAR(clear_module_state->__pyx_n_s_d); | |
5840 Py_CLEAR(clear_module_state->__pyx_n_s_data); | |
5841 Py_CLEAR(clear_module_state->__pyx_n_s_datagenerator); | |
5842 Py_CLEAR(clear_module_state->__pyx_n_s_deepcopy); | |
5843 Py_CLEAR(clear_module_state->__pyx_n_s_defaultdict); | |
5844 Py_CLEAR(clear_module_state->__pyx_n_s_del); | |
5845 Py_CLEAR(clear_module_state->__pyx_kp_u_deletion_is); | |
5846 Py_CLEAR(clear_module_state->__pyx_n_u_descr); | |
5847 Py_CLEAR(clear_module_state->__pyx_n_s_description); | |
5848 Py_CLEAR(clear_module_state->__pyx_n_s_dict); | |
5849 Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); | |
5850 Py_CLEAR(clear_module_state->__pyx_n_s_dict_3); | |
5851 Py_CLEAR(clear_module_state->__pyx_kp_u_disable); | |
5852 Py_CLEAR(clear_module_state->__pyx_n_s_doc); | |
5853 Py_CLEAR(clear_module_state->__pyx_n_s_elts); | |
5854 Py_CLEAR(clear_module_state->__pyx_kp_u_enable); | |
5855 Py_CLEAR(clear_module_state->__pyx_n_s_encoding); | |
5856 Py_CLEAR(clear_module_state->__pyx_n_s_end); | |
5857 Py_CLEAR(clear_module_state->__pyx_n_s_endswith); | |
5858 Py_CLEAR(clear_module_state->__pyx_n_s_enter_default_format); | |
5859 Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); | |
5860 Py_CLEAR(clear_module_state->__pyx_n_s_err); | |
5861 Py_CLEAR(clear_module_state->__pyx_n_s_error); | |
5862 Py_CLEAR(clear_module_state->__pyx_n_s_errorlabel); | |
5863 Py_CLEAR(clear_module_state->__pyx_n_s_errors); | |
5864 Py_CLEAR(clear_module_state->__pyx_n_s_errorstring); | |
5865 Py_CLEAR(clear_module_state->__pyx_n_s_errwarn); | |
5866 Py_CLEAR(clear_module_state->__pyx_kp_u_expected); | |
5867 Py_CLEAR(clear_module_state->__pyx_kp_u_expected_2); | |
5868 Py_CLEAR(clear_module_state->__pyx_kp_u_expected_3); | |
5869 Py_CLEAR(clear_module_state->__pyx_n_s_expected_4); | |
5870 Py_CLEAR(clear_module_state->__pyx_n_s_f); | |
5871 Py_CLEAR(clear_module_state->__pyx_n_s_fa); | |
5872 Py_CLEAR(clear_module_state->__pyx_n_s_faref); | |
5873 Py_CLEAR(clear_module_state->__pyx_n_s_faref_leftflank); | |
5874 Py_CLEAR(clear_module_state->__pyx_n_s_fetch); | |
5875 Py_CLEAR(clear_module_state->__pyx_n_u_fileformat); | |
5876 Py_CLEAR(clear_module_state->__pyx_kp_u_fileformat_VCFv); | |
5877 Py_CLEAR(clear_module_state->__pyx_n_s_filename); | |
5878 Py_CLEAR(clear_module_state->__pyx_n_s_filter); | |
5879 Py_CLEAR(clear_module_state->__pyx_n_s_filter_2); | |
5880 Py_CLEAR(clear_module_state->__pyx_n_u_filter_2); | |
5881 Py_CLEAR(clear_module_state->__pyx_n_s_find); | |
5882 Py_CLEAR(clear_module_state->__pyx_n_s_first); | |
5883 Py_CLEAR(clear_module_state->__pyx_n_s_fmt); | |
5884 Py_CLEAR(clear_module_state->__pyx_kp_u_for); | |
5885 Py_CLEAR(clear_module_state->__pyx_n_s_format); | |
5886 Py_CLEAR(clear_module_state->__pyx_n_u_format); | |
5887 Py_CLEAR(clear_module_state->__pyx_n_s_format_2); | |
5888 Py_CLEAR(clear_module_state->__pyx_n_s_format_format); | |
5889 Py_CLEAR(clear_module_state->__pyx_n_s_format_formatdata); | |
5890 Py_CLEAR(clear_module_state->__pyx_n_s_formatdict); | |
5891 Py_CLEAR(clear_module_state->__pyx_kp_u_found); | |
5892 Py_CLEAR(clear_module_state->__pyx_kp_u_gc); | |
5893 Py_CLEAR(clear_module_state->__pyx_kp_u_genotypes); | |
5894 Py_CLEAR(clear_module_state->__pyx_n_s_get); | |
5895 Py_CLEAR(clear_module_state->__pyx_n_s_get_expected); | |
5896 Py_CLEAR(clear_module_state->__pyx_n_s_get_sequence); | |
5897 Py_CLEAR(clear_module_state->__pyx_n_s_getfilter); | |
5898 Py_CLEAR(clear_module_state->__pyx_n_s_getformat); | |
5899 Py_CLEAR(clear_module_state->__pyx_n_s_getheader); | |
5900 Py_CLEAR(clear_module_state->__pyx_n_s_getinfo); | |
5901 Py_CLEAR(clear_module_state->__pyx_n_s_getsamples); | |
5902 Py_CLEAR(clear_module_state->__pyx_n_s_getstate); | |
5903 Py_CLEAR(clear_module_state->__pyx_kp_u_got); | |
5904 Py_CLEAR(clear_module_state->__pyx_n_s_gts); | |
5905 Py_CLEAR(clear_module_state->__pyx_n_s_gtsRegEx); | |
5906 Py_CLEAR(clear_module_state->__pyx_n_s_have_deletions); | |
5907 Py_CLEAR(clear_module_state->__pyx_n_s_header); | |
5908 Py_CLEAR(clear_module_state->__pyx_n_s_header_2); | |
5909 Py_CLEAR(clear_module_state->__pyx_n_s_headings); | |
5910 Py_CLEAR(clear_module_state->__pyx_n_s_i); | |
5911 Py_CLEAR(clear_module_state->__pyx_kp_u_id); | |
5912 Py_CLEAR(clear_module_state->__pyx_n_s_id_2); | |
5913 Py_CLEAR(clear_module_state->__pyx_n_u_id_2); | |
5914 Py_CLEAR(clear_module_state->__pyx_kp_u_id_numbertype_number_type_descri); | |
5915 Py_CLEAR(clear_module_state->__pyx_n_s_idx); | |
5916 Py_CLEAR(clear_module_state->__pyx_n_s_ielts); | |
5917 Py_CLEAR(clear_module_state->__pyx_n_s_ignored_errors); | |
5918 Py_CLEAR(clear_module_state->__pyx_n_s_ignoreerror); | |
5919 Py_CLEAR(clear_module_state->__pyx_n_s_import); | |
5920 Py_CLEAR(clear_module_state->__pyx_kp_u_in_line); | |
5921 Py_CLEAR(clear_module_state->__pyx_n_s_info); | |
5922 Py_CLEAR(clear_module_state->__pyx_n_s_info_2); | |
5923 Py_CLEAR(clear_module_state->__pyx_n_u_info_2); | |
5924 Py_CLEAR(clear_module_state->__pyx_n_s_init); | |
5925 Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); | |
5926 Py_CLEAR(clear_module_state->__pyx_n_s_initializing); | |
5927 Py_CLEAR(clear_module_state->__pyx_n_s_inregion); | |
5928 Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); | |
5929 Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); | |
5930 Py_CLEAR(clear_module_state->__pyx_n_s_itemgetter); | |
5931 Py_CLEAR(clear_module_state->__pyx_n_s_itervalues); | |
5932 Py_CLEAR(clear_module_state->__pyx_n_s_join); | |
5933 Py_CLEAR(clear_module_state->__pyx_n_s_k); | |
5934 Py_CLEAR(clear_module_state->__pyx_n_s_key); | |
5935 Py_CLEAR(clear_module_state->__pyx_n_s_keys); | |
5936 Py_CLEAR(clear_module_state->__pyx_n_s_l); | |
5937 Py_CLEAR(clear_module_state->__pyx_n_s_label); | |
5938 Py_CLEAR(clear_module_state->__pyx_n_s_last); | |
5939 Py_CLEAR(clear_module_state->__pyx_n_s_last_line); | |
5940 Py_CLEAR(clear_module_state->__pyx_n_s_left); | |
5941 Py_CLEAR(clear_module_state->__pyx_n_s_leftalign); | |
5942 Py_CLEAR(clear_module_state->__pyx_n_s_leftalign_2); | |
5943 Py_CLEAR(clear_module_state->__pyx_n_s_line); | |
5944 Py_CLEAR(clear_module_state->__pyx_n_s_line_2); | |
5945 Py_CLEAR(clear_module_state->__pyx_n_s_lineno); | |
5946 Py_CLEAR(clear_module_state->__pyx_n_s_lineparse); | |
5947 Py_CLEAR(clear_module_state->__pyx_n_s_lines); | |
5948 Py_CLEAR(clear_module_state->__pyx_n_s_lines_2); | |
5949 Py_CLEAR(clear_module_state->__pyx_n_s_longest); | |
5950 Py_CLEAR(clear_module_state->__pyx_n_s_main); | |
5951 Py_CLEAR(clear_module_state->__pyx_n_s_map); | |
5952 Py_CLEAR(clear_module_state->__pyx_n_s_match); | |
5953 Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); | |
5954 Py_CLEAR(clear_module_state->__pyx_n_s_min); | |
5955 Py_CLEAR(clear_module_state->__pyx_n_u_missing); | |
5956 Py_CLEAR(clear_module_state->__pyx_n_s_missingvalue); | |
5957 Py_CLEAR(clear_module_state->__pyx_n_s_module); | |
5958 Py_CLEAR(clear_module_state->__pyx_n_s_movable); | |
5959 Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); | |
5960 Py_CLEAR(clear_module_state->__pyx_n_s_n); | |
5961 Py_CLEAR(clear_module_state->__pyx_n_s_na); | |
5962 Py_CLEAR(clear_module_state->__pyx_n_s_name); | |
5963 Py_CLEAR(clear_module_state->__pyx_n_s_namedtuple); | |
5964 Py_CLEAR(clear_module_state->__pyx_kp_u_needs_to_be_checked); | |
5965 Py_CLEAR(clear_module_state->__pyx_n_s_new); | |
5966 Py_CLEAR(clear_module_state->__pyx_n_s_newalts); | |
5967 Py_CLEAR(clear_module_state->__pyx_n_s_nmb); | |
5968 Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); | |
5969 Py_CLEAR(clear_module_state->__pyx_kp_u_nonref_alleles); | |
5970 Py_CLEAR(clear_module_state->__pyx_n_s_number); | |
5971 Py_CLEAR(clear_module_state->__pyx_n_u_number); | |
5972 Py_CLEAR(clear_module_state->__pyx_n_s_numbertype); | |
5973 Py_CLEAR(clear_module_state->__pyx_n_s_object); | |
5974 Py_CLEAR(clear_module_state->__pyx_n_s_operator); | |
5975 Py_CLEAR(clear_module_state->__pyx_n_s_opt); | |
5976 Py_CLEAR(clear_module_state->__pyx_kp_u_output); | |
5977 Py_CLEAR(clear_module_state->__pyx_n_s_output_2); | |
5978 Py_CLEAR(clear_module_state->__pyx_kp_u_parameters_got); | |
5979 Py_CLEAR(clear_module_state->__pyx_n_s_parse); | |
5980 Py_CLEAR(clear_module_state->__pyx_n_s_parse_2); | |
5981 Py_CLEAR(clear_module_state->__pyx_n_s_parse_data); | |
5982 Py_CLEAR(clear_module_state->__pyx_n_s_parse_format); | |
5983 Py_CLEAR(clear_module_state->__pyx_n_s_parse_formatdata); | |
5984 Py_CLEAR(clear_module_state->__pyx_n_s_parse_header); | |
5985 Py_CLEAR(clear_module_state->__pyx_n_s_parse_header_2); | |
5986 Py_CLEAR(clear_module_state->__pyx_n_s_parse_heading); | |
5987 Py_CLEAR(clear_module_state->__pyx_n_s_parse_regions); | |
5988 Py_CLEAR(clear_module_state->__pyx_n_s_parser); | |
5989 Py_CLEAR(clear_module_state->__pyx_kp_u_phased_genotypes); | |
5990 Py_CLEAR(clear_module_state->__pyx_n_s_pickle); | |
5991 Py_CLEAR(clear_module_state->__pyx_n_s_pos); | |
5992 Py_CLEAR(clear_module_state->__pyx_n_u_pos); | |
5993 Py_CLEAR(clear_module_state->__pyx_n_s_pos1); | |
5994 Py_CLEAR(clear_module_state->__pyx_n_s_pos2); | |
5995 Py_CLEAR(clear_module_state->__pyx_n_s_prepare); | |
5996 Py_CLEAR(clear_module_state->__pyx_n_s_pysam); | |
5997 Py_CLEAR(clear_module_state->__pyx_n_s_pysam_libcvcf); | |
5998 Py_CLEAR(clear_module_state->__pyx_kp_s_pysam_libcvcf_pyx); | |
5999 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); | |
6000 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); | |
6001 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); | |
6002 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); | |
6003 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); | |
6004 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_asVCFRecord); | |
6005 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); | |
6006 Py_CLEAR(clear_module_state->__pyx_n_s_qual); | |
6007 Py_CLEAR(clear_module_state->__pyx_n_u_qual); | |
6008 Py_CLEAR(clear_module_state->__pyx_n_s_qualname); | |
6009 Py_CLEAR(clear_module_state->__pyx_n_s_r); | |
6010 Py_CLEAR(clear_module_state->__pyx_n_s_range); | |
6011 Py_CLEAR(clear_module_state->__pyx_n_s_re); | |
6012 Py_CLEAR(clear_module_state->__pyx_n_s_record); | |
6013 Py_CLEAR(clear_module_state->__pyx_n_s_reduce); | |
6014 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); | |
6015 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); | |
6016 Py_CLEAR(clear_module_state->__pyx_n_s_ref); | |
6017 Py_CLEAR(clear_module_state->__pyx_n_u_ref); | |
6018 Py_CLEAR(clear_module_state->__pyx_n_s_ref1); | |
6019 Py_CLEAR(clear_module_state->__pyx_n_s_ref2); | |
6020 Py_CLEAR(clear_module_state->__pyx_n_s_reference); | |
6021 Py_CLEAR(clear_module_state->__pyx_n_s_reference_2); | |
6022 Py_CLEAR(clear_module_state->__pyx_kp_u_reference_is); | |
6023 Py_CLEAR(clear_module_state->__pyx_kp_u_reference_is_2); | |
6024 Py_CLEAR(clear_module_state->__pyx_n_s_region); | |
6025 Py_CLEAR(clear_module_state->__pyx_n_s_regions); | |
6026 Py_CLEAR(clear_module_state->__pyx_n_s_regions_2); | |
6027 Py_CLEAR(clear_module_state->__pyx_n_s_replace); | |
6028 Py_CLEAR(clear_module_state->__pyx_n_s_required); | |
6029 Py_CLEAR(clear_module_state->__pyx_n_s_required_2); | |
6030 Py_CLEAR(clear_module_state->__pyx_n_s_rest); | |
6031 Py_CLEAR(clear_module_state->__pyx_n_s_result); | |
6032 Py_CLEAR(clear_module_state->__pyx_n_s_s); | |
6033 Py_CLEAR(clear_module_state->__pyx_n_s_sample); | |
6034 Py_CLEAR(clear_module_state->__pyx_n_s_sample2column); | |
6035 Py_CLEAR(clear_module_state->__pyx_n_s_samples); | |
6036 Py_CLEAR(clear_module_state->__pyx_kp_u_samples_2); | |
6037 Py_CLEAR(clear_module_state->__pyx_n_s_samples_3); | |
6038 Py_CLEAR(clear_module_state->__pyx_n_s_sdata); | |
6039 Py_CLEAR(clear_module_state->__pyx_n_s_self); | |
6040 Py_CLEAR(clear_module_state->__pyx_n_s_send); | |
6041 Py_CLEAR(clear_module_state->__pyx_n_s_separator); | |
6042 Py_CLEAR(clear_module_state->__pyx_n_s_sequence); | |
6043 Py_CLEAR(clear_module_state->__pyx_n_s_set_name); | |
6044 Py_CLEAR(clear_module_state->__pyx_n_s_setfilter); | |
6045 Py_CLEAR(clear_module_state->__pyx_n_s_setformat); | |
6046 Py_CLEAR(clear_module_state->__pyx_n_s_setheader); | |
6047 Py_CLEAR(clear_module_state->__pyx_n_s_setinfo); | |
6048 Py_CLEAR(clear_module_state->__pyx_n_s_setreference); | |
6049 Py_CLEAR(clear_module_state->__pyx_n_s_setregions); | |
6050 Py_CLEAR(clear_module_state->__pyx_n_s_setsamples); | |
6051 Py_CLEAR(clear_module_state->__pyx_n_s_setstate); | |
6052 Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); | |
6053 Py_CLEAR(clear_module_state->__pyx_n_s_setversion); | |
6054 Py_CLEAR(clear_module_state->__pyx_n_s_shortest); | |
6055 Py_CLEAR(clear_module_state->__pyx_n_s_spec); | |
6056 Py_CLEAR(clear_module_state->__pyx_n_s_split); | |
6057 Py_CLEAR(clear_module_state->__pyx_n_s_start); | |
6058 Py_CLEAR(clear_module_state->__pyx_n_s_startswith); | |
6059 Py_CLEAR(clear_module_state->__pyx_n_s_state); | |
6060 Py_CLEAR(clear_module_state->__pyx_kp_u_sth_entry_not_found); | |
6061 Py_CLEAR(clear_module_state->__pyx_n_s_stream); | |
6062 Py_CLEAR(clear_module_state->__pyx_n_s_string); | |
6063 Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); | |
6064 Py_CLEAR(clear_module_state->__pyx_n_s_strip); | |
6065 Py_CLEAR(clear_module_state->__pyx_n_s_super); | |
6066 Py_CLEAR(clear_module_state->__pyx_n_s_sys); | |
6067 Py_CLEAR(clear_module_state->__pyx_n_s_t); | |
6068 Py_CLEAR(clear_module_state->__pyx_n_s_tabixfile); | |
6069 Py_CLEAR(clear_module_state->__pyx_n_s_test); | |
6070 Py_CLEAR(clear_module_state->__pyx_n_s_throw); | |
6071 Py_CLEAR(clear_module_state->__pyx_n_s_type); | |
6072 Py_CLEAR(clear_module_state->__pyx_n_u_type); | |
6073 Py_CLEAR(clear_module_state->__pyx_n_s_update); | |
6074 Py_CLEAR(clear_module_state->__pyx_n_s_upper); | |
6075 Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); | |
6076 Py_CLEAR(clear_module_state->__pyx_n_s_v); | |
6077 Py_CLEAR(clear_module_state->__pyx_n_s_validate); | |
6078 Py_CLEAR(clear_module_state->__pyx_n_s_value); | |
6079 Py_CLEAR(clear_module_state->__pyx_n_s_values); | |
6080 Py_CLEAR(clear_module_state->__pyx_kp_u_values_in_element); | |
6081 Py_CLEAR(clear_module_state->__pyx_n_s_var); | |
6082 Py_CLEAR(clear_module_state->__pyx_n_s_vcf); | |
6083 Py_CLEAR(clear_module_state->__pyx_n_s_vcffile); | |
6084 Py_CLEAR(clear_module_state->__pyx_n_s_version); | |
6085 Py_CLEAR(clear_module_state->__pyx_n_s_version_2); | |
6086 Py_CLEAR(clear_module_state->__pyx_n_s_warn_errors); | |
6087 Py_CLEAR(clear_module_state->__pyx_n_s_warnerror); | |
6088 Py_CLEAR(clear_module_state->__pyx_n_s_write); | |
6089 Py_CLEAR(clear_module_state->__pyx_n_s_write_data); | |
6090 Py_CLEAR(clear_module_state->__pyx_n_s_write_header); | |
6091 Py_CLEAR(clear_module_state->__pyx_n_s_write_heading); | |
6092 Py_CLEAR(clear_module_state->__pyx_n_s_writeheader); | |
6093 Py_CLEAR(clear_module_state->__pyx_n_s_x); | |
6094 Py_CLEAR(clear_module_state->__pyx_n_s_y); | |
6095 Py_CLEAR(clear_module_state->__pyx_n_s_zip); | |
6096 Py_CLEAR(clear_module_state->__pyx_float_0_0); | |
6097 Py_CLEAR(clear_module_state->__pyx_int_0); | |
6098 Py_CLEAR(clear_module_state->__pyx_int_1); | |
6099 Py_CLEAR(clear_module_state->__pyx_int_2); | |
6100 Py_CLEAR(clear_module_state->__pyx_int_3); | |
6101 Py_CLEAR(clear_module_state->__pyx_int_4); | |
6102 Py_CLEAR(clear_module_state->__pyx_int_5); | |
6103 Py_CLEAR(clear_module_state->__pyx_int_6); | |
6104 Py_CLEAR(clear_module_state->__pyx_int_7); | |
6105 Py_CLEAR(clear_module_state->__pyx_int_8); | |
6106 Py_CLEAR(clear_module_state->__pyx_int_9); | |
6107 Py_CLEAR(clear_module_state->__pyx_int_10); | |
6108 Py_CLEAR(clear_module_state->__pyx_int_11); | |
6109 Py_CLEAR(clear_module_state->__pyx_int_12); | |
6110 Py_CLEAR(clear_module_state->__pyx_int_13); | |
6111 Py_CLEAR(clear_module_state->__pyx_int_14); | |
6112 Py_CLEAR(clear_module_state->__pyx_int_15); | |
6113 Py_CLEAR(clear_module_state->__pyx_int_16); | |
6114 Py_CLEAR(clear_module_state->__pyx_int_17); | |
6115 Py_CLEAR(clear_module_state->__pyx_int_18); | |
6116 Py_CLEAR(clear_module_state->__pyx_int_19); | |
6117 Py_CLEAR(clear_module_state->__pyx_int_20); | |
6118 Py_CLEAR(clear_module_state->__pyx_int_21); | |
6119 Py_CLEAR(clear_module_state->__pyx_int_22); | |
6120 Py_CLEAR(clear_module_state->__pyx_int_23); | |
6121 Py_CLEAR(clear_module_state->__pyx_int_24); | |
6122 Py_CLEAR(clear_module_state->__pyx_int_25); | |
6123 Py_CLEAR(clear_module_state->__pyx_int_26); | |
6124 Py_CLEAR(clear_module_state->__pyx_int_27); | |
6125 Py_CLEAR(clear_module_state->__pyx_int_28); | |
6126 Py_CLEAR(clear_module_state->__pyx_int_29); | |
6127 Py_CLEAR(clear_module_state->__pyx_int_30); | |
6128 Py_CLEAR(clear_module_state->__pyx_int_31); | |
6129 Py_CLEAR(clear_module_state->__pyx_int_32); | |
6130 Py_CLEAR(clear_module_state->__pyx_int_33); | |
6131 Py_CLEAR(clear_module_state->__pyx_int_40); | |
6132 Py_CLEAR(clear_module_state->__pyx_int_100); | |
6133 Py_CLEAR(clear_module_state->__pyx_int_29527880); | |
6134 Py_CLEAR(clear_module_state->__pyx_int_214161357); | |
6135 Py_CLEAR(clear_module_state->__pyx_int_239654613); | |
6136 Py_CLEAR(clear_module_state->__pyx_int_3000000000); | |
6137 Py_CLEAR(clear_module_state->__pyx_int_neg_1); | |
6138 Py_CLEAR(clear_module_state->__pyx_slice__9); | |
6139 Py_CLEAR(clear_module_state->__pyx_slice__17); | |
6140 Py_CLEAR(clear_module_state->__pyx_slice__18); | |
6141 Py_CLEAR(clear_module_state->__pyx_slice__20); | |
6142 Py_CLEAR(clear_module_state->__pyx_slice__26); | |
6143 Py_CLEAR(clear_module_state->__pyx_slice__28); | |
6144 Py_CLEAR(clear_module_state->__pyx_tuple__21); | |
6145 Py_CLEAR(clear_module_state->__pyx_tuple__22); | |
6146 Py_CLEAR(clear_module_state->__pyx_tuple__30); | |
6147 Py_CLEAR(clear_module_state->__pyx_tuple__31); | |
6148 Py_CLEAR(clear_module_state->__pyx_tuple__32); | |
6149 Py_CLEAR(clear_module_state->__pyx_tuple__35); | |
6150 Py_CLEAR(clear_module_state->__pyx_tuple__36); | |
6151 Py_CLEAR(clear_module_state->__pyx_tuple__37); | |
6152 Py_CLEAR(clear_module_state->__pyx_tuple__39); | |
6153 Py_CLEAR(clear_module_state->__pyx_tuple__41); | |
6154 Py_CLEAR(clear_module_state->__pyx_tuple__42); | |
6155 Py_CLEAR(clear_module_state->__pyx_tuple__44); | |
6156 Py_CLEAR(clear_module_state->__pyx_tuple__45); | |
6157 Py_CLEAR(clear_module_state->__pyx_tuple__47); | |
6158 Py_CLEAR(clear_module_state->__pyx_tuple__49); | |
6159 Py_CLEAR(clear_module_state->__pyx_tuple__52); | |
6160 Py_CLEAR(clear_module_state->__pyx_tuple__53); | |
6161 Py_CLEAR(clear_module_state->__pyx_tuple__54); | |
6162 Py_CLEAR(clear_module_state->__pyx_tuple__56); | |
6163 Py_CLEAR(clear_module_state->__pyx_tuple__57); | |
6164 Py_CLEAR(clear_module_state->__pyx_tuple__59); | |
6165 Py_CLEAR(clear_module_state->__pyx_tuple__61); | |
6166 Py_CLEAR(clear_module_state->__pyx_tuple__62); | |
6167 Py_CLEAR(clear_module_state->__pyx_tuple__64); | |
6168 Py_CLEAR(clear_module_state->__pyx_tuple__66); | |
6169 Py_CLEAR(clear_module_state->__pyx_tuple__68); | |
6170 Py_CLEAR(clear_module_state->__pyx_tuple__70); | |
6171 Py_CLEAR(clear_module_state->__pyx_tuple__71); | |
6172 Py_CLEAR(clear_module_state->__pyx_tuple__73); | |
6173 Py_CLEAR(clear_module_state->__pyx_tuple__75); | |
6174 Py_CLEAR(clear_module_state->__pyx_tuple__77); | |
6175 Py_CLEAR(clear_module_state->__pyx_tuple__79); | |
6176 Py_CLEAR(clear_module_state->__pyx_tuple__81); | |
6177 Py_CLEAR(clear_module_state->__pyx_tuple__83); | |
6178 Py_CLEAR(clear_module_state->__pyx_tuple__85); | |
6179 Py_CLEAR(clear_module_state->__pyx_tuple__87); | |
6180 Py_CLEAR(clear_module_state->__pyx_tuple__89); | |
6181 Py_CLEAR(clear_module_state->__pyx_tuple__91); | |
6182 Py_CLEAR(clear_module_state->__pyx_tuple__93); | |
6183 Py_CLEAR(clear_module_state->__pyx_tuple__95); | |
6184 Py_CLEAR(clear_module_state->__pyx_tuple__97); | |
6185 Py_CLEAR(clear_module_state->__pyx_tuple__100); | |
6186 Py_CLEAR(clear_module_state->__pyx_tuple__103); | |
6187 Py_CLEAR(clear_module_state->__pyx_tuple__106); | |
6188 Py_CLEAR(clear_module_state->__pyx_tuple__109); | |
6189 Py_CLEAR(clear_module_state->__pyx_tuple__111); | |
6190 Py_CLEAR(clear_module_state->__pyx_tuple__113); | |
6191 Py_CLEAR(clear_module_state->__pyx_tuple__115); | |
6192 Py_CLEAR(clear_module_state->__pyx_tuple__117); | |
6193 Py_CLEAR(clear_module_state->__pyx_tuple__120); | |
6194 Py_CLEAR(clear_module_state->__pyx_tuple__122); | |
6195 Py_CLEAR(clear_module_state->__pyx_tuple__125); | |
6196 Py_CLEAR(clear_module_state->__pyx_tuple__127); | |
6197 Py_CLEAR(clear_module_state->__pyx_tuple__129); | |
6198 Py_CLEAR(clear_module_state->__pyx_tuple__132); | |
6199 Py_CLEAR(clear_module_state->__pyx_tuple__134); | |
6200 Py_CLEAR(clear_module_state->__pyx_tuple__135); | |
6201 Py_CLEAR(clear_module_state->__pyx_tuple__137); | |
6202 Py_CLEAR(clear_module_state->__pyx_codeobj__29); | |
6203 Py_CLEAR(clear_module_state->__pyx_codeobj__38); | |
6204 Py_CLEAR(clear_module_state->__pyx_codeobj__40); | |
6205 Py_CLEAR(clear_module_state->__pyx_codeobj__43); | |
6206 Py_CLEAR(clear_module_state->__pyx_codeobj__46); | |
6207 Py_CLEAR(clear_module_state->__pyx_codeobj__48); | |
6208 Py_CLEAR(clear_module_state->__pyx_codeobj__50); | |
6209 Py_CLEAR(clear_module_state->__pyx_codeobj__51); | |
6210 Py_CLEAR(clear_module_state->__pyx_codeobj__55); | |
6211 Py_CLEAR(clear_module_state->__pyx_codeobj__58); | |
6212 Py_CLEAR(clear_module_state->__pyx_codeobj__60); | |
6213 Py_CLEAR(clear_module_state->__pyx_codeobj__63); | |
6214 Py_CLEAR(clear_module_state->__pyx_codeobj__65); | |
6215 Py_CLEAR(clear_module_state->__pyx_codeobj__67); | |
6216 Py_CLEAR(clear_module_state->__pyx_codeobj__69); | |
6217 Py_CLEAR(clear_module_state->__pyx_codeobj__72); | |
6218 Py_CLEAR(clear_module_state->__pyx_codeobj__74); | |
6219 Py_CLEAR(clear_module_state->__pyx_codeobj__76); | |
6220 Py_CLEAR(clear_module_state->__pyx_codeobj__78); | |
6221 Py_CLEAR(clear_module_state->__pyx_codeobj__80); | |
6222 Py_CLEAR(clear_module_state->__pyx_codeobj__82); | |
6223 Py_CLEAR(clear_module_state->__pyx_codeobj__84); | |
6224 Py_CLEAR(clear_module_state->__pyx_codeobj__86); | |
6225 Py_CLEAR(clear_module_state->__pyx_codeobj__88); | |
6226 Py_CLEAR(clear_module_state->__pyx_codeobj__90); | |
6227 Py_CLEAR(clear_module_state->__pyx_codeobj__92); | |
6228 Py_CLEAR(clear_module_state->__pyx_codeobj__94); | |
6229 Py_CLEAR(clear_module_state->__pyx_codeobj__96); | |
6230 Py_CLEAR(clear_module_state->__pyx_codeobj__98); | |
6231 Py_CLEAR(clear_module_state->__pyx_codeobj__99); | |
6232 Py_CLEAR(clear_module_state->__pyx_codeobj__101); | |
6233 Py_CLEAR(clear_module_state->__pyx_codeobj__102); | |
6234 Py_CLEAR(clear_module_state->__pyx_codeobj__104); | |
6235 Py_CLEAR(clear_module_state->__pyx_codeobj__105); | |
6236 Py_CLEAR(clear_module_state->__pyx_codeobj__107); | |
6237 Py_CLEAR(clear_module_state->__pyx_codeobj__108); | |
6238 Py_CLEAR(clear_module_state->__pyx_codeobj__110); | |
6239 Py_CLEAR(clear_module_state->__pyx_codeobj__112); | |
6240 Py_CLEAR(clear_module_state->__pyx_codeobj__114); | |
6241 Py_CLEAR(clear_module_state->__pyx_codeobj__116); | |
6242 Py_CLEAR(clear_module_state->__pyx_codeobj__118); | |
6243 Py_CLEAR(clear_module_state->__pyx_codeobj__119); | |
6244 Py_CLEAR(clear_module_state->__pyx_codeobj__121); | |
6245 Py_CLEAR(clear_module_state->__pyx_codeobj__123); | |
6246 Py_CLEAR(clear_module_state->__pyx_codeobj__124); | |
6247 Py_CLEAR(clear_module_state->__pyx_codeobj__126); | |
6248 Py_CLEAR(clear_module_state->__pyx_codeobj__128); | |
6249 Py_CLEAR(clear_module_state->__pyx_codeobj__130); | |
6250 Py_CLEAR(clear_module_state->__pyx_codeobj__131); | |
6251 Py_CLEAR(clear_module_state->__pyx_codeobj__133); | |
6252 Py_CLEAR(clear_module_state->__pyx_codeobj__136); | |
6253 Py_CLEAR(clear_module_state->__pyx_codeobj__138); | |
6254 return 0; | |
6255 } | |
6256 #endif | |
6257 /* #### Code section: module_state_traverse ### */ | |
6258 #if CYTHON_USE_MODULE_STATE | |
6259 static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { | |
6260 __pyx_mstate *traverse_module_state = __pyx_mstate(m); | |
6261 if (!traverse_module_state) return 0; | |
6262 Py_VISIT(traverse_module_state->__pyx_d); | |
6263 Py_VISIT(traverse_module_state->__pyx_b); | |
6264 Py_VISIT(traverse_module_state->__pyx_cython_runtime); | |
6265 Py_VISIT(traverse_module_state->__pyx_empty_tuple); | |
6266 Py_VISIT(traverse_module_state->__pyx_empty_bytes); | |
6267 Py_VISIT(traverse_module_state->__pyx_empty_unicode); | |
6268 #ifdef __Pyx_CyFunction_USED | |
6269 Py_VISIT(traverse_module_state->__pyx_CyFunctionType); | |
6270 #endif | |
6271 #ifdef __Pyx_FusedFunction_USED | |
6272 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); | |
6273 #endif | |
6274 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile); | |
6275 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_tabix_file_iterator); | |
6276 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_TabixFile); | |
6277 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_Parser); | |
6278 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asTuple); | |
6279 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asGTF); | |
6280 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asGFF3); | |
6281 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asBed); | |
6282 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asVCF); | |
6283 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_TabixIterator); | |
6284 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed); | |
6285 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_GZIterator); | |
6286 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_GZIteratorHead); | |
6287 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_GZIteratorParsed); | |
6288 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_Tabixfile); | |
6289 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_TupleProxy); | |
6290 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator); | |
6291 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy); | |
6292 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_GTFProxy); | |
6293 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy); | |
6294 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_BedProxy); | |
6295 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_VCFProxy); | |
6296 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); | |
6297 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); | |
6298 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); | |
6299 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_5array_array); | |
6300 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_7libcvcf_VCFRecord); | |
6301 Py_VISIT(traverse_module_state->__pyx_type_5pysam_7libcvcf_VCFRecord); | |
6302 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_7libcvcf_asVCFRecord); | |
6303 Py_VISIT(traverse_module_state->__pyx_type_5pysam_7libcvcf_asVCFRecord); | |
6304 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse); | |
6305 Py_VISIT(traverse_module_state->__pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse); | |
6306 Py_VISIT(traverse_module_state->__pyx_kp_u_); | |
6307 Py_VISIT(traverse_module_state->__pyx_kp_b_0); | |
6308 Py_VISIT(traverse_module_state->__pyx_kp_u_0); | |
6309 Py_VISIT(traverse_module_state->__pyx_n_u_A); | |
6310 Py_VISIT(traverse_module_state->__pyx_n_u_ACGTN); | |
6311 Py_VISIT(traverse_module_state->__pyx_kp_u_ACGTN_2); | |
6312 Py_VISIT(traverse_module_state->__pyx_n_u_ALT); | |
6313 Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); | |
6314 Py_VISIT(traverse_module_state->__pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); | |
6315 Py_VISIT(traverse_module_state->__pyx_kp_u_BADLY_FORMATTED_FORMAT_STRING_Fo); | |
6316 Py_VISIT(traverse_module_state->__pyx_n_s_BADLY_FORMATTED_HEADING); | |
6317 Py_VISIT(traverse_module_state->__pyx_kp_u_BADLY_FORMATTED_HEADING_Did_not); | |
6318 Py_VISIT(traverse_module_state->__pyx_kp_u_BAD_CHR_TAG_Error_calculating_ch); | |
6319 Py_VISIT(traverse_module_state->__pyx_n_s_BAD_GENOTYPE); | |
6320 Py_VISIT(traverse_module_state->__pyx_kp_u_BAD_GENOTYPE_Cannot_parse_genoty); | |
6321 Py_VISIT(traverse_module_state->__pyx_n_s_BAD_NUMBER_OF_COLUMNS); | |
6322 Py_VISIT(traverse_module_state->__pyx_kp_u_BAD_NUMBER_OF_COLUMNS_Wrong_numb); | |
6323 Py_VISIT(traverse_module_state->__pyx_n_s_BAD_NUMBER_OF_PARAMETERS); | |
6324 Py_VISIT(traverse_module_state->__pyx_kp_u_BAD_NUMBER_OF_PARAMETERS_Found_u); | |
6325 Py_VISIT(traverse_module_state->__pyx_n_s_BAD_NUMBER_OF_VALUES); | |
6326 Py_VISIT(traverse_module_state->__pyx_kp_u_BAD_NUMBER_OF_VALUES_Found_too_m); | |
6327 Py_VISIT(traverse_module_state->__pyx_n_u_CHROM); | |
6328 Py_VISIT(traverse_module_state->__pyx_kp_u_Can_only_handle_v3_3_and_v4_0_VC); | |
6329 Py_VISIT(traverse_module_state->__pyx_n_u_Character); | |
6330 Py_VISIT(traverse_module_state->__pyx_kp_u_Conditional_genotype_quality); | |
6331 Py_VISIT(traverse_module_state->__pyx_n_u_D); | |
6332 Py_VISIT(traverse_module_state->__pyx_n_u_DP); | |
6333 Py_VISIT(traverse_module_state->__pyx_kp_u_Description); | |
6334 Py_VISIT(traverse_module_state->__pyx_n_u_Description_2); | |
6335 Py_VISIT(traverse_module_state->__pyx_kp_u_Don_t_understand_region_string_s); | |
6336 Py_VISIT(traverse_module_state->__pyx_n_u_EC); | |
6337 Py_VISIT(traverse_module_state->__pyx_n_s_ERROR_FLAG_HAS_VALUE); | |
6338 Py_VISIT(traverse_module_state->__pyx_kp_u_ERROR_FLAG_HAS_VALUE_Flag_fields); | |
6339 Py_VISIT(traverse_module_state->__pyx_n_s_ERROR_FORMAT_NOT_CHAR); | |
6340 Py_VISIT(traverse_module_state->__pyx_kp_u_ERROR_FORMAT_NOT_CHAR_Eexpected); | |
6341 Py_VISIT(traverse_module_state->__pyx_n_s_ERROR_FORMAT_NOT_INTEGER); | |
6342 Py_VISIT(traverse_module_state->__pyx_kp_u_ERROR_FORMAT_NOT_INTEGER_Expecte); | |
6343 Py_VISIT(traverse_module_state->__pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL); | |
6344 Py_VISIT(traverse_module_state->__pyx_kp_u_ERROR_FORMAT_NOT_NUMERICAL_Expec); | |
6345 Py_VISIT(traverse_module_state->__pyx_n_s_ERROR_INFO_STRING); | |
6346 Py_VISIT(traverse_module_state->__pyx_kp_u_ERROR_INFO_STRING_Error_while_pa); | |
6347 Py_VISIT(traverse_module_state->__pyx_n_s_ERROR_TRAILING_DATA); | |
6348 Py_VISIT(traverse_module_state->__pyx_kp_u_ERROR_TRAILING_DATA_Numerical_fi); | |
6349 Py_VISIT(traverse_module_state->__pyx_n_s_ERROR_UNKNOWN_KEY); | |
6350 Py_VISIT(traverse_module_state->__pyx_kp_u_ERROR_UNKNOWN_KEY_Unknown_key_s); | |
6351 Py_VISIT(traverse_module_state->__pyx_n_u_Error); | |
6352 Py_VISIT(traverse_module_state->__pyx_kp_u_Expected_alternate_allel_counts); | |
6353 Py_VISIT(traverse_module_state->__pyx_n_u_FILTER); | |
6354 Py_VISIT(traverse_module_state->__pyx_n_s_FILTER_NOT_DEFINED); | |
6355 Py_VISIT(traverse_module_state->__pyx_kp_u_FILTER_NOT_DEFINED_Identifier_s); | |
6356 Py_VISIT(traverse_module_state->__pyx_n_s_FORMAT); | |
6357 Py_VISIT(traverse_module_state->__pyx_n_u_FORMAT); | |
6358 Py_VISIT(traverse_module_state->__pyx_n_s_FORMAT_MISSING_QUOTES); | |
6359 Py_VISIT(traverse_module_state->__pyx_kp_u_FORMAT_MISSING_QUOTES_Descriptio); | |
6360 Py_VISIT(traverse_module_state->__pyx_n_s_FORMAT_NOT_DEFINED); | |
6361 Py_VISIT(traverse_module_state->__pyx_kp_u_FORMAT_NOT_DEFINED_Identifier_s); | |
6362 Py_VISIT(traverse_module_state->__pyx_n_u_FT); | |
6363 Py_VISIT(traverse_module_state->__pyx_n_u_Flag); | |
6364 Py_VISIT(traverse_module_state->__pyx_n_u_Float); | |
6365 Py_VISIT(traverse_module_state->__pyx_n_u_G); | |
6366 Py_VISIT(traverse_module_state->__pyx_n_u_GL); | |
6367 Py_VISIT(traverse_module_state->__pyx_n_u_GLE); | |
6368 Py_VISIT(traverse_module_state->__pyx_n_u_GP); | |
6369 Py_VISIT(traverse_module_state->__pyx_n_u_GQ); | |
6370 Py_VISIT(traverse_module_state->__pyx_n_u_GT); | |
6371 Py_VISIT(traverse_module_state->__pyx_n_s_GTdata); | |
6372 Py_VISIT(traverse_module_state->__pyx_n_s_GTstring); | |
6373 Py_VISIT(traverse_module_state->__pyx_n_u_Genotype); | |
6374 Py_VISIT(traverse_module_state->__pyx_kp_u_Genotype_Quality); | |
6375 Py_VISIT(traverse_module_state->__pyx_kp_u_Genotype_likelihoods); | |
6376 Py_VISIT(traverse_module_state->__pyx_kp_u_Genotype_posterior_probabilities); | |
6377 Py_VISIT(traverse_module_state->__pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS); | |
6378 Py_VISIT(traverse_module_state->__pyx_kp_u_HEADING_NOT_SEPARATED_BY_TABS_He); | |
6379 Py_VISIT(traverse_module_state->__pyx_n_u_HQ); | |
6380 Py_VISIT(traverse_module_state->__pyx_kp_u_Haplotype_Quality); | |
6381 Py_VISIT(traverse_module_state->__pyx_n_u_I); | |
6382 Py_VISIT(traverse_module_state->__pyx_kp_u_ID); | |
6383 Py_VISIT(traverse_module_state->__pyx_n_u_ID_2); | |
6384 Py_VISIT(traverse_module_state->__pyx_n_u_INFO); | |
6385 Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); | |
6386 Py_VISIT(traverse_module_state->__pyx_n_u_Integer); | |
6387 Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_error_string_s); | |
6388 Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); | |
6389 Py_VISIT(traverse_module_state->__pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE); | |
6390 Py_VISIT(traverse_module_state->__pyx_kp_u_MISSING_INDEL_ALLELE_REF_BASE_In); | |
6391 Py_VISIT(traverse_module_state->__pyx_n_s_MISSING_REF); | |
6392 Py_VISIT(traverse_module_state->__pyx_kp_u_MISSING_REF_Reference_allele_mis); | |
6393 Py_VISIT(traverse_module_state->__pyx_n_u_MQ); | |
6394 Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); | |
6395 Py_VISIT(traverse_module_state->__pyx_n_u_N); | |
6396 Py_VISIT(traverse_module_state->__pyx_n_s_NT_ALLELES); | |
6397 Py_VISIT(traverse_module_state->__pyx_n_s_NT_GENOTYPES); | |
6398 Py_VISIT(traverse_module_state->__pyx_n_s_NT_NR_ALLELES); | |
6399 Py_VISIT(traverse_module_state->__pyx_n_s_NT_NUMBER); | |
6400 Py_VISIT(traverse_module_state->__pyx_n_s_NT_PHASED_GENOTYPES); | |
6401 Py_VISIT(traverse_module_state->__pyx_n_s_NT_UNKNOWN); | |
6402 Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); | |
6403 Py_VISIT(traverse_module_state->__pyx_kp_u_Number); | |
6404 Py_VISIT(traverse_module_state->__pyx_n_u_Number_2); | |
6405 Py_VISIT(traverse_module_state->__pyx_n_b_PASS); | |
6406 Py_VISIT(traverse_module_state->__pyx_n_u_PASS); | |
6407 Py_VISIT(traverse_module_state->__pyx_n_u_PL); | |
6408 Py_VISIT(traverse_module_state->__pyx_n_u_POS); | |
6409 Py_VISIT(traverse_module_state->__pyx_n_s_POS_NOT_NUMERICAL); | |
6410 Py_VISIT(traverse_module_state->__pyx_kp_u_POS_NOT_NUMERICAL_Position_colum); | |
6411 Py_VISIT(traverse_module_state->__pyx_n_s_POS_NOT_POSITIVE); | |
6412 Py_VISIT(traverse_module_state->__pyx_kp_u_POS_NOT_POSITIVE_Position_field); | |
6413 Py_VISIT(traverse_module_state->__pyx_n_u_PQ); | |
6414 Py_VISIT(traverse_module_state->__pyx_n_u_PS); | |
6415 Py_VISIT(traverse_module_state->__pyx_kp_u_Phase_set); | |
6416 Py_VISIT(traverse_module_state->__pyx_kp_u_Phasing_quality); | |
6417 Py_VISIT(traverse_module_state->__pyx_kp_u_Phred_scaled_genotype_likelihood); | |
6418 Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); | |
6419 Py_VISIT(traverse_module_state->__pyx_n_u_QUAL); | |
6420 Py_VISIT(traverse_module_state->__pyx_n_s_QUAL_NOT_NUMERICAL); | |
6421 Py_VISIT(traverse_module_state->__pyx_kp_u_QUAL_NOT_NUMERICAL_Quality_field); | |
6422 Py_VISIT(traverse_module_state->__pyx_n_u_REF); | |
6423 Py_VISIT(traverse_module_state->__pyx_kp_u_RMS_mapping_quality); | |
6424 Py_VISIT(traverse_module_state->__pyx_kp_u_Read_depth_at_this_position_for); | |
6425 Py_VISIT(traverse_module_state->__pyx_kp_u_Required_key_s_not_found_in_data); | |
6426 Py_VISIT(traverse_module_state->__pyx_kp_u_Sample_Genotype_Filter); | |
6427 Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration); | |
6428 Py_VISIT(traverse_module_state->__pyx_n_u_String); | |
6429 Py_VISIT(traverse_module_state->__pyx_n_s_Tabixfile); | |
6430 Py_VISIT(traverse_module_state->__pyx_kp_u_Type); | |
6431 Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); | |
6432 Py_VISIT(traverse_module_state->__pyx_n_u_Type_2); | |
6433 Py_VISIT(traverse_module_state->__pyx_n_s_UNKNOWN_CHAR_IN_REF); | |
6434 Py_VISIT(traverse_module_state->__pyx_kp_u_UNKNOWN_CHAR_IN_REF_Unknown_char); | |
6435 Py_VISIT(traverse_module_state->__pyx_n_s_UNKNOWN_FORMAT_STRING); | |
6436 Py_VISIT(traverse_module_state->__pyx_kp_u_UNKNOWN_FORMAT_STRING_Unknown_fi); | |
6437 Py_VISIT(traverse_module_state->__pyx_kp_u_Undefined_tag); | |
6438 Py_VISIT(traverse_module_state->__pyx_kp_u_Unknown_number_type_encountered); | |
6439 Py_VISIT(traverse_module_state->__pyx_n_s_V33_BAD_ALLELE); | |
6440 Py_VISIT(traverse_module_state->__pyx_kp_u_V33_BAD_ALLELE_Cannot_interpret); | |
6441 Py_VISIT(traverse_module_state->__pyx_n_s_V33_BAD_REF); | |
6442 Py_VISIT(traverse_module_state->__pyx_kp_u_V33_BAD_REF_Reference_should_be); | |
6443 Py_VISIT(traverse_module_state->__pyx_n_s_V33_UNMATCHED_DELETION); | |
6444 Py_VISIT(traverse_module_state->__pyx_kp_u_V33_UNMATCHED_DELETION_Deleted_s); | |
6445 Py_VISIT(traverse_module_state->__pyx_n_s_V40_BAD_ALLELE); | |
6446 Py_VISIT(traverse_module_state->__pyx_kp_u_V40_BAD_ALLELE_Bad_allele_found); | |
6447 Py_VISIT(traverse_module_state->__pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD); | |
6448 Py_VISIT(traverse_module_state->__pyx_kp_u_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2); | |
6449 Py_VISIT(traverse_module_state->__pyx_n_s_V40_MISSING_ANGLE_BRACKETS); | |
6450 Py_VISIT(traverse_module_state->__pyx_kp_u_V40_MISSING_ANGLE_BRACKETS_Forma); | |
6451 Py_VISIT(traverse_module_state->__pyx_n_s_VCF); | |
6452 Py_VISIT(traverse_module_state->__pyx_n_u_VCF); | |
6453 Py_VISIT(traverse_module_state->__pyx_n_s_VCFRecord); | |
6454 Py_VISIT(traverse_module_state->__pyx_n_u_VCFRecord); | |
6455 Py_VISIT(traverse_module_state->__pyx_n_s_VCFRecord___reduce_cython); | |
6456 Py_VISIT(traverse_module_state->__pyx_n_s_VCFRecord___setstate_cython); | |
6457 Py_VISIT(traverse_module_state->__pyx_n_s_VCFRecord_error); | |
6458 Py_VISIT(traverse_module_state->__pyx_n_s_VCF___del); | |
6459 Py_VISIT(traverse_module_state->__pyx_n_s_VCF___init); | |
6460 Py_VISIT(traverse_module_state->__pyx_n_s_VCF__add_definition); | |
6461 Py_VISIT(traverse_module_state->__pyx_n_s_VCF__parse); | |
6462 Py_VISIT(traverse_module_state->__pyx_n_s_VCF__parse_header); | |
6463 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_close); | |
6464 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_compare_calls); | |
6465 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_connect); | |
6466 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_convertGT); | |
6467 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_convertGTback); | |
6468 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_enter_default_format); | |
6469 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_error); | |
6470 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_fetch); | |
6471 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_format_format); | |
6472 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_format_formatdata); | |
6473 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_get_expected); | |
6474 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_getfilter); | |
6475 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_getformat); | |
6476 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_getheader); | |
6477 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_getinfo); | |
6478 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_getsamples); | |
6479 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_ignoreerror); | |
6480 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_inregion); | |
6481 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_parse); | |
6482 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_parse_data); | |
6483 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_parse_format); | |
6484 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_parse_formatdata); | |
6485 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_parse_header); | |
6486 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_parse_heading); | |
6487 Py_VISIT(traverse_module_state->__pyx_kp_u_VCF_says); | |
6488 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_setfilter); | |
6489 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_setformat); | |
6490 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_setheader); | |
6491 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_setinfo); | |
6492 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_setreference); | |
6493 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_setregions); | |
6494 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_setsamples); | |
6495 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_setversion); | |
6496 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_validate); | |
6497 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_warnerror); | |
6498 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_write); | |
6499 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_write_data); | |
6500 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_write_header); | |
6501 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_write_heading); | |
6502 Py_VISIT(traverse_module_state->__pyx_n_s_VCF_writeheader); | |
6503 Py_VISIT(traverse_module_state->__pyx_kp_u_VCFv3_3); | |
6504 Py_VISIT(traverse_module_state->__pyx_kp_u_VCFv4_0); | |
6505 Py_VISIT(traverse_module_state->__pyx_kp_u_VCFv4_1); | |
6506 Py_VISIT(traverse_module_state->__pyx_kp_u_VCFv4_2); | |
6507 Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); | |
6508 Py_VISIT(traverse_module_state->__pyx_n_s_WRONG_REF); | |
6509 Py_VISIT(traverse_module_state->__pyx_kp_u_WRONG_REF_Wrong_reference_s); | |
6510 Py_VISIT(traverse_module_state->__pyx_n_u_Warning); | |
6511 Py_VISIT(traverse_module_state->__pyx_n_s_ZERO_FOR_NON_FLAG_FIELD); | |
6512 Py_VISIT(traverse_module_state->__pyx_kp_u_ZERO_FOR_NON_FLAG_FIELD_number_s); | |
6513 Py_VISIT(traverse_module_state->__pyx_n_s_ZERO_LENGTH_ALLELE); | |
6514 Py_VISIT(traverse_module_state->__pyx_kp_u_ZERO_LENGTH_ALLELE_Found_zero_le); | |
6515 Py_VISIT(traverse_module_state->__pyx_kp_u__10); | |
6516 Py_VISIT(traverse_module_state->__pyx_kp_u__11); | |
6517 Py_VISIT(traverse_module_state->__pyx_kp_u__12); | |
6518 Py_VISIT(traverse_module_state->__pyx_kp_u__13); | |
6519 Py_VISIT(traverse_module_state->__pyx_n_s__139); | |
6520 Py_VISIT(traverse_module_state->__pyx_kp_u__14); | |
6521 Py_VISIT(traverse_module_state->__pyx_kp_u__15); | |
6522 Py_VISIT(traverse_module_state->__pyx_kp_u__16); | |
6523 Py_VISIT(traverse_module_state->__pyx_kp_u__19); | |
6524 Py_VISIT(traverse_module_state->__pyx_kp_u__2); | |
6525 Py_VISIT(traverse_module_state->__pyx_kp_u__23); | |
6526 Py_VISIT(traverse_module_state->__pyx_kp_u__24); | |
6527 Py_VISIT(traverse_module_state->__pyx_kp_u__25); | |
6528 Py_VISIT(traverse_module_state->__pyx_kp_u__27); | |
6529 Py_VISIT(traverse_module_state->__pyx_kp_u__3); | |
6530 Py_VISIT(traverse_module_state->__pyx_n_s__33); | |
6531 Py_VISIT(traverse_module_state->__pyx_kp_u__34); | |
6532 Py_VISIT(traverse_module_state->__pyx_kp_u__4); | |
6533 Py_VISIT(traverse_module_state->__pyx_kp_b__5); | |
6534 Py_VISIT(traverse_module_state->__pyx_kp_u__5); | |
6535 Py_VISIT(traverse_module_state->__pyx_kp_u__6); | |
6536 Py_VISIT(traverse_module_state->__pyx_kp_u__7); | |
6537 Py_VISIT(traverse_module_state->__pyx_kp_u__8); | |
6538 Py_VISIT(traverse_module_state->__pyx_n_s_a); | |
6539 Py_VISIT(traverse_module_state->__pyx_n_s_add); | |
6540 Py_VISIT(traverse_module_state->__pyx_n_s_add_definition); | |
6541 Py_VISIT(traverse_module_state->__pyx_n_s_addn); | |
6542 Py_VISIT(traverse_module_state->__pyx_n_s_addns); | |
6543 Py_VISIT(traverse_module_state->__pyx_n_s_all); | |
6544 Py_VISIT(traverse_module_state->__pyx_n_s_allele); | |
6545 Py_VISIT(traverse_module_state->__pyx_n_s_alleleRegEx); | |
6546 Py_VISIT(traverse_module_state->__pyx_kp_u_alleles); | |
6547 Py_VISIT(traverse_module_state->__pyx_n_s_alt); | |
6548 Py_VISIT(traverse_module_state->__pyx_n_u_alt); | |
6549 Py_VISIT(traverse_module_state->__pyx_n_s_alt1); | |
6550 Py_VISIT(traverse_module_state->__pyx_n_s_alt2); | |
6551 Py_VISIT(traverse_module_state->__pyx_n_s_append); | |
6552 Py_VISIT(traverse_module_state->__pyx_n_s_args); | |
6553 Py_VISIT(traverse_module_state->__pyx_n_s_asVCFRecord); | |
6554 Py_VISIT(traverse_module_state->__pyx_n_s_asVCFRecord___reduce_cython); | |
6555 Py_VISIT(traverse_module_state->__pyx_n_s_asVCFRecord___setstate_cython); | |
6556 Py_VISIT(traverse_module_state->__pyx_n_u_ascii); | |
6557 Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); | |
6558 Py_VISIT(traverse_module_state->__pyx_n_s_bisect); | |
6559 Py_VISIT(traverse_module_state->__pyx_n_s_blurp); | |
6560 Py_VISIT(traverse_module_state->__pyx_n_s_c); | |
6561 Py_VISIT(traverse_module_state->__pyx_n_s_chrom); | |
6562 Py_VISIT(traverse_module_state->__pyx_n_u_chrom); | |
6563 Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); | |
6564 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); | |
6565 Py_VISIT(traverse_module_state->__pyx_n_s_close); | |
6566 Py_VISIT(traverse_module_state->__pyx_n_s_collections); | |
6567 Py_VISIT(traverse_module_state->__pyx_n_s_cols); | |
6568 Py_VISIT(traverse_module_state->__pyx_n_s_compare_calls); | |
6569 Py_VISIT(traverse_module_state->__pyx_n_s_compile); | |
6570 Py_VISIT(traverse_module_state->__pyx_n_s_connect); | |
6571 Py_VISIT(traverse_module_state->__pyx_n_s_convertGT); | |
6572 Py_VISIT(traverse_module_state->__pyx_n_s_convertGTback); | |
6573 Py_VISIT(traverse_module_state->__pyx_n_s_copy); | |
6574 Py_VISIT(traverse_module_state->__pyx_n_s_copy_2); | |
6575 Py_VISIT(traverse_module_state->__pyx_n_s_d); | |
6576 Py_VISIT(traverse_module_state->__pyx_n_s_data); | |
6577 Py_VISIT(traverse_module_state->__pyx_n_s_datagenerator); | |
6578 Py_VISIT(traverse_module_state->__pyx_n_s_deepcopy); | |
6579 Py_VISIT(traverse_module_state->__pyx_n_s_defaultdict); | |
6580 Py_VISIT(traverse_module_state->__pyx_n_s_del); | |
6581 Py_VISIT(traverse_module_state->__pyx_kp_u_deletion_is); | |
6582 Py_VISIT(traverse_module_state->__pyx_n_u_descr); | |
6583 Py_VISIT(traverse_module_state->__pyx_n_s_description); | |
6584 Py_VISIT(traverse_module_state->__pyx_n_s_dict); | |
6585 Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); | |
6586 Py_VISIT(traverse_module_state->__pyx_n_s_dict_3); | |
6587 Py_VISIT(traverse_module_state->__pyx_kp_u_disable); | |
6588 Py_VISIT(traverse_module_state->__pyx_n_s_doc); | |
6589 Py_VISIT(traverse_module_state->__pyx_n_s_elts); | |
6590 Py_VISIT(traverse_module_state->__pyx_kp_u_enable); | |
6591 Py_VISIT(traverse_module_state->__pyx_n_s_encoding); | |
6592 Py_VISIT(traverse_module_state->__pyx_n_s_end); | |
6593 Py_VISIT(traverse_module_state->__pyx_n_s_endswith); | |
6594 Py_VISIT(traverse_module_state->__pyx_n_s_enter_default_format); | |
6595 Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); | |
6596 Py_VISIT(traverse_module_state->__pyx_n_s_err); | |
6597 Py_VISIT(traverse_module_state->__pyx_n_s_error); | |
6598 Py_VISIT(traverse_module_state->__pyx_n_s_errorlabel); | |
6599 Py_VISIT(traverse_module_state->__pyx_n_s_errors); | |
6600 Py_VISIT(traverse_module_state->__pyx_n_s_errorstring); | |
6601 Py_VISIT(traverse_module_state->__pyx_n_s_errwarn); | |
6602 Py_VISIT(traverse_module_state->__pyx_kp_u_expected); | |
6603 Py_VISIT(traverse_module_state->__pyx_kp_u_expected_2); | |
6604 Py_VISIT(traverse_module_state->__pyx_kp_u_expected_3); | |
6605 Py_VISIT(traverse_module_state->__pyx_n_s_expected_4); | |
6606 Py_VISIT(traverse_module_state->__pyx_n_s_f); | |
6607 Py_VISIT(traverse_module_state->__pyx_n_s_fa); | |
6608 Py_VISIT(traverse_module_state->__pyx_n_s_faref); | |
6609 Py_VISIT(traverse_module_state->__pyx_n_s_faref_leftflank); | |
6610 Py_VISIT(traverse_module_state->__pyx_n_s_fetch); | |
6611 Py_VISIT(traverse_module_state->__pyx_n_u_fileformat); | |
6612 Py_VISIT(traverse_module_state->__pyx_kp_u_fileformat_VCFv); | |
6613 Py_VISIT(traverse_module_state->__pyx_n_s_filename); | |
6614 Py_VISIT(traverse_module_state->__pyx_n_s_filter); | |
6615 Py_VISIT(traverse_module_state->__pyx_n_s_filter_2); | |
6616 Py_VISIT(traverse_module_state->__pyx_n_u_filter_2); | |
6617 Py_VISIT(traverse_module_state->__pyx_n_s_find); | |
6618 Py_VISIT(traverse_module_state->__pyx_n_s_first); | |
6619 Py_VISIT(traverse_module_state->__pyx_n_s_fmt); | |
6620 Py_VISIT(traverse_module_state->__pyx_kp_u_for); | |
6621 Py_VISIT(traverse_module_state->__pyx_n_s_format); | |
6622 Py_VISIT(traverse_module_state->__pyx_n_u_format); | |
6623 Py_VISIT(traverse_module_state->__pyx_n_s_format_2); | |
6624 Py_VISIT(traverse_module_state->__pyx_n_s_format_format); | |
6625 Py_VISIT(traverse_module_state->__pyx_n_s_format_formatdata); | |
6626 Py_VISIT(traverse_module_state->__pyx_n_s_formatdict); | |
6627 Py_VISIT(traverse_module_state->__pyx_kp_u_found); | |
6628 Py_VISIT(traverse_module_state->__pyx_kp_u_gc); | |
6629 Py_VISIT(traverse_module_state->__pyx_kp_u_genotypes); | |
6630 Py_VISIT(traverse_module_state->__pyx_n_s_get); | |
6631 Py_VISIT(traverse_module_state->__pyx_n_s_get_expected); | |
6632 Py_VISIT(traverse_module_state->__pyx_n_s_get_sequence); | |
6633 Py_VISIT(traverse_module_state->__pyx_n_s_getfilter); | |
6634 Py_VISIT(traverse_module_state->__pyx_n_s_getformat); | |
6635 Py_VISIT(traverse_module_state->__pyx_n_s_getheader); | |
6636 Py_VISIT(traverse_module_state->__pyx_n_s_getinfo); | |
6637 Py_VISIT(traverse_module_state->__pyx_n_s_getsamples); | |
6638 Py_VISIT(traverse_module_state->__pyx_n_s_getstate); | |
6639 Py_VISIT(traverse_module_state->__pyx_kp_u_got); | |
6640 Py_VISIT(traverse_module_state->__pyx_n_s_gts); | |
6641 Py_VISIT(traverse_module_state->__pyx_n_s_gtsRegEx); | |
6642 Py_VISIT(traverse_module_state->__pyx_n_s_have_deletions); | |
6643 Py_VISIT(traverse_module_state->__pyx_n_s_header); | |
6644 Py_VISIT(traverse_module_state->__pyx_n_s_header_2); | |
6645 Py_VISIT(traverse_module_state->__pyx_n_s_headings); | |
6646 Py_VISIT(traverse_module_state->__pyx_n_s_i); | |
6647 Py_VISIT(traverse_module_state->__pyx_kp_u_id); | |
6648 Py_VISIT(traverse_module_state->__pyx_n_s_id_2); | |
6649 Py_VISIT(traverse_module_state->__pyx_n_u_id_2); | |
6650 Py_VISIT(traverse_module_state->__pyx_kp_u_id_numbertype_number_type_descri); | |
6651 Py_VISIT(traverse_module_state->__pyx_n_s_idx); | |
6652 Py_VISIT(traverse_module_state->__pyx_n_s_ielts); | |
6653 Py_VISIT(traverse_module_state->__pyx_n_s_ignored_errors); | |
6654 Py_VISIT(traverse_module_state->__pyx_n_s_ignoreerror); | |
6655 Py_VISIT(traverse_module_state->__pyx_n_s_import); | |
6656 Py_VISIT(traverse_module_state->__pyx_kp_u_in_line); | |
6657 Py_VISIT(traverse_module_state->__pyx_n_s_info); | |
6658 Py_VISIT(traverse_module_state->__pyx_n_s_info_2); | |
6659 Py_VISIT(traverse_module_state->__pyx_n_u_info_2); | |
6660 Py_VISIT(traverse_module_state->__pyx_n_s_init); | |
6661 Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); | |
6662 Py_VISIT(traverse_module_state->__pyx_n_s_initializing); | |
6663 Py_VISIT(traverse_module_state->__pyx_n_s_inregion); | |
6664 Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); | |
6665 Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); | |
6666 Py_VISIT(traverse_module_state->__pyx_n_s_itemgetter); | |
6667 Py_VISIT(traverse_module_state->__pyx_n_s_itervalues); | |
6668 Py_VISIT(traverse_module_state->__pyx_n_s_join); | |
6669 Py_VISIT(traverse_module_state->__pyx_n_s_k); | |
6670 Py_VISIT(traverse_module_state->__pyx_n_s_key); | |
6671 Py_VISIT(traverse_module_state->__pyx_n_s_keys); | |
6672 Py_VISIT(traverse_module_state->__pyx_n_s_l); | |
6673 Py_VISIT(traverse_module_state->__pyx_n_s_label); | |
6674 Py_VISIT(traverse_module_state->__pyx_n_s_last); | |
6675 Py_VISIT(traverse_module_state->__pyx_n_s_last_line); | |
6676 Py_VISIT(traverse_module_state->__pyx_n_s_left); | |
6677 Py_VISIT(traverse_module_state->__pyx_n_s_leftalign); | |
6678 Py_VISIT(traverse_module_state->__pyx_n_s_leftalign_2); | |
6679 Py_VISIT(traverse_module_state->__pyx_n_s_line); | |
6680 Py_VISIT(traverse_module_state->__pyx_n_s_line_2); | |
6681 Py_VISIT(traverse_module_state->__pyx_n_s_lineno); | |
6682 Py_VISIT(traverse_module_state->__pyx_n_s_lineparse); | |
6683 Py_VISIT(traverse_module_state->__pyx_n_s_lines); | |
6684 Py_VISIT(traverse_module_state->__pyx_n_s_lines_2); | |
6685 Py_VISIT(traverse_module_state->__pyx_n_s_longest); | |
6686 Py_VISIT(traverse_module_state->__pyx_n_s_main); | |
6687 Py_VISIT(traverse_module_state->__pyx_n_s_map); | |
6688 Py_VISIT(traverse_module_state->__pyx_n_s_match); | |
6689 Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); | |
6690 Py_VISIT(traverse_module_state->__pyx_n_s_min); | |
6691 Py_VISIT(traverse_module_state->__pyx_n_u_missing); | |
6692 Py_VISIT(traverse_module_state->__pyx_n_s_missingvalue); | |
6693 Py_VISIT(traverse_module_state->__pyx_n_s_module); | |
6694 Py_VISIT(traverse_module_state->__pyx_n_s_movable); | |
6695 Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); | |
6696 Py_VISIT(traverse_module_state->__pyx_n_s_n); | |
6697 Py_VISIT(traverse_module_state->__pyx_n_s_na); | |
6698 Py_VISIT(traverse_module_state->__pyx_n_s_name); | |
6699 Py_VISIT(traverse_module_state->__pyx_n_s_namedtuple); | |
6700 Py_VISIT(traverse_module_state->__pyx_kp_u_needs_to_be_checked); | |
6701 Py_VISIT(traverse_module_state->__pyx_n_s_new); | |
6702 Py_VISIT(traverse_module_state->__pyx_n_s_newalts); | |
6703 Py_VISIT(traverse_module_state->__pyx_n_s_nmb); | |
6704 Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); | |
6705 Py_VISIT(traverse_module_state->__pyx_kp_u_nonref_alleles); | |
6706 Py_VISIT(traverse_module_state->__pyx_n_s_number); | |
6707 Py_VISIT(traverse_module_state->__pyx_n_u_number); | |
6708 Py_VISIT(traverse_module_state->__pyx_n_s_numbertype); | |
6709 Py_VISIT(traverse_module_state->__pyx_n_s_object); | |
6710 Py_VISIT(traverse_module_state->__pyx_n_s_operator); | |
6711 Py_VISIT(traverse_module_state->__pyx_n_s_opt); | |
6712 Py_VISIT(traverse_module_state->__pyx_kp_u_output); | |
6713 Py_VISIT(traverse_module_state->__pyx_n_s_output_2); | |
6714 Py_VISIT(traverse_module_state->__pyx_kp_u_parameters_got); | |
6715 Py_VISIT(traverse_module_state->__pyx_n_s_parse); | |
6716 Py_VISIT(traverse_module_state->__pyx_n_s_parse_2); | |
6717 Py_VISIT(traverse_module_state->__pyx_n_s_parse_data); | |
6718 Py_VISIT(traverse_module_state->__pyx_n_s_parse_format); | |
6719 Py_VISIT(traverse_module_state->__pyx_n_s_parse_formatdata); | |
6720 Py_VISIT(traverse_module_state->__pyx_n_s_parse_header); | |
6721 Py_VISIT(traverse_module_state->__pyx_n_s_parse_header_2); | |
6722 Py_VISIT(traverse_module_state->__pyx_n_s_parse_heading); | |
6723 Py_VISIT(traverse_module_state->__pyx_n_s_parse_regions); | |
6724 Py_VISIT(traverse_module_state->__pyx_n_s_parser); | |
6725 Py_VISIT(traverse_module_state->__pyx_kp_u_phased_genotypes); | |
6726 Py_VISIT(traverse_module_state->__pyx_n_s_pickle); | |
6727 Py_VISIT(traverse_module_state->__pyx_n_s_pos); | |
6728 Py_VISIT(traverse_module_state->__pyx_n_u_pos); | |
6729 Py_VISIT(traverse_module_state->__pyx_n_s_pos1); | |
6730 Py_VISIT(traverse_module_state->__pyx_n_s_pos2); | |
6731 Py_VISIT(traverse_module_state->__pyx_n_s_prepare); | |
6732 Py_VISIT(traverse_module_state->__pyx_n_s_pysam); | |
6733 Py_VISIT(traverse_module_state->__pyx_n_s_pysam_libcvcf); | |
6734 Py_VISIT(traverse_module_state->__pyx_kp_s_pysam_libcvcf_pyx); | |
6735 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); | |
6736 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); | |
6737 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); | |
6738 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); | |
6739 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); | |
6740 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_asVCFRecord); | |
6741 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); | |
6742 Py_VISIT(traverse_module_state->__pyx_n_s_qual); | |
6743 Py_VISIT(traverse_module_state->__pyx_n_u_qual); | |
6744 Py_VISIT(traverse_module_state->__pyx_n_s_qualname); | |
6745 Py_VISIT(traverse_module_state->__pyx_n_s_r); | |
6746 Py_VISIT(traverse_module_state->__pyx_n_s_range); | |
6747 Py_VISIT(traverse_module_state->__pyx_n_s_re); | |
6748 Py_VISIT(traverse_module_state->__pyx_n_s_record); | |
6749 Py_VISIT(traverse_module_state->__pyx_n_s_reduce); | |
6750 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); | |
6751 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); | |
6752 Py_VISIT(traverse_module_state->__pyx_n_s_ref); | |
6753 Py_VISIT(traverse_module_state->__pyx_n_u_ref); | |
6754 Py_VISIT(traverse_module_state->__pyx_n_s_ref1); | |
6755 Py_VISIT(traverse_module_state->__pyx_n_s_ref2); | |
6756 Py_VISIT(traverse_module_state->__pyx_n_s_reference); | |
6757 Py_VISIT(traverse_module_state->__pyx_n_s_reference_2); | |
6758 Py_VISIT(traverse_module_state->__pyx_kp_u_reference_is); | |
6759 Py_VISIT(traverse_module_state->__pyx_kp_u_reference_is_2); | |
6760 Py_VISIT(traverse_module_state->__pyx_n_s_region); | |
6761 Py_VISIT(traverse_module_state->__pyx_n_s_regions); | |
6762 Py_VISIT(traverse_module_state->__pyx_n_s_regions_2); | |
6763 Py_VISIT(traverse_module_state->__pyx_n_s_replace); | |
6764 Py_VISIT(traverse_module_state->__pyx_n_s_required); | |
6765 Py_VISIT(traverse_module_state->__pyx_n_s_required_2); | |
6766 Py_VISIT(traverse_module_state->__pyx_n_s_rest); | |
6767 Py_VISIT(traverse_module_state->__pyx_n_s_result); | |
6768 Py_VISIT(traverse_module_state->__pyx_n_s_s); | |
6769 Py_VISIT(traverse_module_state->__pyx_n_s_sample); | |
6770 Py_VISIT(traverse_module_state->__pyx_n_s_sample2column); | |
6771 Py_VISIT(traverse_module_state->__pyx_n_s_samples); | |
6772 Py_VISIT(traverse_module_state->__pyx_kp_u_samples_2); | |
6773 Py_VISIT(traverse_module_state->__pyx_n_s_samples_3); | |
6774 Py_VISIT(traverse_module_state->__pyx_n_s_sdata); | |
6775 Py_VISIT(traverse_module_state->__pyx_n_s_self); | |
6776 Py_VISIT(traverse_module_state->__pyx_n_s_send); | |
6777 Py_VISIT(traverse_module_state->__pyx_n_s_separator); | |
6778 Py_VISIT(traverse_module_state->__pyx_n_s_sequence); | |
6779 Py_VISIT(traverse_module_state->__pyx_n_s_set_name); | |
6780 Py_VISIT(traverse_module_state->__pyx_n_s_setfilter); | |
6781 Py_VISIT(traverse_module_state->__pyx_n_s_setformat); | |
6782 Py_VISIT(traverse_module_state->__pyx_n_s_setheader); | |
6783 Py_VISIT(traverse_module_state->__pyx_n_s_setinfo); | |
6784 Py_VISIT(traverse_module_state->__pyx_n_s_setreference); | |
6785 Py_VISIT(traverse_module_state->__pyx_n_s_setregions); | |
6786 Py_VISIT(traverse_module_state->__pyx_n_s_setsamples); | |
6787 Py_VISIT(traverse_module_state->__pyx_n_s_setstate); | |
6788 Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); | |
6789 Py_VISIT(traverse_module_state->__pyx_n_s_setversion); | |
6790 Py_VISIT(traverse_module_state->__pyx_n_s_shortest); | |
6791 Py_VISIT(traverse_module_state->__pyx_n_s_spec); | |
6792 Py_VISIT(traverse_module_state->__pyx_n_s_split); | |
6793 Py_VISIT(traverse_module_state->__pyx_n_s_start); | |
6794 Py_VISIT(traverse_module_state->__pyx_n_s_startswith); | |
6795 Py_VISIT(traverse_module_state->__pyx_n_s_state); | |
6796 Py_VISIT(traverse_module_state->__pyx_kp_u_sth_entry_not_found); | |
6797 Py_VISIT(traverse_module_state->__pyx_n_s_stream); | |
6798 Py_VISIT(traverse_module_state->__pyx_n_s_string); | |
6799 Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); | |
6800 Py_VISIT(traverse_module_state->__pyx_n_s_strip); | |
6801 Py_VISIT(traverse_module_state->__pyx_n_s_super); | |
6802 Py_VISIT(traverse_module_state->__pyx_n_s_sys); | |
6803 Py_VISIT(traverse_module_state->__pyx_n_s_t); | |
6804 Py_VISIT(traverse_module_state->__pyx_n_s_tabixfile); | |
6805 Py_VISIT(traverse_module_state->__pyx_n_s_test); | |
6806 Py_VISIT(traverse_module_state->__pyx_n_s_throw); | |
6807 Py_VISIT(traverse_module_state->__pyx_n_s_type); | |
6808 Py_VISIT(traverse_module_state->__pyx_n_u_type); | |
6809 Py_VISIT(traverse_module_state->__pyx_n_s_update); | |
6810 Py_VISIT(traverse_module_state->__pyx_n_s_upper); | |
6811 Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); | |
6812 Py_VISIT(traverse_module_state->__pyx_n_s_v); | |
6813 Py_VISIT(traverse_module_state->__pyx_n_s_validate); | |
6814 Py_VISIT(traverse_module_state->__pyx_n_s_value); | |
6815 Py_VISIT(traverse_module_state->__pyx_n_s_values); | |
6816 Py_VISIT(traverse_module_state->__pyx_kp_u_values_in_element); | |
6817 Py_VISIT(traverse_module_state->__pyx_n_s_var); | |
6818 Py_VISIT(traverse_module_state->__pyx_n_s_vcf); | |
6819 Py_VISIT(traverse_module_state->__pyx_n_s_vcffile); | |
6820 Py_VISIT(traverse_module_state->__pyx_n_s_version); | |
6821 Py_VISIT(traverse_module_state->__pyx_n_s_version_2); | |
6822 Py_VISIT(traverse_module_state->__pyx_n_s_warn_errors); | |
6823 Py_VISIT(traverse_module_state->__pyx_n_s_warnerror); | |
6824 Py_VISIT(traverse_module_state->__pyx_n_s_write); | |
6825 Py_VISIT(traverse_module_state->__pyx_n_s_write_data); | |
6826 Py_VISIT(traverse_module_state->__pyx_n_s_write_header); | |
6827 Py_VISIT(traverse_module_state->__pyx_n_s_write_heading); | |
6828 Py_VISIT(traverse_module_state->__pyx_n_s_writeheader); | |
6829 Py_VISIT(traverse_module_state->__pyx_n_s_x); | |
6830 Py_VISIT(traverse_module_state->__pyx_n_s_y); | |
6831 Py_VISIT(traverse_module_state->__pyx_n_s_zip); | |
6832 Py_VISIT(traverse_module_state->__pyx_float_0_0); | |
6833 Py_VISIT(traverse_module_state->__pyx_int_0); | |
6834 Py_VISIT(traverse_module_state->__pyx_int_1); | |
6835 Py_VISIT(traverse_module_state->__pyx_int_2); | |
6836 Py_VISIT(traverse_module_state->__pyx_int_3); | |
6837 Py_VISIT(traverse_module_state->__pyx_int_4); | |
6838 Py_VISIT(traverse_module_state->__pyx_int_5); | |
6839 Py_VISIT(traverse_module_state->__pyx_int_6); | |
6840 Py_VISIT(traverse_module_state->__pyx_int_7); | |
6841 Py_VISIT(traverse_module_state->__pyx_int_8); | |
6842 Py_VISIT(traverse_module_state->__pyx_int_9); | |
6843 Py_VISIT(traverse_module_state->__pyx_int_10); | |
6844 Py_VISIT(traverse_module_state->__pyx_int_11); | |
6845 Py_VISIT(traverse_module_state->__pyx_int_12); | |
6846 Py_VISIT(traverse_module_state->__pyx_int_13); | |
6847 Py_VISIT(traverse_module_state->__pyx_int_14); | |
6848 Py_VISIT(traverse_module_state->__pyx_int_15); | |
6849 Py_VISIT(traverse_module_state->__pyx_int_16); | |
6850 Py_VISIT(traverse_module_state->__pyx_int_17); | |
6851 Py_VISIT(traverse_module_state->__pyx_int_18); | |
6852 Py_VISIT(traverse_module_state->__pyx_int_19); | |
6853 Py_VISIT(traverse_module_state->__pyx_int_20); | |
6854 Py_VISIT(traverse_module_state->__pyx_int_21); | |
6855 Py_VISIT(traverse_module_state->__pyx_int_22); | |
6856 Py_VISIT(traverse_module_state->__pyx_int_23); | |
6857 Py_VISIT(traverse_module_state->__pyx_int_24); | |
6858 Py_VISIT(traverse_module_state->__pyx_int_25); | |
6859 Py_VISIT(traverse_module_state->__pyx_int_26); | |
6860 Py_VISIT(traverse_module_state->__pyx_int_27); | |
6861 Py_VISIT(traverse_module_state->__pyx_int_28); | |
6862 Py_VISIT(traverse_module_state->__pyx_int_29); | |
6863 Py_VISIT(traverse_module_state->__pyx_int_30); | |
6864 Py_VISIT(traverse_module_state->__pyx_int_31); | |
6865 Py_VISIT(traverse_module_state->__pyx_int_32); | |
6866 Py_VISIT(traverse_module_state->__pyx_int_33); | |
6867 Py_VISIT(traverse_module_state->__pyx_int_40); | |
6868 Py_VISIT(traverse_module_state->__pyx_int_100); | |
6869 Py_VISIT(traverse_module_state->__pyx_int_29527880); | |
6870 Py_VISIT(traverse_module_state->__pyx_int_214161357); | |
6871 Py_VISIT(traverse_module_state->__pyx_int_239654613); | |
6872 Py_VISIT(traverse_module_state->__pyx_int_3000000000); | |
6873 Py_VISIT(traverse_module_state->__pyx_int_neg_1); | |
6874 Py_VISIT(traverse_module_state->__pyx_slice__9); | |
6875 Py_VISIT(traverse_module_state->__pyx_slice__17); | |
6876 Py_VISIT(traverse_module_state->__pyx_slice__18); | |
6877 Py_VISIT(traverse_module_state->__pyx_slice__20); | |
6878 Py_VISIT(traverse_module_state->__pyx_slice__26); | |
6879 Py_VISIT(traverse_module_state->__pyx_slice__28); | |
6880 Py_VISIT(traverse_module_state->__pyx_tuple__21); | |
6881 Py_VISIT(traverse_module_state->__pyx_tuple__22); | |
6882 Py_VISIT(traverse_module_state->__pyx_tuple__30); | |
6883 Py_VISIT(traverse_module_state->__pyx_tuple__31); | |
6884 Py_VISIT(traverse_module_state->__pyx_tuple__32); | |
6885 Py_VISIT(traverse_module_state->__pyx_tuple__35); | |
6886 Py_VISIT(traverse_module_state->__pyx_tuple__36); | |
6887 Py_VISIT(traverse_module_state->__pyx_tuple__37); | |
6888 Py_VISIT(traverse_module_state->__pyx_tuple__39); | |
6889 Py_VISIT(traverse_module_state->__pyx_tuple__41); | |
6890 Py_VISIT(traverse_module_state->__pyx_tuple__42); | |
6891 Py_VISIT(traverse_module_state->__pyx_tuple__44); | |
6892 Py_VISIT(traverse_module_state->__pyx_tuple__45); | |
6893 Py_VISIT(traverse_module_state->__pyx_tuple__47); | |
6894 Py_VISIT(traverse_module_state->__pyx_tuple__49); | |
6895 Py_VISIT(traverse_module_state->__pyx_tuple__52); | |
6896 Py_VISIT(traverse_module_state->__pyx_tuple__53); | |
6897 Py_VISIT(traverse_module_state->__pyx_tuple__54); | |
6898 Py_VISIT(traverse_module_state->__pyx_tuple__56); | |
6899 Py_VISIT(traverse_module_state->__pyx_tuple__57); | |
6900 Py_VISIT(traverse_module_state->__pyx_tuple__59); | |
6901 Py_VISIT(traverse_module_state->__pyx_tuple__61); | |
6902 Py_VISIT(traverse_module_state->__pyx_tuple__62); | |
6903 Py_VISIT(traverse_module_state->__pyx_tuple__64); | |
6904 Py_VISIT(traverse_module_state->__pyx_tuple__66); | |
6905 Py_VISIT(traverse_module_state->__pyx_tuple__68); | |
6906 Py_VISIT(traverse_module_state->__pyx_tuple__70); | |
6907 Py_VISIT(traverse_module_state->__pyx_tuple__71); | |
6908 Py_VISIT(traverse_module_state->__pyx_tuple__73); | |
6909 Py_VISIT(traverse_module_state->__pyx_tuple__75); | |
6910 Py_VISIT(traverse_module_state->__pyx_tuple__77); | |
6911 Py_VISIT(traverse_module_state->__pyx_tuple__79); | |
6912 Py_VISIT(traverse_module_state->__pyx_tuple__81); | |
6913 Py_VISIT(traverse_module_state->__pyx_tuple__83); | |
6914 Py_VISIT(traverse_module_state->__pyx_tuple__85); | |
6915 Py_VISIT(traverse_module_state->__pyx_tuple__87); | |
6916 Py_VISIT(traverse_module_state->__pyx_tuple__89); | |
6917 Py_VISIT(traverse_module_state->__pyx_tuple__91); | |
6918 Py_VISIT(traverse_module_state->__pyx_tuple__93); | |
6919 Py_VISIT(traverse_module_state->__pyx_tuple__95); | |
6920 Py_VISIT(traverse_module_state->__pyx_tuple__97); | |
6921 Py_VISIT(traverse_module_state->__pyx_tuple__100); | |
6922 Py_VISIT(traverse_module_state->__pyx_tuple__103); | |
6923 Py_VISIT(traverse_module_state->__pyx_tuple__106); | |
6924 Py_VISIT(traverse_module_state->__pyx_tuple__109); | |
6925 Py_VISIT(traverse_module_state->__pyx_tuple__111); | |
6926 Py_VISIT(traverse_module_state->__pyx_tuple__113); | |
6927 Py_VISIT(traverse_module_state->__pyx_tuple__115); | |
6928 Py_VISIT(traverse_module_state->__pyx_tuple__117); | |
6929 Py_VISIT(traverse_module_state->__pyx_tuple__120); | |
6930 Py_VISIT(traverse_module_state->__pyx_tuple__122); | |
6931 Py_VISIT(traverse_module_state->__pyx_tuple__125); | |
6932 Py_VISIT(traverse_module_state->__pyx_tuple__127); | |
6933 Py_VISIT(traverse_module_state->__pyx_tuple__129); | |
6934 Py_VISIT(traverse_module_state->__pyx_tuple__132); | |
6935 Py_VISIT(traverse_module_state->__pyx_tuple__134); | |
6936 Py_VISIT(traverse_module_state->__pyx_tuple__135); | |
6937 Py_VISIT(traverse_module_state->__pyx_tuple__137); | |
6938 Py_VISIT(traverse_module_state->__pyx_codeobj__29); | |
6939 Py_VISIT(traverse_module_state->__pyx_codeobj__38); | |
6940 Py_VISIT(traverse_module_state->__pyx_codeobj__40); | |
6941 Py_VISIT(traverse_module_state->__pyx_codeobj__43); | |
6942 Py_VISIT(traverse_module_state->__pyx_codeobj__46); | |
6943 Py_VISIT(traverse_module_state->__pyx_codeobj__48); | |
6944 Py_VISIT(traverse_module_state->__pyx_codeobj__50); | |
6945 Py_VISIT(traverse_module_state->__pyx_codeobj__51); | |
6946 Py_VISIT(traverse_module_state->__pyx_codeobj__55); | |
6947 Py_VISIT(traverse_module_state->__pyx_codeobj__58); | |
6948 Py_VISIT(traverse_module_state->__pyx_codeobj__60); | |
6949 Py_VISIT(traverse_module_state->__pyx_codeobj__63); | |
6950 Py_VISIT(traverse_module_state->__pyx_codeobj__65); | |
6951 Py_VISIT(traverse_module_state->__pyx_codeobj__67); | |
6952 Py_VISIT(traverse_module_state->__pyx_codeobj__69); | |
6953 Py_VISIT(traverse_module_state->__pyx_codeobj__72); | |
6954 Py_VISIT(traverse_module_state->__pyx_codeobj__74); | |
6955 Py_VISIT(traverse_module_state->__pyx_codeobj__76); | |
6956 Py_VISIT(traverse_module_state->__pyx_codeobj__78); | |
6957 Py_VISIT(traverse_module_state->__pyx_codeobj__80); | |
6958 Py_VISIT(traverse_module_state->__pyx_codeobj__82); | |
6959 Py_VISIT(traverse_module_state->__pyx_codeobj__84); | |
6960 Py_VISIT(traverse_module_state->__pyx_codeobj__86); | |
6961 Py_VISIT(traverse_module_state->__pyx_codeobj__88); | |
6962 Py_VISIT(traverse_module_state->__pyx_codeobj__90); | |
6963 Py_VISIT(traverse_module_state->__pyx_codeobj__92); | |
6964 Py_VISIT(traverse_module_state->__pyx_codeobj__94); | |
6965 Py_VISIT(traverse_module_state->__pyx_codeobj__96); | |
6966 Py_VISIT(traverse_module_state->__pyx_codeobj__98); | |
6967 Py_VISIT(traverse_module_state->__pyx_codeobj__99); | |
6968 Py_VISIT(traverse_module_state->__pyx_codeobj__101); | |
6969 Py_VISIT(traverse_module_state->__pyx_codeobj__102); | |
6970 Py_VISIT(traverse_module_state->__pyx_codeobj__104); | |
6971 Py_VISIT(traverse_module_state->__pyx_codeobj__105); | |
6972 Py_VISIT(traverse_module_state->__pyx_codeobj__107); | |
6973 Py_VISIT(traverse_module_state->__pyx_codeobj__108); | |
6974 Py_VISIT(traverse_module_state->__pyx_codeobj__110); | |
6975 Py_VISIT(traverse_module_state->__pyx_codeobj__112); | |
6976 Py_VISIT(traverse_module_state->__pyx_codeobj__114); | |
6977 Py_VISIT(traverse_module_state->__pyx_codeobj__116); | |
6978 Py_VISIT(traverse_module_state->__pyx_codeobj__118); | |
6979 Py_VISIT(traverse_module_state->__pyx_codeobj__119); | |
6980 Py_VISIT(traverse_module_state->__pyx_codeobj__121); | |
6981 Py_VISIT(traverse_module_state->__pyx_codeobj__123); | |
6982 Py_VISIT(traverse_module_state->__pyx_codeobj__124); | |
6983 Py_VISIT(traverse_module_state->__pyx_codeobj__126); | |
6984 Py_VISIT(traverse_module_state->__pyx_codeobj__128); | |
6985 Py_VISIT(traverse_module_state->__pyx_codeobj__130); | |
6986 Py_VISIT(traverse_module_state->__pyx_codeobj__131); | |
6987 Py_VISIT(traverse_module_state->__pyx_codeobj__133); | |
6988 Py_VISIT(traverse_module_state->__pyx_codeobj__136); | |
6989 Py_VISIT(traverse_module_state->__pyx_codeobj__138); | |
6990 return 0; | |
6991 } | |
6992 #endif | |
6993 /* #### Code section: module_state_defines ### */ | |
6994 #define __pyx_d __pyx_mstate_global->__pyx_d | |
6995 #define __pyx_b __pyx_mstate_global->__pyx_b | |
6996 #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime | |
6997 #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple | |
6998 #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes | |
6999 #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode | |
7000 #ifdef __Pyx_CyFunction_USED | |
7001 #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType | |
7002 #endif | |
7003 #ifdef __Pyx_FusedFunction_USED | |
7004 #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType | |
7005 #endif | |
7006 #ifdef __Pyx_Generator_USED | |
7007 #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType | |
7008 #endif | |
7009 #ifdef __Pyx_IterableCoroutine_USED | |
7010 #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType | |
7011 #endif | |
7012 #ifdef __Pyx_Coroutine_USED | |
7013 #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType | |
7014 #endif | |
7015 #ifdef __Pyx_Coroutine_USED | |
7016 #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType | |
7017 #endif | |
7018 #if CYTHON_USE_MODULE_STATE | |
7019 #endif | |
7020 #if CYTHON_USE_MODULE_STATE | |
7021 #endif | |
7022 #if CYTHON_USE_MODULE_STATE | |
7023 #endif | |
7024 #if CYTHON_USE_MODULE_STATE | |
7025 #endif | |
7026 #if CYTHON_USE_MODULE_STATE | |
7027 #endif | |
7028 #if CYTHON_USE_MODULE_STATE | |
7029 #endif | |
7030 #define __pyx_ptype_5pysam_10libchtslib_HTSFile __pyx_mstate_global->__pyx_ptype_5pysam_10libchtslib_HTSFile | |
7031 #if CYTHON_USE_MODULE_STATE | |
7032 #endif | |
7033 #define __pyx_ptype_5pysam_9libctabix_tabix_file_iterator __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_tabix_file_iterator | |
7034 #define __pyx_ptype_5pysam_9libctabix_TabixFile __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_TabixFile | |
7035 #define __pyx_ptype_5pysam_9libctabix_Parser __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_Parser | |
7036 #define __pyx_ptype_5pysam_9libctabix_asTuple __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asTuple | |
7037 #define __pyx_ptype_5pysam_9libctabix_asGTF __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asGTF | |
7038 #define __pyx_ptype_5pysam_9libctabix_asGFF3 __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asGFF3 | |
7039 #define __pyx_ptype_5pysam_9libctabix_asBed __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asBed | |
7040 #define __pyx_ptype_5pysam_9libctabix_asVCF __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asVCF | |
7041 #define __pyx_ptype_5pysam_9libctabix_TabixIterator __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_TabixIterator | |
7042 #define __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed | |
7043 #define __pyx_ptype_5pysam_9libctabix_GZIterator __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_GZIterator | |
7044 #define __pyx_ptype_5pysam_9libctabix_GZIteratorHead __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_GZIteratorHead | |
7045 #define __pyx_ptype_5pysam_9libctabix_GZIteratorParsed __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_GZIteratorParsed | |
7046 #define __pyx_ptype_5pysam_9libctabix_Tabixfile __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_Tabixfile | |
7047 #if CYTHON_USE_MODULE_STATE | |
7048 #endif | |
7049 #define __pyx_ptype_5pysam_16libctabixproxies_TupleProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_TupleProxy | |
7050 #define __pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator | |
7051 #define __pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy | |
7052 #define __pyx_ptype_5pysam_16libctabixproxies_GTFProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_GTFProxy | |
7053 #define __pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy | |
7054 #define __pyx_ptype_5pysam_16libctabixproxies_BedProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_BedProxy | |
7055 #define __pyx_ptype_5pysam_16libctabixproxies_VCFProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_VCFProxy | |
7056 #if CYTHON_USE_MODULE_STATE | |
7057 #endif | |
7058 #if CYTHON_USE_MODULE_STATE | |
7059 #endif | |
7060 #if CYTHON_USE_MODULE_STATE | |
7061 #endif | |
7062 #if CYTHON_USE_MODULE_STATE | |
7063 #endif | |
7064 #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type | |
7065 #if CYTHON_USE_MODULE_STATE | |
7066 #endif | |
7067 #if CYTHON_USE_MODULE_STATE | |
7068 #endif | |
7069 #if CYTHON_USE_MODULE_STATE | |
7070 #endif | |
7071 #if CYTHON_USE_MODULE_STATE | |
7072 #endif | |
7073 #if CYTHON_USE_MODULE_STATE | |
7074 #endif | |
7075 #if CYTHON_USE_MODULE_STATE | |
7076 #endif | |
7077 #if CYTHON_USE_MODULE_STATE | |
7078 #endif | |
7079 #if CYTHON_USE_MODULE_STATE | |
7080 #endif | |
7081 #if CYTHON_USE_MODULE_STATE | |
7082 #endif | |
7083 #if CYTHON_USE_MODULE_STATE | |
7084 #endif | |
7085 #if CYTHON_USE_MODULE_STATE | |
7086 #endif | |
7087 #if CYTHON_USE_MODULE_STATE | |
7088 #endif | |
7089 #if CYTHON_USE_MODULE_STATE | |
7090 #endif | |
7091 #if CYTHON_USE_MODULE_STATE | |
7092 #endif | |
7093 #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool | |
7094 #if CYTHON_USE_MODULE_STATE | |
7095 #endif | |
7096 #if CYTHON_USE_MODULE_STATE | |
7097 #endif | |
7098 #if CYTHON_USE_MODULE_STATE | |
7099 #endif | |
7100 #if CYTHON_USE_MODULE_STATE | |
7101 #endif | |
7102 #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex | |
7103 #if CYTHON_USE_MODULE_STATE | |
7104 #endif | |
7105 #if CYTHON_USE_MODULE_STATE | |
7106 #endif | |
7107 #if CYTHON_USE_MODULE_STATE | |
7108 #endif | |
7109 #if CYTHON_USE_MODULE_STATE | |
7110 #endif | |
7111 #if CYTHON_USE_MODULE_STATE | |
7112 #endif | |
7113 #if CYTHON_USE_MODULE_STATE | |
7114 #endif | |
7115 #if CYTHON_USE_MODULE_STATE | |
7116 #endif | |
7117 #if CYTHON_USE_MODULE_STATE | |
7118 #endif | |
7119 #if CYTHON_USE_MODULE_STATE | |
7120 #endif | |
7121 #if CYTHON_USE_MODULE_STATE | |
7122 #endif | |
7123 #if CYTHON_USE_MODULE_STATE | |
7124 #endif | |
7125 #if CYTHON_USE_MODULE_STATE | |
7126 #endif | |
7127 #if CYTHON_USE_MODULE_STATE | |
7128 #endif | |
7129 #if CYTHON_USE_MODULE_STATE | |
7130 #endif | |
7131 #if CYTHON_USE_MODULE_STATE | |
7132 #endif | |
7133 #if CYTHON_USE_MODULE_STATE | |
7134 #endif | |
7135 #if CYTHON_USE_MODULE_STATE | |
7136 #endif | |
7137 #if CYTHON_USE_MODULE_STATE | |
7138 #endif | |
7139 #if CYTHON_USE_MODULE_STATE | |
7140 #endif | |
7141 #if CYTHON_USE_MODULE_STATE | |
7142 #endif | |
7143 #if CYTHON_USE_MODULE_STATE | |
7144 #endif | |
7145 #if CYTHON_USE_MODULE_STATE | |
7146 #endif | |
7147 #define __pyx_ptype_7cpython_5array_array __pyx_mstate_global->__pyx_ptype_7cpython_5array_array | |
7148 #if CYTHON_USE_MODULE_STATE | |
7149 #endif | |
7150 #if CYTHON_USE_MODULE_STATE | |
7151 #define __pyx_type_5pysam_7libcvcf_VCFRecord __pyx_mstate_global->__pyx_type_5pysam_7libcvcf_VCFRecord | |
7152 #define __pyx_type_5pysam_7libcvcf_asVCFRecord __pyx_mstate_global->__pyx_type_5pysam_7libcvcf_asVCFRecord | |
7153 #define __pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse __pyx_mstate_global->__pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse | |
7154 #endif | |
7155 #define __pyx_ptype_5pysam_7libcvcf_VCFRecord __pyx_mstate_global->__pyx_ptype_5pysam_7libcvcf_VCFRecord | |
7156 #define __pyx_ptype_5pysam_7libcvcf_asVCFRecord __pyx_mstate_global->__pyx_ptype_5pysam_7libcvcf_asVCFRecord | |
7157 #define __pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse __pyx_mstate_global->__pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse | |
7158 #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ | |
7159 #define __pyx_kp_b_0 __pyx_mstate_global->__pyx_kp_b_0 | |
7160 #define __pyx_kp_u_0 __pyx_mstate_global->__pyx_kp_u_0 | |
7161 #define __pyx_n_u_A __pyx_mstate_global->__pyx_n_u_A | |
7162 #define __pyx_n_u_ACGTN __pyx_mstate_global->__pyx_n_u_ACGTN | |
7163 #define __pyx_kp_u_ACGTN_2 __pyx_mstate_global->__pyx_kp_u_ACGTN_2 | |
7164 #define __pyx_n_u_ALT __pyx_mstate_global->__pyx_n_u_ALT | |
7165 #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError | |
7166 #define __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING __pyx_mstate_global->__pyx_n_s_BADLY_FORMATTED_FORMAT_STRING | |
7167 #define __pyx_kp_u_BADLY_FORMATTED_FORMAT_STRING_Fo __pyx_mstate_global->__pyx_kp_u_BADLY_FORMATTED_FORMAT_STRING_Fo | |
7168 #define __pyx_n_s_BADLY_FORMATTED_HEADING __pyx_mstate_global->__pyx_n_s_BADLY_FORMATTED_HEADING | |
7169 #define __pyx_kp_u_BADLY_FORMATTED_HEADING_Did_not __pyx_mstate_global->__pyx_kp_u_BADLY_FORMATTED_HEADING_Did_not | |
7170 #define __pyx_kp_u_BAD_CHR_TAG_Error_calculating_ch __pyx_mstate_global->__pyx_kp_u_BAD_CHR_TAG_Error_calculating_ch | |
7171 #define __pyx_n_s_BAD_GENOTYPE __pyx_mstate_global->__pyx_n_s_BAD_GENOTYPE | |
7172 #define __pyx_kp_u_BAD_GENOTYPE_Cannot_parse_genoty __pyx_mstate_global->__pyx_kp_u_BAD_GENOTYPE_Cannot_parse_genoty | |
7173 #define __pyx_n_s_BAD_NUMBER_OF_COLUMNS __pyx_mstate_global->__pyx_n_s_BAD_NUMBER_OF_COLUMNS | |
7174 #define __pyx_kp_u_BAD_NUMBER_OF_COLUMNS_Wrong_numb __pyx_mstate_global->__pyx_kp_u_BAD_NUMBER_OF_COLUMNS_Wrong_numb | |
7175 #define __pyx_n_s_BAD_NUMBER_OF_PARAMETERS __pyx_mstate_global->__pyx_n_s_BAD_NUMBER_OF_PARAMETERS | |
7176 #define __pyx_kp_u_BAD_NUMBER_OF_PARAMETERS_Found_u __pyx_mstate_global->__pyx_kp_u_BAD_NUMBER_OF_PARAMETERS_Found_u | |
7177 #define __pyx_n_s_BAD_NUMBER_OF_VALUES __pyx_mstate_global->__pyx_n_s_BAD_NUMBER_OF_VALUES | |
7178 #define __pyx_kp_u_BAD_NUMBER_OF_VALUES_Found_too_m __pyx_mstate_global->__pyx_kp_u_BAD_NUMBER_OF_VALUES_Found_too_m | |
7179 #define __pyx_n_u_CHROM __pyx_mstate_global->__pyx_n_u_CHROM | |
7180 #define __pyx_kp_u_Can_only_handle_v3_3_and_v4_0_VC __pyx_mstate_global->__pyx_kp_u_Can_only_handle_v3_3_and_v4_0_VC | |
7181 #define __pyx_n_u_Character __pyx_mstate_global->__pyx_n_u_Character | |
7182 #define __pyx_kp_u_Conditional_genotype_quality __pyx_mstate_global->__pyx_kp_u_Conditional_genotype_quality | |
7183 #define __pyx_n_u_D __pyx_mstate_global->__pyx_n_u_D | |
7184 #define __pyx_n_u_DP __pyx_mstate_global->__pyx_n_u_DP | |
7185 #define __pyx_kp_u_Description __pyx_mstate_global->__pyx_kp_u_Description | |
7186 #define __pyx_n_u_Description_2 __pyx_mstate_global->__pyx_n_u_Description_2 | |
7187 #define __pyx_kp_u_Don_t_understand_region_string_s __pyx_mstate_global->__pyx_kp_u_Don_t_understand_region_string_s | |
7188 #define __pyx_n_u_EC __pyx_mstate_global->__pyx_n_u_EC | |
7189 #define __pyx_n_s_ERROR_FLAG_HAS_VALUE __pyx_mstate_global->__pyx_n_s_ERROR_FLAG_HAS_VALUE | |
7190 #define __pyx_kp_u_ERROR_FLAG_HAS_VALUE_Flag_fields __pyx_mstate_global->__pyx_kp_u_ERROR_FLAG_HAS_VALUE_Flag_fields | |
7191 #define __pyx_n_s_ERROR_FORMAT_NOT_CHAR __pyx_mstate_global->__pyx_n_s_ERROR_FORMAT_NOT_CHAR | |
7192 #define __pyx_kp_u_ERROR_FORMAT_NOT_CHAR_Eexpected __pyx_mstate_global->__pyx_kp_u_ERROR_FORMAT_NOT_CHAR_Eexpected | |
7193 #define __pyx_n_s_ERROR_FORMAT_NOT_INTEGER __pyx_mstate_global->__pyx_n_s_ERROR_FORMAT_NOT_INTEGER | |
7194 #define __pyx_kp_u_ERROR_FORMAT_NOT_INTEGER_Expecte __pyx_mstate_global->__pyx_kp_u_ERROR_FORMAT_NOT_INTEGER_Expecte | |
7195 #define __pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL __pyx_mstate_global->__pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL | |
7196 #define __pyx_kp_u_ERROR_FORMAT_NOT_NUMERICAL_Expec __pyx_mstate_global->__pyx_kp_u_ERROR_FORMAT_NOT_NUMERICAL_Expec | |
7197 #define __pyx_n_s_ERROR_INFO_STRING __pyx_mstate_global->__pyx_n_s_ERROR_INFO_STRING | |
7198 #define __pyx_kp_u_ERROR_INFO_STRING_Error_while_pa __pyx_mstate_global->__pyx_kp_u_ERROR_INFO_STRING_Error_while_pa | |
7199 #define __pyx_n_s_ERROR_TRAILING_DATA __pyx_mstate_global->__pyx_n_s_ERROR_TRAILING_DATA | |
7200 #define __pyx_kp_u_ERROR_TRAILING_DATA_Numerical_fi __pyx_mstate_global->__pyx_kp_u_ERROR_TRAILING_DATA_Numerical_fi | |
7201 #define __pyx_n_s_ERROR_UNKNOWN_KEY __pyx_mstate_global->__pyx_n_s_ERROR_UNKNOWN_KEY | |
7202 #define __pyx_kp_u_ERROR_UNKNOWN_KEY_Unknown_key_s __pyx_mstate_global->__pyx_kp_u_ERROR_UNKNOWN_KEY_Unknown_key_s | |
7203 #define __pyx_n_u_Error __pyx_mstate_global->__pyx_n_u_Error | |
7204 #define __pyx_kp_u_Expected_alternate_allel_counts __pyx_mstate_global->__pyx_kp_u_Expected_alternate_allel_counts | |
7205 #define __pyx_n_u_FILTER __pyx_mstate_global->__pyx_n_u_FILTER | |
7206 #define __pyx_n_s_FILTER_NOT_DEFINED __pyx_mstate_global->__pyx_n_s_FILTER_NOT_DEFINED | |
7207 #define __pyx_kp_u_FILTER_NOT_DEFINED_Identifier_s __pyx_mstate_global->__pyx_kp_u_FILTER_NOT_DEFINED_Identifier_s | |
7208 #define __pyx_n_s_FORMAT __pyx_mstate_global->__pyx_n_s_FORMAT | |
7209 #define __pyx_n_u_FORMAT __pyx_mstate_global->__pyx_n_u_FORMAT | |
7210 #define __pyx_n_s_FORMAT_MISSING_QUOTES __pyx_mstate_global->__pyx_n_s_FORMAT_MISSING_QUOTES | |
7211 #define __pyx_kp_u_FORMAT_MISSING_QUOTES_Descriptio __pyx_mstate_global->__pyx_kp_u_FORMAT_MISSING_QUOTES_Descriptio | |
7212 #define __pyx_n_s_FORMAT_NOT_DEFINED __pyx_mstate_global->__pyx_n_s_FORMAT_NOT_DEFINED | |
7213 #define __pyx_kp_u_FORMAT_NOT_DEFINED_Identifier_s __pyx_mstate_global->__pyx_kp_u_FORMAT_NOT_DEFINED_Identifier_s | |
7214 #define __pyx_n_u_FT __pyx_mstate_global->__pyx_n_u_FT | |
7215 #define __pyx_n_u_Flag __pyx_mstate_global->__pyx_n_u_Flag | |
7216 #define __pyx_n_u_Float __pyx_mstate_global->__pyx_n_u_Float | |
7217 #define __pyx_n_u_G __pyx_mstate_global->__pyx_n_u_G | |
7218 #define __pyx_n_u_GL __pyx_mstate_global->__pyx_n_u_GL | |
7219 #define __pyx_n_u_GLE __pyx_mstate_global->__pyx_n_u_GLE | |
7220 #define __pyx_n_u_GP __pyx_mstate_global->__pyx_n_u_GP | |
7221 #define __pyx_n_u_GQ __pyx_mstate_global->__pyx_n_u_GQ | |
7222 #define __pyx_n_u_GT __pyx_mstate_global->__pyx_n_u_GT | |
7223 #define __pyx_n_s_GTdata __pyx_mstate_global->__pyx_n_s_GTdata | |
7224 #define __pyx_n_s_GTstring __pyx_mstate_global->__pyx_n_s_GTstring | |
7225 #define __pyx_n_u_Genotype __pyx_mstate_global->__pyx_n_u_Genotype | |
7226 #define __pyx_kp_u_Genotype_Quality __pyx_mstate_global->__pyx_kp_u_Genotype_Quality | |
7227 #define __pyx_kp_u_Genotype_likelihoods __pyx_mstate_global->__pyx_kp_u_Genotype_likelihoods | |
7228 #define __pyx_kp_u_Genotype_posterior_probabilities __pyx_mstate_global->__pyx_kp_u_Genotype_posterior_probabilities | |
7229 #define __pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS __pyx_mstate_global->__pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS | |
7230 #define __pyx_kp_u_HEADING_NOT_SEPARATED_BY_TABS_He __pyx_mstate_global->__pyx_kp_u_HEADING_NOT_SEPARATED_BY_TABS_He | |
7231 #define __pyx_n_u_HQ __pyx_mstate_global->__pyx_n_u_HQ | |
7232 #define __pyx_kp_u_Haplotype_Quality __pyx_mstate_global->__pyx_kp_u_Haplotype_Quality | |
7233 #define __pyx_n_u_I __pyx_mstate_global->__pyx_n_u_I | |
7234 #define __pyx_kp_u_ID __pyx_mstate_global->__pyx_kp_u_ID | |
7235 #define __pyx_n_u_ID_2 __pyx_mstate_global->__pyx_n_u_ID_2 | |
7236 #define __pyx_n_u_INFO __pyx_mstate_global->__pyx_n_u_INFO | |
7237 #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 | |
7238 #define __pyx_n_u_Integer __pyx_mstate_global->__pyx_n_u_Integer | |
7239 #define __pyx_kp_u_Invalid_error_string_s __pyx_mstate_global->__pyx_kp_u_Invalid_error_string_s | |
7240 #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError | |
7241 #define __pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE __pyx_mstate_global->__pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE | |
7242 #define __pyx_kp_u_MISSING_INDEL_ALLELE_REF_BASE_In __pyx_mstate_global->__pyx_kp_u_MISSING_INDEL_ALLELE_REF_BASE_In | |
7243 #define __pyx_n_s_MISSING_REF __pyx_mstate_global->__pyx_n_s_MISSING_REF | |
7244 #define __pyx_kp_u_MISSING_REF_Reference_allele_mis __pyx_mstate_global->__pyx_kp_u_MISSING_REF_Reference_allele_mis | |
7245 #define __pyx_n_u_MQ __pyx_mstate_global->__pyx_n_u_MQ | |
7246 #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError | |
7247 #define __pyx_n_u_N __pyx_mstate_global->__pyx_n_u_N | |
7248 #define __pyx_n_s_NT_ALLELES __pyx_mstate_global->__pyx_n_s_NT_ALLELES | |
7249 #define __pyx_n_s_NT_GENOTYPES __pyx_mstate_global->__pyx_n_s_NT_GENOTYPES | |
7250 #define __pyx_n_s_NT_NR_ALLELES __pyx_mstate_global->__pyx_n_s_NT_NR_ALLELES | |
7251 #define __pyx_n_s_NT_NUMBER __pyx_mstate_global->__pyx_n_s_NT_NUMBER | |
7252 #define __pyx_n_s_NT_PHASED_GENOTYPES __pyx_mstate_global->__pyx_n_s_NT_PHASED_GENOTYPES | |
7253 #define __pyx_n_s_NT_UNKNOWN __pyx_mstate_global->__pyx_n_s_NT_UNKNOWN | |
7254 #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError | |
7255 #define __pyx_kp_u_Number __pyx_mstate_global->__pyx_kp_u_Number | |
7256 #define __pyx_n_u_Number_2 __pyx_mstate_global->__pyx_n_u_Number_2 | |
7257 #define __pyx_n_b_PASS __pyx_mstate_global->__pyx_n_b_PASS | |
7258 #define __pyx_n_u_PASS __pyx_mstate_global->__pyx_n_u_PASS | |
7259 #define __pyx_n_u_PL __pyx_mstate_global->__pyx_n_u_PL | |
7260 #define __pyx_n_u_POS __pyx_mstate_global->__pyx_n_u_POS | |
7261 #define __pyx_n_s_POS_NOT_NUMERICAL __pyx_mstate_global->__pyx_n_s_POS_NOT_NUMERICAL | |
7262 #define __pyx_kp_u_POS_NOT_NUMERICAL_Position_colum __pyx_mstate_global->__pyx_kp_u_POS_NOT_NUMERICAL_Position_colum | |
7263 #define __pyx_n_s_POS_NOT_POSITIVE __pyx_mstate_global->__pyx_n_s_POS_NOT_POSITIVE | |
7264 #define __pyx_kp_u_POS_NOT_POSITIVE_Position_field __pyx_mstate_global->__pyx_kp_u_POS_NOT_POSITIVE_Position_field | |
7265 #define __pyx_n_u_PQ __pyx_mstate_global->__pyx_n_u_PQ | |
7266 #define __pyx_n_u_PS __pyx_mstate_global->__pyx_n_u_PS | |
7267 #define __pyx_kp_u_Phase_set __pyx_mstate_global->__pyx_kp_u_Phase_set | |
7268 #define __pyx_kp_u_Phasing_quality __pyx_mstate_global->__pyx_kp_u_Phasing_quality | |
7269 #define __pyx_kp_u_Phred_scaled_genotype_likelihood __pyx_mstate_global->__pyx_kp_u_Phred_scaled_genotype_likelihood | |
7270 #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError | |
7271 #define __pyx_n_u_QUAL __pyx_mstate_global->__pyx_n_u_QUAL | |
7272 #define __pyx_n_s_QUAL_NOT_NUMERICAL __pyx_mstate_global->__pyx_n_s_QUAL_NOT_NUMERICAL | |
7273 #define __pyx_kp_u_QUAL_NOT_NUMERICAL_Quality_field __pyx_mstate_global->__pyx_kp_u_QUAL_NOT_NUMERICAL_Quality_field | |
7274 #define __pyx_n_u_REF __pyx_mstate_global->__pyx_n_u_REF | |
7275 #define __pyx_kp_u_RMS_mapping_quality __pyx_mstate_global->__pyx_kp_u_RMS_mapping_quality | |
7276 #define __pyx_kp_u_Read_depth_at_this_position_for __pyx_mstate_global->__pyx_kp_u_Read_depth_at_this_position_for | |
7277 #define __pyx_kp_u_Required_key_s_not_found_in_data __pyx_mstate_global->__pyx_kp_u_Required_key_s_not_found_in_data | |
7278 #define __pyx_kp_u_Sample_Genotype_Filter __pyx_mstate_global->__pyx_kp_u_Sample_Genotype_Filter | |
7279 #define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration | |
7280 #define __pyx_n_u_String __pyx_mstate_global->__pyx_n_u_String | |
7281 #define __pyx_n_s_Tabixfile __pyx_mstate_global->__pyx_n_s_Tabixfile | |
7282 #define __pyx_kp_u_Type __pyx_mstate_global->__pyx_kp_u_Type | |
7283 #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError | |
7284 #define __pyx_n_u_Type_2 __pyx_mstate_global->__pyx_n_u_Type_2 | |
7285 #define __pyx_n_s_UNKNOWN_CHAR_IN_REF __pyx_mstate_global->__pyx_n_s_UNKNOWN_CHAR_IN_REF | |
7286 #define __pyx_kp_u_UNKNOWN_CHAR_IN_REF_Unknown_char __pyx_mstate_global->__pyx_kp_u_UNKNOWN_CHAR_IN_REF_Unknown_char | |
7287 #define __pyx_n_s_UNKNOWN_FORMAT_STRING __pyx_mstate_global->__pyx_n_s_UNKNOWN_FORMAT_STRING | |
7288 #define __pyx_kp_u_UNKNOWN_FORMAT_STRING_Unknown_fi __pyx_mstate_global->__pyx_kp_u_UNKNOWN_FORMAT_STRING_Unknown_fi | |
7289 #define __pyx_kp_u_Undefined_tag __pyx_mstate_global->__pyx_kp_u_Undefined_tag | |
7290 #define __pyx_kp_u_Unknown_number_type_encountered __pyx_mstate_global->__pyx_kp_u_Unknown_number_type_encountered | |
7291 #define __pyx_n_s_V33_BAD_ALLELE __pyx_mstate_global->__pyx_n_s_V33_BAD_ALLELE | |
7292 #define __pyx_kp_u_V33_BAD_ALLELE_Cannot_interpret __pyx_mstate_global->__pyx_kp_u_V33_BAD_ALLELE_Cannot_interpret | |
7293 #define __pyx_n_s_V33_BAD_REF __pyx_mstate_global->__pyx_n_s_V33_BAD_REF | |
7294 #define __pyx_kp_u_V33_BAD_REF_Reference_should_be __pyx_mstate_global->__pyx_kp_u_V33_BAD_REF_Reference_should_be | |
7295 #define __pyx_n_s_V33_UNMATCHED_DELETION __pyx_mstate_global->__pyx_n_s_V33_UNMATCHED_DELETION | |
7296 #define __pyx_kp_u_V33_UNMATCHED_DELETION_Deleted_s __pyx_mstate_global->__pyx_kp_u_V33_UNMATCHED_DELETION_Deleted_s | |
7297 #define __pyx_n_s_V40_BAD_ALLELE __pyx_mstate_global->__pyx_n_s_V40_BAD_ALLELE | |
7298 #define __pyx_kp_u_V40_BAD_ALLELE_Bad_allele_found __pyx_mstate_global->__pyx_kp_u_V40_BAD_ALLELE_Bad_allele_found | |
7299 #define __pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD __pyx_mstate_global->__pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD | |
7300 #define __pyx_kp_u_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2 __pyx_mstate_global->__pyx_kp_u_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2 | |
7301 #define __pyx_n_s_V40_MISSING_ANGLE_BRACKETS __pyx_mstate_global->__pyx_n_s_V40_MISSING_ANGLE_BRACKETS | |
7302 #define __pyx_kp_u_V40_MISSING_ANGLE_BRACKETS_Forma __pyx_mstate_global->__pyx_kp_u_V40_MISSING_ANGLE_BRACKETS_Forma | |
7303 #define __pyx_n_s_VCF __pyx_mstate_global->__pyx_n_s_VCF | |
7304 #define __pyx_n_u_VCF __pyx_mstate_global->__pyx_n_u_VCF | |
7305 #define __pyx_n_s_VCFRecord __pyx_mstate_global->__pyx_n_s_VCFRecord | |
7306 #define __pyx_n_u_VCFRecord __pyx_mstate_global->__pyx_n_u_VCFRecord | |
7307 #define __pyx_n_s_VCFRecord___reduce_cython __pyx_mstate_global->__pyx_n_s_VCFRecord___reduce_cython | |
7308 #define __pyx_n_s_VCFRecord___setstate_cython __pyx_mstate_global->__pyx_n_s_VCFRecord___setstate_cython | |
7309 #define __pyx_n_s_VCFRecord_error __pyx_mstate_global->__pyx_n_s_VCFRecord_error | |
7310 #define __pyx_n_s_VCF___del __pyx_mstate_global->__pyx_n_s_VCF___del | |
7311 #define __pyx_n_s_VCF___init __pyx_mstate_global->__pyx_n_s_VCF___init | |
7312 #define __pyx_n_s_VCF__add_definition __pyx_mstate_global->__pyx_n_s_VCF__add_definition | |
7313 #define __pyx_n_s_VCF__parse __pyx_mstate_global->__pyx_n_s_VCF__parse | |
7314 #define __pyx_n_s_VCF__parse_header __pyx_mstate_global->__pyx_n_s_VCF__parse_header | |
7315 #define __pyx_n_s_VCF_close __pyx_mstate_global->__pyx_n_s_VCF_close | |
7316 #define __pyx_n_s_VCF_compare_calls __pyx_mstate_global->__pyx_n_s_VCF_compare_calls | |
7317 #define __pyx_n_s_VCF_connect __pyx_mstate_global->__pyx_n_s_VCF_connect | |
7318 #define __pyx_n_s_VCF_convertGT __pyx_mstate_global->__pyx_n_s_VCF_convertGT | |
7319 #define __pyx_n_s_VCF_convertGTback __pyx_mstate_global->__pyx_n_s_VCF_convertGTback | |
7320 #define __pyx_n_s_VCF_enter_default_format __pyx_mstate_global->__pyx_n_s_VCF_enter_default_format | |
7321 #define __pyx_n_s_VCF_error __pyx_mstate_global->__pyx_n_s_VCF_error | |
7322 #define __pyx_n_s_VCF_fetch __pyx_mstate_global->__pyx_n_s_VCF_fetch | |
7323 #define __pyx_n_s_VCF_format_format __pyx_mstate_global->__pyx_n_s_VCF_format_format | |
7324 #define __pyx_n_s_VCF_format_formatdata __pyx_mstate_global->__pyx_n_s_VCF_format_formatdata | |
7325 #define __pyx_n_s_VCF_get_expected __pyx_mstate_global->__pyx_n_s_VCF_get_expected | |
7326 #define __pyx_n_s_VCF_getfilter __pyx_mstate_global->__pyx_n_s_VCF_getfilter | |
7327 #define __pyx_n_s_VCF_getformat __pyx_mstate_global->__pyx_n_s_VCF_getformat | |
7328 #define __pyx_n_s_VCF_getheader __pyx_mstate_global->__pyx_n_s_VCF_getheader | |
7329 #define __pyx_n_s_VCF_getinfo __pyx_mstate_global->__pyx_n_s_VCF_getinfo | |
7330 #define __pyx_n_s_VCF_getsamples __pyx_mstate_global->__pyx_n_s_VCF_getsamples | |
7331 #define __pyx_n_s_VCF_ignoreerror __pyx_mstate_global->__pyx_n_s_VCF_ignoreerror | |
7332 #define __pyx_n_s_VCF_inregion __pyx_mstate_global->__pyx_n_s_VCF_inregion | |
7333 #define __pyx_n_s_VCF_parse __pyx_mstate_global->__pyx_n_s_VCF_parse | |
7334 #define __pyx_n_s_VCF_parse_data __pyx_mstate_global->__pyx_n_s_VCF_parse_data | |
7335 #define __pyx_n_s_VCF_parse_format __pyx_mstate_global->__pyx_n_s_VCF_parse_format | |
7336 #define __pyx_n_s_VCF_parse_formatdata __pyx_mstate_global->__pyx_n_s_VCF_parse_formatdata | |
7337 #define __pyx_n_s_VCF_parse_header __pyx_mstate_global->__pyx_n_s_VCF_parse_header | |
7338 #define __pyx_n_s_VCF_parse_heading __pyx_mstate_global->__pyx_n_s_VCF_parse_heading | |
7339 #define __pyx_kp_u_VCF_says __pyx_mstate_global->__pyx_kp_u_VCF_says | |
7340 #define __pyx_n_s_VCF_setfilter __pyx_mstate_global->__pyx_n_s_VCF_setfilter | |
7341 #define __pyx_n_s_VCF_setformat __pyx_mstate_global->__pyx_n_s_VCF_setformat | |
7342 #define __pyx_n_s_VCF_setheader __pyx_mstate_global->__pyx_n_s_VCF_setheader | |
7343 #define __pyx_n_s_VCF_setinfo __pyx_mstate_global->__pyx_n_s_VCF_setinfo | |
7344 #define __pyx_n_s_VCF_setreference __pyx_mstate_global->__pyx_n_s_VCF_setreference | |
7345 #define __pyx_n_s_VCF_setregions __pyx_mstate_global->__pyx_n_s_VCF_setregions | |
7346 #define __pyx_n_s_VCF_setsamples __pyx_mstate_global->__pyx_n_s_VCF_setsamples | |
7347 #define __pyx_n_s_VCF_setversion __pyx_mstate_global->__pyx_n_s_VCF_setversion | |
7348 #define __pyx_n_s_VCF_validate __pyx_mstate_global->__pyx_n_s_VCF_validate | |
7349 #define __pyx_n_s_VCF_warnerror __pyx_mstate_global->__pyx_n_s_VCF_warnerror | |
7350 #define __pyx_n_s_VCF_write __pyx_mstate_global->__pyx_n_s_VCF_write | |
7351 #define __pyx_n_s_VCF_write_data __pyx_mstate_global->__pyx_n_s_VCF_write_data | |
7352 #define __pyx_n_s_VCF_write_header __pyx_mstate_global->__pyx_n_s_VCF_write_header | |
7353 #define __pyx_n_s_VCF_write_heading __pyx_mstate_global->__pyx_n_s_VCF_write_heading | |
7354 #define __pyx_n_s_VCF_writeheader __pyx_mstate_global->__pyx_n_s_VCF_writeheader | |
7355 #define __pyx_kp_u_VCFv3_3 __pyx_mstate_global->__pyx_kp_u_VCFv3_3 | |
7356 #define __pyx_kp_u_VCFv4_0 __pyx_mstate_global->__pyx_kp_u_VCFv4_0 | |
7357 #define __pyx_kp_u_VCFv4_1 __pyx_mstate_global->__pyx_kp_u_VCFv4_1 | |
7358 #define __pyx_kp_u_VCFv4_2 __pyx_mstate_global->__pyx_kp_u_VCFv4_2 | |
7359 #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError | |
7360 #define __pyx_n_s_WRONG_REF __pyx_mstate_global->__pyx_n_s_WRONG_REF | |
7361 #define __pyx_kp_u_WRONG_REF_Wrong_reference_s __pyx_mstate_global->__pyx_kp_u_WRONG_REF_Wrong_reference_s | |
7362 #define __pyx_n_u_Warning __pyx_mstate_global->__pyx_n_u_Warning | |
7363 #define __pyx_n_s_ZERO_FOR_NON_FLAG_FIELD __pyx_mstate_global->__pyx_n_s_ZERO_FOR_NON_FLAG_FIELD | |
7364 #define __pyx_kp_u_ZERO_FOR_NON_FLAG_FIELD_number_s __pyx_mstate_global->__pyx_kp_u_ZERO_FOR_NON_FLAG_FIELD_number_s | |
7365 #define __pyx_n_s_ZERO_LENGTH_ALLELE __pyx_mstate_global->__pyx_n_s_ZERO_LENGTH_ALLELE | |
7366 #define __pyx_kp_u_ZERO_LENGTH_ALLELE_Found_zero_le __pyx_mstate_global->__pyx_kp_u_ZERO_LENGTH_ALLELE_Found_zero_le | |
7367 #define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 | |
7368 #define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 | |
7369 #define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 | |
7370 #define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 | |
7371 #define __pyx_n_s__139 __pyx_mstate_global->__pyx_n_s__139 | |
7372 #define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14 | |
7373 #define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15 | |
7374 #define __pyx_kp_u__16 __pyx_mstate_global->__pyx_kp_u__16 | |
7375 #define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19 | |
7376 #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 | |
7377 #define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23 | |
7378 #define __pyx_kp_u__24 __pyx_mstate_global->__pyx_kp_u__24 | |
7379 #define __pyx_kp_u__25 __pyx_mstate_global->__pyx_kp_u__25 | |
7380 #define __pyx_kp_u__27 __pyx_mstate_global->__pyx_kp_u__27 | |
7381 #define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 | |
7382 #define __pyx_n_s__33 __pyx_mstate_global->__pyx_n_s__33 | |
7383 #define __pyx_kp_u__34 __pyx_mstate_global->__pyx_kp_u__34 | |
7384 #define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 | |
7385 #define __pyx_kp_b__5 __pyx_mstate_global->__pyx_kp_b__5 | |
7386 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 | |
7387 #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 | |
7388 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 | |
7389 #define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 | |
7390 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a | |
7391 #define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add | |
7392 #define __pyx_n_s_add_definition __pyx_mstate_global->__pyx_n_s_add_definition | |
7393 #define __pyx_n_s_addn __pyx_mstate_global->__pyx_n_s_addn | |
7394 #define __pyx_n_s_addns __pyx_mstate_global->__pyx_n_s_addns | |
7395 #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all | |
7396 #define __pyx_n_s_allele __pyx_mstate_global->__pyx_n_s_allele | |
7397 #define __pyx_n_s_alleleRegEx __pyx_mstate_global->__pyx_n_s_alleleRegEx | |
7398 #define __pyx_kp_u_alleles __pyx_mstate_global->__pyx_kp_u_alleles | |
7399 #define __pyx_n_s_alt __pyx_mstate_global->__pyx_n_s_alt | |
7400 #define __pyx_n_u_alt __pyx_mstate_global->__pyx_n_u_alt | |
7401 #define __pyx_n_s_alt1 __pyx_mstate_global->__pyx_n_s_alt1 | |
7402 #define __pyx_n_s_alt2 __pyx_mstate_global->__pyx_n_s_alt2 | |
7403 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append | |
7404 #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args | |
7405 #define __pyx_n_s_asVCFRecord __pyx_mstate_global->__pyx_n_s_asVCFRecord | |
7406 #define __pyx_n_s_asVCFRecord___reduce_cython __pyx_mstate_global->__pyx_n_s_asVCFRecord___reduce_cython | |
7407 #define __pyx_n_s_asVCFRecord___setstate_cython __pyx_mstate_global->__pyx_n_s_asVCFRecord___setstate_cython | |
7408 #define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii | |
7409 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines | |
7410 #define __pyx_n_s_bisect __pyx_mstate_global->__pyx_n_s_bisect | |
7411 #define __pyx_n_s_blurp __pyx_mstate_global->__pyx_n_s_blurp | |
7412 #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c | |
7413 #define __pyx_n_s_chrom __pyx_mstate_global->__pyx_n_s_chrom | |
7414 #define __pyx_n_u_chrom __pyx_mstate_global->__pyx_n_u_chrom | |
7415 #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem | |
7416 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback | |
7417 #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close | |
7418 #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections | |
7419 #define __pyx_n_s_cols __pyx_mstate_global->__pyx_n_s_cols | |
7420 #define __pyx_n_s_compare_calls __pyx_mstate_global->__pyx_n_s_compare_calls | |
7421 #define __pyx_n_s_compile __pyx_mstate_global->__pyx_n_s_compile | |
7422 #define __pyx_n_s_connect __pyx_mstate_global->__pyx_n_s_connect | |
7423 #define __pyx_n_s_convertGT __pyx_mstate_global->__pyx_n_s_convertGT | |
7424 #define __pyx_n_s_convertGTback __pyx_mstate_global->__pyx_n_s_convertGTback | |
7425 #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy | |
7426 #define __pyx_n_s_copy_2 __pyx_mstate_global->__pyx_n_s_copy_2 | |
7427 #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d | |
7428 #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data | |
7429 #define __pyx_n_s_datagenerator __pyx_mstate_global->__pyx_n_s_datagenerator | |
7430 #define __pyx_n_s_deepcopy __pyx_mstate_global->__pyx_n_s_deepcopy | |
7431 #define __pyx_n_s_defaultdict __pyx_mstate_global->__pyx_n_s_defaultdict | |
7432 #define __pyx_n_s_del __pyx_mstate_global->__pyx_n_s_del | |
7433 #define __pyx_kp_u_deletion_is __pyx_mstate_global->__pyx_kp_u_deletion_is | |
7434 #define __pyx_n_u_descr __pyx_mstate_global->__pyx_n_u_descr | |
7435 #define __pyx_n_s_description __pyx_mstate_global->__pyx_n_s_description | |
7436 #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict | |
7437 #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 | |
7438 #define __pyx_n_s_dict_3 __pyx_mstate_global->__pyx_n_s_dict_3 | |
7439 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable | |
7440 #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc | |
7441 #define __pyx_n_s_elts __pyx_mstate_global->__pyx_n_s_elts | |
7442 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable | |
7443 #define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding | |
7444 #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end | |
7445 #define __pyx_n_s_endswith __pyx_mstate_global->__pyx_n_s_endswith | |
7446 #define __pyx_n_s_enter_default_format __pyx_mstate_global->__pyx_n_s_enter_default_format | |
7447 #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate | |
7448 #define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err | |
7449 #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error | |
7450 #define __pyx_n_s_errorlabel __pyx_mstate_global->__pyx_n_s_errorlabel | |
7451 #define __pyx_n_s_errors __pyx_mstate_global->__pyx_n_s_errors | |
7452 #define __pyx_n_s_errorstring __pyx_mstate_global->__pyx_n_s_errorstring | |
7453 #define __pyx_n_s_errwarn __pyx_mstate_global->__pyx_n_s_errwarn | |
7454 #define __pyx_kp_u_expected __pyx_mstate_global->__pyx_kp_u_expected | |
7455 #define __pyx_kp_u_expected_2 __pyx_mstate_global->__pyx_kp_u_expected_2 | |
7456 #define __pyx_kp_u_expected_3 __pyx_mstate_global->__pyx_kp_u_expected_3 | |
7457 #define __pyx_n_s_expected_4 __pyx_mstate_global->__pyx_n_s_expected_4 | |
7458 #define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f | |
7459 #define __pyx_n_s_fa __pyx_mstate_global->__pyx_n_s_fa | |
7460 #define __pyx_n_s_faref __pyx_mstate_global->__pyx_n_s_faref | |
7461 #define __pyx_n_s_faref_leftflank __pyx_mstate_global->__pyx_n_s_faref_leftflank | |
7462 #define __pyx_n_s_fetch __pyx_mstate_global->__pyx_n_s_fetch | |
7463 #define __pyx_n_u_fileformat __pyx_mstate_global->__pyx_n_u_fileformat | |
7464 #define __pyx_kp_u_fileformat_VCFv __pyx_mstate_global->__pyx_kp_u_fileformat_VCFv | |
7465 #define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename | |
7466 #define __pyx_n_s_filter __pyx_mstate_global->__pyx_n_s_filter | |
7467 #define __pyx_n_s_filter_2 __pyx_mstate_global->__pyx_n_s_filter_2 | |
7468 #define __pyx_n_u_filter_2 __pyx_mstate_global->__pyx_n_u_filter_2 | |
7469 #define __pyx_n_s_find __pyx_mstate_global->__pyx_n_s_find | |
7470 #define __pyx_n_s_first __pyx_mstate_global->__pyx_n_s_first | |
7471 #define __pyx_n_s_fmt __pyx_mstate_global->__pyx_n_s_fmt | |
7472 #define __pyx_kp_u_for __pyx_mstate_global->__pyx_kp_u_for | |
7473 #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format | |
7474 #define __pyx_n_u_format __pyx_mstate_global->__pyx_n_u_format | |
7475 #define __pyx_n_s_format_2 __pyx_mstate_global->__pyx_n_s_format_2 | |
7476 #define __pyx_n_s_format_format __pyx_mstate_global->__pyx_n_s_format_format | |
7477 #define __pyx_n_s_format_formatdata __pyx_mstate_global->__pyx_n_s_format_formatdata | |
7478 #define __pyx_n_s_formatdict __pyx_mstate_global->__pyx_n_s_formatdict | |
7479 #define __pyx_kp_u_found __pyx_mstate_global->__pyx_kp_u_found | |
7480 #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc | |
7481 #define __pyx_kp_u_genotypes __pyx_mstate_global->__pyx_kp_u_genotypes | |
7482 #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get | |
7483 #define __pyx_n_s_get_expected __pyx_mstate_global->__pyx_n_s_get_expected | |
7484 #define __pyx_n_s_get_sequence __pyx_mstate_global->__pyx_n_s_get_sequence | |
7485 #define __pyx_n_s_getfilter __pyx_mstate_global->__pyx_n_s_getfilter | |
7486 #define __pyx_n_s_getformat __pyx_mstate_global->__pyx_n_s_getformat | |
7487 #define __pyx_n_s_getheader __pyx_mstate_global->__pyx_n_s_getheader | |
7488 #define __pyx_n_s_getinfo __pyx_mstate_global->__pyx_n_s_getinfo | |
7489 #define __pyx_n_s_getsamples __pyx_mstate_global->__pyx_n_s_getsamples | |
7490 #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate | |
7491 #define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got | |
7492 #define __pyx_n_s_gts __pyx_mstate_global->__pyx_n_s_gts | |
7493 #define __pyx_n_s_gtsRegEx __pyx_mstate_global->__pyx_n_s_gtsRegEx | |
7494 #define __pyx_n_s_have_deletions __pyx_mstate_global->__pyx_n_s_have_deletions | |
7495 #define __pyx_n_s_header __pyx_mstate_global->__pyx_n_s_header | |
7496 #define __pyx_n_s_header_2 __pyx_mstate_global->__pyx_n_s_header_2 | |
7497 #define __pyx_n_s_headings __pyx_mstate_global->__pyx_n_s_headings | |
7498 #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i | |
7499 #define __pyx_kp_u_id __pyx_mstate_global->__pyx_kp_u_id | |
7500 #define __pyx_n_s_id_2 __pyx_mstate_global->__pyx_n_s_id_2 | |
7501 #define __pyx_n_u_id_2 __pyx_mstate_global->__pyx_n_u_id_2 | |
7502 #define __pyx_kp_u_id_numbertype_number_type_descri __pyx_mstate_global->__pyx_kp_u_id_numbertype_number_type_descri | |
7503 #define __pyx_n_s_idx __pyx_mstate_global->__pyx_n_s_idx | |
7504 #define __pyx_n_s_ielts __pyx_mstate_global->__pyx_n_s_ielts | |
7505 #define __pyx_n_s_ignored_errors __pyx_mstate_global->__pyx_n_s_ignored_errors | |
7506 #define __pyx_n_s_ignoreerror __pyx_mstate_global->__pyx_n_s_ignoreerror | |
7507 #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import | |
7508 #define __pyx_kp_u_in_line __pyx_mstate_global->__pyx_kp_u_in_line | |
7509 #define __pyx_n_s_info __pyx_mstate_global->__pyx_n_s_info | |
7510 #define __pyx_n_s_info_2 __pyx_mstate_global->__pyx_n_s_info_2 | |
7511 #define __pyx_n_u_info_2 __pyx_mstate_global->__pyx_n_u_info_2 | |
7512 #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init | |
7513 #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass | |
7514 #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing | |
7515 #define __pyx_n_s_inregion __pyx_mstate_global->__pyx_n_s_inregion | |
7516 #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine | |
7517 #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled | |
7518 #define __pyx_n_s_itemgetter __pyx_mstate_global->__pyx_n_s_itemgetter | |
7519 #define __pyx_n_s_itervalues __pyx_mstate_global->__pyx_n_s_itervalues | |
7520 #define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join | |
7521 #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k | |
7522 #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key | |
7523 #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys | |
7524 #define __pyx_n_s_l __pyx_mstate_global->__pyx_n_s_l | |
7525 #define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label | |
7526 #define __pyx_n_s_last __pyx_mstate_global->__pyx_n_s_last | |
7527 #define __pyx_n_s_last_line __pyx_mstate_global->__pyx_n_s_last_line | |
7528 #define __pyx_n_s_left __pyx_mstate_global->__pyx_n_s_left | |
7529 #define __pyx_n_s_leftalign __pyx_mstate_global->__pyx_n_s_leftalign | |
7530 #define __pyx_n_s_leftalign_2 __pyx_mstate_global->__pyx_n_s_leftalign_2 | |
7531 #define __pyx_n_s_line __pyx_mstate_global->__pyx_n_s_line | |
7532 #define __pyx_n_s_line_2 __pyx_mstate_global->__pyx_n_s_line_2 | |
7533 #define __pyx_n_s_lineno __pyx_mstate_global->__pyx_n_s_lineno | |
7534 #define __pyx_n_s_lineparse __pyx_mstate_global->__pyx_n_s_lineparse | |
7535 #define __pyx_n_s_lines __pyx_mstate_global->__pyx_n_s_lines | |
7536 #define __pyx_n_s_lines_2 __pyx_mstate_global->__pyx_n_s_lines_2 | |
7537 #define __pyx_n_s_longest __pyx_mstate_global->__pyx_n_s_longest | |
7538 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main | |
7539 #define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map | |
7540 #define __pyx_n_s_match __pyx_mstate_global->__pyx_n_s_match | |
7541 #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass | |
7542 #define __pyx_n_s_min __pyx_mstate_global->__pyx_n_s_min | |
7543 #define __pyx_n_u_missing __pyx_mstate_global->__pyx_n_u_missing | |
7544 #define __pyx_n_s_missingvalue __pyx_mstate_global->__pyx_n_s_missingvalue | |
7545 #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module | |
7546 #define __pyx_n_s_movable __pyx_mstate_global->__pyx_n_s_movable | |
7547 #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries | |
7548 #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n | |
7549 #define __pyx_n_s_na __pyx_mstate_global->__pyx_n_s_na | |
7550 #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name | |
7551 #define __pyx_n_s_namedtuple __pyx_mstate_global->__pyx_n_s_namedtuple | |
7552 #define __pyx_kp_u_needs_to_be_checked __pyx_mstate_global->__pyx_kp_u_needs_to_be_checked | |
7553 #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new | |
7554 #define __pyx_n_s_newalts __pyx_mstate_global->__pyx_n_s_newalts | |
7555 #define __pyx_n_s_nmb __pyx_mstate_global->__pyx_n_s_nmb | |
7556 #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non | |
7557 #define __pyx_kp_u_nonref_alleles __pyx_mstate_global->__pyx_kp_u_nonref_alleles | |
7558 #define __pyx_n_s_number __pyx_mstate_global->__pyx_n_s_number | |
7559 #define __pyx_n_u_number __pyx_mstate_global->__pyx_n_u_number | |
7560 #define __pyx_n_s_numbertype __pyx_mstate_global->__pyx_n_s_numbertype | |
7561 #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object | |
7562 #define __pyx_n_s_operator __pyx_mstate_global->__pyx_n_s_operator | |
7563 #define __pyx_n_s_opt __pyx_mstate_global->__pyx_n_s_opt | |
7564 #define __pyx_kp_u_output __pyx_mstate_global->__pyx_kp_u_output | |
7565 #define __pyx_n_s_output_2 __pyx_mstate_global->__pyx_n_s_output_2 | |
7566 #define __pyx_kp_u_parameters_got __pyx_mstate_global->__pyx_kp_u_parameters_got | |
7567 #define __pyx_n_s_parse __pyx_mstate_global->__pyx_n_s_parse | |
7568 #define __pyx_n_s_parse_2 __pyx_mstate_global->__pyx_n_s_parse_2 | |
7569 #define __pyx_n_s_parse_data __pyx_mstate_global->__pyx_n_s_parse_data | |
7570 #define __pyx_n_s_parse_format __pyx_mstate_global->__pyx_n_s_parse_format | |
7571 #define __pyx_n_s_parse_formatdata __pyx_mstate_global->__pyx_n_s_parse_formatdata | |
7572 #define __pyx_n_s_parse_header __pyx_mstate_global->__pyx_n_s_parse_header | |
7573 #define __pyx_n_s_parse_header_2 __pyx_mstate_global->__pyx_n_s_parse_header_2 | |
7574 #define __pyx_n_s_parse_heading __pyx_mstate_global->__pyx_n_s_parse_heading | |
7575 #define __pyx_n_s_parse_regions __pyx_mstate_global->__pyx_n_s_parse_regions | |
7576 #define __pyx_n_s_parser __pyx_mstate_global->__pyx_n_s_parser | |
7577 #define __pyx_kp_u_phased_genotypes __pyx_mstate_global->__pyx_kp_u_phased_genotypes | |
7578 #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle | |
7579 #define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos | |
7580 #define __pyx_n_u_pos __pyx_mstate_global->__pyx_n_u_pos | |
7581 #define __pyx_n_s_pos1 __pyx_mstate_global->__pyx_n_s_pos1 | |
7582 #define __pyx_n_s_pos2 __pyx_mstate_global->__pyx_n_s_pos2 | |
7583 #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare | |
7584 #define __pyx_n_s_pysam __pyx_mstate_global->__pyx_n_s_pysam | |
7585 #define __pyx_n_s_pysam_libcvcf __pyx_mstate_global->__pyx_n_s_pysam_libcvcf | |
7586 #define __pyx_kp_s_pysam_libcvcf_pyx __pyx_mstate_global->__pyx_kp_s_pysam_libcvcf_pyx | |
7587 #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError | |
7588 #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum | |
7589 #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result | |
7590 #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state | |
7591 #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type | |
7592 #define __pyx_n_s_pyx_unpickle_asVCFRecord __pyx_mstate_global->__pyx_n_s_pyx_unpickle_asVCFRecord | |
7593 #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable | |
7594 #define __pyx_n_s_qual __pyx_mstate_global->__pyx_n_s_qual | |
7595 #define __pyx_n_u_qual __pyx_mstate_global->__pyx_n_u_qual | |
7596 #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname | |
7597 #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r | |
7598 #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range | |
7599 #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re | |
7600 #define __pyx_n_s_record __pyx_mstate_global->__pyx_n_s_record | |
7601 #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce | |
7602 #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython | |
7603 #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex | |
7604 #define __pyx_n_s_ref __pyx_mstate_global->__pyx_n_s_ref | |
7605 #define __pyx_n_u_ref __pyx_mstate_global->__pyx_n_u_ref | |
7606 #define __pyx_n_s_ref1 __pyx_mstate_global->__pyx_n_s_ref1 | |
7607 #define __pyx_n_s_ref2 __pyx_mstate_global->__pyx_n_s_ref2 | |
7608 #define __pyx_n_s_reference __pyx_mstate_global->__pyx_n_s_reference | |
7609 #define __pyx_n_s_reference_2 __pyx_mstate_global->__pyx_n_s_reference_2 | |
7610 #define __pyx_kp_u_reference_is __pyx_mstate_global->__pyx_kp_u_reference_is | |
7611 #define __pyx_kp_u_reference_is_2 __pyx_mstate_global->__pyx_kp_u_reference_is_2 | |
7612 #define __pyx_n_s_region __pyx_mstate_global->__pyx_n_s_region | |
7613 #define __pyx_n_s_regions __pyx_mstate_global->__pyx_n_s_regions | |
7614 #define __pyx_n_s_regions_2 __pyx_mstate_global->__pyx_n_s_regions_2 | |
7615 #define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace | |
7616 #define __pyx_n_s_required __pyx_mstate_global->__pyx_n_s_required | |
7617 #define __pyx_n_s_required_2 __pyx_mstate_global->__pyx_n_s_required_2 | |
7618 #define __pyx_n_s_rest __pyx_mstate_global->__pyx_n_s_rest | |
7619 #define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result | |
7620 #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s | |
7621 #define __pyx_n_s_sample __pyx_mstate_global->__pyx_n_s_sample | |
7622 #define __pyx_n_s_sample2column __pyx_mstate_global->__pyx_n_s_sample2column | |
7623 #define __pyx_n_s_samples __pyx_mstate_global->__pyx_n_s_samples | |
7624 #define __pyx_kp_u_samples_2 __pyx_mstate_global->__pyx_kp_u_samples_2 | |
7625 #define __pyx_n_s_samples_3 __pyx_mstate_global->__pyx_n_s_samples_3 | |
7626 #define __pyx_n_s_sdata __pyx_mstate_global->__pyx_n_s_sdata | |
7627 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self | |
7628 #define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send | |
7629 #define __pyx_n_s_separator __pyx_mstate_global->__pyx_n_s_separator | |
7630 #define __pyx_n_s_sequence __pyx_mstate_global->__pyx_n_s_sequence | |
7631 #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name | |
7632 #define __pyx_n_s_setfilter __pyx_mstate_global->__pyx_n_s_setfilter | |
7633 #define __pyx_n_s_setformat __pyx_mstate_global->__pyx_n_s_setformat | |
7634 #define __pyx_n_s_setheader __pyx_mstate_global->__pyx_n_s_setheader | |
7635 #define __pyx_n_s_setinfo __pyx_mstate_global->__pyx_n_s_setinfo | |
7636 #define __pyx_n_s_setreference __pyx_mstate_global->__pyx_n_s_setreference | |
7637 #define __pyx_n_s_setregions __pyx_mstate_global->__pyx_n_s_setregions | |
7638 #define __pyx_n_s_setsamples __pyx_mstate_global->__pyx_n_s_setsamples | |
7639 #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate | |
7640 #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython | |
7641 #define __pyx_n_s_setversion __pyx_mstate_global->__pyx_n_s_setversion | |
7642 #define __pyx_n_s_shortest __pyx_mstate_global->__pyx_n_s_shortest | |
7643 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec | |
7644 #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split | |
7645 #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start | |
7646 #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith | |
7647 #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state | |
7648 #define __pyx_kp_u_sth_entry_not_found __pyx_mstate_global->__pyx_kp_u_sth_entry_not_found | |
7649 #define __pyx_n_s_stream __pyx_mstate_global->__pyx_n_s_stream | |
7650 #define __pyx_n_s_string __pyx_mstate_global->__pyx_n_s_string | |
7651 #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource | |
7652 #define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip | |
7653 #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super | |
7654 #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys | |
7655 #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t | |
7656 #define __pyx_n_s_tabixfile __pyx_mstate_global->__pyx_n_s_tabixfile | |
7657 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test | |
7658 #define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw | |
7659 #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type | |
7660 #define __pyx_n_u_type __pyx_mstate_global->__pyx_n_u_type | |
7661 #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update | |
7662 #define __pyx_n_s_upper __pyx_mstate_global->__pyx_n_s_upper | |
7663 #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate | |
7664 #define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v | |
7665 #define __pyx_n_s_validate __pyx_mstate_global->__pyx_n_s_validate | |
7666 #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value | |
7667 #define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values | |
7668 #define __pyx_kp_u_values_in_element __pyx_mstate_global->__pyx_kp_u_values_in_element | |
7669 #define __pyx_n_s_var __pyx_mstate_global->__pyx_n_s_var | |
7670 #define __pyx_n_s_vcf __pyx_mstate_global->__pyx_n_s_vcf | |
7671 #define __pyx_n_s_vcffile __pyx_mstate_global->__pyx_n_s_vcffile | |
7672 #define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version | |
7673 #define __pyx_n_s_version_2 __pyx_mstate_global->__pyx_n_s_version_2 | |
7674 #define __pyx_n_s_warn_errors __pyx_mstate_global->__pyx_n_s_warn_errors | |
7675 #define __pyx_n_s_warnerror __pyx_mstate_global->__pyx_n_s_warnerror | |
7676 #define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write | |
7677 #define __pyx_n_s_write_data __pyx_mstate_global->__pyx_n_s_write_data | |
7678 #define __pyx_n_s_write_header __pyx_mstate_global->__pyx_n_s_write_header | |
7679 #define __pyx_n_s_write_heading __pyx_mstate_global->__pyx_n_s_write_heading | |
7680 #define __pyx_n_s_writeheader __pyx_mstate_global->__pyx_n_s_writeheader | |
7681 #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x | |
7682 #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y | |
7683 #define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip | |
7684 #define __pyx_float_0_0 __pyx_mstate_global->__pyx_float_0_0 | |
7685 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 | |
7686 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 | |
7687 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 | |
7688 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 | |
7689 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 | |
7690 #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 | |
7691 #define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 | |
7692 #define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 | |
7693 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 | |
7694 #define __pyx_int_9 __pyx_mstate_global->__pyx_int_9 | |
7695 #define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 | |
7696 #define __pyx_int_11 __pyx_mstate_global->__pyx_int_11 | |
7697 #define __pyx_int_12 __pyx_mstate_global->__pyx_int_12 | |
7698 #define __pyx_int_13 __pyx_mstate_global->__pyx_int_13 | |
7699 #define __pyx_int_14 __pyx_mstate_global->__pyx_int_14 | |
7700 #define __pyx_int_15 __pyx_mstate_global->__pyx_int_15 | |
7701 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 | |
7702 #define __pyx_int_17 __pyx_mstate_global->__pyx_int_17 | |
7703 #define __pyx_int_18 __pyx_mstate_global->__pyx_int_18 | |
7704 #define __pyx_int_19 __pyx_mstate_global->__pyx_int_19 | |
7705 #define __pyx_int_20 __pyx_mstate_global->__pyx_int_20 | |
7706 #define __pyx_int_21 __pyx_mstate_global->__pyx_int_21 | |
7707 #define __pyx_int_22 __pyx_mstate_global->__pyx_int_22 | |
7708 #define __pyx_int_23 __pyx_mstate_global->__pyx_int_23 | |
7709 #define __pyx_int_24 __pyx_mstate_global->__pyx_int_24 | |
7710 #define __pyx_int_25 __pyx_mstate_global->__pyx_int_25 | |
7711 #define __pyx_int_26 __pyx_mstate_global->__pyx_int_26 | |
7712 #define __pyx_int_27 __pyx_mstate_global->__pyx_int_27 | |
7713 #define __pyx_int_28 __pyx_mstate_global->__pyx_int_28 | |
7714 #define __pyx_int_29 __pyx_mstate_global->__pyx_int_29 | |
7715 #define __pyx_int_30 __pyx_mstate_global->__pyx_int_30 | |
7716 #define __pyx_int_31 __pyx_mstate_global->__pyx_int_31 | |
7717 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 | |
7718 #define __pyx_int_33 __pyx_mstate_global->__pyx_int_33 | |
7719 #define __pyx_int_40 __pyx_mstate_global->__pyx_int_40 | |
7720 #define __pyx_int_100 __pyx_mstate_global->__pyx_int_100 | |
7721 #define __pyx_int_29527880 __pyx_mstate_global->__pyx_int_29527880 | |
7722 #define __pyx_int_214161357 __pyx_mstate_global->__pyx_int_214161357 | |
7723 #define __pyx_int_239654613 __pyx_mstate_global->__pyx_int_239654613 | |
7724 #define __pyx_int_3000000000 __pyx_mstate_global->__pyx_int_3000000000 | |
7725 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 | |
7726 #define __pyx_slice__9 __pyx_mstate_global->__pyx_slice__9 | |
7727 #define __pyx_slice__17 __pyx_mstate_global->__pyx_slice__17 | |
7728 #define __pyx_slice__18 __pyx_mstate_global->__pyx_slice__18 | |
7729 #define __pyx_slice__20 __pyx_mstate_global->__pyx_slice__20 | |
7730 #define __pyx_slice__26 __pyx_mstate_global->__pyx_slice__26 | |
7731 #define __pyx_slice__28 __pyx_mstate_global->__pyx_slice__28 | |
7732 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 | |
7733 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 | |
7734 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 | |
7735 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 | |
7736 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 | |
7737 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 | |
7738 #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 | |
7739 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 | |
7740 #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 | |
7741 #define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 | |
7742 #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 | |
7743 #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 | |
7744 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 | |
7745 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 | |
7746 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 | |
7747 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 | |
7748 #define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 | |
7749 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 | |
7750 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 | |
7751 #define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 | |
7752 #define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 | |
7753 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 | |
7754 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 | |
7755 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 | |
7756 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 | |
7757 #define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 | |
7758 #define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 | |
7759 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 | |
7760 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 | |
7761 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 | |
7762 #define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 | |
7763 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 | |
7764 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 | |
7765 #define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 | |
7766 #define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85 | |
7767 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 | |
7768 #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 | |
7769 #define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 | |
7770 #define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 | |
7771 #define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 | |
7772 #define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 | |
7773 #define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 | |
7774 #define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103 | |
7775 #define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106 | |
7776 #define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109 | |
7777 #define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111 | |
7778 #define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 | |
7779 #define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115 | |
7780 #define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117 | |
7781 #define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120 | |
7782 #define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 | |
7783 #define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 | |
7784 #define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127 | |
7785 #define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 | |
7786 #define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132 | |
7787 #define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134 | |
7788 #define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135 | |
7789 #define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137 | |
7790 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 | |
7791 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 | |
7792 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 | |
7793 #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 | |
7794 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 | |
7795 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 | |
7796 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 | |
7797 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 | |
7798 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 | |
7799 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 | |
7800 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 | |
7801 #define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 | |
7802 #define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 | |
7803 #define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 | |
7804 #define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69 | |
7805 #define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 | |
7806 #define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 | |
7807 #define __pyx_codeobj__76 __pyx_mstate_global->__pyx_codeobj__76 | |
7808 #define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 | |
7809 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 | |
7810 #define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82 | |
7811 #define __pyx_codeobj__84 __pyx_mstate_global->__pyx_codeobj__84 | |
7812 #define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86 | |
7813 #define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 | |
7814 #define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 | |
7815 #define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 | |
7816 #define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 | |
7817 #define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 | |
7818 #define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 | |
7819 #define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 | |
7820 #define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 | |
7821 #define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102 | |
7822 #define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104 | |
7823 #define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105 | |
7824 #define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107 | |
7825 #define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108 | |
7826 #define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110 | |
7827 #define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 | |
7828 #define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114 | |
7829 #define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116 | |
7830 #define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118 | |
7831 #define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119 | |
7832 #define __pyx_codeobj__121 __pyx_mstate_global->__pyx_codeobj__121 | |
7833 #define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123 | |
7834 #define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124 | |
7835 #define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126 | |
7836 #define __pyx_codeobj__128 __pyx_mstate_global->__pyx_codeobj__128 | |
7837 #define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130 | |
7838 #define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131 | |
7839 #define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133 | |
7840 #define __pyx_codeobj__136 __pyx_mstate_global->__pyx_codeobj__136 | |
7841 #define __pyx_codeobj__138 __pyx_mstate_global->__pyx_codeobj__138 | |
7842 /* #### Code section: module_code ### */ | |
7843 | |
7844 /* "cpython/complex.pxd":19 | |
7845 * | |
7846 * @property | |
7847 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< | |
7848 * return self.cval.real | |
7849 * | |
7850 */ | |
7851 | |
7852 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { | |
7853 double __pyx_r; | |
7854 | |
7855 /* "cpython/complex.pxd":20 | |
7856 * @property | |
7857 * cdef inline double real(self) noexcept: | |
7858 * return self.cval.real # <<<<<<<<<<<<<< | |
7859 * | |
7860 * @property | |
7861 */ | |
7862 __pyx_r = __pyx_v_self->cval.real; | |
7863 goto __pyx_L0; | |
7864 | |
7865 /* "cpython/complex.pxd":19 | |
7866 * | |
7867 * @property | |
7868 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< | |
7869 * return self.cval.real | |
7870 * | |
7871 */ | |
7872 | |
7873 /* function exit code */ | |
7874 __pyx_L0:; | |
7875 return __pyx_r; | |
7876 } | |
7877 | |
7878 /* "cpython/complex.pxd":23 | |
7879 * | |
7880 * @property | |
7881 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< | |
7882 * return self.cval.imag | |
7883 * | |
7884 */ | |
7885 | |
7886 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { | |
7887 double __pyx_r; | |
7888 | |
7889 /* "cpython/complex.pxd":24 | |
7890 * @property | |
7891 * cdef inline double imag(self) noexcept: | |
7892 * return self.cval.imag # <<<<<<<<<<<<<< | |
7893 * | |
7894 * # PyTypeObject PyComplex_Type | |
7895 */ | |
7896 __pyx_r = __pyx_v_self->cval.imag; | |
7897 goto __pyx_L0; | |
7898 | |
7899 /* "cpython/complex.pxd":23 | |
7900 * | |
7901 * @property | |
7902 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< | |
7903 * return self.cval.imag | |
7904 * | |
7905 */ | |
7906 | |
7907 /* function exit code */ | |
7908 __pyx_L0:; | |
7909 return __pyx_r; | |
7910 } | |
7911 | |
7912 /* "cpython/contextvars.pxd":112 | |
7913 * | |
7914 * | |
7915 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< | |
7916 * """Return a new reference to the value of the context variable, | |
7917 * or the default value of the context variable, | |
7918 */ | |
7919 | |
7920 static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) { | |
7921 PyObject *__pyx_v_default_value = ((PyObject *)Py_None); | |
7922 PyObject *__pyx_v_value; | |
7923 PyObject *__pyx_v_pyvalue = NULL; | |
7924 PyObject *__pyx_r = NULL; | |
7925 __Pyx_RefNannyDeclarations | |
7926 int __pyx_t_1; | |
7927 int __pyx_t_2; | |
7928 PyObject *__pyx_t_3 = NULL; | |
7929 int __pyx_lineno = 0; | |
7930 const char *__pyx_filename = NULL; | |
7931 int __pyx_clineno = 0; | |
7932 __Pyx_RefNannySetupContext("get_value", 1); | |
7933 if (__pyx_optional_args) { | |
7934 if (__pyx_optional_args->__pyx_n > 0) { | |
7935 __pyx_v_default_value = __pyx_optional_args->default_value; | |
7936 } | |
7937 } | |
7938 | |
7939 /* "cpython/contextvars.pxd":117 | |
7940 * or None if no such value or default was found. | |
7941 * """ | |
7942 * cdef PyObject *value = NULL # <<<<<<<<<<<<<< | |
7943 * PyContextVar_Get(var, NULL, &value) | |
7944 * if value is NULL: | |
7945 */ | |
7946 __pyx_v_value = NULL; | |
7947 | |
7948 /* "cpython/contextvars.pxd":118 | |
7949 * """ | |
7950 * cdef PyObject *value = NULL | |
7951 * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< | |
7952 * if value is NULL: | |
7953 * # context variable does not have a default | |
7954 */ | |
7955 __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 118, __pyx_L1_error) | |
7956 | |
7957 /* "cpython/contextvars.pxd":119 | |
7958 * cdef PyObject *value = NULL | |
7959 * PyContextVar_Get(var, NULL, &value) | |
7960 * if value is NULL: # <<<<<<<<<<<<<< | |
7961 * # context variable does not have a default | |
7962 * pyvalue = default_value | |
7963 */ | |
7964 __pyx_t_2 = (__pyx_v_value == NULL); | |
7965 if (__pyx_t_2) { | |
7966 | |
7967 /* "cpython/contextvars.pxd":121 | |
7968 * if value is NULL: | |
7969 * # context variable does not have a default | |
7970 * pyvalue = default_value # <<<<<<<<<<<<<< | |
7971 * else: | |
7972 * # value or default value of context variable | |
7973 */ | |
7974 __Pyx_INCREF(__pyx_v_default_value); | |
7975 __pyx_v_pyvalue = __pyx_v_default_value; | |
7976 | |
7977 /* "cpython/contextvars.pxd":119 | |
7978 * cdef PyObject *value = NULL | |
7979 * PyContextVar_Get(var, NULL, &value) | |
7980 * if value is NULL: # <<<<<<<<<<<<<< | |
7981 * # context variable does not have a default | |
7982 * pyvalue = default_value | |
7983 */ | |
7984 goto __pyx_L3; | |
7985 } | |
7986 | |
7987 /* "cpython/contextvars.pxd":124 | |
7988 * else: | |
7989 * # value or default value of context variable | |
7990 * pyvalue = <object>value # <<<<<<<<<<<<<< | |
7991 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
7992 * return pyvalue | |
7993 */ | |
7994 /*else*/ { | |
7995 __pyx_t_3 = ((PyObject *)__pyx_v_value); | |
7996 __Pyx_INCREF(__pyx_t_3); | |
7997 __pyx_v_pyvalue = __pyx_t_3; | |
7998 __pyx_t_3 = 0; | |
7999 | |
8000 /* "cpython/contextvars.pxd":125 | |
8001 * # value or default value of context variable | |
8002 * pyvalue = <object>value | |
8003 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< | |
8004 * return pyvalue | |
8005 * | |
8006 */ | |
8007 Py_XDECREF(__pyx_v_value); | |
8008 } | |
8009 __pyx_L3:; | |
8010 | |
8011 /* "cpython/contextvars.pxd":126 | |
8012 * pyvalue = <object>value | |
8013 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
8014 * return pyvalue # <<<<<<<<<<<<<< | |
8015 * | |
8016 * | |
8017 */ | |
8018 __Pyx_XDECREF(__pyx_r); | |
8019 __Pyx_INCREF(__pyx_v_pyvalue); | |
8020 __pyx_r = __pyx_v_pyvalue; | |
8021 goto __pyx_L0; | |
8022 | |
8023 /* "cpython/contextvars.pxd":112 | |
8024 * | |
8025 * | |
8026 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< | |
8027 * """Return a new reference to the value of the context variable, | |
8028 * or the default value of the context variable, | |
8029 */ | |
8030 | |
8031 /* function exit code */ | |
8032 __pyx_L1_error:; | |
8033 __Pyx_XDECREF(__pyx_t_3); | |
8034 __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8035 __pyx_r = 0; | |
8036 __pyx_L0:; | |
8037 __Pyx_XDECREF(__pyx_v_pyvalue); | |
8038 __Pyx_XGIVEREF(__pyx_r); | |
8039 __Pyx_RefNannyFinishContext(); | |
8040 return __pyx_r; | |
8041 } | |
8042 | |
8043 /* "cpython/contextvars.pxd":129 | |
8044 * | |
8045 * | |
8046 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< | |
8047 * """Return a new reference to the value of the context variable, | |
8048 * or the provided default value if no such value was found. | |
8049 */ | |
8050 | |
8051 static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) { | |
8052 PyObject *__pyx_v_default_value = ((PyObject *)Py_None); | |
8053 PyObject *__pyx_v_value; | |
8054 PyObject *__pyx_v_pyvalue = NULL; | |
8055 PyObject *__pyx_r = NULL; | |
8056 __Pyx_RefNannyDeclarations | |
8057 int __pyx_t_1; | |
8058 PyObject *__pyx_t_2 = NULL; | |
8059 int __pyx_lineno = 0; | |
8060 const char *__pyx_filename = NULL; | |
8061 int __pyx_clineno = 0; | |
8062 __Pyx_RefNannySetupContext("get_value_no_default", 1); | |
8063 if (__pyx_optional_args) { | |
8064 if (__pyx_optional_args->__pyx_n > 0) { | |
8065 __pyx_v_default_value = __pyx_optional_args->default_value; | |
8066 } | |
8067 } | |
8068 | |
8069 /* "cpython/contextvars.pxd":135 | |
8070 * Ignores the default value of the context variable, if any. | |
8071 * """ | |
8072 * cdef PyObject *value = NULL # <<<<<<<<<<<<<< | |
8073 * PyContextVar_Get(var, <PyObject*>default_value, &value) | |
8074 * # value of context variable or 'default_value' | |
8075 */ | |
8076 __pyx_v_value = NULL; | |
8077 | |
8078 /* "cpython/contextvars.pxd":136 | |
8079 * """ | |
8080 * cdef PyObject *value = NULL | |
8081 * PyContextVar_Get(var, <PyObject*>default_value, &value) # <<<<<<<<<<<<<< | |
8082 * # value of context variable or 'default_value' | |
8083 * pyvalue = <object>value | |
8084 */ | |
8085 __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 136, __pyx_L1_error) | |
8086 | |
8087 /* "cpython/contextvars.pxd":138 | |
8088 * PyContextVar_Get(var, <PyObject*>default_value, &value) | |
8089 * # value of context variable or 'default_value' | |
8090 * pyvalue = <object>value # <<<<<<<<<<<<<< | |
8091 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
8092 * return pyvalue | |
8093 */ | |
8094 __pyx_t_2 = ((PyObject *)__pyx_v_value); | |
8095 __Pyx_INCREF(__pyx_t_2); | |
8096 __pyx_v_pyvalue = __pyx_t_2; | |
8097 __pyx_t_2 = 0; | |
8098 | |
8099 /* "cpython/contextvars.pxd":139 | |
8100 * # value of context variable or 'default_value' | |
8101 * pyvalue = <object>value | |
8102 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< | |
8103 * return pyvalue | |
8104 */ | |
8105 Py_XDECREF(__pyx_v_value); | |
8106 | |
8107 /* "cpython/contextvars.pxd":140 | |
8108 * pyvalue = <object>value | |
8109 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
8110 * return pyvalue # <<<<<<<<<<<<<< | |
8111 */ | |
8112 __Pyx_XDECREF(__pyx_r); | |
8113 __Pyx_INCREF(__pyx_v_pyvalue); | |
8114 __pyx_r = __pyx_v_pyvalue; | |
8115 goto __pyx_L0; | |
8116 | |
8117 /* "cpython/contextvars.pxd":129 | |
8118 * | |
8119 * | |
8120 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< | |
8121 * """Return a new reference to the value of the context variable, | |
8122 * or the provided default value if no such value was found. | |
8123 */ | |
8124 | |
8125 /* function exit code */ | |
8126 __pyx_L1_error:; | |
8127 __Pyx_XDECREF(__pyx_t_2); | |
8128 __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8129 __pyx_r = 0; | |
8130 __pyx_L0:; | |
8131 __Pyx_XDECREF(__pyx_v_pyvalue); | |
8132 __Pyx_XGIVEREF(__pyx_r); | |
8133 __Pyx_RefNannyFinishContext(); | |
8134 return __pyx_r; | |
8135 } | |
8136 | |
8137 /* "array.pxd":104 | |
8138 * __data_union data | |
8139 * | |
8140 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< | |
8141 * # This implementation of getbuffer is geared towards Cython | |
8142 * # requirements, and does not yet fulfill the PEP. | |
8143 */ | |
8144 | |
8145 /* Python wrapper */ | |
8146 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ | |
8147 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { | |
8148 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
8149 int __pyx_r; | |
8150 __Pyx_RefNannyDeclarations | |
8151 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); | |
8152 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
8153 __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); | |
8154 | |
8155 /* function exit code */ | |
8156 __Pyx_RefNannyFinishContext(); | |
8157 return __pyx_r; | |
8158 } | |
8159 | |
8160 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) { | |
8161 PyObject *__pyx_v_item_count = NULL; | |
8162 int __pyx_r; | |
8163 __Pyx_RefNannyDeclarations | |
8164 PyObject *__pyx_t_1 = NULL; | |
8165 char *__pyx_t_2; | |
8166 int __pyx_t_3; | |
8167 PyObject *__pyx_t_4 = NULL; | |
8168 Py_ssize_t __pyx_t_5; | |
8169 int __pyx_t_6; | |
8170 char __pyx_t_7; | |
8171 int __pyx_lineno = 0; | |
8172 const char *__pyx_filename = NULL; | |
8173 int __pyx_clineno = 0; | |
8174 if (unlikely(__pyx_v_info == NULL)) { | |
8175 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); | |
8176 return -1; | |
8177 } | |
8178 __Pyx_RefNannySetupContext("__getbuffer__", 0); | |
8179 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); | |
8180 __Pyx_GIVEREF(__pyx_v_info->obj); | |
8181 | |
8182 /* "array.pxd":109 | |
8183 * # In particular strided access is always provided regardless | |
8184 * # of flags | |
8185 * item_count = Py_SIZE(self) # <<<<<<<<<<<<<< | |
8186 * | |
8187 * info.suboffsets = NULL | |
8188 */ | |
8189 __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 109, __pyx_L1_error) | |
8190 __Pyx_GOTREF(__pyx_t_1); | |
8191 __pyx_v_item_count = __pyx_t_1; | |
8192 __pyx_t_1 = 0; | |
8193 | |
8194 /* "array.pxd":111 | |
8195 * item_count = Py_SIZE(self) | |
8196 * | |
8197 * info.suboffsets = NULL # <<<<<<<<<<<<<< | |
8198 * info.buf = self.data.as_chars | |
8199 * info.readonly = 0 | |
8200 */ | |
8201 __pyx_v_info->suboffsets = NULL; | |
8202 | |
8203 /* "array.pxd":112 | |
8204 * | |
8205 * info.suboffsets = NULL | |
8206 * info.buf = self.data.as_chars # <<<<<<<<<<<<<< | |
8207 * info.readonly = 0 | |
8208 * info.ndim = 1 | |
8209 */ | |
8210 __pyx_t_2 = __pyx_v_self->data.as_chars; | |
8211 __pyx_v_info->buf = __pyx_t_2; | |
8212 | |
8213 /* "array.pxd":113 | |
8214 * info.suboffsets = NULL | |
8215 * info.buf = self.data.as_chars | |
8216 * info.readonly = 0 # <<<<<<<<<<<<<< | |
8217 * info.ndim = 1 | |
8218 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) | |
8219 */ | |
8220 __pyx_v_info->readonly = 0; | |
8221 | |
8222 /* "array.pxd":114 | |
8223 * info.buf = self.data.as_chars | |
8224 * info.readonly = 0 | |
8225 * info.ndim = 1 # <<<<<<<<<<<<<< | |
8226 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) | |
8227 * info.len = info.itemsize * item_count | |
8228 */ | |
8229 __pyx_v_info->ndim = 1; | |
8230 | |
8231 /* "array.pxd":115 | |
8232 * info.readonly = 0 | |
8233 * info.ndim = 1 | |
8234 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<< | |
8235 * info.len = info.itemsize * item_count | |
8236 * | |
8237 */ | |
8238 __pyx_t_3 = __pyx_v_self->ob_descr->itemsize; | |
8239 __pyx_v_info->itemsize = __pyx_t_3; | |
8240 | |
8241 /* "array.pxd":116 | |
8242 * info.ndim = 1 | |
8243 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) | |
8244 * info.len = info.itemsize * item_count # <<<<<<<<<<<<<< | |
8245 * | |
8246 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
8247 */ | |
8248 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 116, __pyx_L1_error) | |
8249 __Pyx_GOTREF(__pyx_t_1); | |
8250 __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 116, __pyx_L1_error) | |
8251 __Pyx_GOTREF(__pyx_t_4); | |
8252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8253 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 116, __pyx_L1_error) | |
8254 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
8255 __pyx_v_info->len = __pyx_t_5; | |
8256 | |
8257 /* "array.pxd":118 | |
8258 * info.len = info.itemsize * item_count | |
8259 * | |
8260 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<< | |
8261 * if not info.shape: | |
8262 * raise MemoryError() | |
8263 */ | |
8264 __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2))); | |
8265 | |
8266 /* "array.pxd":119 | |
8267 * | |
8268 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
8269 * if not info.shape: # <<<<<<<<<<<<<< | |
8270 * raise MemoryError() | |
8271 * info.shape[0] = item_count # constant regardless of resizing | |
8272 */ | |
8273 __pyx_t_6 = (!(__pyx_v_info->shape != 0)); | |
8274 if (unlikely(__pyx_t_6)) { | |
8275 | |
8276 /* "array.pxd":120 | |
8277 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
8278 * if not info.shape: | |
8279 * raise MemoryError() # <<<<<<<<<<<<<< | |
8280 * info.shape[0] = item_count # constant regardless of resizing | |
8281 * info.strides = &info.itemsize | |
8282 */ | |
8283 PyErr_NoMemory(); __PYX_ERR(3, 120, __pyx_L1_error) | |
8284 | |
8285 /* "array.pxd":119 | |
8286 * | |
8287 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
8288 * if not info.shape: # <<<<<<<<<<<<<< | |
8289 * raise MemoryError() | |
8290 * info.shape[0] = item_count # constant regardless of resizing | |
8291 */ | |
8292 } | |
8293 | |
8294 /* "array.pxd":121 | |
8295 * if not info.shape: | |
8296 * raise MemoryError() | |
8297 * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<< | |
8298 * info.strides = &info.itemsize | |
8299 * | |
8300 */ | |
8301 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 121, __pyx_L1_error) | |
8302 (__pyx_v_info->shape[0]) = __pyx_t_5; | |
8303 | |
8304 /* "array.pxd":122 | |
8305 * raise MemoryError() | |
8306 * info.shape[0] = item_count # constant regardless of resizing | |
8307 * info.strides = &info.itemsize # <<<<<<<<<<<<<< | |
8308 * | |
8309 * info.format = <char*> (info.shape + 1) | |
8310 */ | |
8311 __pyx_v_info->strides = (&__pyx_v_info->itemsize); | |
8312 | |
8313 /* "array.pxd":124 | |
8314 * info.strides = &info.itemsize | |
8315 * | |
8316 * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<< | |
8317 * info.format[0] = self.ob_descr.typecode | |
8318 * info.format[1] = 0 | |
8319 */ | |
8320 __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1)); | |
8321 | |
8322 /* "array.pxd":125 | |
8323 * | |
8324 * info.format = <char*> (info.shape + 1) | |
8325 * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<< | |
8326 * info.format[1] = 0 | |
8327 * info.obj = self | |
8328 */ | |
8329 __pyx_t_7 = __pyx_v_self->ob_descr->typecode; | |
8330 (__pyx_v_info->format[0]) = __pyx_t_7; | |
8331 | |
8332 /* "array.pxd":126 | |
8333 * info.format = <char*> (info.shape + 1) | |
8334 * info.format[0] = self.ob_descr.typecode | |
8335 * info.format[1] = 0 # <<<<<<<<<<<<<< | |
8336 * info.obj = self | |
8337 * | |
8338 */ | |
8339 (__pyx_v_info->format[1]) = 0; | |
8340 | |
8341 /* "array.pxd":127 | |
8342 * info.format[0] = self.ob_descr.typecode | |
8343 * info.format[1] = 0 | |
8344 * info.obj = self # <<<<<<<<<<<<<< | |
8345 * | |
8346 * def __releasebuffer__(self, Py_buffer* info): | |
8347 */ | |
8348 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
8349 __Pyx_GIVEREF((PyObject *)__pyx_v_self); | |
8350 __Pyx_GOTREF(__pyx_v_info->obj); | |
8351 __Pyx_DECREF(__pyx_v_info->obj); | |
8352 __pyx_v_info->obj = ((PyObject *)__pyx_v_self); | |
8353 | |
8354 /* "array.pxd":104 | |
8355 * __data_union data | |
8356 * | |
8357 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< | |
8358 * # This implementation of getbuffer is geared towards Cython | |
8359 * # requirements, and does not yet fulfill the PEP. | |
8360 */ | |
8361 | |
8362 /* function exit code */ | |
8363 __pyx_r = 0; | |
8364 goto __pyx_L0; | |
8365 __pyx_L1_error:; | |
8366 __Pyx_XDECREF(__pyx_t_1); | |
8367 __Pyx_XDECREF(__pyx_t_4); | |
8368 __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8369 __pyx_r = -1; | |
8370 if (__pyx_v_info->obj != NULL) { | |
8371 __Pyx_GOTREF(__pyx_v_info->obj); | |
8372 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; | |
8373 } | |
8374 goto __pyx_L2; | |
8375 __pyx_L0:; | |
8376 if (__pyx_v_info->obj == Py_None) { | |
8377 __Pyx_GOTREF(__pyx_v_info->obj); | |
8378 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; | |
8379 } | |
8380 __pyx_L2:; | |
8381 __Pyx_XDECREF(__pyx_v_item_count); | |
8382 __Pyx_RefNannyFinishContext(); | |
8383 return __pyx_r; | |
8384 } | |
8385 | |
8386 /* "array.pxd":129 | |
8387 * info.obj = self | |
8388 * | |
8389 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< | |
8390 * PyObject_Free(info.shape) | |
8391 * | |
8392 */ | |
8393 | |
8394 /* Python wrapper */ | |
8395 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ | |
8396 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { | |
8397 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
8398 __Pyx_RefNannyDeclarations | |
8399 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); | |
8400 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
8401 __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); | |
8402 | |
8403 /* function exit code */ | |
8404 __Pyx_RefNannyFinishContext(); | |
8405 } | |
8406 | |
8407 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) { | |
8408 | |
8409 /* "array.pxd":130 | |
8410 * | |
8411 * def __releasebuffer__(self, Py_buffer* info): | |
8412 * PyObject_Free(info.shape) # <<<<<<<<<<<<<< | |
8413 * | |
8414 * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr) | |
8415 */ | |
8416 PyObject_Free(__pyx_v_info->shape); | |
8417 | |
8418 /* "array.pxd":129 | |
8419 * info.obj = self | |
8420 * | |
8421 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< | |
8422 * PyObject_Free(info.shape) | |
8423 * | |
8424 */ | |
8425 | |
8426 /* function exit code */ | |
8427 } | |
8428 | |
8429 /* "array.pxd":141 | |
8430 * | |
8431 * | |
8432 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< | |
8433 * """ fast creation of a new array, given a template array. | |
8434 * type will be same as template. | |
8435 */ | |
8436 | |
8437 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) { | |
8438 arrayobject *__pyx_v_op = 0; | |
8439 arrayobject *__pyx_r = NULL; | |
8440 __Pyx_RefNannyDeclarations | |
8441 PyObject *__pyx_t_1 = NULL; | |
8442 int __pyx_t_2; | |
8443 int __pyx_t_3; | |
8444 int __pyx_lineno = 0; | |
8445 const char *__pyx_filename = NULL; | |
8446 int __pyx_clineno = 0; | |
8447 __Pyx_RefNannySetupContext("clone", 1); | |
8448 | |
8449 /* "array.pxd":145 | |
8450 * type will be same as template. | |
8451 * if zero is true, new array will be initialized with zeroes.""" | |
8452 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<< | |
8453 * if zero and op is not None: | |
8454 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
8455 */ | |
8456 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 145, __pyx_L1_error) | |
8457 __Pyx_GOTREF(__pyx_t_1); | |
8458 __pyx_v_op = ((arrayobject *)__pyx_t_1); | |
8459 __pyx_t_1 = 0; | |
8460 | |
8461 /* "array.pxd":146 | |
8462 * if zero is true, new array will be initialized with zeroes.""" | |
8463 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) | |
8464 * if zero and op is not None: # <<<<<<<<<<<<<< | |
8465 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
8466 * return op | |
8467 */ | |
8468 if (__pyx_v_zero) { | |
8469 } else { | |
8470 __pyx_t_2 = __pyx_v_zero; | |
8471 goto __pyx_L4_bool_binop_done; | |
8472 } | |
8473 __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None); | |
8474 __pyx_t_2 = __pyx_t_3; | |
8475 __pyx_L4_bool_binop_done:; | |
8476 if (__pyx_t_2) { | |
8477 | |
8478 /* "array.pxd":147 | |
8479 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) | |
8480 * if zero and op is not None: | |
8481 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<< | |
8482 * return op | |
8483 * | |
8484 */ | |
8485 (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize))); | |
8486 | |
8487 /* "array.pxd":146 | |
8488 * if zero is true, new array will be initialized with zeroes.""" | |
8489 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) | |
8490 * if zero and op is not None: # <<<<<<<<<<<<<< | |
8491 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
8492 * return op | |
8493 */ | |
8494 } | |
8495 | |
8496 /* "array.pxd":148 | |
8497 * if zero and op is not None: | |
8498 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
8499 * return op # <<<<<<<<<<<<<< | |
8500 * | |
8501 * cdef inline array copy(array self): | |
8502 */ | |
8503 __Pyx_XDECREF((PyObject *)__pyx_r); | |
8504 __Pyx_INCREF((PyObject *)__pyx_v_op); | |
8505 __pyx_r = __pyx_v_op; | |
8506 goto __pyx_L0; | |
8507 | |
8508 /* "array.pxd":141 | |
8509 * | |
8510 * | |
8511 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< | |
8512 * """ fast creation of a new array, given a template array. | |
8513 * type will be same as template. | |
8514 */ | |
8515 | |
8516 /* function exit code */ | |
8517 __pyx_L1_error:; | |
8518 __Pyx_XDECREF(__pyx_t_1); | |
8519 __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8520 __pyx_r = 0; | |
8521 __pyx_L0:; | |
8522 __Pyx_XDECREF((PyObject *)__pyx_v_op); | |
8523 __Pyx_XGIVEREF((PyObject *)__pyx_r); | |
8524 __Pyx_RefNannyFinishContext(); | |
8525 return __pyx_r; | |
8526 } | |
8527 | |
8528 /* "array.pxd":150 | |
8529 * return op | |
8530 * | |
8531 * cdef inline array copy(array self): # <<<<<<<<<<<<<< | |
8532 * """ make a copy of an array. """ | |
8533 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
8534 */ | |
8535 | |
8536 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) { | |
8537 arrayobject *__pyx_v_op = 0; | |
8538 arrayobject *__pyx_r = NULL; | |
8539 __Pyx_RefNannyDeclarations | |
8540 PyObject *__pyx_t_1 = NULL; | |
8541 int __pyx_lineno = 0; | |
8542 const char *__pyx_filename = NULL; | |
8543 int __pyx_clineno = 0; | |
8544 __Pyx_RefNannySetupContext("copy", 1); | |
8545 | |
8546 /* "array.pxd":152 | |
8547 * cdef inline array copy(array self): | |
8548 * """ make a copy of an array. """ | |
8549 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<< | |
8550 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) | |
8551 * return op | |
8552 */ | |
8553 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 152, __pyx_L1_error) | |
8554 __Pyx_GOTREF(__pyx_t_1); | |
8555 __pyx_v_op = ((arrayobject *)__pyx_t_1); | |
8556 __pyx_t_1 = 0; | |
8557 | |
8558 /* "array.pxd":153 | |
8559 * """ make a copy of an array. """ | |
8560 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
8561 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<< | |
8562 * return op | |
8563 * | |
8564 */ | |
8565 (void)(memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize))); | |
8566 | |
8567 /* "array.pxd":154 | |
8568 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
8569 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) | |
8570 * return op # <<<<<<<<<<<<<< | |
8571 * | |
8572 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: | |
8573 */ | |
8574 __Pyx_XDECREF((PyObject *)__pyx_r); | |
8575 __Pyx_INCREF((PyObject *)__pyx_v_op); | |
8576 __pyx_r = __pyx_v_op; | |
8577 goto __pyx_L0; | |
8578 | |
8579 /* "array.pxd":150 | |
8580 * return op | |
8581 * | |
8582 * cdef inline array copy(array self): # <<<<<<<<<<<<<< | |
8583 * """ make a copy of an array. """ | |
8584 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
8585 */ | |
8586 | |
8587 /* function exit code */ | |
8588 __pyx_L1_error:; | |
8589 __Pyx_XDECREF(__pyx_t_1); | |
8590 __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8591 __pyx_r = 0; | |
8592 __pyx_L0:; | |
8593 __Pyx_XDECREF((PyObject *)__pyx_v_op); | |
8594 __Pyx_XGIVEREF((PyObject *)__pyx_r); | |
8595 __Pyx_RefNannyFinishContext(); | |
8596 return __pyx_r; | |
8597 } | |
8598 | |
8599 /* "array.pxd":156 | |
8600 * return op | |
8601 * | |
8602 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< | |
8603 * """ efficient appending of new stuff of same type | |
8604 * (e.g. of same array type) | |
8605 */ | |
8606 | |
8607 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) { | |
8608 Py_ssize_t __pyx_v_itemsize; | |
8609 Py_ssize_t __pyx_v_origsize; | |
8610 int __pyx_r; | |
8611 int __pyx_t_1; | |
8612 int __pyx_lineno = 0; | |
8613 const char *__pyx_filename = NULL; | |
8614 int __pyx_clineno = 0; | |
8615 | |
8616 /* "array.pxd":160 | |
8617 * (e.g. of same array type) | |
8618 * n: number of elements (not number of bytes!) """ | |
8619 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<< | |
8620 * cdef Py_ssize_t origsize = Py_SIZE(self) | |
8621 * resize_smart(self, origsize + n) | |
8622 */ | |
8623 __pyx_t_1 = __pyx_v_self->ob_descr->itemsize; | |
8624 __pyx_v_itemsize = __pyx_t_1; | |
8625 | |
8626 /* "array.pxd":161 | |
8627 * n: number of elements (not number of bytes!) """ | |
8628 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize | |
8629 * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<< | |
8630 * resize_smart(self, origsize + n) | |
8631 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) | |
8632 */ | |
8633 __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self)); | |
8634 | |
8635 /* "array.pxd":162 | |
8636 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize | |
8637 * cdef Py_ssize_t origsize = Py_SIZE(self) | |
8638 * resize_smart(self, origsize + n) # <<<<<<<<<<<<<< | |
8639 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) | |
8640 * return 0 | |
8641 */ | |
8642 __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 162, __pyx_L1_error) | |
8643 | |
8644 /* "array.pxd":163 | |
8645 * cdef Py_ssize_t origsize = Py_SIZE(self) | |
8646 * resize_smart(self, origsize + n) | |
8647 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<< | |
8648 * return 0 | |
8649 * | |
8650 */ | |
8651 (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize))); | |
8652 | |
8653 /* "array.pxd":164 | |
8654 * resize_smart(self, origsize + n) | |
8655 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) | |
8656 * return 0 # <<<<<<<<<<<<<< | |
8657 * | |
8658 * cdef inline int extend(array self, array other) except -1: | |
8659 */ | |
8660 __pyx_r = 0; | |
8661 goto __pyx_L0; | |
8662 | |
8663 /* "array.pxd":156 | |
8664 * return op | |
8665 * | |
8666 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< | |
8667 * """ efficient appending of new stuff of same type | |
8668 * (e.g. of same array type) | |
8669 */ | |
8670 | |
8671 /* function exit code */ | |
8672 __pyx_L1_error:; | |
8673 __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8674 __pyx_r = -1; | |
8675 __pyx_L0:; | |
8676 return __pyx_r; | |
8677 } | |
8678 | |
8679 /* "array.pxd":166 | |
8680 * return 0 | |
8681 * | |
8682 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< | |
8683 * """ extend array with data from another array; types must match. """ | |
8684 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
8685 */ | |
8686 | |
8687 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) { | |
8688 int __pyx_r; | |
8689 int __pyx_t_1; | |
8690 int __pyx_t_2; | |
8691 int __pyx_lineno = 0; | |
8692 const char *__pyx_filename = NULL; | |
8693 int __pyx_clineno = 0; | |
8694 | |
8695 /* "array.pxd":168 | |
8696 * cdef inline int extend(array self, array other) except -1: | |
8697 * """ extend array with data from another array; types must match. """ | |
8698 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< | |
8699 * PyErr_BadArgument() | |
8700 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
8701 */ | |
8702 __pyx_t_1 = (__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode); | |
8703 if (__pyx_t_1) { | |
8704 | |
8705 /* "array.pxd":169 | |
8706 * """ extend array with data from another array; types must match. """ | |
8707 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
8708 * PyErr_BadArgument() # <<<<<<<<<<<<<< | |
8709 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
8710 * | |
8711 */ | |
8712 __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 169, __pyx_L1_error) | |
8713 | |
8714 /* "array.pxd":168 | |
8715 * cdef inline int extend(array self, array other) except -1: | |
8716 * """ extend array with data from another array; types must match. """ | |
8717 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< | |
8718 * PyErr_BadArgument() | |
8719 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
8720 */ | |
8721 } | |
8722 | |
8723 /* "array.pxd":170 | |
8724 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
8725 * PyErr_BadArgument() | |
8726 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<< | |
8727 * | |
8728 * cdef inline void zero(array self) noexcept: | |
8729 */ | |
8730 __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 170, __pyx_L1_error) | |
8731 __pyx_r = __pyx_t_2; | |
8732 goto __pyx_L0; | |
8733 | |
8734 /* "array.pxd":166 | |
8735 * return 0 | |
8736 * | |
8737 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< | |
8738 * """ extend array with data from another array; types must match. """ | |
8739 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
8740 */ | |
8741 | |
8742 /* function exit code */ | |
8743 __pyx_L1_error:; | |
8744 __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8745 __pyx_r = -1; | |
8746 __pyx_L0:; | |
8747 return __pyx_r; | |
8748 } | |
8749 | |
8750 /* "array.pxd":172 | |
8751 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
8752 * | |
8753 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<< | |
8754 * """ set all elements of array to zero. """ | |
8755 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) | |
8756 */ | |
8757 | |
8758 static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) { | |
8759 | |
8760 /* "array.pxd":174 | |
8761 * cdef inline void zero(array self) noexcept: | |
8762 * """ set all elements of array to zero. """ | |
8763 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<< | |
8764 */ | |
8765 (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize))); | |
8766 | |
8767 /* "array.pxd":172 | |
8768 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
8769 * | |
8770 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<< | |
8771 * """ set all elements of array to zero. """ | |
8772 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) | |
8773 */ | |
8774 | |
8775 /* function exit code */ | |
8776 } | |
8777 | |
8778 /* "pysam/libcvcf.pyx":68 | |
8779 * | |
8780 * # Utility function. Uses 0-based coordinates | |
8781 * def get_sequence(chrom, start, end, fa): # <<<<<<<<<<<<<< | |
8782 * # obtain sequence from .fa file, without truncation | |
8783 * if end<=start: return "" | |
8784 */ | |
8785 | |
8786 /* Python wrapper */ | |
8787 static PyObject *__pyx_pw_5pysam_7libcvcf_1get_sequence(PyObject *__pyx_self, | |
8788 #if CYTHON_METH_FASTCALL | |
8789 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8790 #else | |
8791 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8792 #endif | |
8793 ); /*proto*/ | |
8794 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_get_sequence, "get_sequence(chrom, start, end, fa)"); | |
8795 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_1get_sequence = {"get_sequence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_1get_sequence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_get_sequence}; | |
8796 static PyObject *__pyx_pw_5pysam_7libcvcf_1get_sequence(PyObject *__pyx_self, | |
8797 #if CYTHON_METH_FASTCALL | |
8798 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8799 #else | |
8800 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8801 #endif | |
8802 ) { | |
8803 PyObject *__pyx_v_chrom = 0; | |
8804 PyObject *__pyx_v_start = 0; | |
8805 PyObject *__pyx_v_end = 0; | |
8806 PyObject *__pyx_v_fa = 0; | |
8807 #if !CYTHON_METH_FASTCALL | |
8808 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
8809 #endif | |
8810 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
8811 PyObject* values[4] = {0,0,0,0}; | |
8812 int __pyx_lineno = 0; | |
8813 const char *__pyx_filename = NULL; | |
8814 int __pyx_clineno = 0; | |
8815 PyObject *__pyx_r = 0; | |
8816 __Pyx_RefNannyDeclarations | |
8817 __Pyx_RefNannySetupContext("get_sequence (wrapper)", 0); | |
8818 #if !CYTHON_METH_FASTCALL | |
8819 #if CYTHON_ASSUME_SAFE_MACROS | |
8820 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
8821 #else | |
8822 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
8823 #endif | |
8824 #endif | |
8825 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
8826 { | |
8827 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_fa,0}; | |
8828 if (__pyx_kwds) { | |
8829 Py_ssize_t kw_args; | |
8830 switch (__pyx_nargs) { | |
8831 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
8832 CYTHON_FALLTHROUGH; | |
8833 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
8834 CYTHON_FALLTHROUGH; | |
8835 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
8836 CYTHON_FALLTHROUGH; | |
8837 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
8838 CYTHON_FALLTHROUGH; | |
8839 case 0: break; | |
8840 default: goto __pyx_L5_argtuple_error; | |
8841 } | |
8842 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
8843 switch (__pyx_nargs) { | |
8844 case 0: | |
8845 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chrom)) != 0)) { | |
8846 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
8847 kw_args--; | |
8848 } | |
8849 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error) | |
8850 else goto __pyx_L5_argtuple_error; | |
8851 CYTHON_FALLTHROUGH; | |
8852 case 1: | |
8853 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start)) != 0)) { | |
8854 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
8855 kw_args--; | |
8856 } | |
8857 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error) | |
8858 else { | |
8859 __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 1); __PYX_ERR(0, 68, __pyx_L3_error) | |
8860 } | |
8861 CYTHON_FALLTHROUGH; | |
8862 case 2: | |
8863 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) { | |
8864 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
8865 kw_args--; | |
8866 } | |
8867 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error) | |
8868 else { | |
8869 __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 2); __PYX_ERR(0, 68, __pyx_L3_error) | |
8870 } | |
8871 CYTHON_FALLTHROUGH; | |
8872 case 3: | |
8873 if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fa)) != 0)) { | |
8874 (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); | |
8875 kw_args--; | |
8876 } | |
8877 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error) | |
8878 else { | |
8879 __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 3); __PYX_ERR(0, 68, __pyx_L3_error) | |
8880 } | |
8881 } | |
8882 if (unlikely(kw_args > 0)) { | |
8883 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
8884 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_sequence") < 0)) __PYX_ERR(0, 68, __pyx_L3_error) | |
8885 } | |
8886 } else if (unlikely(__pyx_nargs != 4)) { | |
8887 goto __pyx_L5_argtuple_error; | |
8888 } else { | |
8889 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
8890 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
8891 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
8892 values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
8893 } | |
8894 __pyx_v_chrom = values[0]; | |
8895 __pyx_v_start = values[1]; | |
8896 __pyx_v_end = values[2]; | |
8897 __pyx_v_fa = values[3]; | |
8898 } | |
8899 goto __pyx_L6_skip; | |
8900 __pyx_L5_argtuple_error:; | |
8901 __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 68, __pyx_L3_error) | |
8902 __pyx_L6_skip:; | |
8903 goto __pyx_L4_argument_unpacking_done; | |
8904 __pyx_L3_error:; | |
8905 { | |
8906 Py_ssize_t __pyx_temp; | |
8907 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8908 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8909 } | |
8910 } | |
8911 __Pyx_AddTraceback("pysam.libcvcf.get_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8912 __Pyx_RefNannyFinishContext(); | |
8913 return NULL; | |
8914 __pyx_L4_argument_unpacking_done:; | |
8915 __pyx_r = __pyx_pf_5pysam_7libcvcf_get_sequence(__pyx_self, __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_fa); | |
8916 | |
8917 /* function exit code */ | |
8918 { | |
8919 Py_ssize_t __pyx_temp; | |
8920 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8921 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8922 } | |
8923 } | |
8924 __Pyx_RefNannyFinishContext(); | |
8925 return __pyx_r; | |
8926 } | |
8927 | |
8928 static PyObject *__pyx_pf_5pysam_7libcvcf_get_sequence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_fa) { | |
8929 PyObject *__pyx_v_sequence = NULL; | |
8930 PyObject *__pyx_r = NULL; | |
8931 __Pyx_RefNannyDeclarations | |
8932 PyObject *__pyx_t_1 = NULL; | |
8933 int __pyx_t_2; | |
8934 int __pyx_t_3; | |
8935 PyObject *__pyx_t_4 = NULL; | |
8936 PyObject *__pyx_t_5 = NULL; | |
8937 PyObject *__pyx_t_6 = NULL; | |
8938 PyObject *__pyx_t_7 = NULL; | |
8939 unsigned int __pyx_t_8; | |
8940 Py_ssize_t __pyx_t_9; | |
8941 int __pyx_lineno = 0; | |
8942 const char *__pyx_filename = NULL; | |
8943 int __pyx_clineno = 0; | |
8944 __Pyx_RefNannySetupContext("get_sequence", 1); | |
8945 | |
8946 /* "pysam/libcvcf.pyx":70 | |
8947 * def get_sequence(chrom, start, end, fa): | |
8948 * # obtain sequence from .fa file, without truncation | |
8949 * if end<=start: return "" # <<<<<<<<<<<<<< | |
8950 * if not fa: return "N"*(end-start) | |
8951 * if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper() | |
8952 */ | |
8953 __pyx_t_1 = PyObject_RichCompare(__pyx_v_end, __pyx_v_start, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) | |
8954 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 70, __pyx_L1_error) | |
8955 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8956 if (__pyx_t_2) { | |
8957 __Pyx_XDECREF(__pyx_r); | |
8958 __Pyx_INCREF(__pyx_kp_u_); | |
8959 __pyx_r = __pyx_kp_u_; | |
8960 goto __pyx_L0; | |
8961 } | |
8962 | |
8963 /* "pysam/libcvcf.pyx":71 | |
8964 * # obtain sequence from .fa file, without truncation | |
8965 * if end<=start: return "" | |
8966 * if not fa: return "N"*(end-start) # <<<<<<<<<<<<<< | |
8967 * if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper() | |
8968 * sequence = fa.fetch(chrom, start, end).upper() | |
8969 */ | |
8970 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fa); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 71, __pyx_L1_error) | |
8971 __pyx_t_3 = (!__pyx_t_2); | |
8972 if (__pyx_t_3) { | |
8973 __Pyx_XDECREF(__pyx_r); | |
8974 __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) | |
8975 __Pyx_GOTREF(__pyx_t_1); | |
8976 __pyx_t_4 = PyNumber_Multiply(__pyx_n_u_N, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error) | |
8977 __Pyx_GOTREF(__pyx_t_4); | |
8978 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8979 __pyx_r = __pyx_t_4; | |
8980 __pyx_t_4 = 0; | |
8981 goto __pyx_L0; | |
8982 } | |
8983 | |
8984 /* "pysam/libcvcf.pyx":72 | |
8985 * if end<=start: return "" | |
8986 * if not fa: return "N"*(end-start) | |
8987 * if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper() # <<<<<<<<<<<<<< | |
8988 * sequence = fa.fetch(chrom, start, end).upper() | |
8989 * if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence)) | |
8990 */ | |
8991 __pyx_t_4 = PyObject_RichCompare(__pyx_v_start, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) | |
8992 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 72, __pyx_L1_error) | |
8993 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
8994 if (__pyx_t_3) { | |
8995 __Pyx_XDECREF(__pyx_r); | |
8996 __pyx_t_4 = PyNumber_Negative(__pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) | |
8997 __Pyx_GOTREF(__pyx_t_4); | |
8998 __pyx_t_1 = PyNumber_Multiply(__pyx_n_u_N, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) | |
8999 __Pyx_GOTREF(__pyx_t_1); | |
9000 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
9001 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error) | |
9002 __Pyx_GOTREF(__pyx_t_6); | |
9003 __pyx_t_7 = NULL; | |
9004 __pyx_t_8 = 0; | |
9005 #if CYTHON_UNPACK_METHODS | |
9006 if (unlikely(PyMethod_Check(__pyx_t_6))) { | |
9007 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); | |
9008 if (likely(__pyx_t_7)) { | |
9009 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
9010 __Pyx_INCREF(__pyx_t_7); | |
9011 __Pyx_INCREF(function); | |
9012 __Pyx_DECREF_SET(__pyx_t_6, function); | |
9013 __pyx_t_8 = 1; | |
9014 } | |
9015 } | |
9016 #endif | |
9017 { | |
9018 PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_chrom, __pyx_int_0, __pyx_v_end, __pyx_v_fa}; | |
9019 __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); | |
9020 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
9021 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) | |
9022 __Pyx_GOTREF(__pyx_t_5); | |
9023 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
9024 } | |
9025 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_upper); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error) | |
9026 __Pyx_GOTREF(__pyx_t_6); | |
9027 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
9028 __pyx_t_5 = NULL; | |
9029 __pyx_t_8 = 0; | |
9030 #if CYTHON_UNPACK_METHODS | |
9031 if (likely(PyMethod_Check(__pyx_t_6))) { | |
9032 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); | |
9033 if (likely(__pyx_t_5)) { | |
9034 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
9035 __Pyx_INCREF(__pyx_t_5); | |
9036 __Pyx_INCREF(function); | |
9037 __Pyx_DECREF_SET(__pyx_t_6, function); | |
9038 __pyx_t_8 = 1; | |
9039 } | |
9040 } | |
9041 #endif | |
9042 { | |
9043 PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; | |
9044 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); | |
9045 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
9046 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) | |
9047 __Pyx_GOTREF(__pyx_t_4); | |
9048 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
9049 } | |
9050 __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error) | |
9051 __Pyx_GOTREF(__pyx_t_6); | |
9052 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9053 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
9054 __pyx_r = __pyx_t_6; | |
9055 __pyx_t_6 = 0; | |
9056 goto __pyx_L0; | |
9057 } | |
9058 | |
9059 /* "pysam/libcvcf.pyx":73 | |
9060 * if not fa: return "N"*(end-start) | |
9061 * if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper() | |
9062 * sequence = fa.fetch(chrom, start, end).upper() # <<<<<<<<<<<<<< | |
9063 * if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence)) | |
9064 * return sequence | |
9065 */ | |
9066 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fa, __pyx_n_s_fetch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) | |
9067 __Pyx_GOTREF(__pyx_t_1); | |
9068 __pyx_t_5 = NULL; | |
9069 __pyx_t_8 = 0; | |
9070 #if CYTHON_UNPACK_METHODS | |
9071 if (likely(PyMethod_Check(__pyx_t_1))) { | |
9072 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); | |
9073 if (likely(__pyx_t_5)) { | |
9074 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
9075 __Pyx_INCREF(__pyx_t_5); | |
9076 __Pyx_INCREF(function); | |
9077 __Pyx_DECREF_SET(__pyx_t_1, function); | |
9078 __pyx_t_8 = 1; | |
9079 } | |
9080 } | |
9081 #endif | |
9082 { | |
9083 PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_chrom, __pyx_v_start, __pyx_v_end}; | |
9084 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); | |
9085 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
9086 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) | |
9087 __Pyx_GOTREF(__pyx_t_4); | |
9088 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9089 } | |
9090 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) | |
9091 __Pyx_GOTREF(__pyx_t_1); | |
9092 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
9093 __pyx_t_4 = NULL; | |
9094 __pyx_t_8 = 0; | |
9095 #if CYTHON_UNPACK_METHODS | |
9096 if (likely(PyMethod_Check(__pyx_t_1))) { | |
9097 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); | |
9098 if (likely(__pyx_t_4)) { | |
9099 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
9100 __Pyx_INCREF(__pyx_t_4); | |
9101 __Pyx_INCREF(function); | |
9102 __Pyx_DECREF_SET(__pyx_t_1, function); | |
9103 __pyx_t_8 = 1; | |
9104 } | |
9105 } | |
9106 #endif | |
9107 { | |
9108 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; | |
9109 __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); | |
9110 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
9111 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) | |
9112 __Pyx_GOTREF(__pyx_t_6); | |
9113 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9114 } | |
9115 __pyx_v_sequence = __pyx_t_6; | |
9116 __pyx_t_6 = 0; | |
9117 | |
9118 /* "pysam/libcvcf.pyx":74 | |
9119 * if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper() | |
9120 * sequence = fa.fetch(chrom, start, end).upper() | |
9121 * if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence)) # <<<<<<<<<<<<<< | |
9122 * return sequence | |
9123 * | |
9124 */ | |
9125 __pyx_t_9 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 74, __pyx_L1_error) | |
9126 __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L1_error) | |
9127 __Pyx_GOTREF(__pyx_t_6); | |
9128 __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) | |
9129 __Pyx_GOTREF(__pyx_t_1); | |
9130 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) | |
9131 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
9132 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9133 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 74, __pyx_L1_error) | |
9134 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
9135 if (__pyx_t_3) { | |
9136 __pyx_t_4 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) | |
9137 __Pyx_GOTREF(__pyx_t_4); | |
9138 __pyx_t_9 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 74, __pyx_L1_error) | |
9139 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) | |
9140 __Pyx_GOTREF(__pyx_t_1); | |
9141 __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L1_error) | |
9142 __Pyx_GOTREF(__pyx_t_6); | |
9143 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
9144 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9145 __pyx_t_1 = PyNumber_Multiply(__pyx_n_u_N, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) | |
9146 __Pyx_GOTREF(__pyx_t_1); | |
9147 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
9148 __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_sequence, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L1_error) | |
9149 __Pyx_GOTREF(__pyx_t_6); | |
9150 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9151 __Pyx_DECREF_SET(__pyx_v_sequence, __pyx_t_6); | |
9152 __pyx_t_6 = 0; | |
9153 } | |
9154 | |
9155 /* "pysam/libcvcf.pyx":75 | |
9156 * sequence = fa.fetch(chrom, start, end).upper() | |
9157 * if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence)) | |
9158 * return sequence # <<<<<<<<<<<<<< | |
9159 * | |
9160 * # Utility function. Parses a region string | |
9161 */ | |
9162 __Pyx_XDECREF(__pyx_r); | |
9163 __Pyx_INCREF(__pyx_v_sequence); | |
9164 __pyx_r = __pyx_v_sequence; | |
9165 goto __pyx_L0; | |
9166 | |
9167 /* "pysam/libcvcf.pyx":68 | |
9168 * | |
9169 * # Utility function. Uses 0-based coordinates | |
9170 * def get_sequence(chrom, start, end, fa): # <<<<<<<<<<<<<< | |
9171 * # obtain sequence from .fa file, without truncation | |
9172 * if end<=start: return "" | |
9173 */ | |
9174 | |
9175 /* function exit code */ | |
9176 __pyx_L1_error:; | |
9177 __Pyx_XDECREF(__pyx_t_1); | |
9178 __Pyx_XDECREF(__pyx_t_4); | |
9179 __Pyx_XDECREF(__pyx_t_5); | |
9180 __Pyx_XDECREF(__pyx_t_6); | |
9181 __Pyx_XDECREF(__pyx_t_7); | |
9182 __Pyx_AddTraceback("pysam.libcvcf.get_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9183 __pyx_r = NULL; | |
9184 __pyx_L0:; | |
9185 __Pyx_XDECREF(__pyx_v_sequence); | |
9186 __Pyx_XGIVEREF(__pyx_r); | |
9187 __Pyx_RefNannyFinishContext(); | |
9188 return __pyx_r; | |
9189 } | |
9190 | |
9191 /* "pysam/libcvcf.pyx":78 | |
9192 * | |
9193 * # Utility function. Parses a region string | |
9194 * def parse_regions( string ): # <<<<<<<<<<<<<< | |
9195 * result = [] | |
9196 * for r in string.split(','): | |
9197 */ | |
9198 | |
9199 /* Python wrapper */ | |
9200 static PyObject *__pyx_pw_5pysam_7libcvcf_3parse_regions(PyObject *__pyx_self, | |
9201 #if CYTHON_METH_FASTCALL | |
9202 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9203 #else | |
9204 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9205 #endif | |
9206 ); /*proto*/ | |
9207 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_2parse_regions, "parse_regions(string)"); | |
9208 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3parse_regions = {"parse_regions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3parse_regions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_2parse_regions}; | |
9209 static PyObject *__pyx_pw_5pysam_7libcvcf_3parse_regions(PyObject *__pyx_self, | |
9210 #if CYTHON_METH_FASTCALL | |
9211 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9212 #else | |
9213 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9214 #endif | |
9215 ) { | |
9216 PyObject *__pyx_v_string = 0; | |
9217 #if !CYTHON_METH_FASTCALL | |
9218 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9219 #endif | |
9220 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9221 PyObject* values[1] = {0}; | |
9222 int __pyx_lineno = 0; | |
9223 const char *__pyx_filename = NULL; | |
9224 int __pyx_clineno = 0; | |
9225 PyObject *__pyx_r = 0; | |
9226 __Pyx_RefNannyDeclarations | |
9227 __Pyx_RefNannySetupContext("parse_regions (wrapper)", 0); | |
9228 #if !CYTHON_METH_FASTCALL | |
9229 #if CYTHON_ASSUME_SAFE_MACROS | |
9230 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9231 #else | |
9232 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
9233 #endif | |
9234 #endif | |
9235 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
9236 { | |
9237 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string,0}; | |
9238 if (__pyx_kwds) { | |
9239 Py_ssize_t kw_args; | |
9240 switch (__pyx_nargs) { | |
9241 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9242 CYTHON_FALLTHROUGH; | |
9243 case 0: break; | |
9244 default: goto __pyx_L5_argtuple_error; | |
9245 } | |
9246 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
9247 switch (__pyx_nargs) { | |
9248 case 0: | |
9249 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_string)) != 0)) { | |
9250 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
9251 kw_args--; | |
9252 } | |
9253 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) | |
9254 else goto __pyx_L5_argtuple_error; | |
9255 } | |
9256 if (unlikely(kw_args > 0)) { | |
9257 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
9258 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_regions") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) | |
9259 } | |
9260 } else if (unlikely(__pyx_nargs != 1)) { | |
9261 goto __pyx_L5_argtuple_error; | |
9262 } else { | |
9263 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9264 } | |
9265 __pyx_v_string = values[0]; | |
9266 } | |
9267 goto __pyx_L6_skip; | |
9268 __pyx_L5_argtuple_error:; | |
9269 __Pyx_RaiseArgtupleInvalid("parse_regions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 78, __pyx_L3_error) | |
9270 __pyx_L6_skip:; | |
9271 goto __pyx_L4_argument_unpacking_done; | |
9272 __pyx_L3_error:; | |
9273 { | |
9274 Py_ssize_t __pyx_temp; | |
9275 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9276 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9277 } | |
9278 } | |
9279 __Pyx_AddTraceback("pysam.libcvcf.parse_regions", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9280 __Pyx_RefNannyFinishContext(); | |
9281 return NULL; | |
9282 __pyx_L4_argument_unpacking_done:; | |
9283 __pyx_r = __pyx_pf_5pysam_7libcvcf_2parse_regions(__pyx_self, __pyx_v_string); | |
9284 | |
9285 /* function exit code */ | |
9286 { | |
9287 Py_ssize_t __pyx_temp; | |
9288 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9289 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9290 } | |
9291 } | |
9292 __Pyx_RefNannyFinishContext(); | |
9293 return __pyx_r; | |
9294 } | |
9295 | |
9296 static PyObject *__pyx_pf_5pysam_7libcvcf_2parse_regions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string) { | |
9297 PyObject *__pyx_v_result = NULL; | |
9298 PyObject *__pyx_v_r = NULL; | |
9299 PyObject *__pyx_v_elts = NULL; | |
9300 PyObject *__pyx_v_chrom = NULL; | |
9301 PyObject *__pyx_v_start = NULL; | |
9302 PyObject *__pyx_v_end = NULL; | |
9303 PyObject *__pyx_v_ielts = NULL; | |
9304 PyObject *__pyx_r = NULL; | |
9305 __Pyx_RefNannyDeclarations | |
9306 PyObject *__pyx_t_1 = NULL; | |
9307 PyObject *__pyx_t_2 = NULL; | |
9308 PyObject *__pyx_t_3 = NULL; | |
9309 unsigned int __pyx_t_4; | |
9310 Py_ssize_t __pyx_t_5; | |
9311 PyObject *(*__pyx_t_6)(PyObject *); | |
9312 PyObject *__pyx_t_7 = NULL; | |
9313 Py_ssize_t __pyx_t_8; | |
9314 int __pyx_t_9; | |
9315 PyObject *__pyx_t_10 = NULL; | |
9316 PyObject *__pyx_t_11 = NULL; | |
9317 PyObject *__pyx_t_12 = NULL; | |
9318 PyObject *__pyx_t_13 = NULL; | |
9319 PyObject *__pyx_t_14 = NULL; | |
9320 int __pyx_t_15; | |
9321 int __pyx_lineno = 0; | |
9322 const char *__pyx_filename = NULL; | |
9323 int __pyx_clineno = 0; | |
9324 __Pyx_RefNannySetupContext("parse_regions", 1); | |
9325 | |
9326 /* "pysam/libcvcf.pyx":79 | |
9327 * # Utility function. Parses a region string | |
9328 * def parse_regions( string ): | |
9329 * result = [] # <<<<<<<<<<<<<< | |
9330 * for r in string.split(','): | |
9331 * elts = r.split(':') | |
9332 */ | |
9333 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) | |
9334 __Pyx_GOTREF(__pyx_t_1); | |
9335 __pyx_v_result = ((PyObject*)__pyx_t_1); | |
9336 __pyx_t_1 = 0; | |
9337 | |
9338 /* "pysam/libcvcf.pyx":80 | |
9339 * def parse_regions( string ): | |
9340 * result = [] | |
9341 * for r in string.split(','): # <<<<<<<<<<<<<< | |
9342 * elts = r.split(':') | |
9343 * chrom, start, end = elts[0], 0, 3000000000 | |
9344 */ | |
9345 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_string, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) | |
9346 __Pyx_GOTREF(__pyx_t_2); | |
9347 __pyx_t_3 = NULL; | |
9348 __pyx_t_4 = 0; | |
9349 #if CYTHON_UNPACK_METHODS | |
9350 if (likely(PyMethod_Check(__pyx_t_2))) { | |
9351 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
9352 if (likely(__pyx_t_3)) { | |
9353 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
9354 __Pyx_INCREF(__pyx_t_3); | |
9355 __Pyx_INCREF(function); | |
9356 __Pyx_DECREF_SET(__pyx_t_2, function); | |
9357 __pyx_t_4 = 1; | |
9358 } | |
9359 } | |
9360 #endif | |
9361 { | |
9362 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__2}; | |
9363 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
9364 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
9365 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) | |
9366 __Pyx_GOTREF(__pyx_t_1); | |
9367 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
9368 } | |
9369 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { | |
9370 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); | |
9371 __pyx_t_5 = 0; | |
9372 __pyx_t_6 = NULL; | |
9373 } else { | |
9374 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) | |
9375 __Pyx_GOTREF(__pyx_t_2); | |
9376 __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L1_error) | |
9377 } | |
9378 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9379 for (;;) { | |
9380 if (likely(!__pyx_t_6)) { | |
9381 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
9382 { | |
9383 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
9384 #if !CYTHON_ASSUME_SAFE_MACROS | |
9385 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 80, __pyx_L1_error) | |
9386 #endif | |
9387 if (__pyx_t_5 >= __pyx_temp) break; | |
9388 } | |
9389 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
9390 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 80, __pyx_L1_error) | |
9391 #else | |
9392 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) | |
9393 __Pyx_GOTREF(__pyx_t_1); | |
9394 #endif | |
9395 } else { | |
9396 { | |
9397 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
9398 #if !CYTHON_ASSUME_SAFE_MACROS | |
9399 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 80, __pyx_L1_error) | |
9400 #endif | |
9401 if (__pyx_t_5 >= __pyx_temp) break; | |
9402 } | |
9403 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
9404 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 80, __pyx_L1_error) | |
9405 #else | |
9406 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) | |
9407 __Pyx_GOTREF(__pyx_t_1); | |
9408 #endif | |
9409 } | |
9410 } else { | |
9411 __pyx_t_1 = __pyx_t_6(__pyx_t_2); | |
9412 if (unlikely(!__pyx_t_1)) { | |
9413 PyObject* exc_type = PyErr_Occurred(); | |
9414 if (exc_type) { | |
9415 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
9416 else __PYX_ERR(0, 80, __pyx_L1_error) | |
9417 } | |
9418 break; | |
9419 } | |
9420 __Pyx_GOTREF(__pyx_t_1); | |
9421 } | |
9422 __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_1); | |
9423 __pyx_t_1 = 0; | |
9424 | |
9425 /* "pysam/libcvcf.pyx":81 | |
9426 * result = [] | |
9427 * for r in string.split(','): | |
9428 * elts = r.split(':') # <<<<<<<<<<<<<< | |
9429 * chrom, start, end = elts[0], 0, 3000000000 | |
9430 * if len(elts)==1: pass | |
9431 */ | |
9432 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) | |
9433 __Pyx_GOTREF(__pyx_t_3); | |
9434 __pyx_t_7 = NULL; | |
9435 __pyx_t_4 = 0; | |
9436 #if CYTHON_UNPACK_METHODS | |
9437 if (likely(PyMethod_Check(__pyx_t_3))) { | |
9438 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); | |
9439 if (likely(__pyx_t_7)) { | |
9440 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
9441 __Pyx_INCREF(__pyx_t_7); | |
9442 __Pyx_INCREF(function); | |
9443 __Pyx_DECREF_SET(__pyx_t_3, function); | |
9444 __pyx_t_4 = 1; | |
9445 } | |
9446 } | |
9447 #endif | |
9448 { | |
9449 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u__3}; | |
9450 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
9451 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
9452 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) | |
9453 __Pyx_GOTREF(__pyx_t_1); | |
9454 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
9455 } | |
9456 __Pyx_XDECREF_SET(__pyx_v_elts, __pyx_t_1); | |
9457 __pyx_t_1 = 0; | |
9458 | |
9459 /* "pysam/libcvcf.pyx":82 | |
9460 * for r in string.split(','): | |
9461 * elts = r.split(':') | |
9462 * chrom, start, end = elts[0], 0, 3000000000 # <<<<<<<<<<<<<< | |
9463 * if len(elts)==1: pass | |
9464 * elif len(elts)==2: | |
9465 */ | |
9466 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) | |
9467 __Pyx_GOTREF(__pyx_t_1); | |
9468 __pyx_t_3 = __pyx_int_0; | |
9469 __Pyx_INCREF(__pyx_t_3); | |
9470 __pyx_t_7 = __pyx_int_3000000000; | |
9471 __Pyx_INCREF(__pyx_t_7); | |
9472 __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_1); | |
9473 __pyx_t_1 = 0; | |
9474 __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_3); | |
9475 __pyx_t_3 = 0; | |
9476 __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_7); | |
9477 __pyx_t_7 = 0; | |
9478 | |
9479 /* "pysam/libcvcf.pyx":83 | |
9480 * elts = r.split(':') | |
9481 * chrom, start, end = elts[0], 0, 3000000000 | |
9482 * if len(elts)==1: pass # <<<<<<<<<<<<<< | |
9483 * elif len(elts)==2: | |
9484 * if len(elts[1])>0: | |
9485 */ | |
9486 __pyx_t_8 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 83, __pyx_L1_error) | |
9487 __pyx_t_9 = (__pyx_t_8 == 1); | |
9488 if (__pyx_t_9) { | |
9489 goto __pyx_L5; | |
9490 } | |
9491 | |
9492 /* "pysam/libcvcf.pyx":84 | |
9493 * chrom, start, end = elts[0], 0, 3000000000 | |
9494 * if len(elts)==1: pass | |
9495 * elif len(elts)==2: # <<<<<<<<<<<<<< | |
9496 * if len(elts[1])>0: | |
9497 * ielts = elts[1].split('-') | |
9498 */ | |
9499 __pyx_t_8 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 84, __pyx_L1_error) | |
9500 __pyx_t_9 = (__pyx_t_8 == 2); | |
9501 if (likely(__pyx_t_9)) { | |
9502 | |
9503 /* "pysam/libcvcf.pyx":85 | |
9504 * if len(elts)==1: pass | |
9505 * elif len(elts)==2: | |
9506 * if len(elts[1])>0: # <<<<<<<<<<<<<< | |
9507 * ielts = elts[1].split('-') | |
9508 * if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r) | |
9509 */ | |
9510 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) | |
9511 __Pyx_GOTREF(__pyx_t_7); | |
9512 __pyx_t_8 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 85, __pyx_L1_error) | |
9513 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
9514 __pyx_t_9 = (__pyx_t_8 > 0); | |
9515 if (__pyx_t_9) { | |
9516 | |
9517 /* "pysam/libcvcf.pyx":86 | |
9518 * elif len(elts)==2: | |
9519 * if len(elts[1])>0: | |
9520 * ielts = elts[1].split('-') # <<<<<<<<<<<<<< | |
9521 * if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r) | |
9522 * try: start, end = int(ielts[0])-1, int(ielts[1]) | |
9523 */ | |
9524 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) | |
9525 __Pyx_GOTREF(__pyx_t_3); | |
9526 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) | |
9527 __Pyx_GOTREF(__pyx_t_1); | |
9528 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
9529 __pyx_t_3 = NULL; | |
9530 __pyx_t_4 = 0; | |
9531 #if CYTHON_UNPACK_METHODS | |
9532 if (likely(PyMethod_Check(__pyx_t_1))) { | |
9533 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
9534 if (likely(__pyx_t_3)) { | |
9535 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
9536 __Pyx_INCREF(__pyx_t_3); | |
9537 __Pyx_INCREF(function); | |
9538 __Pyx_DECREF_SET(__pyx_t_1, function); | |
9539 __pyx_t_4 = 1; | |
9540 } | |
9541 } | |
9542 #endif | |
9543 { | |
9544 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__4}; | |
9545 __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
9546 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
9547 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 86, __pyx_L1_error) | |
9548 __Pyx_GOTREF(__pyx_t_7); | |
9549 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9550 } | |
9551 __Pyx_XDECREF_SET(__pyx_v_ielts, __pyx_t_7); | |
9552 __pyx_t_7 = 0; | |
9553 | |
9554 /* "pysam/libcvcf.pyx":87 | |
9555 * if len(elts[1])>0: | |
9556 * ielts = elts[1].split('-') | |
9557 * if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r) # <<<<<<<<<<<<<< | |
9558 * try: start, end = int(ielts[0])-1, int(ielts[1]) | |
9559 * except: raise ValueError("Don't understand region string '%s'" % r) | |
9560 */ | |
9561 __pyx_t_8 = PyObject_Length(__pyx_v_ielts); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 87, __pyx_L1_error) | |
9562 __pyx_t_9 = (__pyx_t_8 != 2); | |
9563 if (__pyx_t_9) { | |
9564 __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Don_t_understand_region_string_s, __pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error) | |
9565 __Pyx_GOTREF(__pyx_t_7); | |
9566 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) | |
9567 __Pyx_GOTREF(__pyx_t_1); | |
9568 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
9569 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9570 } | |
9571 | |
9572 /* "pysam/libcvcf.pyx":88 | |
9573 * ielts = elts[1].split('-') | |
9574 * if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r) | |
9575 * try: start, end = int(ielts[0])-1, int(ielts[1]) # <<<<<<<<<<<<<< | |
9576 * except: raise ValueError("Don't understand region string '%s'" % r) | |
9577 * else: | |
9578 */ | |
9579 { | |
9580 __Pyx_PyThreadState_declare | |
9581 __Pyx_PyThreadState_assign | |
9582 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); | |
9583 __Pyx_XGOTREF(__pyx_t_10); | |
9584 __Pyx_XGOTREF(__pyx_t_11); | |
9585 __Pyx_XGOTREF(__pyx_t_12); | |
9586 /*try:*/ { | |
9587 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ielts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L8_error) | |
9588 __Pyx_GOTREF(__pyx_t_1); | |
9589 __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L8_error) | |
9590 __Pyx_GOTREF(__pyx_t_7); | |
9591 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9592 __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L8_error) | |
9593 __Pyx_GOTREF(__pyx_t_1); | |
9594 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
9595 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ielts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L8_error) | |
9596 __Pyx_GOTREF(__pyx_t_7); | |
9597 __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L8_error) | |
9598 __Pyx_GOTREF(__pyx_t_3); | |
9599 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
9600 __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_1); | |
9601 __pyx_t_1 = 0; | |
9602 __Pyx_DECREF_SET(__pyx_v_end, __pyx_t_3); | |
9603 __pyx_t_3 = 0; | |
9604 } | |
9605 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; | |
9606 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
9607 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
9608 goto __pyx_L15_try_end; | |
9609 __pyx_L8_error:; | |
9610 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9611 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
9612 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
9613 | |
9614 /* "pysam/libcvcf.pyx":89 | |
9615 * if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r) | |
9616 * try: start, end = int(ielts[0])-1, int(ielts[1]) | |
9617 * except: raise ValueError("Don't understand region string '%s'" % r) # <<<<<<<<<<<<<< | |
9618 * else: | |
9619 * raise ValueError("Don't understand region string '%s'" % r) | |
9620 */ | |
9621 /*except:*/ { | |
9622 __Pyx_AddTraceback("pysam.libcvcf.parse_regions", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9623 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 89, __pyx_L10_except_error) | |
9624 __Pyx_XGOTREF(__pyx_t_3); | |
9625 __Pyx_XGOTREF(__pyx_t_1); | |
9626 __Pyx_XGOTREF(__pyx_t_7); | |
9627 __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Don_t_understand_region_string_s, __pyx_v_r); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 89, __pyx_L10_except_error) | |
9628 __Pyx_GOTREF(__pyx_t_13); | |
9629 __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 89, __pyx_L10_except_error) | |
9630 __Pyx_GOTREF(__pyx_t_14); | |
9631 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; | |
9632 __Pyx_Raise(__pyx_t_14, 0, 0, 0); | |
9633 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; | |
9634 __PYX_ERR(0, 89, __pyx_L10_except_error) | |
9635 } | |
9636 | |
9637 /* "pysam/libcvcf.pyx":88 | |
9638 * ielts = elts[1].split('-') | |
9639 * if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r) | |
9640 * try: start, end = int(ielts[0])-1, int(ielts[1]) # <<<<<<<<<<<<<< | |
9641 * except: raise ValueError("Don't understand region string '%s'" % r) | |
9642 * else: | |
9643 */ | |
9644 __pyx_L10_except_error:; | |
9645 __Pyx_XGIVEREF(__pyx_t_10); | |
9646 __Pyx_XGIVEREF(__pyx_t_11); | |
9647 __Pyx_XGIVEREF(__pyx_t_12); | |
9648 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); | |
9649 goto __pyx_L1_error; | |
9650 __pyx_L15_try_end:; | |
9651 } | |
9652 | |
9653 /* "pysam/libcvcf.pyx":85 | |
9654 * if len(elts)==1: pass | |
9655 * elif len(elts)==2: | |
9656 * if len(elts[1])>0: # <<<<<<<<<<<<<< | |
9657 * ielts = elts[1].split('-') | |
9658 * if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r) | |
9659 */ | |
9660 } | |
9661 | |
9662 /* "pysam/libcvcf.pyx":84 | |
9663 * chrom, start, end = elts[0], 0, 3000000000 | |
9664 * if len(elts)==1: pass | |
9665 * elif len(elts)==2: # <<<<<<<<<<<<<< | |
9666 * if len(elts[1])>0: | |
9667 * ielts = elts[1].split('-') | |
9668 */ | |
9669 goto __pyx_L5; | |
9670 } | |
9671 | |
9672 /* "pysam/libcvcf.pyx":91 | |
9673 * except: raise ValueError("Don't understand region string '%s'" % r) | |
9674 * else: | |
9675 * raise ValueError("Don't understand region string '%s'" % r) # <<<<<<<<<<<<<< | |
9676 * result.append( (chrom,start,end) ) | |
9677 * return result | |
9678 */ | |
9679 /*else*/ { | |
9680 __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Don_t_understand_region_string_s, __pyx_v_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error) | |
9681 __Pyx_GOTREF(__pyx_t_7); | |
9682 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) | |
9683 __Pyx_GOTREF(__pyx_t_1); | |
9684 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
9685 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
9686 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9687 __PYX_ERR(0, 91, __pyx_L1_error) | |
9688 } | |
9689 __pyx_L5:; | |
9690 | |
9691 /* "pysam/libcvcf.pyx":92 | |
9692 * else: | |
9693 * raise ValueError("Don't understand region string '%s'" % r) | |
9694 * result.append( (chrom,start,end) ) # <<<<<<<<<<<<<< | |
9695 * return result | |
9696 * | |
9697 */ | |
9698 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) | |
9699 __Pyx_GOTREF(__pyx_t_1); | |
9700 __Pyx_INCREF(__pyx_v_chrom); | |
9701 __Pyx_GIVEREF(__pyx_v_chrom); | |
9702 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom)) __PYX_ERR(0, 92, __pyx_L1_error); | |
9703 __Pyx_INCREF(__pyx_v_start); | |
9704 __Pyx_GIVEREF(__pyx_v_start); | |
9705 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start)) __PYX_ERR(0, 92, __pyx_L1_error); | |
9706 __Pyx_INCREF(__pyx_v_end); | |
9707 __Pyx_GIVEREF(__pyx_v_end); | |
9708 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end)) __PYX_ERR(0, 92, __pyx_L1_error); | |
9709 __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 92, __pyx_L1_error) | |
9710 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9711 | |
9712 /* "pysam/libcvcf.pyx":80 | |
9713 * def parse_regions( string ): | |
9714 * result = [] | |
9715 * for r in string.split(','): # <<<<<<<<<<<<<< | |
9716 * elts = r.split(':') | |
9717 * chrom, start, end = elts[0], 0, 3000000000 | |
9718 */ | |
9719 } | |
9720 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
9721 | |
9722 /* "pysam/libcvcf.pyx":93 | |
9723 * raise ValueError("Don't understand region string '%s'" % r) | |
9724 * result.append( (chrom,start,end) ) | |
9725 * return result # <<<<<<<<<<<<<< | |
9726 * | |
9727 * | |
9728 */ | |
9729 __Pyx_XDECREF(__pyx_r); | |
9730 __Pyx_INCREF(__pyx_v_result); | |
9731 __pyx_r = __pyx_v_result; | |
9732 goto __pyx_L0; | |
9733 | |
9734 /* "pysam/libcvcf.pyx":78 | |
9735 * | |
9736 * # Utility function. Parses a region string | |
9737 * def parse_regions( string ): # <<<<<<<<<<<<<< | |
9738 * result = [] | |
9739 * for r in string.split(','): | |
9740 */ | |
9741 | |
9742 /* function exit code */ | |
9743 __pyx_L1_error:; | |
9744 __Pyx_XDECREF(__pyx_t_1); | |
9745 __Pyx_XDECREF(__pyx_t_2); | |
9746 __Pyx_XDECREF(__pyx_t_3); | |
9747 __Pyx_XDECREF(__pyx_t_7); | |
9748 __Pyx_XDECREF(__pyx_t_13); | |
9749 __Pyx_XDECREF(__pyx_t_14); | |
9750 __Pyx_AddTraceback("pysam.libcvcf.parse_regions", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9751 __pyx_r = NULL; | |
9752 __pyx_L0:; | |
9753 __Pyx_XDECREF(__pyx_v_result); | |
9754 __Pyx_XDECREF(__pyx_v_r); | |
9755 __Pyx_XDECREF(__pyx_v_elts); | |
9756 __Pyx_XDECREF(__pyx_v_chrom); | |
9757 __Pyx_XDECREF(__pyx_v_start); | |
9758 __Pyx_XDECREF(__pyx_v_end); | |
9759 __Pyx_XDECREF(__pyx_v_ielts); | |
9760 __Pyx_XGIVEREF(__pyx_r); | |
9761 __Pyx_RefNannyFinishContext(); | |
9762 return __pyx_r; | |
9763 } | |
9764 | |
9765 /* "pysam/libcvcf.pyx":114 | |
9766 * cdef uint32_t pos | |
9767 * | |
9768 * def __init__(self, vcf): # <<<<<<<<<<<<<< | |
9769 * self.vcf = vcf | |
9770 * self.encoding = vcf.encoding | |
9771 */ | |
9772 | |
9773 /* Python wrapper */ | |
9774 static int __pyx_pw_5pysam_7libcvcf_9VCFRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
9775 static int __pyx_pw_5pysam_7libcvcf_9VCFRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
9776 PyObject *__pyx_v_vcf = 0; | |
9777 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9778 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9779 PyObject* values[1] = {0}; | |
9780 int __pyx_lineno = 0; | |
9781 const char *__pyx_filename = NULL; | |
9782 int __pyx_clineno = 0; | |
9783 int __pyx_r; | |
9784 __Pyx_RefNannyDeclarations | |
9785 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
9786 #if CYTHON_ASSUME_SAFE_MACROS | |
9787 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9788 #else | |
9789 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
9790 #endif | |
9791 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
9792 { | |
9793 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vcf,0}; | |
9794 if (__pyx_kwds) { | |
9795 Py_ssize_t kw_args; | |
9796 switch (__pyx_nargs) { | |
9797 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
9798 CYTHON_FALLTHROUGH; | |
9799 case 0: break; | |
9800 default: goto __pyx_L5_argtuple_error; | |
9801 } | |
9802 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
9803 switch (__pyx_nargs) { | |
9804 case 0: | |
9805 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vcf)) != 0)) { | |
9806 (void)__Pyx_Arg_NewRef_VARARGS(values[0]); | |
9807 kw_args--; | |
9808 } | |
9809 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L3_error) | |
9810 else goto __pyx_L5_argtuple_error; | |
9811 } | |
9812 if (unlikely(kw_args > 0)) { | |
9813 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
9814 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 114, __pyx_L3_error) | |
9815 } | |
9816 } else if (unlikely(__pyx_nargs != 1)) { | |
9817 goto __pyx_L5_argtuple_error; | |
9818 } else { | |
9819 values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
9820 } | |
9821 __pyx_v_vcf = values[0]; | |
9822 } | |
9823 goto __pyx_L6_skip; | |
9824 __pyx_L5_argtuple_error:; | |
9825 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 114, __pyx_L3_error) | |
9826 __pyx_L6_skip:; | |
9827 goto __pyx_L4_argument_unpacking_done; | |
9828 __pyx_L3_error:; | |
9829 { | |
9830 Py_ssize_t __pyx_temp; | |
9831 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9832 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
9833 } | |
9834 } | |
9835 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9836 __Pyx_RefNannyFinishContext(); | |
9837 return -1; | |
9838 __pyx_L4_argument_unpacking_done:; | |
9839 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord___init__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self), __pyx_v_vcf); | |
9840 | |
9841 /* function exit code */ | |
9842 { | |
9843 Py_ssize_t __pyx_temp; | |
9844 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9845 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
9846 } | |
9847 } | |
9848 __Pyx_RefNannyFinishContext(); | |
9849 return __pyx_r; | |
9850 } | |
9851 | |
9852 static int __pyx_pf_5pysam_7libcvcf_9VCFRecord___init__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_vcf) { | |
9853 int __pyx_r; | |
9854 __Pyx_RefNannyDeclarations | |
9855 PyObject *__pyx_t_1 = NULL; | |
9856 int __pyx_lineno = 0; | |
9857 const char *__pyx_filename = NULL; | |
9858 int __pyx_clineno = 0; | |
9859 __Pyx_RefNannySetupContext("__init__", 1); | |
9860 | |
9861 /* "pysam/libcvcf.pyx":115 | |
9862 * | |
9863 * def __init__(self, vcf): | |
9864 * self.vcf = vcf # <<<<<<<<<<<<<< | |
9865 * self.encoding = vcf.encoding | |
9866 * | |
9867 */ | |
9868 __Pyx_INCREF(__pyx_v_vcf); | |
9869 __Pyx_GIVEREF(__pyx_v_vcf); | |
9870 __Pyx_GOTREF(__pyx_v_self->vcf); | |
9871 __Pyx_DECREF(__pyx_v_self->vcf); | |
9872 __pyx_v_self->vcf = __pyx_v_vcf; | |
9873 | |
9874 /* "pysam/libcvcf.pyx":116 | |
9875 * def __init__(self, vcf): | |
9876 * self.vcf = vcf | |
9877 * self.encoding = vcf.encoding # <<<<<<<<<<<<<< | |
9878 * | |
9879 * # if len(data) != len(self.vcf._samples): | |
9880 */ | |
9881 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vcf, __pyx_n_s_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) | |
9882 __Pyx_GOTREF(__pyx_t_1); | |
9883 __Pyx_GIVEREF(__pyx_t_1); | |
9884 __Pyx_GOTREF(__pyx_v_self->__pyx_base.encoding); | |
9885 __Pyx_DECREF(__pyx_v_self->__pyx_base.encoding); | |
9886 __pyx_v_self->__pyx_base.encoding = __pyx_t_1; | |
9887 __pyx_t_1 = 0; | |
9888 | |
9889 /* "pysam/libcvcf.pyx":114 | |
9890 * cdef uint32_t pos | |
9891 * | |
9892 * def __init__(self, vcf): # <<<<<<<<<<<<<< | |
9893 * self.vcf = vcf | |
9894 * self.encoding = vcf.encoding | |
9895 */ | |
9896 | |
9897 /* function exit code */ | |
9898 __pyx_r = 0; | |
9899 goto __pyx_L0; | |
9900 __pyx_L1_error:; | |
9901 __Pyx_XDECREF(__pyx_t_1); | |
9902 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9903 __pyx_r = -1; | |
9904 __pyx_L0:; | |
9905 __Pyx_RefNannyFinishContext(); | |
9906 return __pyx_r; | |
9907 } | |
9908 | |
9909 /* "pysam/libcvcf.pyx":127 | |
9910 * # len(data))) | |
9911 * | |
9912 * def __cinit__(self, vcf): # <<<<<<<<<<<<<< | |
9913 * # start indexed access at genotypes | |
9914 * self.offset = 9 | |
9915 */ | |
9916 | |
9917 /* Python wrapper */ | |
9918 static int __pyx_pw_5pysam_7libcvcf_9VCFRecord_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
9919 static int __pyx_pw_5pysam_7libcvcf_9VCFRecord_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
9920 PyObject *__pyx_v_vcf = 0; | |
9921 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9922 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9923 PyObject* values[1] = {0}; | |
9924 int __pyx_lineno = 0; | |
9925 const char *__pyx_filename = NULL; | |
9926 int __pyx_clineno = 0; | |
9927 int __pyx_r; | |
9928 __Pyx_RefNannyDeclarations | |
9929 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); | |
9930 #if CYTHON_ASSUME_SAFE_MACROS | |
9931 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9932 #else | |
9933 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
9934 #endif | |
9935 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
9936 { | |
9937 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vcf,0}; | |
9938 if (__pyx_kwds) { | |
9939 Py_ssize_t kw_args; | |
9940 switch (__pyx_nargs) { | |
9941 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
9942 CYTHON_FALLTHROUGH; | |
9943 case 0: break; | |
9944 default: goto __pyx_L5_argtuple_error; | |
9945 } | |
9946 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
9947 switch (__pyx_nargs) { | |
9948 case 0: | |
9949 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vcf)) != 0)) { | |
9950 (void)__Pyx_Arg_NewRef_VARARGS(values[0]); | |
9951 kw_args--; | |
9952 } | |
9953 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L3_error) | |
9954 else goto __pyx_L5_argtuple_error; | |
9955 } | |
9956 if (unlikely(kw_args > 0)) { | |
9957 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
9958 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 127, __pyx_L3_error) | |
9959 } | |
9960 } else if (unlikely(__pyx_nargs != 1)) { | |
9961 goto __pyx_L5_argtuple_error; | |
9962 } else { | |
9963 values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
9964 } | |
9965 __pyx_v_vcf = values[0]; | |
9966 } | |
9967 goto __pyx_L6_skip; | |
9968 __pyx_L5_argtuple_error:; | |
9969 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 127, __pyx_L3_error) | |
9970 __pyx_L6_skip:; | |
9971 goto __pyx_L4_argument_unpacking_done; | |
9972 __pyx_L3_error:; | |
9973 { | |
9974 Py_ssize_t __pyx_temp; | |
9975 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9976 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
9977 } | |
9978 } | |
9979 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9980 __Pyx_RefNannyFinishContext(); | |
9981 return -1; | |
9982 __pyx_L4_argument_unpacking_done:; | |
9983 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_2__cinit__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self), __pyx_v_vcf); | |
9984 | |
9985 /* function exit code */ | |
9986 { | |
9987 Py_ssize_t __pyx_temp; | |
9988 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9989 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
9990 } | |
9991 } | |
9992 __Pyx_RefNannyFinishContext(); | |
9993 return __pyx_r; | |
9994 } | |
9995 | |
9996 static int __pyx_pf_5pysam_7libcvcf_9VCFRecord_2__cinit__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_vcf) { | |
9997 int __pyx_r; | |
9998 __Pyx_RefNannyDeclarations | |
9999 PyObject *__pyx_t_1 = NULL; | |
10000 int __pyx_lineno = 0; | |
10001 const char *__pyx_filename = NULL; | |
10002 int __pyx_clineno = 0; | |
10003 __Pyx_RefNannySetupContext("__cinit__", 1); | |
10004 | |
10005 /* "pysam/libcvcf.pyx":129 | |
10006 * def __cinit__(self, vcf): | |
10007 * # start indexed access at genotypes | |
10008 * self.offset = 9 # <<<<<<<<<<<<<< | |
10009 * | |
10010 * self.vcf = vcf | |
10011 */ | |
10012 __pyx_v_self->__pyx_base.offset = 9; | |
10013 | |
10014 /* "pysam/libcvcf.pyx":131 | |
10015 * self.offset = 9 | |
10016 * | |
10017 * self.vcf = vcf # <<<<<<<<<<<<<< | |
10018 * self.encoding = vcf.encoding | |
10019 * | |
10020 */ | |
10021 __Pyx_INCREF(__pyx_v_vcf); | |
10022 __Pyx_GIVEREF(__pyx_v_vcf); | |
10023 __Pyx_GOTREF(__pyx_v_self->vcf); | |
10024 __Pyx_DECREF(__pyx_v_self->vcf); | |
10025 __pyx_v_self->vcf = __pyx_v_vcf; | |
10026 | |
10027 /* "pysam/libcvcf.pyx":132 | |
10028 * | |
10029 * self.vcf = vcf | |
10030 * self.encoding = vcf.encoding # <<<<<<<<<<<<<< | |
10031 * | |
10032 * def error(self, line, error, opt=None): | |
10033 */ | |
10034 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vcf, __pyx_n_s_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) | |
10035 __Pyx_GOTREF(__pyx_t_1); | |
10036 __Pyx_GIVEREF(__pyx_t_1); | |
10037 __Pyx_GOTREF(__pyx_v_self->__pyx_base.encoding); | |
10038 __Pyx_DECREF(__pyx_v_self->__pyx_base.encoding); | |
10039 __pyx_v_self->__pyx_base.encoding = __pyx_t_1; | |
10040 __pyx_t_1 = 0; | |
10041 | |
10042 /* "pysam/libcvcf.pyx":127 | |
10043 * # len(data))) | |
10044 * | |
10045 * def __cinit__(self, vcf): # <<<<<<<<<<<<<< | |
10046 * # start indexed access at genotypes | |
10047 * self.offset = 9 | |
10048 */ | |
10049 | |
10050 /* function exit code */ | |
10051 __pyx_r = 0; | |
10052 goto __pyx_L0; | |
10053 __pyx_L1_error:; | |
10054 __Pyx_XDECREF(__pyx_t_1); | |
10055 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10056 __pyx_r = -1; | |
10057 __pyx_L0:; | |
10058 __Pyx_RefNannyFinishContext(); | |
10059 return __pyx_r; | |
10060 } | |
10061 | |
10062 /* "pysam/libcvcf.pyx":134 | |
10063 * self.encoding = vcf.encoding | |
10064 * | |
10065 * def error(self, line, error, opt=None): # <<<<<<<<<<<<<< | |
10066 * '''raise error.''' | |
10067 * # pass to vcf file for error handling | |
10068 */ | |
10069 | |
10070 /* Python wrapper */ | |
10071 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_5error(PyObject *__pyx_v_self, | |
10072 #if CYTHON_METH_FASTCALL | |
10073 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10074 #else | |
10075 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10076 #endif | |
10077 ); /*proto*/ | |
10078 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_9VCFRecord_4error, "VCFRecord.error(self, line, error, opt=None)\nraise error."); | |
10079 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_9VCFRecord_5error = {"error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_9VCFRecord_5error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_9VCFRecord_4error}; | |
10080 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_5error(PyObject *__pyx_v_self, | |
10081 #if CYTHON_METH_FASTCALL | |
10082 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10083 #else | |
10084 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10085 #endif | |
10086 ) { | |
10087 PyObject *__pyx_v_line = 0; | |
10088 PyObject *__pyx_v_error = 0; | |
10089 PyObject *__pyx_v_opt = 0; | |
10090 #if !CYTHON_METH_FASTCALL | |
10091 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
10092 #endif | |
10093 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10094 PyObject* values[3] = {0,0,0}; | |
10095 int __pyx_lineno = 0; | |
10096 const char *__pyx_filename = NULL; | |
10097 int __pyx_clineno = 0; | |
10098 PyObject *__pyx_r = 0; | |
10099 __Pyx_RefNannyDeclarations | |
10100 __Pyx_RefNannySetupContext("error (wrapper)", 0); | |
10101 #if !CYTHON_METH_FASTCALL | |
10102 #if CYTHON_ASSUME_SAFE_MACROS | |
10103 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
10104 #else | |
10105 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
10106 #endif | |
10107 #endif | |
10108 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
10109 { | |
10110 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_line,&__pyx_n_s_error,&__pyx_n_s_opt,0}; | |
10111 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
10112 if (__pyx_kwds) { | |
10113 Py_ssize_t kw_args; | |
10114 switch (__pyx_nargs) { | |
10115 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
10116 CYTHON_FALLTHROUGH; | |
10117 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
10118 CYTHON_FALLTHROUGH; | |
10119 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10120 CYTHON_FALLTHROUGH; | |
10121 case 0: break; | |
10122 default: goto __pyx_L5_argtuple_error; | |
10123 } | |
10124 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
10125 switch (__pyx_nargs) { | |
10126 case 0: | |
10127 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line)) != 0)) { | |
10128 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
10129 kw_args--; | |
10130 } | |
10131 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) | |
10132 else goto __pyx_L5_argtuple_error; | |
10133 CYTHON_FALLTHROUGH; | |
10134 case 1: | |
10135 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_error)) != 0)) { | |
10136 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
10137 kw_args--; | |
10138 } | |
10139 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) | |
10140 else { | |
10141 __Pyx_RaiseArgtupleInvalid("error", 0, 2, 3, 1); __PYX_ERR(0, 134, __pyx_L3_error) | |
10142 } | |
10143 CYTHON_FALLTHROUGH; | |
10144 case 2: | |
10145 if (kw_args > 0) { | |
10146 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_opt); | |
10147 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
10148 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) | |
10149 } | |
10150 } | |
10151 if (unlikely(kw_args > 0)) { | |
10152 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
10153 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "error") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) | |
10154 } | |
10155 } else { | |
10156 switch (__pyx_nargs) { | |
10157 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
10158 CYTHON_FALLTHROUGH; | |
10159 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
10160 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10161 break; | |
10162 default: goto __pyx_L5_argtuple_error; | |
10163 } | |
10164 } | |
10165 __pyx_v_line = values[0]; | |
10166 __pyx_v_error = values[1]; | |
10167 __pyx_v_opt = values[2]; | |
10168 } | |
10169 goto __pyx_L6_skip; | |
10170 __pyx_L5_argtuple_error:; | |
10171 __Pyx_RaiseArgtupleInvalid("error", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error) | |
10172 __pyx_L6_skip:; | |
10173 goto __pyx_L4_argument_unpacking_done; | |
10174 __pyx_L3_error:; | |
10175 { | |
10176 Py_ssize_t __pyx_temp; | |
10177 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10178 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
10179 } | |
10180 } | |
10181 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.error", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10182 __Pyx_RefNannyFinishContext(); | |
10183 return NULL; | |
10184 __pyx_L4_argument_unpacking_done:; | |
10185 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_4error(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self), __pyx_v_line, __pyx_v_error, __pyx_v_opt); | |
10186 | |
10187 /* function exit code */ | |
10188 { | |
10189 Py_ssize_t __pyx_temp; | |
10190 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10191 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
10192 } | |
10193 } | |
10194 __Pyx_RefNannyFinishContext(); | |
10195 return __pyx_r; | |
10196 } | |
10197 | |
10198 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_4error(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_error, PyObject *__pyx_v_opt) { | |
10199 PyObject *__pyx_r = NULL; | |
10200 __Pyx_RefNannyDeclarations | |
10201 PyObject *__pyx_t_1 = NULL; | |
10202 PyObject *__pyx_t_2 = NULL; | |
10203 PyObject *__pyx_t_3 = NULL; | |
10204 unsigned int __pyx_t_4; | |
10205 int __pyx_lineno = 0; | |
10206 const char *__pyx_filename = NULL; | |
10207 int __pyx_clineno = 0; | |
10208 __Pyx_RefNannySetupContext("error", 1); | |
10209 | |
10210 /* "pysam/libcvcf.pyx":137 | |
10211 * '''raise error.''' | |
10212 * # pass to vcf file for error handling | |
10213 * return self.vcf.error(line, error, opt) # <<<<<<<<<<<<<< | |
10214 * | |
10215 * cdef update(self, char * buffer, size_t nbytes): | |
10216 */ | |
10217 __Pyx_XDECREF(__pyx_r); | |
10218 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) | |
10219 __Pyx_GOTREF(__pyx_t_2); | |
10220 __pyx_t_3 = NULL; | |
10221 __pyx_t_4 = 0; | |
10222 #if CYTHON_UNPACK_METHODS | |
10223 if (likely(PyMethod_Check(__pyx_t_2))) { | |
10224 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
10225 if (likely(__pyx_t_3)) { | |
10226 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
10227 __Pyx_INCREF(__pyx_t_3); | |
10228 __Pyx_INCREF(function); | |
10229 __Pyx_DECREF_SET(__pyx_t_2, function); | |
10230 __pyx_t_4 = 1; | |
10231 } | |
10232 } | |
10233 #endif | |
10234 { | |
10235 PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_line, __pyx_v_error, __pyx_v_opt}; | |
10236 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
10237 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10238 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) | |
10239 __Pyx_GOTREF(__pyx_t_1); | |
10240 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
10241 } | |
10242 __pyx_r = __pyx_t_1; | |
10243 __pyx_t_1 = 0; | |
10244 goto __pyx_L0; | |
10245 | |
10246 /* "pysam/libcvcf.pyx":134 | |
10247 * self.encoding = vcf.encoding | |
10248 * | |
10249 * def error(self, line, error, opt=None): # <<<<<<<<<<<<<< | |
10250 * '''raise error.''' | |
10251 * # pass to vcf file for error handling | |
10252 */ | |
10253 | |
10254 /* function exit code */ | |
10255 __pyx_L1_error:; | |
10256 __Pyx_XDECREF(__pyx_t_1); | |
10257 __Pyx_XDECREF(__pyx_t_2); | |
10258 __Pyx_XDECREF(__pyx_t_3); | |
10259 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.error", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10260 __pyx_r = NULL; | |
10261 __pyx_L0:; | |
10262 __Pyx_XGIVEREF(__pyx_r); | |
10263 __Pyx_RefNannyFinishContext(); | |
10264 return __pyx_r; | |
10265 } | |
10266 | |
10267 /* "pysam/libcvcf.pyx":139 | |
10268 * return self.vcf.error(line, error, opt) | |
10269 * | |
10270 * cdef update(self, char * buffer, size_t nbytes): # <<<<<<<<<<<<<< | |
10271 * '''update internal data. | |
10272 * | |
10273 */ | |
10274 | |
10275 static PyObject *__pyx_f_5pysam_7libcvcf_9VCFRecord_update(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) { | |
10276 PyObject *__pyx_r = NULL; | |
10277 __Pyx_RefNannyDeclarations | |
10278 PyObject *__pyx_t_1 = NULL; | |
10279 int __pyx_lineno = 0; | |
10280 const char *__pyx_filename = NULL; | |
10281 int __pyx_clineno = 0; | |
10282 __Pyx_RefNannySetupContext("update", 1); | |
10283 | |
10284 /* "pysam/libcvcf.pyx":144 | |
10285 * nbytes does not include the terminal '\0'. | |
10286 * ''' | |
10287 * libctabixproxies.TupleProxy.update(self, buffer, nbytes) # <<<<<<<<<<<<<< | |
10288 * | |
10289 * self.contig = self.fields[0] | |
10290 */ | |
10291 __pyx_t_1 = __pyx_vtabptr_5pysam_16libctabixproxies_TupleProxy->update(((struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *)__pyx_v_self), __pyx_v_buffer, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) | |
10292 __Pyx_GOTREF(__pyx_t_1); | |
10293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10294 | |
10295 /* "pysam/libcvcf.pyx":146 | |
10296 * libctabixproxies.TupleProxy.update(self, buffer, nbytes) | |
10297 * | |
10298 * self.contig = self.fields[0] # <<<<<<<<<<<<<< | |
10299 * # vcf counts from 1 - correct here | |
10300 * self.pos = atoi(self.fields[1]) - 1 | |
10301 */ | |
10302 __pyx_v_self->contig = (__pyx_v_self->__pyx_base.fields[0]); | |
10303 | |
10304 /* "pysam/libcvcf.pyx":148 | |
10305 * self.contig = self.fields[0] | |
10306 * # vcf counts from 1 - correct here | |
10307 * self.pos = atoi(self.fields[1]) - 1 # <<<<<<<<<<<<<< | |
10308 * | |
10309 * def __len__(self): | |
10310 */ | |
10311 __pyx_v_self->pos = (atoi((__pyx_v_self->__pyx_base.fields[1])) - 1); | |
10312 | |
10313 /* "pysam/libcvcf.pyx":139 | |
10314 * return self.vcf.error(line, error, opt) | |
10315 * | |
10316 * cdef update(self, char * buffer, size_t nbytes): # <<<<<<<<<<<<<< | |
10317 * '''update internal data. | |
10318 * | |
10319 */ | |
10320 | |
10321 /* function exit code */ | |
10322 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
10323 goto __pyx_L0; | |
10324 __pyx_L1_error:; | |
10325 __Pyx_XDECREF(__pyx_t_1); | |
10326 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.update", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10327 __pyx_r = 0; | |
10328 __pyx_L0:; | |
10329 __Pyx_XGIVEREF(__pyx_r); | |
10330 __Pyx_RefNannyFinishContext(); | |
10331 return __pyx_r; | |
10332 } | |
10333 | |
10334 /* "pysam/libcvcf.pyx":150 | |
10335 * self.pos = atoi(self.fields[1]) - 1 | |
10336 * | |
10337 * def __len__(self): # <<<<<<<<<<<<<< | |
10338 * return max(0, self.nfields - 9) | |
10339 * | |
10340 */ | |
10341 | |
10342 /* Python wrapper */ | |
10343 static Py_ssize_t __pyx_pw_5pysam_7libcvcf_9VCFRecord_7__len__(PyObject *__pyx_v_self); /*proto*/ | |
10344 static Py_ssize_t __pyx_pw_5pysam_7libcvcf_9VCFRecord_7__len__(PyObject *__pyx_v_self) { | |
10345 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10346 Py_ssize_t __pyx_r; | |
10347 __Pyx_RefNannyDeclarations | |
10348 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); | |
10349 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10350 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_6__len__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
10351 | |
10352 /* function exit code */ | |
10353 __Pyx_RefNannyFinishContext(); | |
10354 return __pyx_r; | |
10355 } | |
10356 | |
10357 static Py_ssize_t __pyx_pf_5pysam_7libcvcf_9VCFRecord_6__len__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
10358 Py_ssize_t __pyx_r; | |
10359 long __pyx_t_1; | |
10360 long __pyx_t_2; | |
10361 long __pyx_t_3; | |
10362 int __pyx_t_4; | |
10363 | |
10364 /* "pysam/libcvcf.pyx":151 | |
10365 * | |
10366 * def __len__(self): | |
10367 * return max(0, self.nfields - 9) # <<<<<<<<<<<<<< | |
10368 * | |
10369 * property contig: | |
10370 */ | |
10371 __pyx_t_1 = (__pyx_v_self->__pyx_base.nfields - 9); | |
10372 __pyx_t_2 = 0; | |
10373 __pyx_t_4 = (__pyx_t_1 > __pyx_t_2); | |
10374 if (__pyx_t_4) { | |
10375 __pyx_t_3 = __pyx_t_1; | |
10376 } else { | |
10377 __pyx_t_3 = __pyx_t_2; | |
10378 } | |
10379 __pyx_r = __pyx_t_3; | |
10380 goto __pyx_L0; | |
10381 | |
10382 /* "pysam/libcvcf.pyx":150 | |
10383 * self.pos = atoi(self.fields[1]) - 1 | |
10384 * | |
10385 * def __len__(self): # <<<<<<<<<<<<<< | |
10386 * return max(0, self.nfields - 9) | |
10387 * | |
10388 */ | |
10389 | |
10390 /* function exit code */ | |
10391 __pyx_L0:; | |
10392 return __pyx_r; | |
10393 } | |
10394 | |
10395 /* "pysam/libcvcf.pyx":154 | |
10396 * | |
10397 * property contig: | |
10398 * def __get__(self): return self.contig # <<<<<<<<<<<<<< | |
10399 * | |
10400 * property pos: | |
10401 */ | |
10402 | |
10403 /* Python wrapper */ | |
10404 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_6contig_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
10405 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_6contig_1__get__(PyObject *__pyx_v_self) { | |
10406 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10407 PyObject *__pyx_r = 0; | |
10408 __Pyx_RefNannyDeclarations | |
10409 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
10410 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10411 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_6contig___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
10412 | |
10413 /* function exit code */ | |
10414 __Pyx_RefNannyFinishContext(); | |
10415 return __pyx_r; | |
10416 } | |
10417 | |
10418 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_6contig___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
10419 PyObject *__pyx_r = NULL; | |
10420 __Pyx_RefNannyDeclarations | |
10421 PyObject *__pyx_t_1 = NULL; | |
10422 int __pyx_lineno = 0; | |
10423 const char *__pyx_filename = NULL; | |
10424 int __pyx_clineno = 0; | |
10425 __Pyx_RefNannySetupContext("__get__", 1); | |
10426 __Pyx_XDECREF(__pyx_r); | |
10427 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->contig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) | |
10428 __Pyx_GOTREF(__pyx_t_1); | |
10429 __pyx_r = __pyx_t_1; | |
10430 __pyx_t_1 = 0; | |
10431 goto __pyx_L0; | |
10432 | |
10433 /* function exit code */ | |
10434 __pyx_L1_error:; | |
10435 __Pyx_XDECREF(__pyx_t_1); | |
10436 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.contig.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10437 __pyx_r = NULL; | |
10438 __pyx_L0:; | |
10439 __Pyx_XGIVEREF(__pyx_r); | |
10440 __Pyx_RefNannyFinishContext(); | |
10441 return __pyx_r; | |
10442 } | |
10443 | |
10444 /* "pysam/libcvcf.pyx":157 | |
10445 * | |
10446 * property pos: | |
10447 * def __get__(self): return self.pos # <<<<<<<<<<<<<< | |
10448 * | |
10449 * property id: | |
10450 */ | |
10451 | |
10452 /* Python wrapper */ | |
10453 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
10454 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_3pos_1__get__(PyObject *__pyx_v_self) { | |
10455 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10456 PyObject *__pyx_r = 0; | |
10457 __Pyx_RefNannyDeclarations | |
10458 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
10459 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10460 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_3pos___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
10461 | |
10462 /* function exit code */ | |
10463 __Pyx_RefNannyFinishContext(); | |
10464 return __pyx_r; | |
10465 } | |
10466 | |
10467 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_3pos___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
10468 PyObject *__pyx_r = NULL; | |
10469 __Pyx_RefNannyDeclarations | |
10470 PyObject *__pyx_t_1 = NULL; | |
10471 int __pyx_lineno = 0; | |
10472 const char *__pyx_filename = NULL; | |
10473 int __pyx_clineno = 0; | |
10474 __Pyx_RefNannySetupContext("__get__", 1); | |
10475 __Pyx_XDECREF(__pyx_r); | |
10476 __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) | |
10477 __Pyx_GOTREF(__pyx_t_1); | |
10478 __pyx_r = __pyx_t_1; | |
10479 __pyx_t_1 = 0; | |
10480 goto __pyx_L0; | |
10481 | |
10482 /* function exit code */ | |
10483 __pyx_L1_error:; | |
10484 __Pyx_XDECREF(__pyx_t_1); | |
10485 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10486 __pyx_r = NULL; | |
10487 __pyx_L0:; | |
10488 __Pyx_XGIVEREF(__pyx_r); | |
10489 __Pyx_RefNannyFinishContext(); | |
10490 return __pyx_r; | |
10491 } | |
10492 | |
10493 /* "pysam/libcvcf.pyx":160 | |
10494 * | |
10495 * property id: | |
10496 * def __get__(self): return self.fields[2] # <<<<<<<<<<<<<< | |
10497 * | |
10498 * property ref: | |
10499 */ | |
10500 | |
10501 /* Python wrapper */ | |
10502 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_2id_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
10503 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_2id_1__get__(PyObject *__pyx_v_self) { | |
10504 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10505 PyObject *__pyx_r = 0; | |
10506 __Pyx_RefNannyDeclarations | |
10507 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
10508 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10509 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_2id___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
10510 | |
10511 /* function exit code */ | |
10512 __Pyx_RefNannyFinishContext(); | |
10513 return __pyx_r; | |
10514 } | |
10515 | |
10516 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_2id___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
10517 PyObject *__pyx_r = NULL; | |
10518 __Pyx_RefNannyDeclarations | |
10519 PyObject *__pyx_t_1 = NULL; | |
10520 int __pyx_lineno = 0; | |
10521 const char *__pyx_filename = NULL; | |
10522 int __pyx_clineno = 0; | |
10523 __Pyx_RefNannySetupContext("__get__", 1); | |
10524 __Pyx_XDECREF(__pyx_r); | |
10525 __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) | |
10526 __Pyx_GOTREF(__pyx_t_1); | |
10527 __pyx_r = __pyx_t_1; | |
10528 __pyx_t_1 = 0; | |
10529 goto __pyx_L0; | |
10530 | |
10531 /* function exit code */ | |
10532 __pyx_L1_error:; | |
10533 __Pyx_XDECREF(__pyx_t_1); | |
10534 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10535 __pyx_r = NULL; | |
10536 __pyx_L0:; | |
10537 __Pyx_XGIVEREF(__pyx_r); | |
10538 __Pyx_RefNannyFinishContext(); | |
10539 return __pyx_r; | |
10540 } | |
10541 | |
10542 /* "pysam/libcvcf.pyx":163 | |
10543 * | |
10544 * property ref: | |
10545 * def __get__(self): # <<<<<<<<<<<<<< | |
10546 * return self.fields[3] | |
10547 * | |
10548 */ | |
10549 | |
10550 /* Python wrapper */ | |
10551 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
10552 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_3ref_1__get__(PyObject *__pyx_v_self) { | |
10553 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10554 PyObject *__pyx_r = 0; | |
10555 __Pyx_RefNannyDeclarations | |
10556 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
10557 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10558 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_3ref___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
10559 | |
10560 /* function exit code */ | |
10561 __Pyx_RefNannyFinishContext(); | |
10562 return __pyx_r; | |
10563 } | |
10564 | |
10565 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_3ref___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
10566 PyObject *__pyx_r = NULL; | |
10567 __Pyx_RefNannyDeclarations | |
10568 PyObject *__pyx_t_1 = NULL; | |
10569 int __pyx_lineno = 0; | |
10570 const char *__pyx_filename = NULL; | |
10571 int __pyx_clineno = 0; | |
10572 __Pyx_RefNannySetupContext("__get__", 1); | |
10573 | |
10574 /* "pysam/libcvcf.pyx":164 | |
10575 * property ref: | |
10576 * def __get__(self): | |
10577 * return self.fields[3] # <<<<<<<<<<<<<< | |
10578 * | |
10579 * property alt: | |
10580 */ | |
10581 __Pyx_XDECREF(__pyx_r); | |
10582 __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[3])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) | |
10583 __Pyx_GOTREF(__pyx_t_1); | |
10584 __pyx_r = __pyx_t_1; | |
10585 __pyx_t_1 = 0; | |
10586 goto __pyx_L0; | |
10587 | |
10588 /* "pysam/libcvcf.pyx":163 | |
10589 * | |
10590 * property ref: | |
10591 * def __get__(self): # <<<<<<<<<<<<<< | |
10592 * return self.fields[3] | |
10593 * | |
10594 */ | |
10595 | |
10596 /* function exit code */ | |
10597 __pyx_L1_error:; | |
10598 __Pyx_XDECREF(__pyx_t_1); | |
10599 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10600 __pyx_r = NULL; | |
10601 __pyx_L0:; | |
10602 __Pyx_XGIVEREF(__pyx_r); | |
10603 __Pyx_RefNannyFinishContext(); | |
10604 return __pyx_r; | |
10605 } | |
10606 | |
10607 /* "pysam/libcvcf.pyx":167 | |
10608 * | |
10609 * property alt: | |
10610 * def __get__(self): # <<<<<<<<<<<<<< | |
10611 * # convert v3.3 to v4.0 alleles below | |
10612 * alt = self.fields[4] | |
10613 */ | |
10614 | |
10615 /* Python wrapper */ | |
10616 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_3alt_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
10617 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_3alt_1__get__(PyObject *__pyx_v_self) { | |
10618 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10619 PyObject *__pyx_r = 0; | |
10620 __Pyx_RefNannyDeclarations | |
10621 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
10622 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10623 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_3alt___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
10624 | |
10625 /* function exit code */ | |
10626 __Pyx_RefNannyFinishContext(); | |
10627 return __pyx_r; | |
10628 } | |
10629 | |
10630 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_3alt___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
10631 PyObject *__pyx_v_alt = NULL; | |
10632 PyObject *__pyx_r = NULL; | |
10633 __Pyx_RefNannyDeclarations | |
10634 PyObject *__pyx_t_1 = NULL; | |
10635 int __pyx_t_2; | |
10636 PyObject *__pyx_t_3 = NULL; | |
10637 PyObject *__pyx_t_4 = NULL; | |
10638 PyObject *__pyx_t_5 = NULL; | |
10639 unsigned int __pyx_t_6; | |
10640 int __pyx_lineno = 0; | |
10641 const char *__pyx_filename = NULL; | |
10642 int __pyx_clineno = 0; | |
10643 __Pyx_RefNannySetupContext("__get__", 1); | |
10644 | |
10645 /* "pysam/libcvcf.pyx":169 | |
10646 * def __get__(self): | |
10647 * # convert v3.3 to v4.0 alleles below | |
10648 * alt = self.fields[4] # <<<<<<<<<<<<<< | |
10649 * if alt == ".": alt = [] | |
10650 * else: alt = alt.upper().split(',') | |
10651 */ | |
10652 __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[4])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) | |
10653 __Pyx_GOTREF(__pyx_t_1); | |
10654 __pyx_v_alt = __pyx_t_1; | |
10655 __pyx_t_1 = 0; | |
10656 | |
10657 /* "pysam/libcvcf.pyx":170 | |
10658 * # convert v3.3 to v4.0 alleles below | |
10659 * alt = self.fields[4] | |
10660 * if alt == ".": alt = [] # <<<<<<<<<<<<<< | |
10661 * else: alt = alt.upper().split(',') | |
10662 * return alt | |
10663 */ | |
10664 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_alt, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) | |
10665 if (__pyx_t_2) { | |
10666 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) | |
10667 __Pyx_GOTREF(__pyx_t_1); | |
10668 __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_1); | |
10669 __pyx_t_1 = 0; | |
10670 goto __pyx_L3; | |
10671 } | |
10672 | |
10673 /* "pysam/libcvcf.pyx":171 | |
10674 * alt = self.fields[4] | |
10675 * if alt == ".": alt = [] | |
10676 * else: alt = alt.upper().split(',') # <<<<<<<<<<<<<< | |
10677 * return alt | |
10678 * | |
10679 */ | |
10680 /*else*/ { | |
10681 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_alt, __pyx_n_s_upper); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) | |
10682 __Pyx_GOTREF(__pyx_t_4); | |
10683 __pyx_t_5 = NULL; | |
10684 __pyx_t_6 = 0; | |
10685 #if CYTHON_UNPACK_METHODS | |
10686 if (likely(PyMethod_Check(__pyx_t_4))) { | |
10687 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); | |
10688 if (likely(__pyx_t_5)) { | |
10689 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
10690 __Pyx_INCREF(__pyx_t_5); | |
10691 __Pyx_INCREF(function); | |
10692 __Pyx_DECREF_SET(__pyx_t_4, function); | |
10693 __pyx_t_6 = 1; | |
10694 } | |
10695 } | |
10696 #endif | |
10697 { | |
10698 PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; | |
10699 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); | |
10700 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
10701 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) | |
10702 __Pyx_GOTREF(__pyx_t_3); | |
10703 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
10704 } | |
10705 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) | |
10706 __Pyx_GOTREF(__pyx_t_4); | |
10707 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10708 __pyx_t_3 = NULL; | |
10709 __pyx_t_6 = 0; | |
10710 #if CYTHON_UNPACK_METHODS | |
10711 if (likely(PyMethod_Check(__pyx_t_4))) { | |
10712 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); | |
10713 if (likely(__pyx_t_3)) { | |
10714 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
10715 __Pyx_INCREF(__pyx_t_3); | |
10716 __Pyx_INCREF(function); | |
10717 __Pyx_DECREF_SET(__pyx_t_4, function); | |
10718 __pyx_t_6 = 1; | |
10719 } | |
10720 } | |
10721 #endif | |
10722 { | |
10723 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__2}; | |
10724 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); | |
10725 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10726 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) | |
10727 __Pyx_GOTREF(__pyx_t_1); | |
10728 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
10729 } | |
10730 __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_1); | |
10731 __pyx_t_1 = 0; | |
10732 } | |
10733 __pyx_L3:; | |
10734 | |
10735 /* "pysam/libcvcf.pyx":172 | |
10736 * if alt == ".": alt = [] | |
10737 * else: alt = alt.upper().split(',') | |
10738 * return alt # <<<<<<<<<<<<<< | |
10739 * | |
10740 * property qual: | |
10741 */ | |
10742 __Pyx_XDECREF(__pyx_r); | |
10743 __Pyx_INCREF(__pyx_v_alt); | |
10744 __pyx_r = __pyx_v_alt; | |
10745 goto __pyx_L0; | |
10746 | |
10747 /* "pysam/libcvcf.pyx":167 | |
10748 * | |
10749 * property alt: | |
10750 * def __get__(self): # <<<<<<<<<<<<<< | |
10751 * # convert v3.3 to v4.0 alleles below | |
10752 * alt = self.fields[4] | |
10753 */ | |
10754 | |
10755 /* function exit code */ | |
10756 __pyx_L1_error:; | |
10757 __Pyx_XDECREF(__pyx_t_1); | |
10758 __Pyx_XDECREF(__pyx_t_3); | |
10759 __Pyx_XDECREF(__pyx_t_4); | |
10760 __Pyx_XDECREF(__pyx_t_5); | |
10761 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.alt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10762 __pyx_r = NULL; | |
10763 __pyx_L0:; | |
10764 __Pyx_XDECREF(__pyx_v_alt); | |
10765 __Pyx_XGIVEREF(__pyx_r); | |
10766 __Pyx_RefNannyFinishContext(); | |
10767 return __pyx_r; | |
10768 } | |
10769 | |
10770 /* "pysam/libcvcf.pyx":175 | |
10771 * | |
10772 * property qual: | |
10773 * def __get__(self): # <<<<<<<<<<<<<< | |
10774 * qual = self.fields[5] | |
10775 * if qual == b".": qual = -1 | |
10776 */ | |
10777 | |
10778 /* Python wrapper */ | |
10779 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_4qual_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
10780 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_4qual_1__get__(PyObject *__pyx_v_self) { | |
10781 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10782 PyObject *__pyx_r = 0; | |
10783 __Pyx_RefNannyDeclarations | |
10784 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
10785 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10786 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_4qual___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
10787 | |
10788 /* function exit code */ | |
10789 __Pyx_RefNannyFinishContext(); | |
10790 return __pyx_r; | |
10791 } | |
10792 | |
10793 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_4qual___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
10794 PyObject *__pyx_v_qual = NULL; | |
10795 PyObject *__pyx_r = NULL; | |
10796 __Pyx_RefNannyDeclarations | |
10797 PyObject *__pyx_t_1 = NULL; | |
10798 int __pyx_t_2; | |
10799 PyObject *__pyx_t_3 = NULL; | |
10800 PyObject *__pyx_t_4 = NULL; | |
10801 PyObject *__pyx_t_5 = NULL; | |
10802 PyObject *__pyx_t_6 = NULL; | |
10803 PyObject *__pyx_t_7 = NULL; | |
10804 PyObject *__pyx_t_8 = NULL; | |
10805 PyObject *__pyx_t_9 = NULL; | |
10806 PyObject *__pyx_t_10 = NULL; | |
10807 PyObject *__pyx_t_11 = NULL; | |
10808 PyObject *__pyx_t_12 = NULL; | |
10809 unsigned int __pyx_t_13; | |
10810 int __pyx_lineno = 0; | |
10811 const char *__pyx_filename = NULL; | |
10812 int __pyx_clineno = 0; | |
10813 __Pyx_RefNannySetupContext("__get__", 1); | |
10814 | |
10815 /* "pysam/libcvcf.pyx":176 | |
10816 * property qual: | |
10817 * def __get__(self): | |
10818 * qual = self.fields[5] # <<<<<<<<<<<<<< | |
10819 * if qual == b".": qual = -1 | |
10820 * else: | |
10821 */ | |
10822 __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[5])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) | |
10823 __Pyx_GOTREF(__pyx_t_1); | |
10824 __pyx_v_qual = __pyx_t_1; | |
10825 __pyx_t_1 = 0; | |
10826 | |
10827 /* "pysam/libcvcf.pyx":177 | |
10828 * def __get__(self): | |
10829 * qual = self.fields[5] | |
10830 * if qual == b".": qual = -1 # <<<<<<<<<<<<<< | |
10831 * else: | |
10832 * try: qual = float(qual) | |
10833 */ | |
10834 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_qual, __pyx_kp_b__5, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) | |
10835 if (__pyx_t_2) { | |
10836 __Pyx_INCREF(__pyx_int_neg_1); | |
10837 __Pyx_DECREF_SET(__pyx_v_qual, __pyx_int_neg_1); | |
10838 goto __pyx_L3; | |
10839 } | |
10840 | |
10841 /* "pysam/libcvcf.pyx":179 | |
10842 * if qual == b".": qual = -1 | |
10843 * else: | |
10844 * try: qual = float(qual) # <<<<<<<<<<<<<< | |
10845 * except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL) | |
10846 * return qual | |
10847 */ | |
10848 /*else*/ { | |
10849 { | |
10850 __Pyx_PyThreadState_declare | |
10851 __Pyx_PyThreadState_assign | |
10852 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); | |
10853 __Pyx_XGOTREF(__pyx_t_3); | |
10854 __Pyx_XGOTREF(__pyx_t_4); | |
10855 __Pyx_XGOTREF(__pyx_t_5); | |
10856 /*try:*/ { | |
10857 __pyx_t_1 = __Pyx_PyNumber_Float(__pyx_v_qual); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L4_error) | |
10858 __Pyx_GOTREF(__pyx_t_1); | |
10859 __Pyx_DECREF_SET(__pyx_v_qual, __pyx_t_1); | |
10860 __pyx_t_1 = 0; | |
10861 } | |
10862 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10863 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
10864 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
10865 goto __pyx_L9_try_end; | |
10866 __pyx_L4_error:; | |
10867 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10868 | |
10869 /* "pysam/libcvcf.pyx":180 | |
10870 * else: | |
10871 * try: qual = float(qual) | |
10872 * except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL) # <<<<<<<<<<<<<< | |
10873 * return qual | |
10874 * | |
10875 */ | |
10876 /*except:*/ { | |
10877 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.qual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10878 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 180, __pyx_L6_except_error) | |
10879 __Pyx_XGOTREF(__pyx_t_1); | |
10880 __Pyx_XGOTREF(__pyx_t_6); | |
10881 __Pyx_XGOTREF(__pyx_t_7); | |
10882 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 180, __pyx_L6_except_error) | |
10883 __Pyx_GOTREF(__pyx_t_9); | |
10884 __pyx_t_10 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 180, __pyx_L6_except_error) | |
10885 __Pyx_GOTREF(__pyx_t_10); | |
10886 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_QUAL_NOT_NUMERICAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 180, __pyx_L6_except_error) | |
10887 __Pyx_GOTREF(__pyx_t_11); | |
10888 __pyx_t_12 = NULL; | |
10889 __pyx_t_13 = 0; | |
10890 #if CYTHON_UNPACK_METHODS | |
10891 if (likely(PyMethod_Check(__pyx_t_9))) { | |
10892 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); | |
10893 if (likely(__pyx_t_12)) { | |
10894 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); | |
10895 __Pyx_INCREF(__pyx_t_12); | |
10896 __Pyx_INCREF(function); | |
10897 __Pyx_DECREF_SET(__pyx_t_9, function); | |
10898 __pyx_t_13 = 1; | |
10899 } | |
10900 } | |
10901 #endif | |
10902 { | |
10903 PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_10, __pyx_t_11}; | |
10904 __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13); | |
10905 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
10906 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
10907 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
10908 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 180, __pyx_L6_except_error) | |
10909 __Pyx_GOTREF(__pyx_t_8); | |
10910 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
10911 } | |
10912 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
10913 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10914 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
10915 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
10916 goto __pyx_L5_exception_handled; | |
10917 } | |
10918 | |
10919 /* "pysam/libcvcf.pyx":179 | |
10920 * if qual == b".": qual = -1 | |
10921 * else: | |
10922 * try: qual = float(qual) # <<<<<<<<<<<<<< | |
10923 * except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL) | |
10924 * return qual | |
10925 */ | |
10926 __pyx_L6_except_error:; | |
10927 __Pyx_XGIVEREF(__pyx_t_3); | |
10928 __Pyx_XGIVEREF(__pyx_t_4); | |
10929 __Pyx_XGIVEREF(__pyx_t_5); | |
10930 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); | |
10931 goto __pyx_L1_error; | |
10932 __pyx_L5_exception_handled:; | |
10933 __Pyx_XGIVEREF(__pyx_t_3); | |
10934 __Pyx_XGIVEREF(__pyx_t_4); | |
10935 __Pyx_XGIVEREF(__pyx_t_5); | |
10936 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); | |
10937 __pyx_L9_try_end:; | |
10938 } | |
10939 } | |
10940 __pyx_L3:; | |
10941 | |
10942 /* "pysam/libcvcf.pyx":181 | |
10943 * try: qual = float(qual) | |
10944 * except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL) | |
10945 * return qual # <<<<<<<<<<<<<< | |
10946 * | |
10947 * property filter: | |
10948 */ | |
10949 __Pyx_XDECREF(__pyx_r); | |
10950 __Pyx_INCREF(__pyx_v_qual); | |
10951 __pyx_r = __pyx_v_qual; | |
10952 goto __pyx_L0; | |
10953 | |
10954 /* "pysam/libcvcf.pyx":175 | |
10955 * | |
10956 * property qual: | |
10957 * def __get__(self): # <<<<<<<<<<<<<< | |
10958 * qual = self.fields[5] | |
10959 * if qual == b".": qual = -1 | |
10960 */ | |
10961 | |
10962 /* function exit code */ | |
10963 __pyx_L1_error:; | |
10964 __Pyx_XDECREF(__pyx_t_1); | |
10965 __Pyx_XDECREF(__pyx_t_6); | |
10966 __Pyx_XDECREF(__pyx_t_7); | |
10967 __Pyx_XDECREF(__pyx_t_8); | |
10968 __Pyx_XDECREF(__pyx_t_9); | |
10969 __Pyx_XDECREF(__pyx_t_10); | |
10970 __Pyx_XDECREF(__pyx_t_11); | |
10971 __Pyx_XDECREF(__pyx_t_12); | |
10972 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.qual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10973 __pyx_r = NULL; | |
10974 __pyx_L0:; | |
10975 __Pyx_XDECREF(__pyx_v_qual); | |
10976 __Pyx_XGIVEREF(__pyx_r); | |
10977 __Pyx_RefNannyFinishContext(); | |
10978 return __pyx_r; | |
10979 } | |
10980 | |
10981 /* "pysam/libcvcf.pyx":184 | |
10982 * | |
10983 * property filter: | |
10984 * def __get__(self): # <<<<<<<<<<<<<< | |
10985 * f = self.fields[6] | |
10986 * # postpone checking that filters exist. Encode missing filter or no filtering as empty list | |
10987 */ | |
10988 | |
10989 /* Python wrapper */ | |
10990 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_6filter_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
10991 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_6filter_1__get__(PyObject *__pyx_v_self) { | |
10992 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10993 PyObject *__pyx_r = 0; | |
10994 __Pyx_RefNannyDeclarations | |
10995 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
10996 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10997 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_6filter___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
10998 | |
10999 /* function exit code */ | |
11000 __Pyx_RefNannyFinishContext(); | |
11001 return __pyx_r; | |
11002 } | |
11003 | |
11004 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_6filter___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
11005 char *__pyx_v_f; | |
11006 PyObject *__pyx_r = NULL; | |
11007 __Pyx_RefNannyDeclarations | |
11008 int __pyx_t_1; | |
11009 PyObject *__pyx_t_2 = NULL; | |
11010 int __pyx_t_3; | |
11011 PyObject *__pyx_t_4 = NULL; | |
11012 PyObject *__pyx_t_5 = NULL; | |
11013 unsigned int __pyx_t_6; | |
11014 int __pyx_lineno = 0; | |
11015 const char *__pyx_filename = NULL; | |
11016 int __pyx_clineno = 0; | |
11017 __Pyx_RefNannySetupContext("__get__", 1); | |
11018 | |
11019 /* "pysam/libcvcf.pyx":185 | |
11020 * property filter: | |
11021 * def __get__(self): | |
11022 * f = self.fields[6] # <<<<<<<<<<<<<< | |
11023 * # postpone checking that filters exist. Encode missing filter or no filtering as empty list | |
11024 * if f == b"." or f == b"PASS" or f == b"0": return [] | |
11025 */ | |
11026 __pyx_v_f = (__pyx_v_self->__pyx_base.fields[6]); | |
11027 | |
11028 /* "pysam/libcvcf.pyx":187 | |
11029 * f = self.fields[6] | |
11030 * # postpone checking that filters exist. Encode missing filter or no filtering as empty list | |
11031 * if f == b"." or f == b"PASS" or f == b"0": return [] # <<<<<<<<<<<<<< | |
11032 * else: return f.split(';') | |
11033 * | |
11034 */ | |
11035 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) | |
11036 __Pyx_GOTREF(__pyx_t_2); | |
11037 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_kp_b__5, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) | |
11038 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11039 if (!__pyx_t_3) { | |
11040 } else { | |
11041 __pyx_t_1 = __pyx_t_3; | |
11042 goto __pyx_L4_bool_binop_done; | |
11043 } | |
11044 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) | |
11045 __Pyx_GOTREF(__pyx_t_2); | |
11046 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_PASS, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) | |
11047 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11048 if (!__pyx_t_3) { | |
11049 } else { | |
11050 __pyx_t_1 = __pyx_t_3; | |
11051 goto __pyx_L4_bool_binop_done; | |
11052 } | |
11053 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) | |
11054 __Pyx_GOTREF(__pyx_t_2); | |
11055 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_kp_b_0, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) | |
11056 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11057 __pyx_t_1 = __pyx_t_3; | |
11058 __pyx_L4_bool_binop_done:; | |
11059 if (__pyx_t_1) { | |
11060 __Pyx_XDECREF(__pyx_r); | |
11061 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) | |
11062 __Pyx_GOTREF(__pyx_t_2); | |
11063 __pyx_r = __pyx_t_2; | |
11064 __pyx_t_2 = 0; | |
11065 goto __pyx_L0; | |
11066 } | |
11067 | |
11068 /* "pysam/libcvcf.pyx":188 | |
11069 * # postpone checking that filters exist. Encode missing filter or no filtering as empty list | |
11070 * if f == b"." or f == b"PASS" or f == b"0": return [] | |
11071 * else: return f.split(';') # <<<<<<<<<<<<<< | |
11072 * | |
11073 * property info: | |
11074 */ | |
11075 /*else*/ { | |
11076 __Pyx_XDECREF(__pyx_r); | |
11077 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error) | |
11078 __Pyx_GOTREF(__pyx_t_4); | |
11079 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) | |
11080 __Pyx_GOTREF(__pyx_t_5); | |
11081 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11082 __pyx_t_4 = NULL; | |
11083 __pyx_t_6 = 0; | |
11084 #if CYTHON_UNPACK_METHODS | |
11085 if (likely(PyMethod_Check(__pyx_t_5))) { | |
11086 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); | |
11087 if (likely(__pyx_t_4)) { | |
11088 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
11089 __Pyx_INCREF(__pyx_t_4); | |
11090 __Pyx_INCREF(function); | |
11091 __Pyx_DECREF_SET(__pyx_t_5, function); | |
11092 __pyx_t_6 = 1; | |
11093 } | |
11094 } | |
11095 #endif | |
11096 { | |
11097 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__6}; | |
11098 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); | |
11099 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11100 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) | |
11101 __Pyx_GOTREF(__pyx_t_2); | |
11102 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
11103 } | |
11104 __pyx_r = __pyx_t_2; | |
11105 __pyx_t_2 = 0; | |
11106 goto __pyx_L0; | |
11107 } | |
11108 | |
11109 /* "pysam/libcvcf.pyx":184 | |
11110 * | |
11111 * property filter: | |
11112 * def __get__(self): # <<<<<<<<<<<<<< | |
11113 * f = self.fields[6] | |
11114 * # postpone checking that filters exist. Encode missing filter or no filtering as empty list | |
11115 */ | |
11116 | |
11117 /* function exit code */ | |
11118 __pyx_L1_error:; | |
11119 __Pyx_XDECREF(__pyx_t_2); | |
11120 __Pyx_XDECREF(__pyx_t_4); | |
11121 __Pyx_XDECREF(__pyx_t_5); | |
11122 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.filter.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11123 __pyx_r = NULL; | |
11124 __pyx_L0:; | |
11125 __Pyx_XGIVEREF(__pyx_r); | |
11126 __Pyx_RefNannyFinishContext(); | |
11127 return __pyx_r; | |
11128 } | |
11129 | |
11130 /* "pysam/libcvcf.pyx":191 | |
11131 * | |
11132 * property info: | |
11133 * def __get__(self): # <<<<<<<<<<<<<< | |
11134 * col = self.fields[7] | |
11135 * # dictionary of keys, and list of values | |
11136 */ | |
11137 | |
11138 /* Python wrapper */ | |
11139 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_4info_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
11140 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_4info_1__get__(PyObject *__pyx_v_self) { | |
11141 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
11142 PyObject *__pyx_r = 0; | |
11143 __Pyx_RefNannyDeclarations | |
11144 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
11145 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
11146 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_4info___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
11147 | |
11148 /* function exit code */ | |
11149 __Pyx_RefNannyFinishContext(); | |
11150 return __pyx_r; | |
11151 } | |
11152 | |
11153 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_4info___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
11154 char *__pyx_v_col; | |
11155 PyObject *__pyx_v_info = NULL; | |
11156 PyObject *__pyx_v_blurp = NULL; | |
11157 PyObject *__pyx_v_elts = NULL; | |
11158 PyObject *__pyx_v_v = NULL; | |
11159 PyObject *__pyx_r = NULL; | |
11160 __Pyx_RefNannyDeclarations | |
11161 PyObject *__pyx_t_1 = NULL; | |
11162 int __pyx_t_2; | |
11163 PyObject *__pyx_t_3 = NULL; | |
11164 PyObject *__pyx_t_4 = NULL; | |
11165 unsigned int __pyx_t_5; | |
11166 Py_ssize_t __pyx_t_6; | |
11167 PyObject *(*__pyx_t_7)(PyObject *); | |
11168 PyObject *__pyx_t_8 = NULL; | |
11169 Py_ssize_t __pyx_t_9; | |
11170 PyObject *__pyx_t_10 = NULL; | |
11171 PyObject *__pyx_t_11 = NULL; | |
11172 PyObject *__pyx_t_12 = NULL; | |
11173 int __pyx_lineno = 0; | |
11174 const char *__pyx_filename = NULL; | |
11175 int __pyx_clineno = 0; | |
11176 __Pyx_RefNannySetupContext("__get__", 1); | |
11177 | |
11178 /* "pysam/libcvcf.pyx":192 | |
11179 * property info: | |
11180 * def __get__(self): | |
11181 * col = self.fields[7] # <<<<<<<<<<<<<< | |
11182 * # dictionary of keys, and list of values | |
11183 * info = {} | |
11184 */ | |
11185 __pyx_v_col = (__pyx_v_self->__pyx_base.fields[7]); | |
11186 | |
11187 /* "pysam/libcvcf.pyx":194 | |
11188 * col = self.fields[7] | |
11189 * # dictionary of keys, and list of values | |
11190 * info = {} # <<<<<<<<<<<<<< | |
11191 * if col != b".": | |
11192 * for blurp in col.split(';'): | |
11193 */ | |
11194 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) | |
11195 __Pyx_GOTREF(__pyx_t_1); | |
11196 __pyx_v_info = ((PyObject*)__pyx_t_1); | |
11197 __pyx_t_1 = 0; | |
11198 | |
11199 /* "pysam/libcvcf.pyx":195 | |
11200 * # dictionary of keys, and list of values | |
11201 * info = {} | |
11202 * if col != b".": # <<<<<<<<<<<<<< | |
11203 * for blurp in col.split(';'): | |
11204 * elts = blurp.split('=') | |
11205 */ | |
11206 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_col); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) | |
11207 __Pyx_GOTREF(__pyx_t_1); | |
11208 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__5, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 195, __pyx_L1_error) | |
11209 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
11210 if (__pyx_t_2) { | |
11211 | |
11212 /* "pysam/libcvcf.pyx":196 | |
11213 * info = {} | |
11214 * if col != b".": | |
11215 * for blurp in col.split(';'): # <<<<<<<<<<<<<< | |
11216 * elts = blurp.split('=') | |
11217 * if len(elts) == 1: v = None | |
11218 */ | |
11219 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_col); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) | |
11220 __Pyx_GOTREF(__pyx_t_3); | |
11221 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error) | |
11222 __Pyx_GOTREF(__pyx_t_4); | |
11223 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11224 __pyx_t_3 = NULL; | |
11225 __pyx_t_5 = 0; | |
11226 #if CYTHON_UNPACK_METHODS | |
11227 if (likely(PyMethod_Check(__pyx_t_4))) { | |
11228 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); | |
11229 if (likely(__pyx_t_3)) { | |
11230 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
11231 __Pyx_INCREF(__pyx_t_3); | |
11232 __Pyx_INCREF(function); | |
11233 __Pyx_DECREF_SET(__pyx_t_4, function); | |
11234 __pyx_t_5 = 1; | |
11235 } | |
11236 } | |
11237 #endif | |
11238 { | |
11239 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__6}; | |
11240 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
11241 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11242 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) | |
11243 __Pyx_GOTREF(__pyx_t_1); | |
11244 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11245 } | |
11246 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { | |
11247 __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); | |
11248 __pyx_t_6 = 0; | |
11249 __pyx_t_7 = NULL; | |
11250 } else { | |
11251 __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error) | |
11252 __Pyx_GOTREF(__pyx_t_4); | |
11253 __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error) | |
11254 } | |
11255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
11256 for (;;) { | |
11257 if (likely(!__pyx_t_7)) { | |
11258 if (likely(PyList_CheckExact(__pyx_t_4))) { | |
11259 { | |
11260 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); | |
11261 #if !CYTHON_ASSUME_SAFE_MACROS | |
11262 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 196, __pyx_L1_error) | |
11263 #endif | |
11264 if (__pyx_t_6 >= __pyx_temp) break; | |
11265 } | |
11266 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
11267 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 196, __pyx_L1_error) | |
11268 #else | |
11269 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) | |
11270 __Pyx_GOTREF(__pyx_t_1); | |
11271 #endif | |
11272 } else { | |
11273 { | |
11274 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); | |
11275 #if !CYTHON_ASSUME_SAFE_MACROS | |
11276 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 196, __pyx_L1_error) | |
11277 #endif | |
11278 if (__pyx_t_6 >= __pyx_temp) break; | |
11279 } | |
11280 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
11281 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 196, __pyx_L1_error) | |
11282 #else | |
11283 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) | |
11284 __Pyx_GOTREF(__pyx_t_1); | |
11285 #endif | |
11286 } | |
11287 } else { | |
11288 __pyx_t_1 = __pyx_t_7(__pyx_t_4); | |
11289 if (unlikely(!__pyx_t_1)) { | |
11290 PyObject* exc_type = PyErr_Occurred(); | |
11291 if (exc_type) { | |
11292 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
11293 else __PYX_ERR(0, 196, __pyx_L1_error) | |
11294 } | |
11295 break; | |
11296 } | |
11297 __Pyx_GOTREF(__pyx_t_1); | |
11298 } | |
11299 __Pyx_XDECREF_SET(__pyx_v_blurp, __pyx_t_1); | |
11300 __pyx_t_1 = 0; | |
11301 | |
11302 /* "pysam/libcvcf.pyx":197 | |
11303 * if col != b".": | |
11304 * for blurp in col.split(';'): | |
11305 * elts = blurp.split('=') # <<<<<<<<<<<<<< | |
11306 * if len(elts) == 1: v = None | |
11307 * elif len(elts) == 2: v = elts[1] | |
11308 */ | |
11309 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_blurp, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) | |
11310 __Pyx_GOTREF(__pyx_t_3); | |
11311 __pyx_t_8 = NULL; | |
11312 __pyx_t_5 = 0; | |
11313 #if CYTHON_UNPACK_METHODS | |
11314 if (likely(PyMethod_Check(__pyx_t_3))) { | |
11315 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); | |
11316 if (likely(__pyx_t_8)) { | |
11317 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
11318 __Pyx_INCREF(__pyx_t_8); | |
11319 __Pyx_INCREF(function); | |
11320 __Pyx_DECREF_SET(__pyx_t_3, function); | |
11321 __pyx_t_5 = 1; | |
11322 } | |
11323 } | |
11324 #endif | |
11325 { | |
11326 PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u__7}; | |
11327 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
11328 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
11329 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) | |
11330 __Pyx_GOTREF(__pyx_t_1); | |
11331 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11332 } | |
11333 __Pyx_XDECREF_SET(__pyx_v_elts, __pyx_t_1); | |
11334 __pyx_t_1 = 0; | |
11335 | |
11336 /* "pysam/libcvcf.pyx":198 | |
11337 * for blurp in col.split(';'): | |
11338 * elts = blurp.split('=') | |
11339 * if len(elts) == 1: v = None # <<<<<<<<<<<<<< | |
11340 * elif len(elts) == 2: v = elts[1] | |
11341 * else: self.vcf.error(str(self),self.ERROR_INFO_STRING) | |
11342 */ | |
11343 __pyx_t_9 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 198, __pyx_L1_error) | |
11344 __pyx_t_2 = (__pyx_t_9 == 1); | |
11345 if (__pyx_t_2) { | |
11346 __Pyx_INCREF(Py_None); | |
11347 __Pyx_XDECREF_SET(__pyx_v_v, Py_None); | |
11348 goto __pyx_L6; | |
11349 } | |
11350 | |
11351 /* "pysam/libcvcf.pyx":199 | |
11352 * elts = blurp.split('=') | |
11353 * if len(elts) == 1: v = None | |
11354 * elif len(elts) == 2: v = elts[1] # <<<<<<<<<<<<<< | |
11355 * else: self.vcf.error(str(self),self.ERROR_INFO_STRING) | |
11356 * info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self.vcf)) | |
11357 */ | |
11358 __pyx_t_9 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 199, __pyx_L1_error) | |
11359 __pyx_t_2 = (__pyx_t_9 == 2); | |
11360 if (__pyx_t_2) { | |
11361 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) | |
11362 __Pyx_GOTREF(__pyx_t_1); | |
11363 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); | |
11364 __pyx_t_1 = 0; | |
11365 goto __pyx_L6; | |
11366 } | |
11367 | |
11368 /* "pysam/libcvcf.pyx":200 | |
11369 * if len(elts) == 1: v = None | |
11370 * elif len(elts) == 2: v = elts[1] | |
11371 * else: self.vcf.error(str(self),self.ERROR_INFO_STRING) # <<<<<<<<<<<<<< | |
11372 * info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self.vcf)) | |
11373 * return info | |
11374 */ | |
11375 /*else*/ { | |
11376 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) | |
11377 __Pyx_GOTREF(__pyx_t_3); | |
11378 __pyx_t_8 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) | |
11379 __Pyx_GOTREF(__pyx_t_8); | |
11380 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ERROR_INFO_STRING); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 200, __pyx_L1_error) | |
11381 __Pyx_GOTREF(__pyx_t_10); | |
11382 __pyx_t_11 = NULL; | |
11383 __pyx_t_5 = 0; | |
11384 #if CYTHON_UNPACK_METHODS | |
11385 if (likely(PyMethod_Check(__pyx_t_3))) { | |
11386 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3); | |
11387 if (likely(__pyx_t_11)) { | |
11388 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
11389 __Pyx_INCREF(__pyx_t_11); | |
11390 __Pyx_INCREF(function); | |
11391 __Pyx_DECREF_SET(__pyx_t_3, function); | |
11392 __pyx_t_5 = 1; | |
11393 } | |
11394 } | |
11395 #endif | |
11396 { | |
11397 PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_8, __pyx_t_10}; | |
11398 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
11399 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
11400 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
11401 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
11402 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) | |
11403 __Pyx_GOTREF(__pyx_t_1); | |
11404 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11405 } | |
11406 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
11407 } | |
11408 __pyx_L6:; | |
11409 | |
11410 /* "pysam/libcvcf.pyx":201 | |
11411 * elif len(elts) == 2: v = elts[1] | |
11412 * else: self.vcf.error(str(self),self.ERROR_INFO_STRING) | |
11413 * info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self.vcf)) # <<<<<<<<<<<<<< | |
11414 * return info | |
11415 * | |
11416 */ | |
11417 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_parse_formatdata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) | |
11418 __Pyx_GOTREF(__pyx_t_3); | |
11419 __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 201, __pyx_L1_error) | |
11420 __Pyx_GOTREF(__pyx_t_10); | |
11421 if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 201, __pyx_L1_error) } | |
11422 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_info); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 201, __pyx_L1_error) | |
11423 __Pyx_GOTREF(__pyx_t_8); | |
11424 __pyx_t_11 = __Pyx_PyObject_Unicode(__pyx_v_self->vcf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 201, __pyx_L1_error) | |
11425 __Pyx_GOTREF(__pyx_t_11); | |
11426 __pyx_t_12 = NULL; | |
11427 __pyx_t_5 = 0; | |
11428 #if CYTHON_UNPACK_METHODS | |
11429 if (likely(PyMethod_Check(__pyx_t_3))) { | |
11430 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); | |
11431 if (likely(__pyx_t_12)) { | |
11432 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
11433 __Pyx_INCREF(__pyx_t_12); | |
11434 __Pyx_INCREF(function); | |
11435 __Pyx_DECREF_SET(__pyx_t_3, function); | |
11436 __pyx_t_5 = 1; | |
11437 } | |
11438 } | |
11439 #endif | |
11440 { | |
11441 PyObject *__pyx_callargs[5] = {__pyx_t_12, __pyx_t_10, __pyx_v_v, __pyx_t_8, __pyx_t_11}; | |
11442 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); | |
11443 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
11444 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
11445 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
11446 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
11447 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) | |
11448 __Pyx_GOTREF(__pyx_t_1); | |
11449 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11450 } | |
11451 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) | |
11452 __Pyx_GOTREF(__pyx_t_3); | |
11453 if (unlikely((PyDict_SetItem(__pyx_v_info, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(0, 201, __pyx_L1_error) | |
11454 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11455 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
11456 | |
11457 /* "pysam/libcvcf.pyx":196 | |
11458 * info = {} | |
11459 * if col != b".": | |
11460 * for blurp in col.split(';'): # <<<<<<<<<<<<<< | |
11461 * elts = blurp.split('=') | |
11462 * if len(elts) == 1: v = None | |
11463 */ | |
11464 } | |
11465 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11466 | |
11467 /* "pysam/libcvcf.pyx":195 | |
11468 * # dictionary of keys, and list of values | |
11469 * info = {} | |
11470 * if col != b".": # <<<<<<<<<<<<<< | |
11471 * for blurp in col.split(';'): | |
11472 * elts = blurp.split('=') | |
11473 */ | |
11474 } | |
11475 | |
11476 /* "pysam/libcvcf.pyx":202 | |
11477 * else: self.vcf.error(str(self),self.ERROR_INFO_STRING) | |
11478 * info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self.vcf)) | |
11479 * return info # <<<<<<<<<<<<<< | |
11480 * | |
11481 * property format: | |
11482 */ | |
11483 __Pyx_XDECREF(__pyx_r); | |
11484 __Pyx_INCREF(__pyx_v_info); | |
11485 __pyx_r = __pyx_v_info; | |
11486 goto __pyx_L0; | |
11487 | |
11488 /* "pysam/libcvcf.pyx":191 | |
11489 * | |
11490 * property info: | |
11491 * def __get__(self): # <<<<<<<<<<<<<< | |
11492 * col = self.fields[7] | |
11493 * # dictionary of keys, and list of values | |
11494 */ | |
11495 | |
11496 /* function exit code */ | |
11497 __pyx_L1_error:; | |
11498 __Pyx_XDECREF(__pyx_t_1); | |
11499 __Pyx_XDECREF(__pyx_t_3); | |
11500 __Pyx_XDECREF(__pyx_t_4); | |
11501 __Pyx_XDECREF(__pyx_t_8); | |
11502 __Pyx_XDECREF(__pyx_t_10); | |
11503 __Pyx_XDECREF(__pyx_t_11); | |
11504 __Pyx_XDECREF(__pyx_t_12); | |
11505 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11506 __pyx_r = NULL; | |
11507 __pyx_L0:; | |
11508 __Pyx_XDECREF(__pyx_v_info); | |
11509 __Pyx_XDECREF(__pyx_v_blurp); | |
11510 __Pyx_XDECREF(__pyx_v_elts); | |
11511 __Pyx_XDECREF(__pyx_v_v); | |
11512 __Pyx_XGIVEREF(__pyx_r); | |
11513 __Pyx_RefNannyFinishContext(); | |
11514 return __pyx_r; | |
11515 } | |
11516 | |
11517 /* "pysam/libcvcf.pyx":205 | |
11518 * | |
11519 * property format: | |
11520 * def __get__(self): # <<<<<<<<<<<<<< | |
11521 * return self.fields[8].split(':') | |
11522 * | |
11523 */ | |
11524 | |
11525 /* Python wrapper */ | |
11526 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_6format_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
11527 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_6format_1__get__(PyObject *__pyx_v_self) { | |
11528 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
11529 PyObject *__pyx_r = 0; | |
11530 __Pyx_RefNannyDeclarations | |
11531 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
11532 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
11533 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_6format___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
11534 | |
11535 /* function exit code */ | |
11536 __Pyx_RefNannyFinishContext(); | |
11537 return __pyx_r; | |
11538 } | |
11539 | |
11540 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_6format___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
11541 PyObject *__pyx_r = NULL; | |
11542 __Pyx_RefNannyDeclarations | |
11543 PyObject *__pyx_t_1 = NULL; | |
11544 PyObject *__pyx_t_2 = NULL; | |
11545 PyObject *__pyx_t_3 = NULL; | |
11546 unsigned int __pyx_t_4; | |
11547 int __pyx_lineno = 0; | |
11548 const char *__pyx_filename = NULL; | |
11549 int __pyx_clineno = 0; | |
11550 __Pyx_RefNannySetupContext("__get__", 1); | |
11551 | |
11552 /* "pysam/libcvcf.pyx":206 | |
11553 * property format: | |
11554 * def __get__(self): | |
11555 * return self.fields[8].split(':') # <<<<<<<<<<<<<< | |
11556 * | |
11557 * property samples: | |
11558 */ | |
11559 __Pyx_XDECREF(__pyx_r); | |
11560 __pyx_t_2 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) | |
11561 __Pyx_GOTREF(__pyx_t_2); | |
11562 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) | |
11563 __Pyx_GOTREF(__pyx_t_3); | |
11564 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11565 __pyx_t_2 = NULL; | |
11566 __pyx_t_4 = 0; | |
11567 #if CYTHON_UNPACK_METHODS | |
11568 if (likely(PyMethod_Check(__pyx_t_3))) { | |
11569 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); | |
11570 if (likely(__pyx_t_2)) { | |
11571 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
11572 __Pyx_INCREF(__pyx_t_2); | |
11573 __Pyx_INCREF(function); | |
11574 __Pyx_DECREF_SET(__pyx_t_3, function); | |
11575 __pyx_t_4 = 1; | |
11576 } | |
11577 } | |
11578 #endif | |
11579 { | |
11580 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u__3}; | |
11581 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
11582 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11583 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) | |
11584 __Pyx_GOTREF(__pyx_t_1); | |
11585 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11586 } | |
11587 __pyx_r = __pyx_t_1; | |
11588 __pyx_t_1 = 0; | |
11589 goto __pyx_L0; | |
11590 | |
11591 /* "pysam/libcvcf.pyx":205 | |
11592 * | |
11593 * property format: | |
11594 * def __get__(self): # <<<<<<<<<<<<<< | |
11595 * return self.fields[8].split(':') | |
11596 * | |
11597 */ | |
11598 | |
11599 /* function exit code */ | |
11600 __pyx_L1_error:; | |
11601 __Pyx_XDECREF(__pyx_t_1); | |
11602 __Pyx_XDECREF(__pyx_t_2); | |
11603 __Pyx_XDECREF(__pyx_t_3); | |
11604 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.format.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11605 __pyx_r = NULL; | |
11606 __pyx_L0:; | |
11607 __Pyx_XGIVEREF(__pyx_r); | |
11608 __Pyx_RefNannyFinishContext(); | |
11609 return __pyx_r; | |
11610 } | |
11611 | |
11612 /* "pysam/libcvcf.pyx":209 | |
11613 * | |
11614 * property samples: | |
11615 * def __get__(self): # <<<<<<<<<<<<<< | |
11616 * return self.vcf._samples | |
11617 * | |
11618 */ | |
11619 | |
11620 /* Python wrapper */ | |
11621 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_7samples_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
11622 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_7samples_1__get__(PyObject *__pyx_v_self) { | |
11623 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
11624 PyObject *__pyx_r = 0; | |
11625 __Pyx_RefNannyDeclarations | |
11626 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
11627 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
11628 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_7samples___get__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
11629 | |
11630 /* function exit code */ | |
11631 __Pyx_RefNannyFinishContext(); | |
11632 return __pyx_r; | |
11633 } | |
11634 | |
11635 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_7samples___get__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
11636 PyObject *__pyx_r = NULL; | |
11637 __Pyx_RefNannyDeclarations | |
11638 PyObject *__pyx_t_1 = NULL; | |
11639 int __pyx_lineno = 0; | |
11640 const char *__pyx_filename = NULL; | |
11641 int __pyx_clineno = 0; | |
11642 __Pyx_RefNannySetupContext("__get__", 1); | |
11643 | |
11644 /* "pysam/libcvcf.pyx":210 | |
11645 * property samples: | |
11646 * def __get__(self): | |
11647 * return self.vcf._samples # <<<<<<<<<<<<<< | |
11648 * | |
11649 * def __getitem__(self, key): | |
11650 */ | |
11651 __Pyx_XDECREF(__pyx_r); | |
11652 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) | |
11653 __Pyx_GOTREF(__pyx_t_1); | |
11654 __pyx_r = __pyx_t_1; | |
11655 __pyx_t_1 = 0; | |
11656 goto __pyx_L0; | |
11657 | |
11658 /* "pysam/libcvcf.pyx":209 | |
11659 * | |
11660 * property samples: | |
11661 * def __get__(self): # <<<<<<<<<<<<<< | |
11662 * return self.vcf._samples | |
11663 * | |
11664 */ | |
11665 | |
11666 /* function exit code */ | |
11667 __pyx_L1_error:; | |
11668 __Pyx_XDECREF(__pyx_t_1); | |
11669 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.samples.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11670 __pyx_r = NULL; | |
11671 __pyx_L0:; | |
11672 __Pyx_XGIVEREF(__pyx_r); | |
11673 __Pyx_RefNannyFinishContext(); | |
11674 return __pyx_r; | |
11675 } | |
11676 | |
11677 /* "pysam/libcvcf.pyx":212 | |
11678 * return self.vcf._samples | |
11679 * | |
11680 * def __getitem__(self, key): # <<<<<<<<<<<<<< | |
11681 * | |
11682 * # parse sample columns | |
11683 */ | |
11684 | |
11685 /* Python wrapper */ | |
11686 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ | |
11687 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { | |
11688 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
11689 PyObject *__pyx_r = 0; | |
11690 __Pyx_RefNannyDeclarations | |
11691 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); | |
11692 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
11693 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_8__getitem__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self), ((PyObject *)__pyx_v_key)); | |
11694 | |
11695 /* function exit code */ | |
11696 __Pyx_RefNannyFinishContext(); | |
11697 return __pyx_r; | |
11698 } | |
11699 | |
11700 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_8__getitem__(struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_key) { | |
11701 PyObject *__pyx_v_values = NULL; | |
11702 PyObject *__pyx_v_alt = NULL; | |
11703 PyObject *__pyx_v_format = NULL; | |
11704 PyObject *__pyx_v_result = NULL; | |
11705 Py_ssize_t __pyx_v_idx; | |
11706 PyObject *__pyx_v_expected = NULL; | |
11707 PyObject *__pyx_v_value = NULL; | |
11708 PyObject *__pyx_r = NULL; | |
11709 __Pyx_RefNannyDeclarations | |
11710 PyObject *__pyx_t_1 = NULL; | |
11711 PyObject *__pyx_t_2 = NULL; | |
11712 PyObject *__pyx_t_3 = NULL; | |
11713 Py_ssize_t __pyx_t_4; | |
11714 unsigned int __pyx_t_5; | |
11715 Py_ssize_t __pyx_t_6; | |
11716 int __pyx_t_7; | |
11717 PyObject *__pyx_t_8 = NULL; | |
11718 PyObject *__pyx_t_9 = NULL; | |
11719 Py_UCS4 __pyx_t_10; | |
11720 PyObject *__pyx_t_11 = NULL; | |
11721 Py_ssize_t __pyx_t_12; | |
11722 Py_ssize_t __pyx_t_13; | |
11723 int __pyx_t_14; | |
11724 PyObject *__pyx_t_15 = NULL; | |
11725 int __pyx_lineno = 0; | |
11726 const char *__pyx_filename = NULL; | |
11727 int __pyx_clineno = 0; | |
11728 __Pyx_RefNannySetupContext("__getitem__", 1); | |
11729 | |
11730 /* "pysam/libcvcf.pyx":215 | |
11731 * | |
11732 * # parse sample columns | |
11733 * values = self.fields[self.vcf._sample2column[key]].split(':') # <<<<<<<<<<<<<< | |
11734 * alt = self.alt | |
11735 * format = self.format | |
11736 */ | |
11737 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_sample2column); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) | |
11738 __Pyx_GOTREF(__pyx_t_2); | |
11739 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) | |
11740 __Pyx_GOTREF(__pyx_t_3); | |
11741 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11742 __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L1_error) | |
11743 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11744 __pyx_t_3 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[__pyx_t_4])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) | |
11745 __Pyx_GOTREF(__pyx_t_3); | |
11746 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) | |
11747 __Pyx_GOTREF(__pyx_t_2); | |
11748 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11749 __pyx_t_3 = NULL; | |
11750 __pyx_t_5 = 0; | |
11751 #if CYTHON_UNPACK_METHODS | |
11752 if (likely(PyMethod_Check(__pyx_t_2))) { | |
11753 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
11754 if (likely(__pyx_t_3)) { | |
11755 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
11756 __Pyx_INCREF(__pyx_t_3); | |
11757 __Pyx_INCREF(function); | |
11758 __Pyx_DECREF_SET(__pyx_t_2, function); | |
11759 __pyx_t_5 = 1; | |
11760 } | |
11761 } | |
11762 #endif | |
11763 { | |
11764 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__3}; | |
11765 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
11766 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11767 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) | |
11768 __Pyx_GOTREF(__pyx_t_1); | |
11769 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11770 } | |
11771 __pyx_v_values = __pyx_t_1; | |
11772 __pyx_t_1 = 0; | |
11773 | |
11774 /* "pysam/libcvcf.pyx":216 | |
11775 * # parse sample columns | |
11776 * values = self.fields[self.vcf._sample2column[key]].split(':') | |
11777 * alt = self.alt # <<<<<<<<<<<<<< | |
11778 * format = self.format | |
11779 * | |
11780 */ | |
11781 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_alt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) | |
11782 __Pyx_GOTREF(__pyx_t_1); | |
11783 __pyx_v_alt = __pyx_t_1; | |
11784 __pyx_t_1 = 0; | |
11785 | |
11786 /* "pysam/libcvcf.pyx":217 | |
11787 * values = self.fields[self.vcf._sample2column[key]].split(':') | |
11788 * alt = self.alt | |
11789 * format = self.format # <<<<<<<<<<<<<< | |
11790 * | |
11791 * if len(values) > len(format): | |
11792 */ | |
11793 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) | |
11794 __Pyx_GOTREF(__pyx_t_1); | |
11795 __pyx_v_format = __pyx_t_1; | |
11796 __pyx_t_1 = 0; | |
11797 | |
11798 /* "pysam/libcvcf.pyx":219 | |
11799 * format = self.format | |
11800 * | |
11801 * if len(values) > len(format): # <<<<<<<<<<<<<< | |
11802 * self.vcf.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\ | |
11803 * (len(values),key,len(format))) | |
11804 */ | |
11805 __pyx_t_4 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 219, __pyx_L1_error) | |
11806 __pyx_t_6 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 219, __pyx_L1_error) | |
11807 __pyx_t_7 = (__pyx_t_4 > __pyx_t_6); | |
11808 if (__pyx_t_7) { | |
11809 | |
11810 /* "pysam/libcvcf.pyx":220 | |
11811 * | |
11812 * if len(values) > len(format): | |
11813 * self.vcf.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\ # <<<<<<<<<<<<<< | |
11814 * (len(values),key,len(format))) | |
11815 * | |
11816 */ | |
11817 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) | |
11818 __Pyx_GOTREF(__pyx_t_2); | |
11819 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) | |
11820 __Pyx_GOTREF(__pyx_t_3); | |
11821 __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error) | |
11822 __Pyx_GOTREF(__pyx_t_8); | |
11823 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11824 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BAD_NUMBER_OF_VALUES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) | |
11825 __Pyx_GOTREF(__pyx_t_3); | |
11826 __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 220, __pyx_L1_error) | |
11827 __Pyx_GOTREF(__pyx_t_9); | |
11828 __pyx_t_6 = 0; | |
11829 __pyx_t_10 = 127; | |
11830 __Pyx_INCREF(__pyx_kp_u_found); | |
11831 __pyx_t_6 += 7; | |
11832 __Pyx_GIVEREF(__pyx_kp_u_found); | |
11833 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_u_found); | |
11834 | |
11835 /* "pysam/libcvcf.pyx":221 | |
11836 * if len(values) > len(format): | |
11837 * self.vcf.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\ | |
11838 * (len(values),key,len(format))) # <<<<<<<<<<<<<< | |
11839 * | |
11840 * result = {} | |
11841 */ | |
11842 __pyx_t_4 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 221, __pyx_L1_error) | |
11843 __pyx_t_11 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_4, 0, ' ', 'd'); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L1_error) | |
11844 __Pyx_GOTREF(__pyx_t_11); | |
11845 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11); | |
11846 __Pyx_GIVEREF(__pyx_t_11); | |
11847 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11); | |
11848 __pyx_t_11 = 0; | |
11849 __Pyx_INCREF(__pyx_kp_u_values_in_element); | |
11850 __pyx_t_6 += 19; | |
11851 __Pyx_GIVEREF(__pyx_kp_u_values_in_element); | |
11852 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_kp_u_values_in_element); | |
11853 __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L1_error) | |
11854 __Pyx_GOTREF(__pyx_t_11); | |
11855 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_10; | |
11856 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11); | |
11857 __Pyx_GIVEREF(__pyx_t_11); | |
11858 PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_11); | |
11859 __pyx_t_11 = 0; | |
11860 __Pyx_INCREF(__pyx_kp_u_expected); | |
11861 __pyx_t_6 += 11; | |
11862 __Pyx_GIVEREF(__pyx_kp_u_expected); | |
11863 PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_kp_u_expected); | |
11864 __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 221, __pyx_L1_error) | |
11865 __pyx_t_11 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_4, 0, ' ', 'd'); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L1_error) | |
11866 __Pyx_GOTREF(__pyx_t_11); | |
11867 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11); | |
11868 __Pyx_GIVEREF(__pyx_t_11); | |
11869 PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_11); | |
11870 __pyx_t_11 = 0; | |
11871 __Pyx_INCREF(__pyx_kp_u__8); | |
11872 __pyx_t_6 += 1; | |
11873 __Pyx_GIVEREF(__pyx_kp_u__8); | |
11874 PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_kp_u__8); | |
11875 | |
11876 /* "pysam/libcvcf.pyx":220 | |
11877 * | |
11878 * if len(values) > len(format): | |
11879 * self.vcf.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\ # <<<<<<<<<<<<<< | |
11880 * (len(values),key,len(format))) | |
11881 * | |
11882 */ | |
11883 __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_9, 7, __pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 220, __pyx_L1_error) | |
11884 __Pyx_GOTREF(__pyx_t_11); | |
11885 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
11886 __pyx_t_9 = NULL; | |
11887 __pyx_t_5 = 0; | |
11888 #if CYTHON_UNPACK_METHODS | |
11889 if (likely(PyMethod_Check(__pyx_t_2))) { | |
11890 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); | |
11891 if (likely(__pyx_t_9)) { | |
11892 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
11893 __Pyx_INCREF(__pyx_t_9); | |
11894 __Pyx_INCREF(function); | |
11895 __Pyx_DECREF_SET(__pyx_t_2, function); | |
11896 __pyx_t_5 = 1; | |
11897 } | |
11898 } | |
11899 #endif | |
11900 { | |
11901 PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_8, __pyx_t_3, __pyx_t_11}; | |
11902 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); | |
11903 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
11904 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
11905 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11906 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
11907 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) | |
11908 __Pyx_GOTREF(__pyx_t_1); | |
11909 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11910 } | |
11911 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
11912 | |
11913 /* "pysam/libcvcf.pyx":219 | |
11914 * format = self.format | |
11915 * | |
11916 * if len(values) > len(format): # <<<<<<<<<<<<<< | |
11917 * self.vcf.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\ | |
11918 * (len(values),key,len(format))) | |
11919 */ | |
11920 } | |
11921 | |
11922 /* "pysam/libcvcf.pyx":223 | |
11923 * (len(values),key,len(format))) | |
11924 * | |
11925 * result = {} # <<<<<<<<<<<<<< | |
11926 * for idx in range(len(format)): | |
11927 * expected = self.vcf.get_expected(format[idx], self.vcf._format, alt) | |
11928 */ | |
11929 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) | |
11930 __Pyx_GOTREF(__pyx_t_1); | |
11931 __pyx_v_result = ((PyObject*)__pyx_t_1); | |
11932 __pyx_t_1 = 0; | |
11933 | |
11934 /* "pysam/libcvcf.pyx":224 | |
11935 * | |
11936 * result = {} | |
11937 * for idx in range(len(format)): # <<<<<<<<<<<<<< | |
11938 * expected = self.vcf.get_expected(format[idx], self.vcf._format, alt) | |
11939 * if idx < len(values): value = values[idx] | |
11940 */ | |
11941 __pyx_t_6 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 224, __pyx_L1_error) | |
11942 __pyx_t_4 = __pyx_t_6; | |
11943 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_4; __pyx_t_12+=1) { | |
11944 __pyx_v_idx = __pyx_t_12; | |
11945 | |
11946 /* "pysam/libcvcf.pyx":225 | |
11947 * result = {} | |
11948 * for idx in range(len(format)): | |
11949 * expected = self.vcf.get_expected(format[idx], self.vcf._format, alt) # <<<<<<<<<<<<<< | |
11950 * if idx < len(values): value = values[idx] | |
11951 * else: | |
11952 */ | |
11953 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_get_expected); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) | |
11954 __Pyx_GOTREF(__pyx_t_2); | |
11955 __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 225, __pyx_L1_error) | |
11956 __Pyx_GOTREF(__pyx_t_11); | |
11957 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_format_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) | |
11958 __Pyx_GOTREF(__pyx_t_3); | |
11959 __pyx_t_8 = NULL; | |
11960 __pyx_t_5 = 0; | |
11961 #if CYTHON_UNPACK_METHODS | |
11962 if (likely(PyMethod_Check(__pyx_t_2))) { | |
11963 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); | |
11964 if (likely(__pyx_t_8)) { | |
11965 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
11966 __Pyx_INCREF(__pyx_t_8); | |
11967 __Pyx_INCREF(function); | |
11968 __Pyx_DECREF_SET(__pyx_t_2, function); | |
11969 __pyx_t_5 = 1; | |
11970 } | |
11971 } | |
11972 #endif | |
11973 { | |
11974 PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_11, __pyx_t_3, __pyx_v_alt}; | |
11975 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); | |
11976 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
11977 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
11978 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11979 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) | |
11980 __Pyx_GOTREF(__pyx_t_1); | |
11981 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11982 } | |
11983 __Pyx_XDECREF_SET(__pyx_v_expected, __pyx_t_1); | |
11984 __pyx_t_1 = 0; | |
11985 | |
11986 /* "pysam/libcvcf.pyx":226 | |
11987 * for idx in range(len(format)): | |
11988 * expected = self.vcf.get_expected(format[idx], self.vcf._format, alt) | |
11989 * if idx < len(values): value = values[idx] # <<<<<<<<<<<<<< | |
11990 * else: | |
11991 * if expected == -1: value = "." | |
11992 */ | |
11993 __pyx_t_13 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 226, __pyx_L1_error) | |
11994 __pyx_t_7 = (__pyx_v_idx < __pyx_t_13); | |
11995 if (__pyx_t_7) { | |
11996 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) | |
11997 __Pyx_GOTREF(__pyx_t_1); | |
11998 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); | |
11999 __pyx_t_1 = 0; | |
12000 goto __pyx_L6; | |
12001 } | |
12002 | |
12003 /* "pysam/libcvcf.pyx":228 | |
12004 * if idx < len(values): value = values[idx] | |
12005 * else: | |
12006 * if expected == -1: value = "." # <<<<<<<<<<<<<< | |
12007 * else: value = ",".join(["."]*expected) | |
12008 * | |
12009 */ | |
12010 /*else*/ { | |
12011 __pyx_t_7 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_expected, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) | |
12012 if (__pyx_t_7) { | |
12013 __Pyx_INCREF(__pyx_kp_u__5); | |
12014 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_kp_u__5); | |
12015 goto __pyx_L7; | |
12016 } | |
12017 | |
12018 /* "pysam/libcvcf.pyx":229 | |
12019 * else: | |
12020 * if expected == -1: value = "." | |
12021 * else: value = ",".join(["."]*expected) # <<<<<<<<<<<<<< | |
12022 * | |
12023 * result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data)) | |
12024 */ | |
12025 /*else*/ { | |
12026 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) | |
12027 __Pyx_GOTREF(__pyx_t_1); | |
12028 __Pyx_INCREF(__pyx_kp_u__5); | |
12029 __Pyx_GIVEREF(__pyx_kp_u__5); | |
12030 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__5)) __PYX_ERR(0, 229, __pyx_L1_error); | |
12031 { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_expected); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 229, __pyx_L1_error) | |
12032 __Pyx_GOTREF(__pyx_temp); | |
12033 __Pyx_DECREF(__pyx_t_1); | |
12034 __pyx_t_1 = __pyx_temp; | |
12035 } | |
12036 __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) | |
12037 __Pyx_GOTREF(__pyx_t_2); | |
12038 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12039 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); | |
12040 __pyx_t_2 = 0; | |
12041 } | |
12042 __pyx_L7:; | |
12043 } | |
12044 __pyx_L6:; | |
12045 | |
12046 /* "pysam/libcvcf.pyx":231 | |
12047 * else: value = ",".join(["."]*expected) | |
12048 * | |
12049 * result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data)) # <<<<<<<<<<<<<< | |
12050 * if expected != -1 and len(result[format[idx]]) != expected: | |
12051 * self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS, | |
12052 */ | |
12053 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_parse_formatdata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) | |
12054 __Pyx_GOTREF(__pyx_t_1); | |
12055 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) | |
12056 __Pyx_GOTREF(__pyx_t_3); | |
12057 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_format_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 231, __pyx_L1_error) | |
12058 __Pyx_GOTREF(__pyx_t_11); | |
12059 __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) | |
12060 __Pyx_GOTREF(__pyx_t_8); | |
12061 __pyx_t_9 = __Pyx_PyObject_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 231, __pyx_L1_error) | |
12062 __Pyx_GOTREF(__pyx_t_9); | |
12063 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
12064 __pyx_t_8 = NULL; | |
12065 __pyx_t_5 = 0; | |
12066 #if CYTHON_UNPACK_METHODS | |
12067 if (likely(PyMethod_Check(__pyx_t_1))) { | |
12068 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); | |
12069 if (likely(__pyx_t_8)) { | |
12070 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
12071 __Pyx_INCREF(__pyx_t_8); | |
12072 __Pyx_INCREF(function); | |
12073 __Pyx_DECREF_SET(__pyx_t_1, function); | |
12074 __pyx_t_5 = 1; | |
12075 } | |
12076 } | |
12077 #endif | |
12078 { | |
12079 PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_v_value, __pyx_t_11, __pyx_t_9}; | |
12080 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); | |
12081 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
12082 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
12083 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
12084 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
12085 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) | |
12086 __Pyx_GOTREF(__pyx_t_2); | |
12087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12088 } | |
12089 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) | |
12090 __Pyx_GOTREF(__pyx_t_1); | |
12091 if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_t_1, __pyx_t_2) < 0))) __PYX_ERR(0, 231, __pyx_L1_error) | |
12092 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12093 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12094 | |
12095 /* "pysam/libcvcf.pyx":232 | |
12096 * | |
12097 * result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data)) | |
12098 * if expected != -1 and len(result[format[idx]]) != expected: # <<<<<<<<<<<<<< | |
12099 * self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS, | |
12100 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]])) | |
12101 */ | |
12102 __pyx_t_14 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_expected, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) | |
12103 if (__pyx_t_14) { | |
12104 } else { | |
12105 __pyx_t_7 = __pyx_t_14; | |
12106 goto __pyx_L9_bool_binop_done; | |
12107 } | |
12108 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) | |
12109 __Pyx_GOTREF(__pyx_t_2); | |
12110 __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) | |
12111 __Pyx_GOTREF(__pyx_t_1); | |
12112 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12113 __pyx_t_13 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 232, __pyx_L1_error) | |
12114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12115 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) | |
12116 __Pyx_GOTREF(__pyx_t_1); | |
12117 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_expected, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) | |
12118 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12119 __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) | |
12120 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12121 __pyx_t_7 = __pyx_t_14; | |
12122 __pyx_L9_bool_binop_done:; | |
12123 if (__pyx_t_7) { | |
12124 | |
12125 /* "pysam/libcvcf.pyx":233 | |
12126 * result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data)) | |
12127 * if expected != -1 and len(result[format[idx]]) != expected: | |
12128 * self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS, # <<<<<<<<<<<<<< | |
12129 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]])) | |
12130 * if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]])) | |
12131 */ | |
12132 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) | |
12133 __Pyx_GOTREF(__pyx_t_1); | |
12134 __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error) | |
12135 __Pyx_GOTREF(__pyx_t_9); | |
12136 __pyx_t_11 = __Pyx_PyObject_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error) | |
12137 __Pyx_GOTREF(__pyx_t_11); | |
12138 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
12139 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BAD_NUMBER_OF_PARAMETERS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error) | |
12140 __Pyx_GOTREF(__pyx_t_9); | |
12141 | |
12142 /* "pysam/libcvcf.pyx":234 | |
12143 * if expected != -1 and len(result[format[idx]]) != expected: | |
12144 * self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS, | |
12145 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]])) # <<<<<<<<<<<<<< | |
12146 * if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]])) | |
12147 * result[format[idx]] = result[format[idx]][:expected] | |
12148 */ | |
12149 __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) | |
12150 __Pyx_GOTREF(__pyx_t_3); | |
12151 __pyx_t_13 = 0; | |
12152 __pyx_t_10 = 127; | |
12153 __Pyx_INCREF(__pyx_kp_u_id); | |
12154 __pyx_t_13 += 3; | |
12155 __Pyx_GIVEREF(__pyx_kp_u_id); | |
12156 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_id); | |
12157 __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) | |
12158 __Pyx_GOTREF(__pyx_t_8); | |
12159 __pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_8), __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 234, __pyx_L1_error) | |
12160 __Pyx_GOTREF(__pyx_t_15); | |
12161 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
12162 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_10; | |
12163 __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15); | |
12164 __Pyx_GIVEREF(__pyx_t_15); | |
12165 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_15); | |
12166 __pyx_t_15 = 0; | |
12167 __Pyx_INCREF(__pyx_kp_u_expected_2); | |
12168 __pyx_t_13 += 11; | |
12169 __Pyx_GIVEREF(__pyx_kp_u_expected_2); | |
12170 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_expected_2); | |
12171 __pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_expected), __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 234, __pyx_L1_error) | |
12172 __Pyx_GOTREF(__pyx_t_15); | |
12173 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_10; | |
12174 __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15); | |
12175 __Pyx_GIVEREF(__pyx_t_15); | |
12176 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_15); | |
12177 __pyx_t_15 = 0; | |
12178 __Pyx_INCREF(__pyx_kp_u_parameters_got); | |
12179 __pyx_t_13 += 17; | |
12180 __Pyx_GIVEREF(__pyx_kp_u_parameters_got); | |
12181 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_parameters_got); | |
12182 __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 234, __pyx_L1_error) | |
12183 __Pyx_GOTREF(__pyx_t_15); | |
12184 __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_15); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) | |
12185 __Pyx_GOTREF(__pyx_t_8); | |
12186 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
12187 __pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_8), __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 234, __pyx_L1_error) | |
12188 __Pyx_GOTREF(__pyx_t_15); | |
12189 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
12190 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_10; | |
12191 __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15); | |
12192 __Pyx_GIVEREF(__pyx_t_15); | |
12193 PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_15); | |
12194 __pyx_t_15 = 0; | |
12195 __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_13, __pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 234, __pyx_L1_error) | |
12196 __Pyx_GOTREF(__pyx_t_15); | |
12197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
12198 __pyx_t_3 = NULL; | |
12199 __pyx_t_5 = 0; | |
12200 #if CYTHON_UNPACK_METHODS | |
12201 if (likely(PyMethod_Check(__pyx_t_1))) { | |
12202 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
12203 if (likely(__pyx_t_3)) { | |
12204 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
12205 __Pyx_INCREF(__pyx_t_3); | |
12206 __Pyx_INCREF(function); | |
12207 __Pyx_DECREF_SET(__pyx_t_1, function); | |
12208 __pyx_t_5 = 1; | |
12209 } | |
12210 } | |
12211 #endif | |
12212 { | |
12213 PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_11, __pyx_t_9, __pyx_t_15}; | |
12214 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); | |
12215 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
12216 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
12217 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
12218 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
12219 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) | |
12220 __Pyx_GOTREF(__pyx_t_2); | |
12221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12222 } | |
12223 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12224 | |
12225 /* "pysam/libcvcf.pyx":235 | |
12226 * self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS, | |
12227 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]])) | |
12228 * if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]])) # <<<<<<<<<<<<<< | |
12229 * result[format[idx]] = result[format[idx]][:expected] | |
12230 * | |
12231 */ | |
12232 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12233 __Pyx_GOTREF(__pyx_t_2); | |
12234 __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12235 __Pyx_GOTREF(__pyx_t_1); | |
12236 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12237 __pyx_t_13 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 235, __pyx_L1_error) | |
12238 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12239 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12240 __Pyx_GOTREF(__pyx_t_1); | |
12241 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_expected, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12243 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) | |
12244 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12245 if (__pyx_t_7) { | |
12246 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12247 __Pyx_GOTREF(__pyx_t_2); | |
12248 __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12249 __Pyx_GOTREF(__pyx_t_1); | |
12250 __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12251 __Pyx_GOTREF(__pyx_t_15); | |
12252 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12253 __Pyx_GOTREF(__pyx_t_9); | |
12254 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
12255 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_9, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12256 __Pyx_GOTREF(__pyx_t_15); | |
12257 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
12258 __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12259 __Pyx_GOTREF(__pyx_t_9); | |
12260 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12261 __Pyx_GOTREF(__pyx_t_11); | |
12262 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
12263 __pyx_t_13 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 235, __pyx_L1_error) | |
12264 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
12265 __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12266 __Pyx_GOTREF(__pyx_t_11); | |
12267 __pyx_t_9 = PyNumber_Subtract(__pyx_v_expected, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12268 __Pyx_GOTREF(__pyx_t_9); | |
12269 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
12270 __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12271 __Pyx_GOTREF(__pyx_t_11); | |
12272 __Pyx_GIVEREF(__pyx_t_15); | |
12273 if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_15)) __PYX_ERR(0, 235, __pyx_L1_error); | |
12274 { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12275 __Pyx_GOTREF(__pyx_temp); | |
12276 __Pyx_DECREF(__pyx_t_11); | |
12277 __pyx_t_11 = __pyx_temp; | |
12278 } | |
12279 __pyx_t_15 = 0; | |
12280 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
12281 __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 235, __pyx_L1_error) | |
12282 __Pyx_GOTREF(__pyx_t_9); | |
12283 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12284 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
12285 if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_t_2, __pyx_t_9) < 0))) __PYX_ERR(0, 235, __pyx_L1_error) | |
12286 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
12287 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12288 } | |
12289 | |
12290 /* "pysam/libcvcf.pyx":236 | |
12291 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]])) | |
12292 * if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]])) | |
12293 * result[format[idx]] = result[format[idx]][:expected] # <<<<<<<<<<<<<< | |
12294 * | |
12295 * return result | |
12296 */ | |
12297 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) | |
12298 __Pyx_GOTREF(__pyx_t_2); | |
12299 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L1_error) | |
12300 __Pyx_GOTREF(__pyx_t_9); | |
12301 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12302 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_9, 0, 0, NULL, &__pyx_v_expected, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) | |
12303 __Pyx_GOTREF(__pyx_t_2); | |
12304 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
12305 __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L1_error) | |
12306 __Pyx_GOTREF(__pyx_t_9); | |
12307 if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_t_9, __pyx_t_2) < 0))) __PYX_ERR(0, 236, __pyx_L1_error) | |
12308 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
12309 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12310 | |
12311 /* "pysam/libcvcf.pyx":232 | |
12312 * | |
12313 * result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data)) | |
12314 * if expected != -1 and len(result[format[idx]]) != expected: # <<<<<<<<<<<<<< | |
12315 * self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS, | |
12316 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]])) | |
12317 */ | |
12318 } | |
12319 } | |
12320 | |
12321 /* "pysam/libcvcf.pyx":238 | |
12322 * result[format[idx]] = result[format[idx]][:expected] | |
12323 * | |
12324 * return result # <<<<<<<<<<<<<< | |
12325 * | |
12326 * | |
12327 */ | |
12328 __Pyx_XDECREF(__pyx_r); | |
12329 __Pyx_INCREF(__pyx_v_result); | |
12330 __pyx_r = __pyx_v_result; | |
12331 goto __pyx_L0; | |
12332 | |
12333 /* "pysam/libcvcf.pyx":212 | |
12334 * return self.vcf._samples | |
12335 * | |
12336 * def __getitem__(self, key): # <<<<<<<<<<<<<< | |
12337 * | |
12338 * # parse sample columns | |
12339 */ | |
12340 | |
12341 /* function exit code */ | |
12342 __pyx_L1_error:; | |
12343 __Pyx_XDECREF(__pyx_t_1); | |
12344 __Pyx_XDECREF(__pyx_t_2); | |
12345 __Pyx_XDECREF(__pyx_t_3); | |
12346 __Pyx_XDECREF(__pyx_t_8); | |
12347 __Pyx_XDECREF(__pyx_t_9); | |
12348 __Pyx_XDECREF(__pyx_t_11); | |
12349 __Pyx_XDECREF(__pyx_t_15); | |
12350 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12351 __pyx_r = NULL; | |
12352 __pyx_L0:; | |
12353 __Pyx_XDECREF(__pyx_v_values); | |
12354 __Pyx_XDECREF(__pyx_v_alt); | |
12355 __Pyx_XDECREF(__pyx_v_format); | |
12356 __Pyx_XDECREF(__pyx_v_result); | |
12357 __Pyx_XDECREF(__pyx_v_expected); | |
12358 __Pyx_XDECREF(__pyx_v_value); | |
12359 __Pyx_XGIVEREF(__pyx_r); | |
12360 __Pyx_RefNannyFinishContext(); | |
12361 return __pyx_r; | |
12362 } | |
12363 | |
12364 /* "(tree fragment)":1 | |
12365 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
12366 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
12367 * def __setstate_cython__(self, __pyx_state): | |
12368 */ | |
12369 | |
12370 /* Python wrapper */ | |
12371 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_11__reduce_cython__(PyObject *__pyx_v_self, | |
12372 #if CYTHON_METH_FASTCALL | |
12373 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12374 #else | |
12375 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12376 #endif | |
12377 ); /*proto*/ | |
12378 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_9VCFRecord_10__reduce_cython__, "VCFRecord.__reduce_cython__(self)"); | |
12379 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_9VCFRecord_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_9VCFRecord_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_9VCFRecord_10__reduce_cython__}; | |
12380 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_11__reduce_cython__(PyObject *__pyx_v_self, | |
12381 #if CYTHON_METH_FASTCALL | |
12382 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12383 #else | |
12384 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12385 #endif | |
12386 ) { | |
12387 #if !CYTHON_METH_FASTCALL | |
12388 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
12389 #endif | |
12390 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
12391 PyObject *__pyx_r = 0; | |
12392 __Pyx_RefNannyDeclarations | |
12393 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
12394 #if !CYTHON_METH_FASTCALL | |
12395 #if CYTHON_ASSUME_SAFE_MACROS | |
12396 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
12397 #else | |
12398 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
12399 #endif | |
12400 #endif | |
12401 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
12402 if (unlikely(__pyx_nargs > 0)) { | |
12403 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
12404 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
12405 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_10__reduce_cython__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self)); | |
12406 | |
12407 /* function exit code */ | |
12408 __Pyx_RefNannyFinishContext(); | |
12409 return __pyx_r; | |
12410 } | |
12411 | |
12412 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self) { | |
12413 PyObject *__pyx_r = NULL; | |
12414 __Pyx_RefNannyDeclarations | |
12415 int __pyx_lineno = 0; | |
12416 const char *__pyx_filename = NULL; | |
12417 int __pyx_clineno = 0; | |
12418 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
12419 | |
12420 /* "(tree fragment)":2 | |
12421 * def __reduce_cython__(self): | |
12422 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
12423 * def __setstate_cython__(self, __pyx_state): | |
12424 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
12425 */ | |
12426 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
12427 __PYX_ERR(1, 2, __pyx_L1_error) | |
12428 | |
12429 /* "(tree fragment)":1 | |
12430 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
12431 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
12432 * def __setstate_cython__(self, __pyx_state): | |
12433 */ | |
12434 | |
12435 /* function exit code */ | |
12436 __pyx_L1_error:; | |
12437 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12438 __pyx_r = NULL; | |
12439 __Pyx_XGIVEREF(__pyx_r); | |
12440 __Pyx_RefNannyFinishContext(); | |
12441 return __pyx_r; | |
12442 } | |
12443 | |
12444 /* "(tree fragment)":3 | |
12445 * def __reduce_cython__(self): | |
12446 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
12447 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
12448 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
12449 */ | |
12450 | |
12451 /* Python wrapper */ | |
12452 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_13__setstate_cython__(PyObject *__pyx_v_self, | |
12453 #if CYTHON_METH_FASTCALL | |
12454 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12455 #else | |
12456 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12457 #endif | |
12458 ); /*proto*/ | |
12459 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_9VCFRecord_12__setstate_cython__, "VCFRecord.__setstate_cython__(self, __pyx_state)"); | |
12460 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_9VCFRecord_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_9VCFRecord_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_9VCFRecord_12__setstate_cython__}; | |
12461 static PyObject *__pyx_pw_5pysam_7libcvcf_9VCFRecord_13__setstate_cython__(PyObject *__pyx_v_self, | |
12462 #if CYTHON_METH_FASTCALL | |
12463 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12464 #else | |
12465 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12466 #endif | |
12467 ) { | |
12468 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
12469 #if !CYTHON_METH_FASTCALL | |
12470 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
12471 #endif | |
12472 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
12473 PyObject* values[1] = {0}; | |
12474 int __pyx_lineno = 0; | |
12475 const char *__pyx_filename = NULL; | |
12476 int __pyx_clineno = 0; | |
12477 PyObject *__pyx_r = 0; | |
12478 __Pyx_RefNannyDeclarations | |
12479 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
12480 #if !CYTHON_METH_FASTCALL | |
12481 #if CYTHON_ASSUME_SAFE_MACROS | |
12482 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
12483 #else | |
12484 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
12485 #endif | |
12486 #endif | |
12487 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
12488 { | |
12489 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
12490 if (__pyx_kwds) { | |
12491 Py_ssize_t kw_args; | |
12492 switch (__pyx_nargs) { | |
12493 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12494 CYTHON_FALLTHROUGH; | |
12495 case 0: break; | |
12496 default: goto __pyx_L5_argtuple_error; | |
12497 } | |
12498 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
12499 switch (__pyx_nargs) { | |
12500 case 0: | |
12501 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
12502 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
12503 kw_args--; | |
12504 } | |
12505 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
12506 else goto __pyx_L5_argtuple_error; | |
12507 } | |
12508 if (unlikely(kw_args > 0)) { | |
12509 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
12510 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) | |
12511 } | |
12512 } else if (unlikely(__pyx_nargs != 1)) { | |
12513 goto __pyx_L5_argtuple_error; | |
12514 } else { | |
12515 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12516 } | |
12517 __pyx_v___pyx_state = values[0]; | |
12518 } | |
12519 goto __pyx_L6_skip; | |
12520 __pyx_L5_argtuple_error:; | |
12521 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
12522 __pyx_L6_skip:; | |
12523 goto __pyx_L4_argument_unpacking_done; | |
12524 __pyx_L3_error:; | |
12525 { | |
12526 Py_ssize_t __pyx_temp; | |
12527 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12528 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12529 } | |
12530 } | |
12531 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12532 __Pyx_RefNannyFinishContext(); | |
12533 return NULL; | |
12534 __pyx_L4_argument_unpacking_done:; | |
12535 __pyx_r = __pyx_pf_5pysam_7libcvcf_9VCFRecord_12__setstate_cython__(((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_v_self), __pyx_v___pyx_state); | |
12536 | |
12537 /* function exit code */ | |
12538 { | |
12539 Py_ssize_t __pyx_temp; | |
12540 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12541 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12542 } | |
12543 } | |
12544 __Pyx_RefNannyFinishContext(); | |
12545 return __pyx_r; | |
12546 } | |
12547 | |
12548 static PyObject *__pyx_pf_5pysam_7libcvcf_9VCFRecord_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
12549 PyObject *__pyx_r = NULL; | |
12550 __Pyx_RefNannyDeclarations | |
12551 int __pyx_lineno = 0; | |
12552 const char *__pyx_filename = NULL; | |
12553 int __pyx_clineno = 0; | |
12554 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
12555 | |
12556 /* "(tree fragment)":4 | |
12557 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
12558 * def __setstate_cython__(self, __pyx_state): | |
12559 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
12560 */ | |
12561 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
12562 __PYX_ERR(1, 4, __pyx_L1_error) | |
12563 | |
12564 /* "(tree fragment)":3 | |
12565 * def __reduce_cython__(self): | |
12566 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
12567 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
12568 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
12569 */ | |
12570 | |
12571 /* function exit code */ | |
12572 __pyx_L1_error:; | |
12573 __Pyx_AddTraceback("pysam.libcvcf.VCFRecord.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12574 __pyx_r = NULL; | |
12575 __Pyx_XGIVEREF(__pyx_r); | |
12576 __Pyx_RefNannyFinishContext(); | |
12577 return __pyx_r; | |
12578 } | |
12579 | |
12580 /* "pysam/libcvcf.pyx":244 | |
12581 * '''converts a :term:`tabix row` into a VCF record.''' | |
12582 * cdef vcffile | |
12583 * def __init__(self, vcffile): # <<<<<<<<<<<<<< | |
12584 * self.vcffile = vcffile | |
12585 * | |
12586 */ | |
12587 | |
12588 /* Python wrapper */ | |
12589 static int __pyx_pw_5pysam_7libcvcf_11asVCFRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
12590 static int __pyx_pw_5pysam_7libcvcf_11asVCFRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
12591 PyObject *__pyx_v_vcffile = 0; | |
12592 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
12593 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
12594 PyObject* values[1] = {0}; | |
12595 int __pyx_lineno = 0; | |
12596 const char *__pyx_filename = NULL; | |
12597 int __pyx_clineno = 0; | |
12598 int __pyx_r; | |
12599 __Pyx_RefNannyDeclarations | |
12600 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
12601 #if CYTHON_ASSUME_SAFE_MACROS | |
12602 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
12603 #else | |
12604 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
12605 #endif | |
12606 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
12607 { | |
12608 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vcffile,0}; | |
12609 if (__pyx_kwds) { | |
12610 Py_ssize_t kw_args; | |
12611 switch (__pyx_nargs) { | |
12612 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
12613 CYTHON_FALLTHROUGH; | |
12614 case 0: break; | |
12615 default: goto __pyx_L5_argtuple_error; | |
12616 } | |
12617 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
12618 switch (__pyx_nargs) { | |
12619 case 0: | |
12620 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vcffile)) != 0)) { | |
12621 (void)__Pyx_Arg_NewRef_VARARGS(values[0]); | |
12622 kw_args--; | |
12623 } | |
12624 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error) | |
12625 else goto __pyx_L5_argtuple_error; | |
12626 } | |
12627 if (unlikely(kw_args > 0)) { | |
12628 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
12629 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 244, __pyx_L3_error) | |
12630 } | |
12631 } else if (unlikely(__pyx_nargs != 1)) { | |
12632 goto __pyx_L5_argtuple_error; | |
12633 } else { | |
12634 values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
12635 } | |
12636 __pyx_v_vcffile = values[0]; | |
12637 } | |
12638 goto __pyx_L6_skip; | |
12639 __pyx_L5_argtuple_error:; | |
12640 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 244, __pyx_L3_error) | |
12641 __pyx_L6_skip:; | |
12642 goto __pyx_L4_argument_unpacking_done; | |
12643 __pyx_L3_error:; | |
12644 { | |
12645 Py_ssize_t __pyx_temp; | |
12646 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12647 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
12648 } | |
12649 } | |
12650 __Pyx_AddTraceback("pysam.libcvcf.asVCFRecord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12651 __Pyx_RefNannyFinishContext(); | |
12652 return -1; | |
12653 __pyx_L4_argument_unpacking_done:; | |
12654 __pyx_r = __pyx_pf_5pysam_7libcvcf_11asVCFRecord___init__(((struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *)__pyx_v_self), __pyx_v_vcffile); | |
12655 | |
12656 /* function exit code */ | |
12657 { | |
12658 Py_ssize_t __pyx_temp; | |
12659 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12660 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
12661 } | |
12662 } | |
12663 __Pyx_RefNannyFinishContext(); | |
12664 return __pyx_r; | |
12665 } | |
12666 | |
12667 static int __pyx_pf_5pysam_7libcvcf_11asVCFRecord___init__(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *__pyx_v_self, PyObject *__pyx_v_vcffile) { | |
12668 int __pyx_r; | |
12669 __Pyx_RefNannyDeclarations | |
12670 __Pyx_RefNannySetupContext("__init__", 1); | |
12671 | |
12672 /* "pysam/libcvcf.pyx":245 | |
12673 * cdef vcffile | |
12674 * def __init__(self, vcffile): | |
12675 * self.vcffile = vcffile # <<<<<<<<<<<<<< | |
12676 * | |
12677 * cdef parse(self, char * buffer, int len): | |
12678 */ | |
12679 __Pyx_INCREF(__pyx_v_vcffile); | |
12680 __Pyx_GIVEREF(__pyx_v_vcffile); | |
12681 __Pyx_GOTREF(__pyx_v_self->vcffile); | |
12682 __Pyx_DECREF(__pyx_v_self->vcffile); | |
12683 __pyx_v_self->vcffile = __pyx_v_vcffile; | |
12684 | |
12685 /* "pysam/libcvcf.pyx":244 | |
12686 * '''converts a :term:`tabix row` into a VCF record.''' | |
12687 * cdef vcffile | |
12688 * def __init__(self, vcffile): # <<<<<<<<<<<<<< | |
12689 * self.vcffile = vcffile | |
12690 * | |
12691 */ | |
12692 | |
12693 /* function exit code */ | |
12694 __pyx_r = 0; | |
12695 __Pyx_RefNannyFinishContext(); | |
12696 return __pyx_r; | |
12697 } | |
12698 | |
12699 /* "pysam/libcvcf.pyx":247 | |
12700 * self.vcffile = vcffile | |
12701 * | |
12702 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
12703 * cdef VCFRecord r | |
12704 * r = VCFRecord(self.vcffile) | |
12705 */ | |
12706 | |
12707 static PyObject *__pyx_f_5pysam_7libcvcf_11asVCFRecord_parse(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) { | |
12708 struct __pyx_obj_5pysam_7libcvcf_VCFRecord *__pyx_v_r = 0; | |
12709 PyObject *__pyx_r = NULL; | |
12710 __Pyx_RefNannyDeclarations | |
12711 PyObject *__pyx_t_1 = NULL; | |
12712 int __pyx_lineno = 0; | |
12713 const char *__pyx_filename = NULL; | |
12714 int __pyx_clineno = 0; | |
12715 __Pyx_RefNannySetupContext("parse", 1); | |
12716 | |
12717 /* "pysam/libcvcf.pyx":249 | |
12718 * cdef parse(self, char * buffer, int len): | |
12719 * cdef VCFRecord r | |
12720 * r = VCFRecord(self.vcffile) # <<<<<<<<<<<<<< | |
12721 * r.copy(buffer, len) | |
12722 * return r | |
12723 */ | |
12724 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5pysam_7libcvcf_VCFRecord), __pyx_v_self->vcffile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) | |
12725 __Pyx_GOTREF(__pyx_t_1); | |
12726 __pyx_v_r = ((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)__pyx_t_1); | |
12727 __pyx_t_1 = 0; | |
12728 | |
12729 /* "pysam/libcvcf.pyx":250 | |
12730 * cdef VCFRecord r | |
12731 * r = VCFRecord(self.vcffile) | |
12732 * r.copy(buffer, len) # <<<<<<<<<<<<<< | |
12733 * return r | |
12734 * | |
12735 */ | |
12736 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_7libcvcf_VCFRecord *)__pyx_v_r->__pyx_base.__pyx_vtab)->__pyx_base.copy(((struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) | |
12737 __Pyx_GOTREF(__pyx_t_1); | |
12738 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12739 | |
12740 /* "pysam/libcvcf.pyx":251 | |
12741 * r = VCFRecord(self.vcffile) | |
12742 * r.copy(buffer, len) | |
12743 * return r # <<<<<<<<<<<<<< | |
12744 * | |
12745 * class VCF(object): | |
12746 */ | |
12747 __Pyx_XDECREF(__pyx_r); | |
12748 __Pyx_INCREF((PyObject *)__pyx_v_r); | |
12749 __pyx_r = ((PyObject *)__pyx_v_r); | |
12750 goto __pyx_L0; | |
12751 | |
12752 /* "pysam/libcvcf.pyx":247 | |
12753 * self.vcffile = vcffile | |
12754 * | |
12755 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
12756 * cdef VCFRecord r | |
12757 * r = VCFRecord(self.vcffile) | |
12758 */ | |
12759 | |
12760 /* function exit code */ | |
12761 __pyx_L1_error:; | |
12762 __Pyx_XDECREF(__pyx_t_1); | |
12763 __Pyx_AddTraceback("pysam.libcvcf.asVCFRecord.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12764 __pyx_r = 0; | |
12765 __pyx_L0:; | |
12766 __Pyx_XDECREF((PyObject *)__pyx_v_r); | |
12767 __Pyx_XGIVEREF(__pyx_r); | |
12768 __Pyx_RefNannyFinishContext(); | |
12769 return __pyx_r; | |
12770 } | |
12771 | |
12772 /* "(tree fragment)":1 | |
12773 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
12774 * cdef tuple state | |
12775 * cdef object _dict | |
12776 */ | |
12777 | |
12778 /* Python wrapper */ | |
12779 static PyObject *__pyx_pw_5pysam_7libcvcf_11asVCFRecord_3__reduce_cython__(PyObject *__pyx_v_self, | |
12780 #if CYTHON_METH_FASTCALL | |
12781 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12782 #else | |
12783 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12784 #endif | |
12785 ); /*proto*/ | |
12786 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_11asVCFRecord_2__reduce_cython__, "asVCFRecord.__reduce_cython__(self)"); | |
12787 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_11asVCFRecord_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_11asVCFRecord_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_11asVCFRecord_2__reduce_cython__}; | |
12788 static PyObject *__pyx_pw_5pysam_7libcvcf_11asVCFRecord_3__reduce_cython__(PyObject *__pyx_v_self, | |
12789 #if CYTHON_METH_FASTCALL | |
12790 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12791 #else | |
12792 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12793 #endif | |
12794 ) { | |
12795 #if !CYTHON_METH_FASTCALL | |
12796 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
12797 #endif | |
12798 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
12799 PyObject *__pyx_r = 0; | |
12800 __Pyx_RefNannyDeclarations | |
12801 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
12802 #if !CYTHON_METH_FASTCALL | |
12803 #if CYTHON_ASSUME_SAFE_MACROS | |
12804 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
12805 #else | |
12806 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
12807 #endif | |
12808 #endif | |
12809 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
12810 if (unlikely(__pyx_nargs > 0)) { | |
12811 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
12812 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
12813 __pyx_r = __pyx_pf_5pysam_7libcvcf_11asVCFRecord_2__reduce_cython__(((struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *)__pyx_v_self)); | |
12814 | |
12815 /* function exit code */ | |
12816 __Pyx_RefNannyFinishContext(); | |
12817 return __pyx_r; | |
12818 } | |
12819 | |
12820 static PyObject *__pyx_pf_5pysam_7libcvcf_11asVCFRecord_2__reduce_cython__(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *__pyx_v_self) { | |
12821 PyObject *__pyx_v_state = 0; | |
12822 PyObject *__pyx_v__dict = 0; | |
12823 int __pyx_v_use_setstate; | |
12824 PyObject *__pyx_r = NULL; | |
12825 __Pyx_RefNannyDeclarations | |
12826 PyObject *__pyx_t_1 = NULL; | |
12827 int __pyx_t_2; | |
12828 PyObject *__pyx_t_3 = NULL; | |
12829 int __pyx_t_4; | |
12830 PyObject *__pyx_t_5 = NULL; | |
12831 int __pyx_lineno = 0; | |
12832 const char *__pyx_filename = NULL; | |
12833 int __pyx_clineno = 0; | |
12834 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
12835 | |
12836 /* "(tree fragment)":5 | |
12837 * cdef object _dict | |
12838 * cdef bint use_setstate | |
12839 * state = (self.encoding, self.vcffile) # <<<<<<<<<<<<<< | |
12840 * _dict = getattr(self, '__dict__', None) | |
12841 * if _dict is not None: | |
12842 */ | |
12843 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
12844 __Pyx_GOTREF(__pyx_t_1); | |
12845 __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); | |
12846 __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); | |
12847 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding)) __PYX_ERR(1, 5, __pyx_L1_error); | |
12848 __Pyx_INCREF(__pyx_v_self->vcffile); | |
12849 __Pyx_GIVEREF(__pyx_v_self->vcffile); | |
12850 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->vcffile)) __PYX_ERR(1, 5, __pyx_L1_error); | |
12851 __pyx_v_state = ((PyObject*)__pyx_t_1); | |
12852 __pyx_t_1 = 0; | |
12853 | |
12854 /* "(tree fragment)":6 | |
12855 * cdef bint use_setstate | |
12856 * state = (self.encoding, self.vcffile) | |
12857 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
12858 * if _dict is not None: | |
12859 * state += (_dict,) | |
12860 */ | |
12861 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
12862 __Pyx_GOTREF(__pyx_t_1); | |
12863 __pyx_v__dict = __pyx_t_1; | |
12864 __pyx_t_1 = 0; | |
12865 | |
12866 /* "(tree fragment)":7 | |
12867 * state = (self.encoding, self.vcffile) | |
12868 * _dict = getattr(self, '__dict__', None) | |
12869 * if _dict is not None: # <<<<<<<<<<<<<< | |
12870 * state += (_dict,) | |
12871 * use_setstate = True | |
12872 */ | |
12873 __pyx_t_2 = (__pyx_v__dict != Py_None); | |
12874 if (__pyx_t_2) { | |
12875 | |
12876 /* "(tree fragment)":8 | |
12877 * _dict = getattr(self, '__dict__', None) | |
12878 * if _dict is not None: | |
12879 * state += (_dict,) # <<<<<<<<<<<<<< | |
12880 * use_setstate = True | |
12881 * else: | |
12882 */ | |
12883 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) | |
12884 __Pyx_GOTREF(__pyx_t_1); | |
12885 __Pyx_INCREF(__pyx_v__dict); | |
12886 __Pyx_GIVEREF(__pyx_v__dict); | |
12887 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); | |
12888 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) | |
12889 __Pyx_GOTREF(__pyx_t_3); | |
12890 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12891 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); | |
12892 __pyx_t_3 = 0; | |
12893 | |
12894 /* "(tree fragment)":9 | |
12895 * if _dict is not None: | |
12896 * state += (_dict,) | |
12897 * use_setstate = True # <<<<<<<<<<<<<< | |
12898 * else: | |
12899 * use_setstate = self.encoding is not None or self.vcffile is not None | |
12900 */ | |
12901 __pyx_v_use_setstate = 1; | |
12902 | |
12903 /* "(tree fragment)":7 | |
12904 * state = (self.encoding, self.vcffile) | |
12905 * _dict = getattr(self, '__dict__', None) | |
12906 * if _dict is not None: # <<<<<<<<<<<<<< | |
12907 * state += (_dict,) | |
12908 * use_setstate = True | |
12909 */ | |
12910 goto __pyx_L3; | |
12911 } | |
12912 | |
12913 /* "(tree fragment)":11 | |
12914 * use_setstate = True | |
12915 * else: | |
12916 * use_setstate = self.encoding is not None or self.vcffile is not None # <<<<<<<<<<<<<< | |
12917 * if use_setstate: | |
12918 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, None), state | |
12919 */ | |
12920 /*else*/ { | |
12921 __pyx_t_4 = (__pyx_v_self->__pyx_base.encoding != Py_None); | |
12922 if (!__pyx_t_4) { | |
12923 } else { | |
12924 __pyx_t_2 = __pyx_t_4; | |
12925 goto __pyx_L4_bool_binop_done; | |
12926 } | |
12927 __pyx_t_4 = (__pyx_v_self->vcffile != Py_None); | |
12928 __pyx_t_2 = __pyx_t_4; | |
12929 __pyx_L4_bool_binop_done:; | |
12930 __pyx_v_use_setstate = __pyx_t_2; | |
12931 } | |
12932 __pyx_L3:; | |
12933 | |
12934 /* "(tree fragment)":12 | |
12935 * else: | |
12936 * use_setstate = self.encoding is not None or self.vcffile is not None | |
12937 * if use_setstate: # <<<<<<<<<<<<<< | |
12938 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, None), state | |
12939 * else: | |
12940 */ | |
12941 if (__pyx_v_use_setstate) { | |
12942 | |
12943 /* "(tree fragment)":13 | |
12944 * use_setstate = self.encoding is not None or self.vcffile is not None | |
12945 * if use_setstate: | |
12946 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, None), state # <<<<<<<<<<<<<< | |
12947 * else: | |
12948 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, state) | |
12949 */ | |
12950 __Pyx_XDECREF(__pyx_r); | |
12951 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_asVCFRecord); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
12952 __Pyx_GOTREF(__pyx_t_3); | |
12953 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) | |
12954 __Pyx_GOTREF(__pyx_t_1); | |
12955 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
12956 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
12957 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); | |
12958 __Pyx_INCREF(__pyx_int_239654613); | |
12959 __Pyx_GIVEREF(__pyx_int_239654613); | |
12960 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_239654613)) __PYX_ERR(1, 13, __pyx_L1_error); | |
12961 __Pyx_INCREF(Py_None); | |
12962 __Pyx_GIVEREF(Py_None); | |
12963 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); | |
12964 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) | |
12965 __Pyx_GOTREF(__pyx_t_5); | |
12966 __Pyx_GIVEREF(__pyx_t_3); | |
12967 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); | |
12968 __Pyx_GIVEREF(__pyx_t_1); | |
12969 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); | |
12970 __Pyx_INCREF(__pyx_v_state); | |
12971 __Pyx_GIVEREF(__pyx_v_state); | |
12972 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); | |
12973 __pyx_t_3 = 0; | |
12974 __pyx_t_1 = 0; | |
12975 __pyx_r = __pyx_t_5; | |
12976 __pyx_t_5 = 0; | |
12977 goto __pyx_L0; | |
12978 | |
12979 /* "(tree fragment)":12 | |
12980 * else: | |
12981 * use_setstate = self.encoding is not None or self.vcffile is not None | |
12982 * if use_setstate: # <<<<<<<<<<<<<< | |
12983 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, None), state | |
12984 * else: | |
12985 */ | |
12986 } | |
12987 | |
12988 /* "(tree fragment)":15 | |
12989 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, None), state | |
12990 * else: | |
12991 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, state) # <<<<<<<<<<<<<< | |
12992 * def __setstate_cython__(self, __pyx_state): | |
12993 * __pyx_unpickle_asVCFRecord__set_state(self, __pyx_state) | |
12994 */ | |
12995 /*else*/ { | |
12996 __Pyx_XDECREF(__pyx_r); | |
12997 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_asVCFRecord); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) | |
12998 __Pyx_GOTREF(__pyx_t_5); | |
12999 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
13000 __Pyx_GOTREF(__pyx_t_1); | |
13001 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
13002 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
13003 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); | |
13004 __Pyx_INCREF(__pyx_int_239654613); | |
13005 __Pyx_GIVEREF(__pyx_int_239654613); | |
13006 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_239654613)) __PYX_ERR(1, 15, __pyx_L1_error); | |
13007 __Pyx_INCREF(__pyx_v_state); | |
13008 __Pyx_GIVEREF(__pyx_v_state); | |
13009 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); | |
13010 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) | |
13011 __Pyx_GOTREF(__pyx_t_3); | |
13012 __Pyx_GIVEREF(__pyx_t_5); | |
13013 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error); | |
13014 __Pyx_GIVEREF(__pyx_t_1); | |
13015 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); | |
13016 __pyx_t_5 = 0; | |
13017 __pyx_t_1 = 0; | |
13018 __pyx_r = __pyx_t_3; | |
13019 __pyx_t_3 = 0; | |
13020 goto __pyx_L0; | |
13021 } | |
13022 | |
13023 /* "(tree fragment)":1 | |
13024 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
13025 * cdef tuple state | |
13026 * cdef object _dict | |
13027 */ | |
13028 | |
13029 /* function exit code */ | |
13030 __pyx_L1_error:; | |
13031 __Pyx_XDECREF(__pyx_t_1); | |
13032 __Pyx_XDECREF(__pyx_t_3); | |
13033 __Pyx_XDECREF(__pyx_t_5); | |
13034 __Pyx_AddTraceback("pysam.libcvcf.asVCFRecord.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13035 __pyx_r = NULL; | |
13036 __pyx_L0:; | |
13037 __Pyx_XDECREF(__pyx_v_state); | |
13038 __Pyx_XDECREF(__pyx_v__dict); | |
13039 __Pyx_XGIVEREF(__pyx_r); | |
13040 __Pyx_RefNannyFinishContext(); | |
13041 return __pyx_r; | |
13042 } | |
13043 | |
13044 /* "(tree fragment)":16 | |
13045 * else: | |
13046 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, state) | |
13047 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
13048 * __pyx_unpickle_asVCFRecord__set_state(self, __pyx_state) | |
13049 */ | |
13050 | |
13051 /* Python wrapper */ | |
13052 static PyObject *__pyx_pw_5pysam_7libcvcf_11asVCFRecord_5__setstate_cython__(PyObject *__pyx_v_self, | |
13053 #if CYTHON_METH_FASTCALL | |
13054 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13055 #else | |
13056 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13057 #endif | |
13058 ); /*proto*/ | |
13059 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_11asVCFRecord_4__setstate_cython__, "asVCFRecord.__setstate_cython__(self, __pyx_state)"); | |
13060 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_11asVCFRecord_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_11asVCFRecord_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_11asVCFRecord_4__setstate_cython__}; | |
13061 static PyObject *__pyx_pw_5pysam_7libcvcf_11asVCFRecord_5__setstate_cython__(PyObject *__pyx_v_self, | |
13062 #if CYTHON_METH_FASTCALL | |
13063 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13064 #else | |
13065 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13066 #endif | |
13067 ) { | |
13068 PyObject *__pyx_v___pyx_state = 0; | |
13069 #if !CYTHON_METH_FASTCALL | |
13070 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
13071 #endif | |
13072 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13073 PyObject* values[1] = {0}; | |
13074 int __pyx_lineno = 0; | |
13075 const char *__pyx_filename = NULL; | |
13076 int __pyx_clineno = 0; | |
13077 PyObject *__pyx_r = 0; | |
13078 __Pyx_RefNannyDeclarations | |
13079 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
13080 #if !CYTHON_METH_FASTCALL | |
13081 #if CYTHON_ASSUME_SAFE_MACROS | |
13082 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
13083 #else | |
13084 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
13085 #endif | |
13086 #endif | |
13087 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
13088 { | |
13089 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
13090 if (__pyx_kwds) { | |
13091 Py_ssize_t kw_args; | |
13092 switch (__pyx_nargs) { | |
13093 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
13094 CYTHON_FALLTHROUGH; | |
13095 case 0: break; | |
13096 default: goto __pyx_L5_argtuple_error; | |
13097 } | |
13098 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
13099 switch (__pyx_nargs) { | |
13100 case 0: | |
13101 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
13102 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
13103 kw_args--; | |
13104 } | |
13105 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) | |
13106 else goto __pyx_L5_argtuple_error; | |
13107 } | |
13108 if (unlikely(kw_args > 0)) { | |
13109 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
13110 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) | |
13111 } | |
13112 } else if (unlikely(__pyx_nargs != 1)) { | |
13113 goto __pyx_L5_argtuple_error; | |
13114 } else { | |
13115 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
13116 } | |
13117 __pyx_v___pyx_state = values[0]; | |
13118 } | |
13119 goto __pyx_L6_skip; | |
13120 __pyx_L5_argtuple_error:; | |
13121 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) | |
13122 __pyx_L6_skip:; | |
13123 goto __pyx_L4_argument_unpacking_done; | |
13124 __pyx_L3_error:; | |
13125 { | |
13126 Py_ssize_t __pyx_temp; | |
13127 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
13128 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
13129 } | |
13130 } | |
13131 __Pyx_AddTraceback("pysam.libcvcf.asVCFRecord.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13132 __Pyx_RefNannyFinishContext(); | |
13133 return NULL; | |
13134 __pyx_L4_argument_unpacking_done:; | |
13135 __pyx_r = __pyx_pf_5pysam_7libcvcf_11asVCFRecord_4__setstate_cython__(((struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *)__pyx_v_self), __pyx_v___pyx_state); | |
13136 | |
13137 /* function exit code */ | |
13138 { | |
13139 Py_ssize_t __pyx_temp; | |
13140 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
13141 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
13142 } | |
13143 } | |
13144 __Pyx_RefNannyFinishContext(); | |
13145 return __pyx_r; | |
13146 } | |
13147 | |
13148 static PyObject *__pyx_pf_5pysam_7libcvcf_11asVCFRecord_4__setstate_cython__(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
13149 PyObject *__pyx_r = NULL; | |
13150 __Pyx_RefNannyDeclarations | |
13151 PyObject *__pyx_t_1 = NULL; | |
13152 int __pyx_lineno = 0; | |
13153 const char *__pyx_filename = NULL; | |
13154 int __pyx_clineno = 0; | |
13155 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
13156 | |
13157 /* "(tree fragment)":17 | |
13158 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, state) | |
13159 * def __setstate_cython__(self, __pyx_state): | |
13160 * __pyx_unpickle_asVCFRecord__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
13161 */ | |
13162 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) | |
13163 __pyx_t_1 = __pyx_f_5pysam_7libcvcf___pyx_unpickle_asVCFRecord__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) | |
13164 __Pyx_GOTREF(__pyx_t_1); | |
13165 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13166 | |
13167 /* "(tree fragment)":16 | |
13168 * else: | |
13169 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, state) | |
13170 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
13171 * __pyx_unpickle_asVCFRecord__set_state(self, __pyx_state) | |
13172 */ | |
13173 | |
13174 /* function exit code */ | |
13175 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
13176 goto __pyx_L0; | |
13177 __pyx_L1_error:; | |
13178 __Pyx_XDECREF(__pyx_t_1); | |
13179 __Pyx_AddTraceback("pysam.libcvcf.asVCFRecord.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13180 __pyx_r = NULL; | |
13181 __pyx_L0:; | |
13182 __Pyx_XGIVEREF(__pyx_r); | |
13183 __Pyx_RefNannyFinishContext(); | |
13184 return __pyx_r; | |
13185 } | |
13186 | |
13187 /* "pysam/libcvcf.pyx":330 | |
13188 * _lines = None | |
13189 * | |
13190 * def __init__(self, _copy=None, reference=None, regions=None, # <<<<<<<<<<<<<< | |
13191 * lines=None, leftalign=False): | |
13192 * # make error identifiers accessible by name | |
13193 */ | |
13194 | |
13195 /* Python wrapper */ | |
13196 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_1__init__(PyObject *__pyx_self, | |
13197 #if CYTHON_METH_FASTCALL | |
13198 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13199 #else | |
13200 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13201 #endif | |
13202 ); /*proto*/ | |
13203 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF___init__, "VCF.__init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False)"); | |
13204 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF___init__}; | |
13205 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_1__init__(PyObject *__pyx_self, | |
13206 #if CYTHON_METH_FASTCALL | |
13207 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13208 #else | |
13209 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13210 #endif | |
13211 ) { | |
13212 PyObject *__pyx_v_self = 0; | |
13213 PyObject *__pyx_v__copy = 0; | |
13214 PyObject *__pyx_v_reference = 0; | |
13215 PyObject *__pyx_v_regions = 0; | |
13216 PyObject *__pyx_v_lines = 0; | |
13217 PyObject *__pyx_v_leftalign = 0; | |
13218 #if !CYTHON_METH_FASTCALL | |
13219 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
13220 #endif | |
13221 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13222 PyObject* values[6] = {0,0,0,0,0,0}; | |
13223 int __pyx_lineno = 0; | |
13224 const char *__pyx_filename = NULL; | |
13225 int __pyx_clineno = 0; | |
13226 PyObject *__pyx_r = 0; | |
13227 __Pyx_RefNannyDeclarations | |
13228 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
13229 #if !CYTHON_METH_FASTCALL | |
13230 #if CYTHON_ASSUME_SAFE_MACROS | |
13231 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
13232 #else | |
13233 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
13234 #endif | |
13235 #endif | |
13236 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
13237 { | |
13238 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_copy,&__pyx_n_s_reference,&__pyx_n_s_regions,&__pyx_n_s_lines,&__pyx_n_s_leftalign,0}; | |
13239 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
13240 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
13241 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
13242 | |
13243 /* "pysam/libcvcf.pyx":331 | |
13244 * | |
13245 * def __init__(self, _copy=None, reference=None, regions=None, | |
13246 * lines=None, leftalign=False): # <<<<<<<<<<<<<< | |
13247 * # make error identifiers accessible by name | |
13248 * for id in self._errors.keys(): | |
13249 */ | |
13250 values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
13251 values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); | |
13252 if (__pyx_kwds) { | |
13253 Py_ssize_t kw_args; | |
13254 switch (__pyx_nargs) { | |
13255 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
13256 CYTHON_FALLTHROUGH; | |
13257 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
13258 CYTHON_FALLTHROUGH; | |
13259 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
13260 CYTHON_FALLTHROUGH; | |
13261 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
13262 CYTHON_FALLTHROUGH; | |
13263 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
13264 CYTHON_FALLTHROUGH; | |
13265 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
13266 CYTHON_FALLTHROUGH; | |
13267 case 0: break; | |
13268 default: goto __pyx_L5_argtuple_error; | |
13269 } | |
13270 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
13271 switch (__pyx_nargs) { | |
13272 case 0: | |
13273 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
13274 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
13275 kw_args--; | |
13276 } | |
13277 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) | |
13278 else goto __pyx_L5_argtuple_error; | |
13279 CYTHON_FALLTHROUGH; | |
13280 case 1: | |
13281 if (kw_args > 0) { | |
13282 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_copy); | |
13283 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
13284 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) | |
13285 } | |
13286 CYTHON_FALLTHROUGH; | |
13287 case 2: | |
13288 if (kw_args > 0) { | |
13289 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reference); | |
13290 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
13291 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) | |
13292 } | |
13293 CYTHON_FALLTHROUGH; | |
13294 case 3: | |
13295 if (kw_args > 0) { | |
13296 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_regions); | |
13297 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
13298 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) | |
13299 } | |
13300 CYTHON_FALLTHROUGH; | |
13301 case 4: | |
13302 if (kw_args > 0) { | |
13303 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lines); | |
13304 if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
13305 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) | |
13306 } | |
13307 CYTHON_FALLTHROUGH; | |
13308 case 5: | |
13309 if (kw_args > 0) { | |
13310 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_leftalign); | |
13311 if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
13312 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error) | |
13313 } | |
13314 } | |
13315 if (unlikely(kw_args > 0)) { | |
13316 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
13317 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 330, __pyx_L3_error) | |
13318 } | |
13319 } else { | |
13320 switch (__pyx_nargs) { | |
13321 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
13322 CYTHON_FALLTHROUGH; | |
13323 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
13324 CYTHON_FALLTHROUGH; | |
13325 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
13326 CYTHON_FALLTHROUGH; | |
13327 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
13328 CYTHON_FALLTHROUGH; | |
13329 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
13330 CYTHON_FALLTHROUGH; | |
13331 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
13332 break; | |
13333 default: goto __pyx_L5_argtuple_error; | |
13334 } | |
13335 } | |
13336 __pyx_v_self = values[0]; | |
13337 __pyx_v__copy = values[1]; | |
13338 __pyx_v_reference = values[2]; | |
13339 __pyx_v_regions = values[3]; | |
13340 __pyx_v_lines = values[4]; | |
13341 __pyx_v_leftalign = values[5]; | |
13342 } | |
13343 goto __pyx_L6_skip; | |
13344 __pyx_L5_argtuple_error:; | |
13345 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 330, __pyx_L3_error) | |
13346 __pyx_L6_skip:; | |
13347 goto __pyx_L4_argument_unpacking_done; | |
13348 __pyx_L3_error:; | |
13349 { | |
13350 Py_ssize_t __pyx_temp; | |
13351 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
13352 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
13353 } | |
13354 } | |
13355 __Pyx_AddTraceback("pysam.libcvcf.VCF.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13356 __Pyx_RefNannyFinishContext(); | |
13357 return NULL; | |
13358 __pyx_L4_argument_unpacking_done:; | |
13359 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF___init__(__pyx_self, __pyx_v_self, __pyx_v__copy, __pyx_v_reference, __pyx_v_regions, __pyx_v_lines, __pyx_v_leftalign); | |
13360 | |
13361 /* "pysam/libcvcf.pyx":330 | |
13362 * _lines = None | |
13363 * | |
13364 * def __init__(self, _copy=None, reference=None, regions=None, # <<<<<<<<<<<<<< | |
13365 * lines=None, leftalign=False): | |
13366 * # make error identifiers accessible by name | |
13367 */ | |
13368 | |
13369 /* function exit code */ | |
13370 { | |
13371 Py_ssize_t __pyx_temp; | |
13372 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
13373 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
13374 } | |
13375 } | |
13376 __Pyx_RefNannyFinishContext(); | |
13377 return __pyx_r; | |
13378 } | |
13379 | |
13380 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v__copy, PyObject *__pyx_v_reference, PyObject *__pyx_v_regions, PyObject *__pyx_v_lines, PyObject *__pyx_v_leftalign) { | |
13381 PyObject *__pyx_v_id = NULL; | |
13382 PyObject *__pyx_r = NULL; | |
13383 __Pyx_RefNannyDeclarations | |
13384 PyObject *__pyx_t_1 = NULL; | |
13385 Py_ssize_t __pyx_t_2; | |
13386 Py_ssize_t __pyx_t_3; | |
13387 int __pyx_t_4; | |
13388 PyObject *__pyx_t_5 = NULL; | |
13389 PyObject *__pyx_t_6 = NULL; | |
13390 int __pyx_t_7; | |
13391 PyObject *__pyx_t_8 = NULL; | |
13392 PyObject *__pyx_t_9 = NULL; | |
13393 unsigned int __pyx_t_10; | |
13394 int __pyx_t_11; | |
13395 int __pyx_lineno = 0; | |
13396 const char *__pyx_filename = NULL; | |
13397 int __pyx_clineno = 0; | |
13398 __Pyx_RefNannySetupContext("__init__", 1); | |
13399 | |
13400 /* "pysam/libcvcf.pyx":333 | |
13401 * lines=None, leftalign=False): | |
13402 * # make error identifiers accessible by name | |
13403 * for id in self._errors.keys(): # <<<<<<<<<<<<<< | |
13404 * self.__dict__[self._errors[id].split(':')[0]] = id | |
13405 * if _copy != None: | |
13406 */ | |
13407 __pyx_t_2 = 0; | |
13408 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) | |
13409 __Pyx_GOTREF(__pyx_t_5); | |
13410 if (unlikely(__pyx_t_5 == Py_None)) { | |
13411 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); | |
13412 __PYX_ERR(0, 333, __pyx_L1_error) | |
13413 } | |
13414 __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error) | |
13415 __Pyx_GOTREF(__pyx_t_6); | |
13416 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13417 __Pyx_XDECREF(__pyx_t_1); | |
13418 __pyx_t_1 = __pyx_t_6; | |
13419 __pyx_t_6 = 0; | |
13420 while (1) { | |
13421 __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, NULL, NULL, __pyx_t_4); | |
13422 if (unlikely(__pyx_t_7 == 0)) break; | |
13423 if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 333, __pyx_L1_error) | |
13424 __Pyx_GOTREF(__pyx_t_6); | |
13425 __Pyx_XDECREF_SET(__pyx_v_id, __pyx_t_6); | |
13426 __pyx_t_6 = 0; | |
13427 | |
13428 /* "pysam/libcvcf.pyx":334 | |
13429 * # make error identifiers accessible by name | |
13430 * for id in self._errors.keys(): | |
13431 * self.__dict__[self._errors[id].split(':')[0]] = id # <<<<<<<<<<<<<< | |
13432 * if _copy != None: | |
13433 * self._leftalign = _copy._leftalign | |
13434 */ | |
13435 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) | |
13436 __Pyx_GOTREF(__pyx_t_6); | |
13437 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errors); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) | |
13438 __Pyx_GOTREF(__pyx_t_8); | |
13439 __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_id); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 334, __pyx_L1_error) | |
13440 __Pyx_GOTREF(__pyx_t_9); | |
13441 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13442 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) | |
13443 __Pyx_GOTREF(__pyx_t_8); | |
13444 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
13445 __pyx_t_9 = NULL; | |
13446 __pyx_t_10 = 0; | |
13447 #if CYTHON_UNPACK_METHODS | |
13448 if (likely(PyMethod_Check(__pyx_t_8))) { | |
13449 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); | |
13450 if (likely(__pyx_t_9)) { | |
13451 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); | |
13452 __Pyx_INCREF(__pyx_t_9); | |
13453 __Pyx_INCREF(function); | |
13454 __Pyx_DECREF_SET(__pyx_t_8, function); | |
13455 __pyx_t_10 = 1; | |
13456 } | |
13457 } | |
13458 #endif | |
13459 { | |
13460 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u__3}; | |
13461 __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
13462 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
13463 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) | |
13464 __Pyx_GOTREF(__pyx_t_5); | |
13465 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13466 } | |
13467 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) | |
13468 __Pyx_GOTREF(__pyx_t_8); | |
13469 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13470 if (unlikely((PyObject_SetItem(__pyx_t_6, __pyx_t_8, __pyx_v_id) < 0))) __PYX_ERR(0, 334, __pyx_L1_error) | |
13471 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13472 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13473 } | |
13474 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13475 | |
13476 /* "pysam/libcvcf.pyx":335 | |
13477 * for id in self._errors.keys(): | |
13478 * self.__dict__[self._errors[id].split(':')[0]] = id | |
13479 * if _copy != None: # <<<<<<<<<<<<<< | |
13480 * self._leftalign = _copy._leftalign | |
13481 * self._header = _copy._header[:] | |
13482 */ | |
13483 __pyx_t_1 = PyObject_RichCompare(__pyx_v__copy, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) | |
13484 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 335, __pyx_L1_error) | |
13485 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13486 if (__pyx_t_11) { | |
13487 | |
13488 /* "pysam/libcvcf.pyx":336 | |
13489 * self.__dict__[self._errors[id].split(':')[0]] = id | |
13490 * if _copy != None: | |
13491 * self._leftalign = _copy._leftalign # <<<<<<<<<<<<<< | |
13492 * self._header = _copy._header[:] | |
13493 * self._version = _copy._version | |
13494 */ | |
13495 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_leftalign_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) | |
13496 __Pyx_GOTREF(__pyx_t_1); | |
13497 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_leftalign_2, __pyx_t_1) < 0) __PYX_ERR(0, 336, __pyx_L1_error) | |
13498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13499 | |
13500 /* "pysam/libcvcf.pyx":337 | |
13501 * if _copy != None: | |
13502 * self._leftalign = _copy._leftalign | |
13503 * self._header = _copy._header[:] # <<<<<<<<<<<<<< | |
13504 * self._version = _copy._version | |
13505 * self._info = copy.deepcopy(_copy._info) | |
13506 */ | |
13507 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) | |
13508 __Pyx_GOTREF(__pyx_t_1); | |
13509 __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_slice__9, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error) | |
13510 __Pyx_GOTREF(__pyx_t_8); | |
13511 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13512 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header, __pyx_t_8) < 0) __PYX_ERR(0, 337, __pyx_L1_error) | |
13513 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13514 | |
13515 /* "pysam/libcvcf.pyx":338 | |
13516 * self._leftalign = _copy._leftalign | |
13517 * self._header = _copy._header[:] | |
13518 * self._version = _copy._version # <<<<<<<<<<<<<< | |
13519 * self._info = copy.deepcopy(_copy._info) | |
13520 * self._filter = copy.deepcopy(_copy._filter) | |
13521 */ | |
13522 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_version); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 338, __pyx_L1_error) | |
13523 __Pyx_GOTREF(__pyx_t_8); | |
13524 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_t_8) < 0) __PYX_ERR(0, 338, __pyx_L1_error) | |
13525 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13526 | |
13527 /* "pysam/libcvcf.pyx":339 | |
13528 * self._header = _copy._header[:] | |
13529 * self._version = _copy._version | |
13530 * self._info = copy.deepcopy(_copy._info) # <<<<<<<<<<<<<< | |
13531 * self._filter = copy.deepcopy(_copy._filter) | |
13532 * self._format = copy.deepcopy(_copy._format) | |
13533 */ | |
13534 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) | |
13535 __Pyx_GOTREF(__pyx_t_1); | |
13536 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) | |
13537 __Pyx_GOTREF(__pyx_t_6); | |
13538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13539 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) | |
13540 __Pyx_GOTREF(__pyx_t_1); | |
13541 __pyx_t_5 = NULL; | |
13542 __pyx_t_10 = 0; | |
13543 #if CYTHON_UNPACK_METHODS | |
13544 if (unlikely(PyMethod_Check(__pyx_t_6))) { | |
13545 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); | |
13546 if (likely(__pyx_t_5)) { | |
13547 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
13548 __Pyx_INCREF(__pyx_t_5); | |
13549 __Pyx_INCREF(function); | |
13550 __Pyx_DECREF_SET(__pyx_t_6, function); | |
13551 __pyx_t_10 = 1; | |
13552 } | |
13553 } | |
13554 #endif | |
13555 { | |
13556 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; | |
13557 __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
13558 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13559 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13560 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 339, __pyx_L1_error) | |
13561 __Pyx_GOTREF(__pyx_t_8); | |
13562 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13563 } | |
13564 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_info, __pyx_t_8) < 0) __PYX_ERR(0, 339, __pyx_L1_error) | |
13565 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13566 | |
13567 /* "pysam/libcvcf.pyx":340 | |
13568 * self._version = _copy._version | |
13569 * self._info = copy.deepcopy(_copy._info) | |
13570 * self._filter = copy.deepcopy(_copy._filter) # <<<<<<<<<<<<<< | |
13571 * self._format = copy.deepcopy(_copy._format) | |
13572 * self._samples = _copy._samples[:] | |
13573 */ | |
13574 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) | |
13575 __Pyx_GOTREF(__pyx_t_6); | |
13576 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) | |
13577 __Pyx_GOTREF(__pyx_t_1); | |
13578 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13579 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_filter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) | |
13580 __Pyx_GOTREF(__pyx_t_6); | |
13581 __pyx_t_5 = NULL; | |
13582 __pyx_t_10 = 0; | |
13583 #if CYTHON_UNPACK_METHODS | |
13584 if (unlikely(PyMethod_Check(__pyx_t_1))) { | |
13585 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); | |
13586 if (likely(__pyx_t_5)) { | |
13587 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
13588 __Pyx_INCREF(__pyx_t_5); | |
13589 __Pyx_INCREF(function); | |
13590 __Pyx_DECREF_SET(__pyx_t_1, function); | |
13591 __pyx_t_10 = 1; | |
13592 } | |
13593 } | |
13594 #endif | |
13595 { | |
13596 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; | |
13597 __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
13598 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13599 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13600 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) | |
13601 __Pyx_GOTREF(__pyx_t_8); | |
13602 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13603 } | |
13604 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_filter, __pyx_t_8) < 0) __PYX_ERR(0, 340, __pyx_L1_error) | |
13605 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13606 | |
13607 /* "pysam/libcvcf.pyx":341 | |
13608 * self._info = copy.deepcopy(_copy._info) | |
13609 * self._filter = copy.deepcopy(_copy._filter) | |
13610 * self._format = copy.deepcopy(_copy._format) # <<<<<<<<<<<<<< | |
13611 * self._samples = _copy._samples[:] | |
13612 * self._sample2column = copy.deepcopy(_copy._sample2column) | |
13613 */ | |
13614 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) | |
13615 __Pyx_GOTREF(__pyx_t_1); | |
13616 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) | |
13617 __Pyx_GOTREF(__pyx_t_6); | |
13618 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13619 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_format_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) | |
13620 __Pyx_GOTREF(__pyx_t_1); | |
13621 __pyx_t_5 = NULL; | |
13622 __pyx_t_10 = 0; | |
13623 #if CYTHON_UNPACK_METHODS | |
13624 if (unlikely(PyMethod_Check(__pyx_t_6))) { | |
13625 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); | |
13626 if (likely(__pyx_t_5)) { | |
13627 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
13628 __Pyx_INCREF(__pyx_t_5); | |
13629 __Pyx_INCREF(function); | |
13630 __Pyx_DECREF_SET(__pyx_t_6, function); | |
13631 __pyx_t_10 = 1; | |
13632 } | |
13633 } | |
13634 #endif | |
13635 { | |
13636 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; | |
13637 __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
13638 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13639 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13640 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __pyx_L1_error) | |
13641 __Pyx_GOTREF(__pyx_t_8); | |
13642 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13643 } | |
13644 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_format_2, __pyx_t_8) < 0) __PYX_ERR(0, 341, __pyx_L1_error) | |
13645 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13646 | |
13647 /* "pysam/libcvcf.pyx":342 | |
13648 * self._filter = copy.deepcopy(_copy._filter) | |
13649 * self._format = copy.deepcopy(_copy._format) | |
13650 * self._samples = _copy._samples[:] # <<<<<<<<<<<<<< | |
13651 * self._sample2column = copy.deepcopy(_copy._sample2column) | |
13652 * self._ignored_errors = copy.deepcopy(_copy._ignored_errors) | |
13653 */ | |
13654 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_samples); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __pyx_L1_error) | |
13655 __Pyx_GOTREF(__pyx_t_8); | |
13656 __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, NULL, NULL, &__pyx_slice__9, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) | |
13657 __Pyx_GOTREF(__pyx_t_6); | |
13658 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13659 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_samples, __pyx_t_6) < 0) __PYX_ERR(0, 342, __pyx_L1_error) | |
13660 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13661 | |
13662 /* "pysam/libcvcf.pyx":343 | |
13663 * self._format = copy.deepcopy(_copy._format) | |
13664 * self._samples = _copy._samples[:] | |
13665 * self._sample2column = copy.deepcopy(_copy._sample2column) # <<<<<<<<<<<<<< | |
13666 * self._ignored_errors = copy.deepcopy(_copy._ignored_errors) | |
13667 * self._warn_errors = copy.deepcopy(_copy._warn_errors) | |
13668 */ | |
13669 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error) | |
13670 __Pyx_GOTREF(__pyx_t_8); | |
13671 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) | |
13672 __Pyx_GOTREF(__pyx_t_1); | |
13673 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13674 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_sample2column); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error) | |
13675 __Pyx_GOTREF(__pyx_t_8); | |
13676 __pyx_t_5 = NULL; | |
13677 __pyx_t_10 = 0; | |
13678 #if CYTHON_UNPACK_METHODS | |
13679 if (unlikely(PyMethod_Check(__pyx_t_1))) { | |
13680 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); | |
13681 if (likely(__pyx_t_5)) { | |
13682 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
13683 __Pyx_INCREF(__pyx_t_5); | |
13684 __Pyx_INCREF(function); | |
13685 __Pyx_DECREF_SET(__pyx_t_1, function); | |
13686 __pyx_t_10 = 1; | |
13687 } | |
13688 } | |
13689 #endif | |
13690 { | |
13691 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8}; | |
13692 __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
13693 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13694 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13695 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error) | |
13696 __Pyx_GOTREF(__pyx_t_6); | |
13697 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13698 } | |
13699 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sample2column, __pyx_t_6) < 0) __PYX_ERR(0, 343, __pyx_L1_error) | |
13700 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13701 | |
13702 /* "pysam/libcvcf.pyx":344 | |
13703 * self._samples = _copy._samples[:] | |
13704 * self._sample2column = copy.deepcopy(_copy._sample2column) | |
13705 * self._ignored_errors = copy.deepcopy(_copy._ignored_errors) # <<<<<<<<<<<<<< | |
13706 * self._warn_errors = copy.deepcopy(_copy._warn_errors) | |
13707 * self._reference = _copy._reference | |
13708 */ | |
13709 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) | |
13710 __Pyx_GOTREF(__pyx_t_1); | |
13711 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error) | |
13712 __Pyx_GOTREF(__pyx_t_8); | |
13713 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13714 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_ignored_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) | |
13715 __Pyx_GOTREF(__pyx_t_1); | |
13716 __pyx_t_5 = NULL; | |
13717 __pyx_t_10 = 0; | |
13718 #if CYTHON_UNPACK_METHODS | |
13719 if (unlikely(PyMethod_Check(__pyx_t_8))) { | |
13720 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); | |
13721 if (likely(__pyx_t_5)) { | |
13722 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); | |
13723 __Pyx_INCREF(__pyx_t_5); | |
13724 __Pyx_INCREF(function); | |
13725 __Pyx_DECREF_SET(__pyx_t_8, function); | |
13726 __pyx_t_10 = 1; | |
13727 } | |
13728 } | |
13729 #endif | |
13730 { | |
13731 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; | |
13732 __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
13733 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13735 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error) | |
13736 __Pyx_GOTREF(__pyx_t_6); | |
13737 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13738 } | |
13739 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ignored_errors, __pyx_t_6) < 0) __PYX_ERR(0, 344, __pyx_L1_error) | |
13740 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13741 | |
13742 /* "pysam/libcvcf.pyx":345 | |
13743 * self._sample2column = copy.deepcopy(_copy._sample2column) | |
13744 * self._ignored_errors = copy.deepcopy(_copy._ignored_errors) | |
13745 * self._warn_errors = copy.deepcopy(_copy._warn_errors) # <<<<<<<<<<<<<< | |
13746 * self._reference = _copy._reference | |
13747 * self._regions = _copy._regions | |
13748 */ | |
13749 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 345, __pyx_L1_error) | |
13750 __Pyx_GOTREF(__pyx_t_8); | |
13751 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) | |
13752 __Pyx_GOTREF(__pyx_t_1); | |
13753 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13754 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_warn_errors); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 345, __pyx_L1_error) | |
13755 __Pyx_GOTREF(__pyx_t_8); | |
13756 __pyx_t_5 = NULL; | |
13757 __pyx_t_10 = 0; | |
13758 #if CYTHON_UNPACK_METHODS | |
13759 if (unlikely(PyMethod_Check(__pyx_t_1))) { | |
13760 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); | |
13761 if (likely(__pyx_t_5)) { | |
13762 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
13763 __Pyx_INCREF(__pyx_t_5); | |
13764 __Pyx_INCREF(function); | |
13765 __Pyx_DECREF_SET(__pyx_t_1, function); | |
13766 __pyx_t_10 = 1; | |
13767 } | |
13768 } | |
13769 #endif | |
13770 { | |
13771 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8}; | |
13772 __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
13773 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13774 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
13775 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error) | |
13776 __Pyx_GOTREF(__pyx_t_6); | |
13777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13778 } | |
13779 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_warn_errors, __pyx_t_6) < 0) __PYX_ERR(0, 345, __pyx_L1_error) | |
13780 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13781 | |
13782 /* "pysam/libcvcf.pyx":346 | |
13783 * self._ignored_errors = copy.deepcopy(_copy._ignored_errors) | |
13784 * self._warn_errors = copy.deepcopy(_copy._warn_errors) | |
13785 * self._reference = _copy._reference # <<<<<<<<<<<<<< | |
13786 * self._regions = _copy._regions | |
13787 * if reference: self._reference = reference | |
13788 */ | |
13789 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) | |
13790 __Pyx_GOTREF(__pyx_t_6); | |
13791 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reference_2, __pyx_t_6) < 0) __PYX_ERR(0, 346, __pyx_L1_error) | |
13792 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13793 | |
13794 /* "pysam/libcvcf.pyx":347 | |
13795 * self._warn_errors = copy.deepcopy(_copy._warn_errors) | |
13796 * self._reference = _copy._reference | |
13797 * self._regions = _copy._regions # <<<<<<<<<<<<<< | |
13798 * if reference: self._reference = reference | |
13799 * if regions: self._regions = regions | |
13800 */ | |
13801 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_regions_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error) | |
13802 __Pyx_GOTREF(__pyx_t_6); | |
13803 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_regions_2, __pyx_t_6) < 0) __PYX_ERR(0, 347, __pyx_L1_error) | |
13804 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
13805 | |
13806 /* "pysam/libcvcf.pyx":335 | |
13807 * for id in self._errors.keys(): | |
13808 * self.__dict__[self._errors[id].split(':')[0]] = id | |
13809 * if _copy != None: # <<<<<<<<<<<<<< | |
13810 * self._leftalign = _copy._leftalign | |
13811 * self._header = _copy._header[:] | |
13812 */ | |
13813 } | |
13814 | |
13815 /* "pysam/libcvcf.pyx":348 | |
13816 * self._reference = _copy._reference | |
13817 * self._regions = _copy._regions | |
13818 * if reference: self._reference = reference # <<<<<<<<<<<<<< | |
13819 * if regions: self._regions = regions | |
13820 * if leftalign: self._leftalign = leftalign | |
13821 */ | |
13822 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_reference); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) | |
13823 if (__pyx_t_11) { | |
13824 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reference_2, __pyx_v_reference) < 0) __PYX_ERR(0, 348, __pyx_L1_error) | |
13825 } | |
13826 | |
13827 /* "pysam/libcvcf.pyx":349 | |
13828 * self._regions = _copy._regions | |
13829 * if reference: self._reference = reference | |
13830 * if regions: self._regions = regions # <<<<<<<<<<<<<< | |
13831 * if leftalign: self._leftalign = leftalign | |
13832 * self._lines = lines | |
13833 */ | |
13834 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_regions); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) | |
13835 if (__pyx_t_11) { | |
13836 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_regions_2, __pyx_v_regions) < 0) __PYX_ERR(0, 349, __pyx_L1_error) | |
13837 } | |
13838 | |
13839 /* "pysam/libcvcf.pyx":350 | |
13840 * if reference: self._reference = reference | |
13841 * if regions: self._regions = regions | |
13842 * if leftalign: self._leftalign = leftalign # <<<<<<<<<<<<<< | |
13843 * self._lines = lines | |
13844 * self.encoding = "ascii" | |
13845 */ | |
13846 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_leftalign); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) | |
13847 if (__pyx_t_11) { | |
13848 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_leftalign_2, __pyx_v_leftalign) < 0) __PYX_ERR(0, 350, __pyx_L1_error) | |
13849 } | |
13850 | |
13851 /* "pysam/libcvcf.pyx":351 | |
13852 * if regions: self._regions = regions | |
13853 * if leftalign: self._leftalign = leftalign | |
13854 * self._lines = lines # <<<<<<<<<<<<<< | |
13855 * self.encoding = "ascii" | |
13856 * self.tabixfile = None | |
13857 */ | |
13858 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lines_2, __pyx_v_lines) < 0) __PYX_ERR(0, 351, __pyx_L1_error) | |
13859 | |
13860 /* "pysam/libcvcf.pyx":352 | |
13861 * if leftalign: self._leftalign = leftalign | |
13862 * self._lines = lines | |
13863 * self.encoding = "ascii" # <<<<<<<<<<<<<< | |
13864 * self.tabixfile = None | |
13865 * | |
13866 */ | |
13867 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_encoding, __pyx_n_u_ascii) < 0) __PYX_ERR(0, 352, __pyx_L1_error) | |
13868 | |
13869 /* "pysam/libcvcf.pyx":353 | |
13870 * self._lines = lines | |
13871 * self.encoding = "ascii" | |
13872 * self.tabixfile = None # <<<<<<<<<<<<<< | |
13873 * | |
13874 * def error(self,line,error,opt=None): | |
13875 */ | |
13876 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile, Py_None) < 0) __PYX_ERR(0, 353, __pyx_L1_error) | |
13877 | |
13878 /* "pysam/libcvcf.pyx":330 | |
13879 * _lines = None | |
13880 * | |
13881 * def __init__(self, _copy=None, reference=None, regions=None, # <<<<<<<<<<<<<< | |
13882 * lines=None, leftalign=False): | |
13883 * # make error identifiers accessible by name | |
13884 */ | |
13885 | |
13886 /* function exit code */ | |
13887 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
13888 goto __pyx_L0; | |
13889 __pyx_L1_error:; | |
13890 __Pyx_XDECREF(__pyx_t_1); | |
13891 __Pyx_XDECREF(__pyx_t_5); | |
13892 __Pyx_XDECREF(__pyx_t_6); | |
13893 __Pyx_XDECREF(__pyx_t_8); | |
13894 __Pyx_XDECREF(__pyx_t_9); | |
13895 __Pyx_AddTraceback("pysam.libcvcf.VCF.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13896 __pyx_r = NULL; | |
13897 __pyx_L0:; | |
13898 __Pyx_XDECREF(__pyx_v_id); | |
13899 __Pyx_XGIVEREF(__pyx_r); | |
13900 __Pyx_RefNannyFinishContext(); | |
13901 return __pyx_r; | |
13902 } | |
13903 | |
13904 /* "pysam/libcvcf.pyx":355 | |
13905 * self.tabixfile = None | |
13906 * | |
13907 * def error(self,line,error,opt=None): # <<<<<<<<<<<<<< | |
13908 * if error in self._ignored_errors: return | |
13909 * errorlabel, errorstring = self._errors[error].split(':') | |
13910 */ | |
13911 | |
13912 /* Python wrapper */ | |
13913 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_3error(PyObject *__pyx_self, | |
13914 #if CYTHON_METH_FASTCALL | |
13915 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13916 #else | |
13917 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13918 #endif | |
13919 ); /*proto*/ | |
13920 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_2error, "VCF.error(self, line, error, opt=None)"); | |
13921 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_3error = {"error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_3error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_2error}; | |
13922 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_3error(PyObject *__pyx_self, | |
13923 #if CYTHON_METH_FASTCALL | |
13924 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13925 #else | |
13926 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13927 #endif | |
13928 ) { | |
13929 PyObject *__pyx_v_self = 0; | |
13930 PyObject *__pyx_v_line = 0; | |
13931 PyObject *__pyx_v_error = 0; | |
13932 PyObject *__pyx_v_opt = 0; | |
13933 #if !CYTHON_METH_FASTCALL | |
13934 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
13935 #endif | |
13936 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13937 PyObject* values[4] = {0,0,0,0}; | |
13938 int __pyx_lineno = 0; | |
13939 const char *__pyx_filename = NULL; | |
13940 int __pyx_clineno = 0; | |
13941 PyObject *__pyx_r = 0; | |
13942 __Pyx_RefNannyDeclarations | |
13943 __Pyx_RefNannySetupContext("error (wrapper)", 0); | |
13944 #if !CYTHON_METH_FASTCALL | |
13945 #if CYTHON_ASSUME_SAFE_MACROS | |
13946 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
13947 #else | |
13948 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
13949 #endif | |
13950 #endif | |
13951 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
13952 { | |
13953 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,&__pyx_n_s_error,&__pyx_n_s_opt,0}; | |
13954 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
13955 if (__pyx_kwds) { | |
13956 Py_ssize_t kw_args; | |
13957 switch (__pyx_nargs) { | |
13958 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
13959 CYTHON_FALLTHROUGH; | |
13960 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
13961 CYTHON_FALLTHROUGH; | |
13962 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
13963 CYTHON_FALLTHROUGH; | |
13964 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
13965 CYTHON_FALLTHROUGH; | |
13966 case 0: break; | |
13967 default: goto __pyx_L5_argtuple_error; | |
13968 } | |
13969 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
13970 switch (__pyx_nargs) { | |
13971 case 0: | |
13972 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
13973 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
13974 kw_args--; | |
13975 } | |
13976 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) | |
13977 else goto __pyx_L5_argtuple_error; | |
13978 CYTHON_FALLTHROUGH; | |
13979 case 1: | |
13980 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line)) != 0)) { | |
13981 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
13982 kw_args--; | |
13983 } | |
13984 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) | |
13985 else { | |
13986 __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, 1); __PYX_ERR(0, 355, __pyx_L3_error) | |
13987 } | |
13988 CYTHON_FALLTHROUGH; | |
13989 case 2: | |
13990 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_error)) != 0)) { | |
13991 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
13992 kw_args--; | |
13993 } | |
13994 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) | |
13995 else { | |
13996 __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, 2); __PYX_ERR(0, 355, __pyx_L3_error) | |
13997 } | |
13998 CYTHON_FALLTHROUGH; | |
13999 case 3: | |
14000 if (kw_args > 0) { | |
14001 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_opt); | |
14002 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
14003 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) | |
14004 } | |
14005 } | |
14006 if (unlikely(kw_args > 0)) { | |
14007 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
14008 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "error") < 0)) __PYX_ERR(0, 355, __pyx_L3_error) | |
14009 } | |
14010 } else { | |
14011 switch (__pyx_nargs) { | |
14012 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
14013 CYTHON_FALLTHROUGH; | |
14014 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
14015 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
14016 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
14017 break; | |
14018 default: goto __pyx_L5_argtuple_error; | |
14019 } | |
14020 } | |
14021 __pyx_v_self = values[0]; | |
14022 __pyx_v_line = values[1]; | |
14023 __pyx_v_error = values[2]; | |
14024 __pyx_v_opt = values[3]; | |
14025 } | |
14026 goto __pyx_L6_skip; | |
14027 __pyx_L5_argtuple_error:; | |
14028 __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 355, __pyx_L3_error) | |
14029 __pyx_L6_skip:; | |
14030 goto __pyx_L4_argument_unpacking_done; | |
14031 __pyx_L3_error:; | |
14032 { | |
14033 Py_ssize_t __pyx_temp; | |
14034 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14035 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
14036 } | |
14037 } | |
14038 __Pyx_AddTraceback("pysam.libcvcf.VCF.error", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14039 __Pyx_RefNannyFinishContext(); | |
14040 return NULL; | |
14041 __pyx_L4_argument_unpacking_done:; | |
14042 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_2error(__pyx_self, __pyx_v_self, __pyx_v_line, __pyx_v_error, __pyx_v_opt); | |
14043 | |
14044 /* function exit code */ | |
14045 { | |
14046 Py_ssize_t __pyx_temp; | |
14047 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14048 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
14049 } | |
14050 } | |
14051 __Pyx_RefNannyFinishContext(); | |
14052 return __pyx_r; | |
14053 } | |
14054 | |
14055 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_2error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_error, PyObject *__pyx_v_opt) { | |
14056 PyObject *__pyx_v_errorlabel = NULL; | |
14057 PyObject *__pyx_v_errorstring = NULL; | |
14058 PyObject *__pyx_v_errwarn = NULL; | |
14059 PyObject *__pyx_r = NULL; | |
14060 __Pyx_RefNannyDeclarations | |
14061 PyObject *__pyx_t_1 = NULL; | |
14062 int __pyx_t_2; | |
14063 PyObject *__pyx_t_3 = NULL; | |
14064 PyObject *__pyx_t_4 = NULL; | |
14065 unsigned int __pyx_t_5; | |
14066 PyObject *__pyx_t_6 = NULL; | |
14067 PyObject *(*__pyx_t_7)(PyObject *); | |
14068 Py_ssize_t __pyx_t_8; | |
14069 Py_UCS4 __pyx_t_9; | |
14070 int __pyx_lineno = 0; | |
14071 const char *__pyx_filename = NULL; | |
14072 int __pyx_clineno = 0; | |
14073 __Pyx_RefNannySetupContext("error", 1); | |
14074 | |
14075 /* "pysam/libcvcf.pyx":356 | |
14076 * | |
14077 * def error(self,line,error,opt=None): | |
14078 * if error in self._ignored_errors: return # <<<<<<<<<<<<<< | |
14079 * errorlabel, errorstring = self._errors[error].split(':') | |
14080 * if opt: errorstring = errorstring % opt | |
14081 */ | |
14082 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ignored_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) | |
14083 __Pyx_GOTREF(__pyx_t_1); | |
14084 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_error, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 356, __pyx_L1_error) | |
14085 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14086 if (__pyx_t_2) { | |
14087 __Pyx_XDECREF(__pyx_r); | |
14088 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
14089 goto __pyx_L0; | |
14090 } | |
14091 | |
14092 /* "pysam/libcvcf.pyx":357 | |
14093 * def error(self,line,error,opt=None): | |
14094 * if error in self._ignored_errors: return | |
14095 * errorlabel, errorstring = self._errors[error].split(':') # <<<<<<<<<<<<<< | |
14096 * if opt: errorstring = errorstring % opt | |
14097 * errwarn = ["Error","Warning"][error in self._warn_errors] | |
14098 */ | |
14099 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) | |
14100 __Pyx_GOTREF(__pyx_t_3); | |
14101 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) | |
14102 __Pyx_GOTREF(__pyx_t_4); | |
14103 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14104 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) | |
14105 __Pyx_GOTREF(__pyx_t_3); | |
14106 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14107 __pyx_t_4 = NULL; | |
14108 __pyx_t_5 = 0; | |
14109 #if CYTHON_UNPACK_METHODS | |
14110 if (likely(PyMethod_Check(__pyx_t_3))) { | |
14111 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
14112 if (likely(__pyx_t_4)) { | |
14113 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
14114 __Pyx_INCREF(__pyx_t_4); | |
14115 __Pyx_INCREF(function); | |
14116 __Pyx_DECREF_SET(__pyx_t_3, function); | |
14117 __pyx_t_5 = 1; | |
14118 } | |
14119 } | |
14120 #endif | |
14121 { | |
14122 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__3}; | |
14123 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
14124 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14125 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) | |
14126 __Pyx_GOTREF(__pyx_t_1); | |
14127 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14128 } | |
14129 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { | |
14130 PyObject* sequence = __pyx_t_1; | |
14131 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
14132 if (unlikely(size != 2)) { | |
14133 if (size > 2) __Pyx_RaiseTooManyValuesError(2); | |
14134 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
14135 __PYX_ERR(0, 357, __pyx_L1_error) | |
14136 } | |
14137 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
14138 if (likely(PyTuple_CheckExact(sequence))) { | |
14139 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); | |
14140 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); | |
14141 } else { | |
14142 __pyx_t_3 = PyList_GET_ITEM(sequence, 0); | |
14143 __pyx_t_4 = PyList_GET_ITEM(sequence, 1); | |
14144 } | |
14145 __Pyx_INCREF(__pyx_t_3); | |
14146 __Pyx_INCREF(__pyx_t_4); | |
14147 #else | |
14148 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) | |
14149 __Pyx_GOTREF(__pyx_t_3); | |
14150 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) | |
14151 __Pyx_GOTREF(__pyx_t_4); | |
14152 #endif | |
14153 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14154 } else { | |
14155 Py_ssize_t index = -1; | |
14156 __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) | |
14157 __Pyx_GOTREF(__pyx_t_6); | |
14158 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14159 __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); | |
14160 index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; | |
14161 __Pyx_GOTREF(__pyx_t_3); | |
14162 index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; | |
14163 __Pyx_GOTREF(__pyx_t_4); | |
14164 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 357, __pyx_L1_error) | |
14165 __pyx_t_7 = NULL; | |
14166 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
14167 goto __pyx_L5_unpacking_done; | |
14168 __pyx_L4_unpacking_failed:; | |
14169 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
14170 __pyx_t_7 = NULL; | |
14171 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
14172 __PYX_ERR(0, 357, __pyx_L1_error) | |
14173 __pyx_L5_unpacking_done:; | |
14174 } | |
14175 __pyx_v_errorlabel = __pyx_t_3; | |
14176 __pyx_t_3 = 0; | |
14177 __pyx_v_errorstring = __pyx_t_4; | |
14178 __pyx_t_4 = 0; | |
14179 | |
14180 /* "pysam/libcvcf.pyx":358 | |
14181 * if error in self._ignored_errors: return | |
14182 * errorlabel, errorstring = self._errors[error].split(':') | |
14183 * if opt: errorstring = errorstring % opt # <<<<<<<<<<<<<< | |
14184 * errwarn = ["Error","Warning"][error in self._warn_errors] | |
14185 * errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring) | |
14186 */ | |
14187 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opt); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 358, __pyx_L1_error) | |
14188 if (__pyx_t_2) { | |
14189 __pyx_t_1 = PyNumber_Remainder(__pyx_v_errorstring, __pyx_v_opt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) | |
14190 __Pyx_GOTREF(__pyx_t_1); | |
14191 __Pyx_DECREF_SET(__pyx_v_errorstring, __pyx_t_1); | |
14192 __pyx_t_1 = 0; | |
14193 } | |
14194 | |
14195 /* "pysam/libcvcf.pyx":359 | |
14196 * errorlabel, errorstring = self._errors[error].split(':') | |
14197 * if opt: errorstring = errorstring % opt | |
14198 * errwarn = ["Error","Warning"][error in self._warn_errors] # <<<<<<<<<<<<<< | |
14199 * errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring) | |
14200 * if error in self._warn_errors: return | |
14201 */ | |
14202 __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) | |
14203 __Pyx_GOTREF(__pyx_t_1); | |
14204 __Pyx_INCREF(__pyx_n_u_Error); | |
14205 __Pyx_GIVEREF(__pyx_n_u_Error); | |
14206 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_Error)) __PYX_ERR(0, 359, __pyx_L1_error); | |
14207 __Pyx_INCREF(__pyx_n_u_Warning); | |
14208 __Pyx_GIVEREF(__pyx_n_u_Warning); | |
14209 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_Warning)) __PYX_ERR(0, 359, __pyx_L1_error); | |
14210 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_warn_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) | |
14211 __Pyx_GOTREF(__pyx_t_4); | |
14212 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_error, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 359, __pyx_L1_error) | |
14213 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14214 __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_t_1, __pyx_t_2, int, 1, __Pyx_PyBool_FromLong, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) | |
14215 __Pyx_GOTREF(__pyx_t_4); | |
14216 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14217 __pyx_v_errwarn = __pyx_t_4; | |
14218 __pyx_t_4 = 0; | |
14219 | |
14220 /* "pysam/libcvcf.pyx":360 | |
14221 * if opt: errorstring = errorstring % opt | |
14222 * errwarn = ["Error","Warning"][error in self._warn_errors] | |
14223 * errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring) # <<<<<<<<<<<<<< | |
14224 * if error in self._warn_errors: return | |
14225 * raise ValueError(errorstring) | |
14226 */ | |
14227 __pyx_t_4 = PyTuple_New(11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) | |
14228 __Pyx_GOTREF(__pyx_t_4); | |
14229 __pyx_t_8 = 0; | |
14230 __pyx_t_9 = 127; | |
14231 __Pyx_INCREF(__pyx_kp_u_in_line); | |
14232 __pyx_t_8 += 9; | |
14233 __Pyx_GIVEREF(__pyx_kp_u_in_line); | |
14234 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_in_line); | |
14235 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lineno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) | |
14236 __Pyx_GOTREF(__pyx_t_1); | |
14237 __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) | |
14238 __Pyx_GOTREF(__pyx_t_3); | |
14239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14240 __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_9; | |
14241 __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); | |
14242 __Pyx_GIVEREF(__pyx_t_3); | |
14243 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); | |
14244 __pyx_t_3 = 0; | |
14245 __Pyx_INCREF(__pyx_kp_u__10); | |
14246 __pyx_t_8 += 3; | |
14247 __Pyx_GIVEREF(__pyx_kp_u__10); | |
14248 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__10); | |
14249 __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_line), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) | |
14250 __Pyx_GOTREF(__pyx_t_3); | |
14251 __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_9; | |
14252 __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); | |
14253 __Pyx_GIVEREF(__pyx_t_3); | |
14254 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); | |
14255 __pyx_t_3 = 0; | |
14256 __Pyx_INCREF(__pyx_kp_u__11); | |
14257 __pyx_t_8 += 2; | |
14258 __Pyx_GIVEREF(__pyx_kp_u__11); | |
14259 PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__11); | |
14260 __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_errwarn), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) | |
14261 __Pyx_GOTREF(__pyx_t_3); | |
14262 __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_9; | |
14263 __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); | |
14264 __Pyx_GIVEREF(__pyx_t_3); | |
14265 PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_3); | |
14266 __pyx_t_3 = 0; | |
14267 __Pyx_INCREF(__pyx_kp_u__12); | |
14268 __pyx_t_8 += 1; | |
14269 __Pyx_GIVEREF(__pyx_kp_u__12); | |
14270 PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__12); | |
14271 __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_errorlabel), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) | |
14272 __Pyx_GOTREF(__pyx_t_3); | |
14273 __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_9; | |
14274 __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); | |
14275 __Pyx_GIVEREF(__pyx_t_3); | |
14276 PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_3); | |
14277 __pyx_t_3 = 0; | |
14278 __Pyx_INCREF(__pyx_kp_u__13); | |
14279 __pyx_t_8 += 2; | |
14280 __Pyx_GIVEREF(__pyx_kp_u__13); | |
14281 PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_kp_u__13); | |
14282 __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_errorstring), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) | |
14283 __Pyx_GOTREF(__pyx_t_3); | |
14284 __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_9; | |
14285 __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); | |
14286 __Pyx_GIVEREF(__pyx_t_3); | |
14287 PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_t_3); | |
14288 __pyx_t_3 = 0; | |
14289 __Pyx_INCREF(__pyx_kp_u__14); | |
14290 __pyx_t_8 += 1; | |
14291 __Pyx_GIVEREF(__pyx_kp_u__14); | |
14292 PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_kp_u__14); | |
14293 __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 11, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) | |
14294 __Pyx_GOTREF(__pyx_t_3); | |
14295 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14296 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_errorstring, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) | |
14297 __Pyx_GOTREF(__pyx_t_4); | |
14298 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14299 __Pyx_DECREF_SET(__pyx_v_errorstring, __pyx_t_4); | |
14300 __pyx_t_4 = 0; | |
14301 | |
14302 /* "pysam/libcvcf.pyx":361 | |
14303 * errwarn = ["Error","Warning"][error in self._warn_errors] | |
14304 * errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring) | |
14305 * if error in self._warn_errors: return # <<<<<<<<<<<<<< | |
14306 * raise ValueError(errorstring) | |
14307 * | |
14308 */ | |
14309 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_warn_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) | |
14310 __Pyx_GOTREF(__pyx_t_4); | |
14311 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_error, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 361, __pyx_L1_error) | |
14312 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14313 if (__pyx_t_2) { | |
14314 __Pyx_XDECREF(__pyx_r); | |
14315 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
14316 goto __pyx_L0; | |
14317 } | |
14318 | |
14319 /* "pysam/libcvcf.pyx":362 | |
14320 * errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring) | |
14321 * if error in self._warn_errors: return | |
14322 * raise ValueError(errorstring) # <<<<<<<<<<<<<< | |
14323 * | |
14324 * def parse_format(self,line,format,filter=False): | |
14325 */ | |
14326 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_errorstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L1_error) | |
14327 __Pyx_GOTREF(__pyx_t_4); | |
14328 __Pyx_Raise(__pyx_t_4, 0, 0, 0); | |
14329 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14330 __PYX_ERR(0, 362, __pyx_L1_error) | |
14331 | |
14332 /* "pysam/libcvcf.pyx":355 | |
14333 * self.tabixfile = None | |
14334 * | |
14335 * def error(self,line,error,opt=None): # <<<<<<<<<<<<<< | |
14336 * if error in self._ignored_errors: return | |
14337 * errorlabel, errorstring = self._errors[error].split(':') | |
14338 */ | |
14339 | |
14340 /* function exit code */ | |
14341 __pyx_L1_error:; | |
14342 __Pyx_XDECREF(__pyx_t_1); | |
14343 __Pyx_XDECREF(__pyx_t_3); | |
14344 __Pyx_XDECREF(__pyx_t_4); | |
14345 __Pyx_XDECREF(__pyx_t_6); | |
14346 __Pyx_AddTraceback("pysam.libcvcf.VCF.error", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14347 __pyx_r = NULL; | |
14348 __pyx_L0:; | |
14349 __Pyx_XDECREF(__pyx_v_errorlabel); | |
14350 __Pyx_XDECREF(__pyx_v_errorstring); | |
14351 __Pyx_XDECREF(__pyx_v_errwarn); | |
14352 __Pyx_XGIVEREF(__pyx_r); | |
14353 __Pyx_RefNannyFinishContext(); | |
14354 return __pyx_r; | |
14355 } | |
14356 | |
14357 /* "pysam/libcvcf.pyx":364 | |
14358 * raise ValueError(errorstring) | |
14359 * | |
14360 * def parse_format(self,line,format,filter=False): # <<<<<<<<<<<<<< | |
14361 * if self._version == 40: | |
14362 * if not format.startswith('<'): | |
14363 */ | |
14364 | |
14365 /* Python wrapper */ | |
14366 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_5parse_format(PyObject *__pyx_self, | |
14367 #if CYTHON_METH_FASTCALL | |
14368 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14369 #else | |
14370 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14371 #endif | |
14372 ); /*proto*/ | |
14373 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_4parse_format, "VCF.parse_format(self, line, format, filter=False)"); | |
14374 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_5parse_format = {"parse_format", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_5parse_format, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_4parse_format}; | |
14375 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_5parse_format(PyObject *__pyx_self, | |
14376 #if CYTHON_METH_FASTCALL | |
14377 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14378 #else | |
14379 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14380 #endif | |
14381 ) { | |
14382 PyObject *__pyx_v_self = 0; | |
14383 PyObject *__pyx_v_line = 0; | |
14384 PyObject *__pyx_v_format = 0; | |
14385 PyObject *__pyx_v_filter = 0; | |
14386 #if !CYTHON_METH_FASTCALL | |
14387 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14388 #endif | |
14389 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14390 PyObject* values[4] = {0,0,0,0}; | |
14391 int __pyx_lineno = 0; | |
14392 const char *__pyx_filename = NULL; | |
14393 int __pyx_clineno = 0; | |
14394 PyObject *__pyx_r = 0; | |
14395 __Pyx_RefNannyDeclarations | |
14396 __Pyx_RefNannySetupContext("parse_format (wrapper)", 0); | |
14397 #if !CYTHON_METH_FASTCALL | |
14398 #if CYTHON_ASSUME_SAFE_MACROS | |
14399 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14400 #else | |
14401 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
14402 #endif | |
14403 #endif | |
14404 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
14405 { | |
14406 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,&__pyx_n_s_format,&__pyx_n_s_filter_2,0}; | |
14407 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); | |
14408 if (__pyx_kwds) { | |
14409 Py_ssize_t kw_args; | |
14410 switch (__pyx_nargs) { | |
14411 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
14412 CYTHON_FALLTHROUGH; | |
14413 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
14414 CYTHON_FALLTHROUGH; | |
14415 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
14416 CYTHON_FALLTHROUGH; | |
14417 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
14418 CYTHON_FALLTHROUGH; | |
14419 case 0: break; | |
14420 default: goto __pyx_L5_argtuple_error; | |
14421 } | |
14422 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
14423 switch (__pyx_nargs) { | |
14424 case 0: | |
14425 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
14426 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
14427 kw_args--; | |
14428 } | |
14429 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L3_error) | |
14430 else goto __pyx_L5_argtuple_error; | |
14431 CYTHON_FALLTHROUGH; | |
14432 case 1: | |
14433 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line)) != 0)) { | |
14434 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
14435 kw_args--; | |
14436 } | |
14437 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L3_error) | |
14438 else { | |
14439 __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, 1); __PYX_ERR(0, 364, __pyx_L3_error) | |
14440 } | |
14441 CYTHON_FALLTHROUGH; | |
14442 case 2: | |
14443 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) { | |
14444 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
14445 kw_args--; | |
14446 } | |
14447 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L3_error) | |
14448 else { | |
14449 __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, 2); __PYX_ERR(0, 364, __pyx_L3_error) | |
14450 } | |
14451 CYTHON_FALLTHROUGH; | |
14452 case 3: | |
14453 if (kw_args > 0) { | |
14454 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filter_2); | |
14455 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
14456 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L3_error) | |
14457 } | |
14458 } | |
14459 if (unlikely(kw_args > 0)) { | |
14460 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
14461 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_format") < 0)) __PYX_ERR(0, 364, __pyx_L3_error) | |
14462 } | |
14463 } else { | |
14464 switch (__pyx_nargs) { | |
14465 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
14466 CYTHON_FALLTHROUGH; | |
14467 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
14468 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
14469 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
14470 break; | |
14471 default: goto __pyx_L5_argtuple_error; | |
14472 } | |
14473 } | |
14474 __pyx_v_self = values[0]; | |
14475 __pyx_v_line = values[1]; | |
14476 __pyx_v_format = values[2]; | |
14477 __pyx_v_filter = values[3]; | |
14478 } | |
14479 goto __pyx_L6_skip; | |
14480 __pyx_L5_argtuple_error:; | |
14481 __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 364, __pyx_L3_error) | |
14482 __pyx_L6_skip:; | |
14483 goto __pyx_L4_argument_unpacking_done; | |
14484 __pyx_L3_error:; | |
14485 { | |
14486 Py_ssize_t __pyx_temp; | |
14487 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14488 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
14489 } | |
14490 } | |
14491 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_format", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14492 __Pyx_RefNannyFinishContext(); | |
14493 return NULL; | |
14494 __pyx_L4_argument_unpacking_done:; | |
14495 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_4parse_format(__pyx_self, __pyx_v_self, __pyx_v_line, __pyx_v_format, __pyx_v_filter); | |
14496 | |
14497 /* function exit code */ | |
14498 { | |
14499 Py_ssize_t __pyx_temp; | |
14500 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14501 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
14502 } | |
14503 } | |
14504 __Pyx_RefNannyFinishContext(); | |
14505 return __pyx_r; | |
14506 } | |
14507 | |
14508 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_4parse_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_format, PyObject *__pyx_v_filter) { | |
14509 PyObject *__pyx_v_data = NULL; | |
14510 PyObject *__pyx_v_idx = NULL; | |
14511 PyObject *__pyx_v_elts = NULL; | |
14512 PyObject *__pyx_v_first = NULL; | |
14513 PyObject *__pyx_v_rest = NULL; | |
14514 PyObject *__pyx_v_n = NULL; | |
14515 PyObject *__pyx_v_t = NULL; | |
14516 PyObject *__pyx_r = NULL; | |
14517 __Pyx_RefNannyDeclarations | |
14518 PyObject *__pyx_t_1 = NULL; | |
14519 int __pyx_t_2; | |
14520 PyObject *__pyx_t_3 = NULL; | |
14521 PyObject *__pyx_t_4 = NULL; | |
14522 unsigned int __pyx_t_5; | |
14523 int __pyx_t_6; | |
14524 PyObject *__pyx_t_7 = NULL; | |
14525 Py_ssize_t __pyx_t_8; | |
14526 int __pyx_t_9; | |
14527 PyObject *__pyx_t_10 = NULL; | |
14528 PyObject *__pyx_t_11 = NULL; | |
14529 PyObject *__pyx_t_12 = NULL; | |
14530 PyObject *__pyx_t_13 = NULL; | |
14531 PyObject *__pyx_t_14 = NULL; | |
14532 int __pyx_t_15; | |
14533 PyObject *__pyx_t_16 = NULL; | |
14534 int __pyx_lineno = 0; | |
14535 const char *__pyx_filename = NULL; | |
14536 int __pyx_clineno = 0; | |
14537 __Pyx_RefNannySetupContext("parse_format", 0); | |
14538 __Pyx_INCREF(__pyx_v_format); | |
14539 | |
14540 /* "pysam/libcvcf.pyx":365 | |
14541 * | |
14542 * def parse_format(self,line,format,filter=False): | |
14543 * if self._version == 40: # <<<<<<<<<<<<<< | |
14544 * if not format.startswith('<'): | |
14545 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14546 */ | |
14547 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) | |
14548 __Pyx_GOTREF(__pyx_t_1); | |
14549 __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_40, 40, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 365, __pyx_L1_error) | |
14550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14551 if (__pyx_t_2) { | |
14552 | |
14553 /* "pysam/libcvcf.pyx":366 | |
14554 * def parse_format(self,line,format,filter=False): | |
14555 * if self._version == 40: | |
14556 * if not format.startswith('<'): # <<<<<<<<<<<<<< | |
14557 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14558 * format = "<"+format | |
14559 */ | |
14560 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) | |
14561 __Pyx_GOTREF(__pyx_t_3); | |
14562 __pyx_t_4 = NULL; | |
14563 __pyx_t_5 = 0; | |
14564 #if CYTHON_UNPACK_METHODS | |
14565 if (likely(PyMethod_Check(__pyx_t_3))) { | |
14566 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
14567 if (likely(__pyx_t_4)) { | |
14568 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
14569 __Pyx_INCREF(__pyx_t_4); | |
14570 __Pyx_INCREF(function); | |
14571 __Pyx_DECREF_SET(__pyx_t_3, function); | |
14572 __pyx_t_5 = 1; | |
14573 } | |
14574 } | |
14575 #endif | |
14576 { | |
14577 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__15}; | |
14578 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
14579 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14580 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) | |
14581 __Pyx_GOTREF(__pyx_t_1); | |
14582 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14583 } | |
14584 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 366, __pyx_L1_error) | |
14585 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14586 __pyx_t_6 = (!__pyx_t_2); | |
14587 if (__pyx_t_6) { | |
14588 | |
14589 /* "pysam/libcvcf.pyx":367 | |
14590 * if self._version == 40: | |
14591 * if not format.startswith('<'): | |
14592 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) # <<<<<<<<<<<<<< | |
14593 * format = "<"+format | |
14594 * if not format.endswith('>'): | |
14595 */ | |
14596 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) | |
14597 __Pyx_GOTREF(__pyx_t_3); | |
14598 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V40_MISSING_ANGLE_BRACKETS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __pyx_L1_error) | |
14599 __Pyx_GOTREF(__pyx_t_4); | |
14600 __pyx_t_7 = NULL; | |
14601 __pyx_t_5 = 0; | |
14602 #if CYTHON_UNPACK_METHODS | |
14603 if (likely(PyMethod_Check(__pyx_t_3))) { | |
14604 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); | |
14605 if (likely(__pyx_t_7)) { | |
14606 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
14607 __Pyx_INCREF(__pyx_t_7); | |
14608 __Pyx_INCREF(function); | |
14609 __Pyx_DECREF_SET(__pyx_t_3, function); | |
14610 __pyx_t_5 = 1; | |
14611 } | |
14612 } | |
14613 #endif | |
14614 { | |
14615 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_4}; | |
14616 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
14617 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
14618 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14619 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) | |
14620 __Pyx_GOTREF(__pyx_t_1); | |
14621 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14622 } | |
14623 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14624 | |
14625 /* "pysam/libcvcf.pyx":368 | |
14626 * if not format.startswith('<'): | |
14627 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14628 * format = "<"+format # <<<<<<<<<<<<<< | |
14629 * if not format.endswith('>'): | |
14630 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14631 */ | |
14632 __pyx_t_1 = PyNumber_Add(__pyx_kp_u__15, __pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) | |
14633 __Pyx_GOTREF(__pyx_t_1); | |
14634 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_1); | |
14635 __pyx_t_1 = 0; | |
14636 | |
14637 /* "pysam/libcvcf.pyx":366 | |
14638 * def parse_format(self,line,format,filter=False): | |
14639 * if self._version == 40: | |
14640 * if not format.startswith('<'): # <<<<<<<<<<<<<< | |
14641 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14642 * format = "<"+format | |
14643 */ | |
14644 } | |
14645 | |
14646 /* "pysam/libcvcf.pyx":369 | |
14647 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14648 * format = "<"+format | |
14649 * if not format.endswith('>'): # <<<<<<<<<<<<<< | |
14650 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14651 * format += ">" | |
14652 */ | |
14653 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) | |
14654 __Pyx_GOTREF(__pyx_t_3); | |
14655 __pyx_t_4 = NULL; | |
14656 __pyx_t_5 = 0; | |
14657 #if CYTHON_UNPACK_METHODS | |
14658 if (likely(PyMethod_Check(__pyx_t_3))) { | |
14659 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
14660 if (likely(__pyx_t_4)) { | |
14661 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
14662 __Pyx_INCREF(__pyx_t_4); | |
14663 __Pyx_INCREF(function); | |
14664 __Pyx_DECREF_SET(__pyx_t_3, function); | |
14665 __pyx_t_5 = 1; | |
14666 } | |
14667 } | |
14668 #endif | |
14669 { | |
14670 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__16}; | |
14671 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
14672 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14673 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error) | |
14674 __Pyx_GOTREF(__pyx_t_1); | |
14675 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14676 } | |
14677 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 369, __pyx_L1_error) | |
14678 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14679 __pyx_t_2 = (!__pyx_t_6); | |
14680 if (__pyx_t_2) { | |
14681 | |
14682 /* "pysam/libcvcf.pyx":370 | |
14683 * format = "<"+format | |
14684 * if not format.endswith('>'): | |
14685 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) # <<<<<<<<<<<<<< | |
14686 * format += ">" | |
14687 * format = format[1:-1] | |
14688 */ | |
14689 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) | |
14690 __Pyx_GOTREF(__pyx_t_3); | |
14691 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V40_MISSING_ANGLE_BRACKETS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error) | |
14692 __Pyx_GOTREF(__pyx_t_4); | |
14693 __pyx_t_7 = NULL; | |
14694 __pyx_t_5 = 0; | |
14695 #if CYTHON_UNPACK_METHODS | |
14696 if (likely(PyMethod_Check(__pyx_t_3))) { | |
14697 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); | |
14698 if (likely(__pyx_t_7)) { | |
14699 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
14700 __Pyx_INCREF(__pyx_t_7); | |
14701 __Pyx_INCREF(function); | |
14702 __Pyx_DECREF_SET(__pyx_t_3, function); | |
14703 __pyx_t_5 = 1; | |
14704 } | |
14705 } | |
14706 #endif | |
14707 { | |
14708 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_4}; | |
14709 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
14710 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
14711 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14712 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) | |
14713 __Pyx_GOTREF(__pyx_t_1); | |
14714 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14715 } | |
14716 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14717 | |
14718 /* "pysam/libcvcf.pyx":371 | |
14719 * if not format.endswith('>'): | |
14720 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14721 * format += ">" # <<<<<<<<<<<<<< | |
14722 * format = format[1:-1] | |
14723 * data = {'id':None,'number':None,'type':None,'descr':None} | |
14724 */ | |
14725 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_format, __pyx_kp_u__16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) | |
14726 __Pyx_GOTREF(__pyx_t_1); | |
14727 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_1); | |
14728 __pyx_t_1 = 0; | |
14729 | |
14730 /* "pysam/libcvcf.pyx":369 | |
14731 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14732 * format = "<"+format | |
14733 * if not format.endswith('>'): # <<<<<<<<<<<<<< | |
14734 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14735 * format += ">" | |
14736 */ | |
14737 } | |
14738 | |
14739 /* "pysam/libcvcf.pyx":372 | |
14740 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14741 * format += ">" | |
14742 * format = format[1:-1] # <<<<<<<<<<<<<< | |
14743 * data = {'id':None,'number':None,'type':None,'descr':None} | |
14744 * idx = 0 | |
14745 */ | |
14746 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_format, 1, -1L, NULL, NULL, &__pyx_slice__17, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) | |
14747 __Pyx_GOTREF(__pyx_t_1); | |
14748 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_1); | |
14749 __pyx_t_1 = 0; | |
14750 | |
14751 /* "pysam/libcvcf.pyx":365 | |
14752 * | |
14753 * def parse_format(self,line,format,filter=False): | |
14754 * if self._version == 40: # <<<<<<<<<<<<<< | |
14755 * if not format.startswith('<'): | |
14756 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
14757 */ | |
14758 } | |
14759 | |
14760 /* "pysam/libcvcf.pyx":373 | |
14761 * format += ">" | |
14762 * format = format[1:-1] | |
14763 * data = {'id':None,'number':None,'type':None,'descr':None} # <<<<<<<<<<<<<< | |
14764 * idx = 0 | |
14765 * while len(format.strip())>0: | |
14766 */ | |
14767 __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error) | |
14768 __Pyx_GOTREF(__pyx_t_1); | |
14769 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_id_2, Py_None) < 0) __PYX_ERR(0, 373, __pyx_L1_error) | |
14770 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_number, Py_None) < 0) __PYX_ERR(0, 373, __pyx_L1_error) | |
14771 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_type, Py_None) < 0) __PYX_ERR(0, 373, __pyx_L1_error) | |
14772 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_descr, Py_None) < 0) __PYX_ERR(0, 373, __pyx_L1_error) | |
14773 __pyx_v_data = ((PyObject*)__pyx_t_1); | |
14774 __pyx_t_1 = 0; | |
14775 | |
14776 /* "pysam/libcvcf.pyx":374 | |
14777 * format = format[1:-1] | |
14778 * data = {'id':None,'number':None,'type':None,'descr':None} | |
14779 * idx = 0 # <<<<<<<<<<<<<< | |
14780 * while len(format.strip())>0: | |
14781 * elts = format.strip().split(',') | |
14782 */ | |
14783 __Pyx_INCREF(__pyx_int_0); | |
14784 __pyx_v_idx = __pyx_int_0; | |
14785 | |
14786 /* "pysam/libcvcf.pyx":375 | |
14787 * data = {'id':None,'number':None,'type':None,'descr':None} | |
14788 * idx = 0 | |
14789 * while len(format.strip())>0: # <<<<<<<<<<<<<< | |
14790 * elts = format.strip().split(',') | |
14791 * first, rest = elts[0], ','.join(elts[1:]) | |
14792 */ | |
14793 while (1) { | |
14794 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) | |
14795 __Pyx_GOTREF(__pyx_t_3); | |
14796 __pyx_t_4 = NULL; | |
14797 __pyx_t_5 = 0; | |
14798 #if CYTHON_UNPACK_METHODS | |
14799 if (likely(PyMethod_Check(__pyx_t_3))) { | |
14800 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
14801 if (likely(__pyx_t_4)) { | |
14802 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
14803 __Pyx_INCREF(__pyx_t_4); | |
14804 __Pyx_INCREF(function); | |
14805 __Pyx_DECREF_SET(__pyx_t_3, function); | |
14806 __pyx_t_5 = 1; | |
14807 } | |
14808 } | |
14809 #endif | |
14810 { | |
14811 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; | |
14812 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); | |
14813 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14814 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) | |
14815 __Pyx_GOTREF(__pyx_t_1); | |
14816 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14817 } | |
14818 __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 375, __pyx_L1_error) | |
14819 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14820 __pyx_t_2 = (__pyx_t_8 > 0); | |
14821 if (!__pyx_t_2) break; | |
14822 | |
14823 /* "pysam/libcvcf.pyx":376 | |
14824 * idx = 0 | |
14825 * while len(format.strip())>0: | |
14826 * elts = format.strip().split(',') # <<<<<<<<<<<<<< | |
14827 * first, rest = elts[0], ','.join(elts[1:]) | |
14828 * if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')): | |
14829 */ | |
14830 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_strip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) | |
14831 __Pyx_GOTREF(__pyx_t_4); | |
14832 __pyx_t_7 = NULL; | |
14833 __pyx_t_5 = 0; | |
14834 #if CYTHON_UNPACK_METHODS | |
14835 if (likely(PyMethod_Check(__pyx_t_4))) { | |
14836 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); | |
14837 if (likely(__pyx_t_7)) { | |
14838 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
14839 __Pyx_INCREF(__pyx_t_7); | |
14840 __Pyx_INCREF(function); | |
14841 __Pyx_DECREF_SET(__pyx_t_4, function); | |
14842 __pyx_t_5 = 1; | |
14843 } | |
14844 } | |
14845 #endif | |
14846 { | |
14847 PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; | |
14848 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); | |
14849 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
14850 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) | |
14851 __Pyx_GOTREF(__pyx_t_3); | |
14852 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14853 } | |
14854 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) | |
14855 __Pyx_GOTREF(__pyx_t_4); | |
14856 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14857 __pyx_t_3 = NULL; | |
14858 __pyx_t_5 = 0; | |
14859 #if CYTHON_UNPACK_METHODS | |
14860 if (likely(PyMethod_Check(__pyx_t_4))) { | |
14861 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); | |
14862 if (likely(__pyx_t_3)) { | |
14863 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
14864 __Pyx_INCREF(__pyx_t_3); | |
14865 __Pyx_INCREF(function); | |
14866 __Pyx_DECREF_SET(__pyx_t_4, function); | |
14867 __pyx_t_5 = 1; | |
14868 } | |
14869 } | |
14870 #endif | |
14871 { | |
14872 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__2}; | |
14873 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
14874 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14875 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) | |
14876 __Pyx_GOTREF(__pyx_t_1); | |
14877 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14878 } | |
14879 __Pyx_XDECREF_SET(__pyx_v_elts, __pyx_t_1); | |
14880 __pyx_t_1 = 0; | |
14881 | |
14882 /* "pysam/libcvcf.pyx":377 | |
14883 * while len(format.strip())>0: | |
14884 * elts = format.strip().split(',') | |
14885 * first, rest = elts[0], ','.join(elts[1:]) # <<<<<<<<<<<<<< | |
14886 * if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')): | |
14887 * if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS) | |
14888 */ | |
14889 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) | |
14890 __Pyx_GOTREF(__pyx_t_1); | |
14891 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_elts, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) | |
14892 __Pyx_GOTREF(__pyx_t_4); | |
14893 __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) | |
14894 __Pyx_GOTREF(__pyx_t_3); | |
14895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14896 __Pyx_XDECREF_SET(__pyx_v_first, __pyx_t_1); | |
14897 __pyx_t_1 = 0; | |
14898 __Pyx_XDECREF_SET(__pyx_v_rest, ((PyObject*)__pyx_t_3)); | |
14899 __pyx_t_3 = 0; | |
14900 | |
14901 /* "pysam/libcvcf.pyx":378 | |
14902 * elts = format.strip().split(',') | |
14903 * first, rest = elts[0], ','.join(elts[1:]) | |
14904 * if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')): # <<<<<<<<<<<<<< | |
14905 * if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS) | |
14906 * if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
14907 */ | |
14908 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) | |
14909 __Pyx_GOTREF(__pyx_t_1); | |
14910 __pyx_t_4 = NULL; | |
14911 __pyx_t_5 = 0; | |
14912 #if CYTHON_UNPACK_METHODS | |
14913 if (likely(PyMethod_Check(__pyx_t_1))) { | |
14914 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); | |
14915 if (likely(__pyx_t_4)) { | |
14916 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
14917 __Pyx_INCREF(__pyx_t_4); | |
14918 __Pyx_INCREF(function); | |
14919 __Pyx_DECREF_SET(__pyx_t_1, function); | |
14920 __pyx_t_5 = 1; | |
14921 } | |
14922 } | |
14923 #endif | |
14924 { | |
14925 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__7}; | |
14926 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
14927 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14928 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) | |
14929 __Pyx_GOTREF(__pyx_t_3); | |
14930 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14931 } | |
14932 __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_3, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 378, __pyx_L1_error) | |
14933 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14934 if (!__pyx_t_6) { | |
14935 } else { | |
14936 __pyx_t_2 = __pyx_t_6; | |
14937 goto __pyx_L9_bool_binop_done; | |
14938 } | |
14939 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) | |
14940 __Pyx_GOTREF(__pyx_t_1); | |
14941 __pyx_t_4 = NULL; | |
14942 __pyx_t_5 = 0; | |
14943 #if CYTHON_UNPACK_METHODS | |
14944 if (likely(PyMethod_Check(__pyx_t_1))) { | |
14945 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); | |
14946 if (likely(__pyx_t_4)) { | |
14947 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
14948 __Pyx_INCREF(__pyx_t_4); | |
14949 __Pyx_INCREF(function); | |
14950 __Pyx_DECREF_SET(__pyx_t_1, function); | |
14951 __pyx_t_5 = 1; | |
14952 } | |
14953 } | |
14954 #endif | |
14955 { | |
14956 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__19}; | |
14957 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
14958 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14959 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) | |
14960 __Pyx_GOTREF(__pyx_t_3); | |
14961 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14962 } | |
14963 __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) | |
14964 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14965 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 378, __pyx_L1_error) | |
14966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14967 if (__pyx_t_6) { | |
14968 } else { | |
14969 __pyx_t_2 = __pyx_t_6; | |
14970 goto __pyx_L9_bool_binop_done; | |
14971 } | |
14972 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_find); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) | |
14973 __Pyx_GOTREF(__pyx_t_3); | |
14974 __pyx_t_4 = NULL; | |
14975 __pyx_t_5 = 0; | |
14976 #if CYTHON_UNPACK_METHODS | |
14977 if (likely(PyMethod_Check(__pyx_t_3))) { | |
14978 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
14979 if (likely(__pyx_t_4)) { | |
14980 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
14981 __Pyx_INCREF(__pyx_t_4); | |
14982 __Pyx_INCREF(function); | |
14983 __Pyx_DECREF_SET(__pyx_t_3, function); | |
14984 __pyx_t_5 = 1; | |
14985 } | |
14986 } | |
14987 #endif | |
14988 { | |
14989 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u__7}; | |
14990 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
14991 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14992 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) | |
14993 __Pyx_GOTREF(__pyx_t_1); | |
14994 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14995 } | |
14996 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_find); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) | |
14997 __Pyx_GOTREF(__pyx_t_4); | |
14998 __pyx_t_7 = NULL; | |
14999 __pyx_t_5 = 0; | |
15000 #if CYTHON_UNPACK_METHODS | |
15001 if (likely(PyMethod_Check(__pyx_t_4))) { | |
15002 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); | |
15003 if (likely(__pyx_t_7)) { | |
15004 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
15005 __Pyx_INCREF(__pyx_t_7); | |
15006 __Pyx_INCREF(function); | |
15007 __Pyx_DECREF_SET(__pyx_t_4, function); | |
15008 __pyx_t_5 = 1; | |
15009 } | |
15010 } | |
15011 #endif | |
15012 { | |
15013 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u__19}; | |
15014 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15015 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
15016 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) | |
15017 __Pyx_GOTREF(__pyx_t_3); | |
15018 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15019 } | |
15020 __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) | |
15021 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15022 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15023 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 378, __pyx_L1_error) | |
15024 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15025 __pyx_t_2 = __pyx_t_6; | |
15026 __pyx_L9_bool_binop_done:; | |
15027 if (__pyx_t_2) { | |
15028 | |
15029 /* "pysam/libcvcf.pyx":379 | |
15030 * first, rest = elts[0], ','.join(elts[1:]) | |
15031 * if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')): | |
15032 * if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS) # <<<<<<<<<<<<<< | |
15033 * if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15034 * first = ["ID=","Number=","Type=","Description="][idx] + first | |
15035 */ | |
15036 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error) | |
15037 __Pyx_GOTREF(__pyx_t_4); | |
15038 __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_4, __pyx_int_40, 40, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 379, __pyx_L1_error) | |
15039 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15040 if (__pyx_t_2) { | |
15041 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) | |
15042 __Pyx_GOTREF(__pyx_t_3); | |
15043 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) | |
15044 __Pyx_GOTREF(__pyx_t_1); | |
15045 __pyx_t_7 = NULL; | |
15046 __pyx_t_5 = 0; | |
15047 #if CYTHON_UNPACK_METHODS | |
15048 if (likely(PyMethod_Check(__pyx_t_3))) { | |
15049 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); | |
15050 if (likely(__pyx_t_7)) { | |
15051 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
15052 __Pyx_INCREF(__pyx_t_7); | |
15053 __Pyx_INCREF(function); | |
15054 __Pyx_DECREF_SET(__pyx_t_3, function); | |
15055 __pyx_t_5 = 1; | |
15056 } | |
15057 } | |
15058 #endif | |
15059 { | |
15060 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_1}; | |
15061 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
15062 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
15063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15064 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error) | |
15065 __Pyx_GOTREF(__pyx_t_4); | |
15066 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15067 } | |
15068 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15069 } | |
15070 | |
15071 /* "pysam/libcvcf.pyx":380 | |
15072 * if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')): | |
15073 * if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS) | |
15074 * if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) # <<<<<<<<<<<<<< | |
15075 * first = ["ID=","Number=","Type=","Description="][idx] + first | |
15076 * if first.startswith('ID='): data['id'] = first.split('=')[1] | |
15077 */ | |
15078 __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_idx, __pyx_int_4, 4, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 380, __pyx_L1_error) | |
15079 if (__pyx_t_2) { | |
15080 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) | |
15081 __Pyx_GOTREF(__pyx_t_3); | |
15082 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) | |
15083 __Pyx_GOTREF(__pyx_t_1); | |
15084 __pyx_t_7 = NULL; | |
15085 __pyx_t_5 = 0; | |
15086 #if CYTHON_UNPACK_METHODS | |
15087 if (likely(PyMethod_Check(__pyx_t_3))) { | |
15088 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); | |
15089 if (likely(__pyx_t_7)) { | |
15090 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
15091 __Pyx_INCREF(__pyx_t_7); | |
15092 __Pyx_INCREF(function); | |
15093 __Pyx_DECREF_SET(__pyx_t_3, function); | |
15094 __pyx_t_5 = 1; | |
15095 } | |
15096 } | |
15097 #endif | |
15098 { | |
15099 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_1}; | |
15100 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
15101 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
15102 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15103 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) | |
15104 __Pyx_GOTREF(__pyx_t_4); | |
15105 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15106 } | |
15107 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15108 } | |
15109 | |
15110 /* "pysam/libcvcf.pyx":381 | |
15111 * if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS) | |
15112 * if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15113 * first = ["ID=","Number=","Type=","Description="][idx] + first # <<<<<<<<<<<<<< | |
15114 * if first.startswith('ID='): data['id'] = first.split('=')[1] | |
15115 * elif first.startswith('Number='): data['number'] = first.split('=')[1] | |
15116 */ | |
15117 __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) | |
15118 __Pyx_GOTREF(__pyx_t_4); | |
15119 __Pyx_INCREF(__pyx_kp_u_ID); | |
15120 __Pyx_GIVEREF(__pyx_kp_u_ID); | |
15121 if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_ID)) __PYX_ERR(0, 381, __pyx_L1_error); | |
15122 __Pyx_INCREF(__pyx_kp_u_Number); | |
15123 __Pyx_GIVEREF(__pyx_kp_u_Number); | |
15124 if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u_Number)) __PYX_ERR(0, 381, __pyx_L1_error); | |
15125 __Pyx_INCREF(__pyx_kp_u_Type); | |
15126 __Pyx_GIVEREF(__pyx_kp_u_Type); | |
15127 if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_Type)) __PYX_ERR(0, 381, __pyx_L1_error); | |
15128 __Pyx_INCREF(__pyx_kp_u_Description); | |
15129 __Pyx_GIVEREF(__pyx_kp_u_Description); | |
15130 if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_kp_u_Description)) __PYX_ERR(0, 381, __pyx_L1_error); | |
15131 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) | |
15132 __Pyx_GOTREF(__pyx_t_3); | |
15133 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15134 __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_first); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) | |
15135 __Pyx_GOTREF(__pyx_t_4); | |
15136 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15137 __Pyx_DECREF_SET(__pyx_v_first, __pyx_t_4); | |
15138 __pyx_t_4 = 0; | |
15139 | |
15140 /* "pysam/libcvcf.pyx":378 | |
15141 * elts = format.strip().split(',') | |
15142 * first, rest = elts[0], ','.join(elts[1:]) | |
15143 * if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')): # <<<<<<<<<<<<<< | |
15144 * if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS) | |
15145 * if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15146 */ | |
15147 } | |
15148 | |
15149 /* "pysam/libcvcf.pyx":382 | |
15150 * if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15151 * first = ["ID=","Number=","Type=","Description="][idx] + first | |
15152 * if first.startswith('ID='): data['id'] = first.split('=')[1] # <<<<<<<<<<<<<< | |
15153 * elif first.startswith('Number='): data['number'] = first.split('=')[1] | |
15154 * elif first.startswith('Type='): data['type'] = first.split('=')[1] | |
15155 */ | |
15156 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) | |
15157 __Pyx_GOTREF(__pyx_t_3); | |
15158 __pyx_t_1 = NULL; | |
15159 __pyx_t_5 = 0; | |
15160 #if CYTHON_UNPACK_METHODS | |
15161 if (likely(PyMethod_Check(__pyx_t_3))) { | |
15162 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); | |
15163 if (likely(__pyx_t_1)) { | |
15164 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
15165 __Pyx_INCREF(__pyx_t_1); | |
15166 __Pyx_INCREF(function); | |
15167 __Pyx_DECREF_SET(__pyx_t_3, function); | |
15168 __pyx_t_5 = 1; | |
15169 } | |
15170 } | |
15171 #endif | |
15172 { | |
15173 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_ID}; | |
15174 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15175 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15176 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) | |
15177 __Pyx_GOTREF(__pyx_t_4); | |
15178 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15179 } | |
15180 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 382, __pyx_L1_error) | |
15181 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15182 if (__pyx_t_2) { | |
15183 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) | |
15184 __Pyx_GOTREF(__pyx_t_3); | |
15185 __pyx_t_1 = NULL; | |
15186 __pyx_t_5 = 0; | |
15187 #if CYTHON_UNPACK_METHODS | |
15188 if (likely(PyMethod_Check(__pyx_t_3))) { | |
15189 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); | |
15190 if (likely(__pyx_t_1)) { | |
15191 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
15192 __Pyx_INCREF(__pyx_t_1); | |
15193 __Pyx_INCREF(function); | |
15194 __Pyx_DECREF_SET(__pyx_t_3, function); | |
15195 __pyx_t_5 = 1; | |
15196 } | |
15197 } | |
15198 #endif | |
15199 { | |
15200 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u__7}; | |
15201 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15202 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15203 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) | |
15204 __Pyx_GOTREF(__pyx_t_4); | |
15205 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15206 } | |
15207 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) | |
15208 __Pyx_GOTREF(__pyx_t_3); | |
15209 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15210 if (unlikely((PyDict_SetItem(__pyx_v_data, __pyx_n_u_id_2, __pyx_t_3) < 0))) __PYX_ERR(0, 382, __pyx_L1_error) | |
15211 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15212 goto __pyx_L14; | |
15213 } | |
15214 | |
15215 /* "pysam/libcvcf.pyx":383 | |
15216 * first = ["ID=","Number=","Type=","Description="][idx] + first | |
15217 * if first.startswith('ID='): data['id'] = first.split('=')[1] | |
15218 * elif first.startswith('Number='): data['number'] = first.split('=')[1] # <<<<<<<<<<<<<< | |
15219 * elif first.startswith('Type='): data['type'] = first.split('=')[1] | |
15220 * elif first.startswith('Description='): | |
15221 */ | |
15222 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) | |
15223 __Pyx_GOTREF(__pyx_t_4); | |
15224 __pyx_t_1 = NULL; | |
15225 __pyx_t_5 = 0; | |
15226 #if CYTHON_UNPACK_METHODS | |
15227 if (likely(PyMethod_Check(__pyx_t_4))) { | |
15228 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); | |
15229 if (likely(__pyx_t_1)) { | |
15230 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
15231 __Pyx_INCREF(__pyx_t_1); | |
15232 __Pyx_INCREF(function); | |
15233 __Pyx_DECREF_SET(__pyx_t_4, function); | |
15234 __pyx_t_5 = 1; | |
15235 } | |
15236 } | |
15237 #endif | |
15238 { | |
15239 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_Number}; | |
15240 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15241 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15242 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) | |
15243 __Pyx_GOTREF(__pyx_t_3); | |
15244 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15245 } | |
15246 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 383, __pyx_L1_error) | |
15247 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15248 if (__pyx_t_2) { | |
15249 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) | |
15250 __Pyx_GOTREF(__pyx_t_4); | |
15251 __pyx_t_1 = NULL; | |
15252 __pyx_t_5 = 0; | |
15253 #if CYTHON_UNPACK_METHODS | |
15254 if (likely(PyMethod_Check(__pyx_t_4))) { | |
15255 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); | |
15256 if (likely(__pyx_t_1)) { | |
15257 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
15258 __Pyx_INCREF(__pyx_t_1); | |
15259 __Pyx_INCREF(function); | |
15260 __Pyx_DECREF_SET(__pyx_t_4, function); | |
15261 __pyx_t_5 = 1; | |
15262 } | |
15263 } | |
15264 #endif | |
15265 { | |
15266 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u__7}; | |
15267 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15268 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15269 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) | |
15270 __Pyx_GOTREF(__pyx_t_3); | |
15271 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15272 } | |
15273 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) | |
15274 __Pyx_GOTREF(__pyx_t_4); | |
15275 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15276 if (unlikely((PyDict_SetItem(__pyx_v_data, __pyx_n_u_number, __pyx_t_4) < 0))) __PYX_ERR(0, 383, __pyx_L1_error) | |
15277 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15278 goto __pyx_L14; | |
15279 } | |
15280 | |
15281 /* "pysam/libcvcf.pyx":384 | |
15282 * if first.startswith('ID='): data['id'] = first.split('=')[1] | |
15283 * elif first.startswith('Number='): data['number'] = first.split('=')[1] | |
15284 * elif first.startswith('Type='): data['type'] = first.split('=')[1] # <<<<<<<<<<<<<< | |
15285 * elif first.startswith('Description='): | |
15286 * elts = format.split('"') | |
15287 */ | |
15288 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) | |
15289 __Pyx_GOTREF(__pyx_t_3); | |
15290 __pyx_t_1 = NULL; | |
15291 __pyx_t_5 = 0; | |
15292 #if CYTHON_UNPACK_METHODS | |
15293 if (likely(PyMethod_Check(__pyx_t_3))) { | |
15294 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); | |
15295 if (likely(__pyx_t_1)) { | |
15296 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
15297 __Pyx_INCREF(__pyx_t_1); | |
15298 __Pyx_INCREF(function); | |
15299 __Pyx_DECREF_SET(__pyx_t_3, function); | |
15300 __pyx_t_5 = 1; | |
15301 } | |
15302 } | |
15303 #endif | |
15304 { | |
15305 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_Type}; | |
15306 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15307 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15308 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) | |
15309 __Pyx_GOTREF(__pyx_t_4); | |
15310 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15311 } | |
15312 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 384, __pyx_L1_error) | |
15313 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15314 if (__pyx_t_2) { | |
15315 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) | |
15316 __Pyx_GOTREF(__pyx_t_3); | |
15317 __pyx_t_1 = NULL; | |
15318 __pyx_t_5 = 0; | |
15319 #if CYTHON_UNPACK_METHODS | |
15320 if (likely(PyMethod_Check(__pyx_t_3))) { | |
15321 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); | |
15322 if (likely(__pyx_t_1)) { | |
15323 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
15324 __Pyx_INCREF(__pyx_t_1); | |
15325 __Pyx_INCREF(function); | |
15326 __Pyx_DECREF_SET(__pyx_t_3, function); | |
15327 __pyx_t_5 = 1; | |
15328 } | |
15329 } | |
15330 #endif | |
15331 { | |
15332 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u__7}; | |
15333 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15334 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15335 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) | |
15336 __Pyx_GOTREF(__pyx_t_4); | |
15337 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15338 } | |
15339 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) | |
15340 __Pyx_GOTREF(__pyx_t_3); | |
15341 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15342 if (unlikely((PyDict_SetItem(__pyx_v_data, __pyx_n_u_type, __pyx_t_3) < 0))) __PYX_ERR(0, 384, __pyx_L1_error) | |
15343 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15344 goto __pyx_L14; | |
15345 } | |
15346 | |
15347 /* "pysam/libcvcf.pyx":385 | |
15348 * elif first.startswith('Number='): data['number'] = first.split('=')[1] | |
15349 * elif first.startswith('Type='): data['type'] = first.split('=')[1] | |
15350 * elif first.startswith('Description='): # <<<<<<<<<<<<<< | |
15351 * elts = format.split('"') | |
15352 * if len(elts)<3: | |
15353 */ | |
15354 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error) | |
15355 __Pyx_GOTREF(__pyx_t_4); | |
15356 __pyx_t_1 = NULL; | |
15357 __pyx_t_5 = 0; | |
15358 #if CYTHON_UNPACK_METHODS | |
15359 if (likely(PyMethod_Check(__pyx_t_4))) { | |
15360 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); | |
15361 if (likely(__pyx_t_1)) { | |
15362 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
15363 __Pyx_INCREF(__pyx_t_1); | |
15364 __Pyx_INCREF(function); | |
15365 __Pyx_DECREF_SET(__pyx_t_4, function); | |
15366 __pyx_t_5 = 1; | |
15367 } | |
15368 } | |
15369 #endif | |
15370 { | |
15371 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_Description}; | |
15372 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15373 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15374 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) | |
15375 __Pyx_GOTREF(__pyx_t_3); | |
15376 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15377 } | |
15378 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 385, __pyx_L1_error) | |
15379 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15380 if (__pyx_t_2) { | |
15381 | |
15382 /* "pysam/libcvcf.pyx":386 | |
15383 * elif first.startswith('Type='): data['type'] = first.split('=')[1] | |
15384 * elif first.startswith('Description='): | |
15385 * elts = format.split('"') # <<<<<<<<<<<<<< | |
15386 * if len(elts)<3: | |
15387 * self.error(line,self.FORMAT_MISSING_QUOTES) | |
15388 */ | |
15389 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) | |
15390 __Pyx_GOTREF(__pyx_t_4); | |
15391 __pyx_t_1 = NULL; | |
15392 __pyx_t_5 = 0; | |
15393 #if CYTHON_UNPACK_METHODS | |
15394 if (likely(PyMethod_Check(__pyx_t_4))) { | |
15395 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); | |
15396 if (likely(__pyx_t_1)) { | |
15397 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
15398 __Pyx_INCREF(__pyx_t_1); | |
15399 __Pyx_INCREF(function); | |
15400 __Pyx_DECREF_SET(__pyx_t_4, function); | |
15401 __pyx_t_5 = 1; | |
15402 } | |
15403 } | |
15404 #endif | |
15405 { | |
15406 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u__19}; | |
15407 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15408 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15409 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error) | |
15410 __Pyx_GOTREF(__pyx_t_3); | |
15411 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15412 } | |
15413 __Pyx_DECREF_SET(__pyx_v_elts, __pyx_t_3); | |
15414 __pyx_t_3 = 0; | |
15415 | |
15416 /* "pysam/libcvcf.pyx":387 | |
15417 * elif first.startswith('Description='): | |
15418 * elts = format.split('"') | |
15419 * if len(elts)<3: # <<<<<<<<<<<<<< | |
15420 * self.error(line,self.FORMAT_MISSING_QUOTES) | |
15421 * elts = first.split('=') + [rest] | |
15422 */ | |
15423 __pyx_t_8 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 387, __pyx_L1_error) | |
15424 __pyx_t_2 = (__pyx_t_8 < 3); | |
15425 if (__pyx_t_2) { | |
15426 | |
15427 /* "pysam/libcvcf.pyx":388 | |
15428 * elts = format.split('"') | |
15429 * if len(elts)<3: | |
15430 * self.error(line,self.FORMAT_MISSING_QUOTES) # <<<<<<<<<<<<<< | |
15431 * elts = first.split('=') + [rest] | |
15432 * data['descr'] = elts[1] | |
15433 */ | |
15434 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error) | |
15435 __Pyx_GOTREF(__pyx_t_4); | |
15436 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FORMAT_MISSING_QUOTES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) | |
15437 __Pyx_GOTREF(__pyx_t_1); | |
15438 __pyx_t_7 = NULL; | |
15439 __pyx_t_5 = 0; | |
15440 #if CYTHON_UNPACK_METHODS | |
15441 if (likely(PyMethod_Check(__pyx_t_4))) { | |
15442 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); | |
15443 if (likely(__pyx_t_7)) { | |
15444 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
15445 __Pyx_INCREF(__pyx_t_7); | |
15446 __Pyx_INCREF(function); | |
15447 __Pyx_DECREF_SET(__pyx_t_4, function); | |
15448 __pyx_t_5 = 1; | |
15449 } | |
15450 } | |
15451 #endif | |
15452 { | |
15453 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_1}; | |
15454 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
15455 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
15456 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15457 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error) | |
15458 __Pyx_GOTREF(__pyx_t_3); | |
15459 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15460 } | |
15461 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15462 | |
15463 /* "pysam/libcvcf.pyx":389 | |
15464 * if len(elts)<3: | |
15465 * self.error(line,self.FORMAT_MISSING_QUOTES) | |
15466 * elts = first.split('=') + [rest] # <<<<<<<<<<<<<< | |
15467 * data['descr'] = elts[1] | |
15468 * rest = '"'.join(elts[2:]) | |
15469 */ | |
15470 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error) | |
15471 __Pyx_GOTREF(__pyx_t_4); | |
15472 __pyx_t_1 = NULL; | |
15473 __pyx_t_5 = 0; | |
15474 #if CYTHON_UNPACK_METHODS | |
15475 if (likely(PyMethod_Check(__pyx_t_4))) { | |
15476 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); | |
15477 if (likely(__pyx_t_1)) { | |
15478 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
15479 __Pyx_INCREF(__pyx_t_1); | |
15480 __Pyx_INCREF(function); | |
15481 __Pyx_DECREF_SET(__pyx_t_4, function); | |
15482 __pyx_t_5 = 1; | |
15483 } | |
15484 } | |
15485 #endif | |
15486 { | |
15487 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u__7}; | |
15488 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15489 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15490 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) | |
15491 __Pyx_GOTREF(__pyx_t_3); | |
15492 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15493 } | |
15494 __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error) | |
15495 __Pyx_GOTREF(__pyx_t_4); | |
15496 __Pyx_INCREF(__pyx_v_rest); | |
15497 __Pyx_GIVEREF(__pyx_v_rest); | |
15498 if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_rest)) __PYX_ERR(0, 389, __pyx_L1_error); | |
15499 __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) | |
15500 __Pyx_GOTREF(__pyx_t_1); | |
15501 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15502 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15503 __Pyx_DECREF_SET(__pyx_v_elts, __pyx_t_1); | |
15504 __pyx_t_1 = 0; | |
15505 | |
15506 /* "pysam/libcvcf.pyx":387 | |
15507 * elif first.startswith('Description='): | |
15508 * elts = format.split('"') | |
15509 * if len(elts)<3: # <<<<<<<<<<<<<< | |
15510 * self.error(line,self.FORMAT_MISSING_QUOTES) | |
15511 * elts = first.split('=') + [rest] | |
15512 */ | |
15513 } | |
15514 | |
15515 /* "pysam/libcvcf.pyx":390 | |
15516 * self.error(line,self.FORMAT_MISSING_QUOTES) | |
15517 * elts = first.split('=') + [rest] | |
15518 * data['descr'] = elts[1] # <<<<<<<<<<<<<< | |
15519 * rest = '"'.join(elts[2:]) | |
15520 * if rest.startswith(','): rest = rest[1:] | |
15521 */ | |
15522 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) | |
15523 __Pyx_GOTREF(__pyx_t_1); | |
15524 if (unlikely((PyDict_SetItem(__pyx_v_data, __pyx_n_u_descr, __pyx_t_1) < 0))) __PYX_ERR(0, 390, __pyx_L1_error) | |
15525 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15526 | |
15527 /* "pysam/libcvcf.pyx":391 | |
15528 * elts = first.split('=') + [rest] | |
15529 * data['descr'] = elts[1] | |
15530 * rest = '"'.join(elts[2:]) # <<<<<<<<<<<<<< | |
15531 * if rest.startswith(','): rest = rest[1:] | |
15532 * else: | |
15533 */ | |
15534 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_elts, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) | |
15535 __Pyx_GOTREF(__pyx_t_1); | |
15536 __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__19, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) | |
15537 __Pyx_GOTREF(__pyx_t_4); | |
15538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15539 __Pyx_DECREF_SET(__pyx_v_rest, ((PyObject*)__pyx_t_4)); | |
15540 __pyx_t_4 = 0; | |
15541 | |
15542 /* "pysam/libcvcf.pyx":392 | |
15543 * data['descr'] = elts[1] | |
15544 * rest = '"'.join(elts[2:]) | |
15545 * if rest.startswith(','): rest = rest[1:] # <<<<<<<<<<<<<< | |
15546 * else: | |
15547 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15548 */ | |
15549 if (unlikely(__pyx_v_rest == Py_None)) { | |
15550 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "startswith"); | |
15551 __PYX_ERR(0, 392, __pyx_L1_error) | |
15552 } | |
15553 __pyx_t_2 = __Pyx_PyUnicode_Tailmatch(__pyx_v_rest, __pyx_kp_u__2, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 392, __pyx_L1_error) | |
15554 if (__pyx_t_2) { | |
15555 if (unlikely(__pyx_v_rest == Py_None)) { | |
15556 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
15557 __PYX_ERR(0, 392, __pyx_L1_error) | |
15558 } | |
15559 __pyx_t_4 = __Pyx_PyUnicode_Substring(__pyx_v_rest, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) | |
15560 __Pyx_GOTREF(__pyx_t_4); | |
15561 __Pyx_DECREF_SET(__pyx_v_rest, ((PyObject*)__pyx_t_4)); | |
15562 __pyx_t_4 = 0; | |
15563 } | |
15564 | |
15565 /* "pysam/libcvcf.pyx":385 | |
15566 * elif first.startswith('Number='): data['number'] = first.split('=')[1] | |
15567 * elif first.startswith('Type='): data['type'] = first.split('=')[1] | |
15568 * elif first.startswith('Description='): # <<<<<<<<<<<<<< | |
15569 * elts = format.split('"') | |
15570 * if len(elts)<3: | |
15571 */ | |
15572 goto __pyx_L14; | |
15573 } | |
15574 | |
15575 /* "pysam/libcvcf.pyx":394 | |
15576 * if rest.startswith(','): rest = rest[1:] | |
15577 * else: | |
15578 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) # <<<<<<<<<<<<<< | |
15579 * format = rest | |
15580 * idx += 1 | |
15581 */ | |
15582 /*else*/ { | |
15583 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) | |
15584 __Pyx_GOTREF(__pyx_t_1); | |
15585 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) | |
15586 __Pyx_GOTREF(__pyx_t_3); | |
15587 __pyx_t_7 = NULL; | |
15588 __pyx_t_5 = 0; | |
15589 #if CYTHON_UNPACK_METHODS | |
15590 if (likely(PyMethod_Check(__pyx_t_1))) { | |
15591 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); | |
15592 if (likely(__pyx_t_7)) { | |
15593 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
15594 __Pyx_INCREF(__pyx_t_7); | |
15595 __Pyx_INCREF(function); | |
15596 __Pyx_DECREF_SET(__pyx_t_1, function); | |
15597 __pyx_t_5 = 1; | |
15598 } | |
15599 } | |
15600 #endif | |
15601 { | |
15602 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_3}; | |
15603 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
15604 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
15605 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15606 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error) | |
15607 __Pyx_GOTREF(__pyx_t_4); | |
15608 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15609 } | |
15610 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15611 } | |
15612 __pyx_L14:; | |
15613 | |
15614 /* "pysam/libcvcf.pyx":395 | |
15615 * else: | |
15616 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15617 * format = rest # <<<<<<<<<<<<<< | |
15618 * idx += 1 | |
15619 * if filter and idx==1: idx=3 # skip number and type fields for FILTER format strings | |
15620 */ | |
15621 __Pyx_INCREF(__pyx_v_rest); | |
15622 __Pyx_DECREF_SET(__pyx_v_format, __pyx_v_rest); | |
15623 | |
15624 /* "pysam/libcvcf.pyx":396 | |
15625 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15626 * format = rest | |
15627 * idx += 1 # <<<<<<<<<<<<<< | |
15628 * if filter and idx==1: idx=3 # skip number and type fields for FILTER format strings | |
15629 * if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15630 */ | |
15631 __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_idx, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) | |
15632 __Pyx_GOTREF(__pyx_t_4); | |
15633 __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_4); | |
15634 __pyx_t_4 = 0; | |
15635 | |
15636 /* "pysam/libcvcf.pyx":397 | |
15637 * format = rest | |
15638 * idx += 1 | |
15639 * if filter and idx==1: idx=3 # skip number and type fields for FILTER format strings # <<<<<<<<<<<<<< | |
15640 * if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15641 * if 'descr' not in data: | |
15642 */ | |
15643 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 397, __pyx_L1_error) | |
15644 if (__pyx_t_6) { | |
15645 } else { | |
15646 __pyx_t_2 = __pyx_t_6; | |
15647 goto __pyx_L18_bool_binop_done; | |
15648 } | |
15649 __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_idx, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 397, __pyx_L1_error) | |
15650 __pyx_t_2 = __pyx_t_6; | |
15651 __pyx_L18_bool_binop_done:; | |
15652 if (__pyx_t_2) { | |
15653 __Pyx_INCREF(__pyx_int_3); | |
15654 __Pyx_DECREF_SET(__pyx_v_idx, __pyx_int_3); | |
15655 } | |
15656 } | |
15657 | |
15658 /* "pysam/libcvcf.pyx":398 | |
15659 * idx += 1 | |
15660 * if filter and idx==1: idx=3 # skip number and type fields for FILTER format strings | |
15661 * if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) # <<<<<<<<<<<<<< | |
15662 * if 'descr' not in data: | |
15663 * # missing description | |
15664 */ | |
15665 __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_id_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error) | |
15666 __Pyx_GOTREF(__pyx_t_4); | |
15667 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 398, __pyx_L1_error) | |
15668 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15669 __pyx_t_6 = (!__pyx_t_2); | |
15670 if (__pyx_t_6) { | |
15671 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error) | |
15672 __Pyx_GOTREF(__pyx_t_1); | |
15673 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) | |
15674 __Pyx_GOTREF(__pyx_t_3); | |
15675 __pyx_t_7 = NULL; | |
15676 __pyx_t_5 = 0; | |
15677 #if CYTHON_UNPACK_METHODS | |
15678 if (likely(PyMethod_Check(__pyx_t_1))) { | |
15679 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); | |
15680 if (likely(__pyx_t_7)) { | |
15681 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
15682 __Pyx_INCREF(__pyx_t_7); | |
15683 __Pyx_INCREF(function); | |
15684 __Pyx_DECREF_SET(__pyx_t_1, function); | |
15685 __pyx_t_5 = 1; | |
15686 } | |
15687 } | |
15688 #endif | |
15689 { | |
15690 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_3}; | |
15691 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
15692 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
15693 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15694 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error) | |
15695 __Pyx_GOTREF(__pyx_t_4); | |
15696 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15697 } | |
15698 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15699 } | |
15700 | |
15701 /* "pysam/libcvcf.pyx":399 | |
15702 * if filter and idx==1: idx=3 # skip number and type fields for FILTER format strings | |
15703 * if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15704 * if 'descr' not in data: # <<<<<<<<<<<<<< | |
15705 * # missing description | |
15706 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15707 */ | |
15708 __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_descr, __pyx_v_data, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) | |
15709 if (__pyx_t_6) { | |
15710 | |
15711 /* "pysam/libcvcf.pyx":401 | |
15712 * if 'descr' not in data: | |
15713 * # missing description | |
15714 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) # <<<<<<<<<<<<<< | |
15715 * data['descr'] = "" | |
15716 * if not data['type'] and not data['number']: | |
15717 */ | |
15718 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) | |
15719 __Pyx_GOTREF(__pyx_t_1); | |
15720 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) | |
15721 __Pyx_GOTREF(__pyx_t_3); | |
15722 __pyx_t_7 = NULL; | |
15723 __pyx_t_5 = 0; | |
15724 #if CYTHON_UNPACK_METHODS | |
15725 if (likely(PyMethod_Check(__pyx_t_1))) { | |
15726 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); | |
15727 if (likely(__pyx_t_7)) { | |
15728 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
15729 __Pyx_INCREF(__pyx_t_7); | |
15730 __Pyx_INCREF(function); | |
15731 __Pyx_DECREF_SET(__pyx_t_1, function); | |
15732 __pyx_t_5 = 1; | |
15733 } | |
15734 } | |
15735 #endif | |
15736 { | |
15737 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_3}; | |
15738 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
15739 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
15740 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15741 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) | |
15742 __Pyx_GOTREF(__pyx_t_4); | |
15743 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15744 } | |
15745 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15746 | |
15747 /* "pysam/libcvcf.pyx":402 | |
15748 * # missing description | |
15749 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15750 * data['descr'] = "" # <<<<<<<<<<<<<< | |
15751 * if not data['type'] and not data['number']: | |
15752 * # fine, ##filter format | |
15753 */ | |
15754 if (unlikely((PyDict_SetItem(__pyx_v_data, __pyx_n_u_descr, __pyx_kp_u_) < 0))) __PYX_ERR(0, 402, __pyx_L1_error) | |
15755 | |
15756 /* "pysam/libcvcf.pyx":399 | |
15757 * if filter and idx==1: idx=3 # skip number and type fields for FILTER format strings | |
15758 * if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15759 * if 'descr' not in data: # <<<<<<<<<<<<<< | |
15760 * # missing description | |
15761 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15762 */ | |
15763 } | |
15764 | |
15765 /* "pysam/libcvcf.pyx":403 | |
15766 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15767 * data['descr'] = "" | |
15768 * if not data['type'] and not data['number']: # <<<<<<<<<<<<<< | |
15769 * # fine, ##filter format | |
15770 * return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.') | |
15771 */ | |
15772 __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error) | |
15773 __Pyx_GOTREF(__pyx_t_4); | |
15774 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 403, __pyx_L1_error) | |
15775 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15776 __pyx_t_9 = (!__pyx_t_2); | |
15777 if (__pyx_t_9) { | |
15778 } else { | |
15779 __pyx_t_6 = __pyx_t_9; | |
15780 goto __pyx_L23_bool_binop_done; | |
15781 } | |
15782 __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error) | |
15783 __Pyx_GOTREF(__pyx_t_4); | |
15784 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 403, __pyx_L1_error) | |
15785 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15786 __pyx_t_2 = (!__pyx_t_9); | |
15787 __pyx_t_6 = __pyx_t_2; | |
15788 __pyx_L23_bool_binop_done:; | |
15789 if (__pyx_t_6) { | |
15790 | |
15791 /* "pysam/libcvcf.pyx":405 | |
15792 * if not data['type'] and not data['number']: | |
15793 * # fine, ##filter format | |
15794 * return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.') # <<<<<<<<<<<<<< | |
15795 * if not data['type'] in ["Integer","Float","Character","String","Flag"]: | |
15796 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15797 */ | |
15798 __Pyx_XDECREF(__pyx_r); | |
15799 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) | |
15800 __Pyx_GOTREF(__pyx_t_1); | |
15801 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_id_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) | |
15802 __Pyx_GOTREF(__pyx_t_3); | |
15803 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L1_error) | |
15804 __Pyx_GOTREF(__pyx_t_7); | |
15805 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_descr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 405, __pyx_L1_error) | |
15806 __Pyx_GOTREF(__pyx_t_10); | |
15807 __pyx_t_11 = NULL; | |
15808 __pyx_t_5 = 0; | |
15809 #if CYTHON_UNPACK_METHODS | |
15810 if (unlikely(PyMethod_Check(__pyx_t_1))) { | |
15811 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); | |
15812 if (likely(__pyx_t_11)) { | |
15813 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
15814 __Pyx_INCREF(__pyx_t_11); | |
15815 __Pyx_INCREF(function); | |
15816 __Pyx_DECREF_SET(__pyx_t_1, function); | |
15817 __pyx_t_5 = 1; | |
15818 } | |
15819 } | |
15820 #endif | |
15821 { | |
15822 PyObject *__pyx_callargs[7] = {__pyx_t_11, __pyx_t_3, __pyx_t_7, __pyx_int_0, __pyx_n_u_Flag, __pyx_t_10, __pyx_kp_u__5}; | |
15823 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
15824 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
15825 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15826 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
15827 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
15828 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) | |
15829 __Pyx_GOTREF(__pyx_t_4); | |
15830 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15831 } | |
15832 __pyx_r = __pyx_t_4; | |
15833 __pyx_t_4 = 0; | |
15834 goto __pyx_L0; | |
15835 | |
15836 /* "pysam/libcvcf.pyx":403 | |
15837 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15838 * data['descr'] = "" | |
15839 * if not data['type'] and not data['number']: # <<<<<<<<<<<<<< | |
15840 * # fine, ##filter format | |
15841 * return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.') | |
15842 */ | |
15843 } | |
15844 | |
15845 /* "pysam/libcvcf.pyx":406 | |
15846 * # fine, ##filter format | |
15847 * return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.') | |
15848 * if not data['type'] in ["Integer","Float","Character","String","Flag"]: # <<<<<<<<<<<<<< | |
15849 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15850 * # I would like a missing-value field, but it isn't there | |
15851 */ | |
15852 __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) | |
15853 __Pyx_GOTREF(__pyx_t_4); | |
15854 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_Integer, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) | |
15855 if (__pyx_t_2) { | |
15856 } else { | |
15857 __pyx_t_6 = __pyx_t_2; | |
15858 goto __pyx_L26_bool_binop_done; | |
15859 } | |
15860 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_Float, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) | |
15861 if (__pyx_t_2) { | |
15862 } else { | |
15863 __pyx_t_6 = __pyx_t_2; | |
15864 goto __pyx_L26_bool_binop_done; | |
15865 } | |
15866 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_Character, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) | |
15867 if (__pyx_t_2) { | |
15868 } else { | |
15869 __pyx_t_6 = __pyx_t_2; | |
15870 goto __pyx_L26_bool_binop_done; | |
15871 } | |
15872 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_String, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) | |
15873 if (__pyx_t_2) { | |
15874 } else { | |
15875 __pyx_t_6 = __pyx_t_2; | |
15876 goto __pyx_L26_bool_binop_done; | |
15877 } | |
15878 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_Flag, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) | |
15879 __pyx_t_6 = __pyx_t_2; | |
15880 __pyx_L26_bool_binop_done:; | |
15881 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15882 __pyx_t_2 = __pyx_t_6; | |
15883 if (__pyx_t_2) { | |
15884 | |
15885 /* "pysam/libcvcf.pyx":407 | |
15886 * return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.') | |
15887 * if not data['type'] in ["Integer","Float","Character","String","Flag"]: | |
15888 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) # <<<<<<<<<<<<<< | |
15889 * # I would like a missing-value field, but it isn't there | |
15890 * if data['type'] in ['Integer','Float']: data['missing'] = None # Do NOT use arbitrary int/float as missing value | |
15891 */ | |
15892 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) | |
15893 __Pyx_GOTREF(__pyx_t_1); | |
15894 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 407, __pyx_L1_error) | |
15895 __Pyx_GOTREF(__pyx_t_10); | |
15896 __pyx_t_7 = NULL; | |
15897 __pyx_t_5 = 0; | |
15898 #if CYTHON_UNPACK_METHODS | |
15899 if (likely(PyMethod_Check(__pyx_t_1))) { | |
15900 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); | |
15901 if (likely(__pyx_t_7)) { | |
15902 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
15903 __Pyx_INCREF(__pyx_t_7); | |
15904 __Pyx_INCREF(function); | |
15905 __Pyx_DECREF_SET(__pyx_t_1, function); | |
15906 __pyx_t_5 = 1; | |
15907 } | |
15908 } | |
15909 #endif | |
15910 { | |
15911 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_10}; | |
15912 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
15913 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
15914 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
15915 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) | |
15916 __Pyx_GOTREF(__pyx_t_4); | |
15917 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15918 } | |
15919 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15920 | |
15921 /* "pysam/libcvcf.pyx":406 | |
15922 * # fine, ##filter format | |
15923 * return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.') | |
15924 * if not data['type'] in ["Integer","Float","Character","String","Flag"]: # <<<<<<<<<<<<<< | |
15925 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15926 * # I would like a missing-value field, but it isn't there | |
15927 */ | |
15928 } | |
15929 | |
15930 /* "pysam/libcvcf.pyx":409 | |
15931 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15932 * # I would like a missing-value field, but it isn't there | |
15933 * if data['type'] in ['Integer','Float']: data['missing'] = None # Do NOT use arbitrary int/float as missing value # <<<<<<<<<<<<<< | |
15934 * else: data['missing'] = '.' | |
15935 * if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15936 */ | |
15937 __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error) | |
15938 __Pyx_GOTREF(__pyx_t_4); | |
15939 __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_Integer, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 409, __pyx_L1_error) | |
15940 if (!__pyx_t_6) { | |
15941 } else { | |
15942 __pyx_t_2 = __pyx_t_6; | |
15943 goto __pyx_L32_bool_binop_done; | |
15944 } | |
15945 __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_Float, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 409, __pyx_L1_error) | |
15946 __pyx_t_2 = __pyx_t_6; | |
15947 __pyx_L32_bool_binop_done:; | |
15948 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15949 __pyx_t_6 = __pyx_t_2; | |
15950 if (__pyx_t_6) { | |
15951 if (unlikely((PyDict_SetItem(__pyx_v_data, __pyx_n_u_missing, Py_None) < 0))) __PYX_ERR(0, 409, __pyx_L1_error) | |
15952 goto __pyx_L31; | |
15953 } | |
15954 | |
15955 /* "pysam/libcvcf.pyx":410 | |
15956 * # I would like a missing-value field, but it isn't there | |
15957 * if data['type'] in ['Integer','Float']: data['missing'] = None # Do NOT use arbitrary int/float as missing value | |
15958 * else: data['missing'] = '.' # <<<<<<<<<<<<<< | |
15959 * if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
15960 * try: | |
15961 */ | |
15962 /*else*/ { | |
15963 if (unlikely((PyDict_SetItem(__pyx_v_data, __pyx_n_u_missing, __pyx_kp_u__5) < 0))) __PYX_ERR(0, 410, __pyx_L1_error) | |
15964 } | |
15965 __pyx_L31:; | |
15966 | |
15967 /* "pysam/libcvcf.pyx":411 | |
15968 * if data['type'] in ['Integer','Float']: data['missing'] = None # Do NOT use arbitrary int/float as missing value | |
15969 * else: data['missing'] = '.' | |
15970 * if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) # <<<<<<<<<<<<<< | |
15971 * try: | |
15972 * n = int(data['number']) | |
15973 */ | |
15974 __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L1_error) | |
15975 __Pyx_GOTREF(__pyx_t_4); | |
15976 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 411, __pyx_L1_error) | |
15977 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15978 __pyx_t_2 = (!__pyx_t_6); | |
15979 if (__pyx_t_2) { | |
15980 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) | |
15981 __Pyx_GOTREF(__pyx_t_1); | |
15982 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 411, __pyx_L1_error) | |
15983 __Pyx_GOTREF(__pyx_t_10); | |
15984 __pyx_t_7 = NULL; | |
15985 __pyx_t_5 = 0; | |
15986 #if CYTHON_UNPACK_METHODS | |
15987 if (likely(PyMethod_Check(__pyx_t_1))) { | |
15988 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); | |
15989 if (likely(__pyx_t_7)) { | |
15990 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
15991 __Pyx_INCREF(__pyx_t_7); | |
15992 __Pyx_INCREF(function); | |
15993 __Pyx_DECREF_SET(__pyx_t_1, function); | |
15994 __pyx_t_5 = 1; | |
15995 } | |
15996 } | |
15997 #endif | |
15998 { | |
15999 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_10}; | |
16000 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
16001 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16002 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
16003 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L1_error) | |
16004 __Pyx_GOTREF(__pyx_t_4); | |
16005 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16006 } | |
16007 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
16008 } | |
16009 | |
16010 /* "pysam/libcvcf.pyx":412 | |
16011 * else: data['missing'] = '.' | |
16012 * if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
16013 * try: # <<<<<<<<<<<<<< | |
16014 * n = int(data['number']) | |
16015 * t = self.NT_NUMBER | |
16016 */ | |
16017 { | |
16018 __Pyx_PyThreadState_declare | |
16019 __Pyx_PyThreadState_assign | |
16020 __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); | |
16021 __Pyx_XGOTREF(__pyx_t_12); | |
16022 __Pyx_XGOTREF(__pyx_t_13); | |
16023 __Pyx_XGOTREF(__pyx_t_14); | |
16024 /*try:*/ { | |
16025 | |
16026 /* "pysam/libcvcf.pyx":413 | |
16027 * if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
16028 * try: | |
16029 * n = int(data['number']) # <<<<<<<<<<<<<< | |
16030 * t = self.NT_NUMBER | |
16031 * except ValueError: | |
16032 */ | |
16033 __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L35_error) | |
16034 __Pyx_GOTREF(__pyx_t_4); | |
16035 __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L35_error) | |
16036 __Pyx_GOTREF(__pyx_t_1); | |
16037 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
16038 __pyx_v_n = __pyx_t_1; | |
16039 __pyx_t_1 = 0; | |
16040 | |
16041 /* "pysam/libcvcf.pyx":414 | |
16042 * try: | |
16043 * n = int(data['number']) | |
16044 * t = self.NT_NUMBER # <<<<<<<<<<<<<< | |
16045 * except ValueError: | |
16046 * n = -1 | |
16047 */ | |
16048 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L35_error) | |
16049 __Pyx_GOTREF(__pyx_t_1); | |
16050 __pyx_v_t = __pyx_t_1; | |
16051 __pyx_t_1 = 0; | |
16052 | |
16053 /* "pysam/libcvcf.pyx":412 | |
16054 * else: data['missing'] = '.' | |
16055 * if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
16056 * try: # <<<<<<<<<<<<<< | |
16057 * n = int(data['number']) | |
16058 * t = self.NT_NUMBER | |
16059 */ | |
16060 } | |
16061 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
16062 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; | |
16063 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; | |
16064 goto __pyx_L40_try_end; | |
16065 __pyx_L35_error:; | |
16066 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16067 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; | |
16068 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
16069 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
16070 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
16071 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16072 | |
16073 /* "pysam/libcvcf.pyx":415 | |
16074 * n = int(data['number']) | |
16075 * t = self.NT_NUMBER | |
16076 * except ValueError: # <<<<<<<<<<<<<< | |
16077 * n = -1 | |
16078 * if data['number'] == '.': t = self.NT_UNKNOWN | |
16079 */ | |
16080 __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); | |
16081 if (__pyx_t_15) { | |
16082 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_format", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16083 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_10) < 0) __PYX_ERR(0, 415, __pyx_L37_except_error) | |
16084 __Pyx_XGOTREF(__pyx_t_1); | |
16085 __Pyx_XGOTREF(__pyx_t_4); | |
16086 __Pyx_XGOTREF(__pyx_t_10); | |
16087 | |
16088 /* "pysam/libcvcf.pyx":416 | |
16089 * t = self.NT_NUMBER | |
16090 * except ValueError: | |
16091 * n = -1 # <<<<<<<<<<<<<< | |
16092 * if data['number'] == '.': t = self.NT_UNKNOWN | |
16093 * elif data['number'] == '#alleles': t = self.NT_ALLELES | |
16094 */ | |
16095 __Pyx_INCREF(__pyx_int_neg_1); | |
16096 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_int_neg_1); | |
16097 | |
16098 /* "pysam/libcvcf.pyx":417 | |
16099 * except ValueError: | |
16100 * n = -1 | |
16101 * if data['number'] == '.': t = self.NT_UNKNOWN # <<<<<<<<<<<<<< | |
16102 * elif data['number'] == '#alleles': t = self.NT_ALLELES | |
16103 * elif data['number'] == '#nonref_alleles': t = self.NT_NR_ALLELES | |
16104 */ | |
16105 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 417, __pyx_L37_except_error) | |
16106 __Pyx_GOTREF(__pyx_t_7); | |
16107 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 417, __pyx_L37_except_error) | |
16108 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16109 if (__pyx_t_2) { | |
16110 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 417, __pyx_L37_except_error) | |
16111 __Pyx_GOTREF(__pyx_t_7); | |
16112 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_7); | |
16113 __pyx_t_7 = 0; | |
16114 goto __pyx_L43; | |
16115 } | |
16116 | |
16117 /* "pysam/libcvcf.pyx":418 | |
16118 * n = -1 | |
16119 * if data['number'] == '.': t = self.NT_UNKNOWN | |
16120 * elif data['number'] == '#alleles': t = self.NT_ALLELES # <<<<<<<<<<<<<< | |
16121 * elif data['number'] == '#nonref_alleles': t = self.NT_NR_ALLELES | |
16122 * elif data['number'] == '#genotypes': t = self.NT_GENOTYPES | |
16123 */ | |
16124 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L37_except_error) | |
16125 __Pyx_GOTREF(__pyx_t_7); | |
16126 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u_alleles, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 418, __pyx_L37_except_error) | |
16127 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16128 if (__pyx_t_2) { | |
16129 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L37_except_error) | |
16130 __Pyx_GOTREF(__pyx_t_7); | |
16131 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_7); | |
16132 __pyx_t_7 = 0; | |
16133 goto __pyx_L43; | |
16134 } | |
16135 | |
16136 /* "pysam/libcvcf.pyx":419 | |
16137 * if data['number'] == '.': t = self.NT_UNKNOWN | |
16138 * elif data['number'] == '#alleles': t = self.NT_ALLELES | |
16139 * elif data['number'] == '#nonref_alleles': t = self.NT_NR_ALLELES # <<<<<<<<<<<<<< | |
16140 * elif data['number'] == '#genotypes': t = self.NT_GENOTYPES | |
16141 * elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES | |
16142 */ | |
16143 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L37_except_error) | |
16144 __Pyx_GOTREF(__pyx_t_7); | |
16145 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u_nonref_alleles, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 419, __pyx_L37_except_error) | |
16146 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16147 if (__pyx_t_2) { | |
16148 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NR_ALLELES); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L37_except_error) | |
16149 __Pyx_GOTREF(__pyx_t_7); | |
16150 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_7); | |
16151 __pyx_t_7 = 0; | |
16152 goto __pyx_L43; | |
16153 } | |
16154 | |
16155 /* "pysam/libcvcf.pyx":420 | |
16156 * elif data['number'] == '#alleles': t = self.NT_ALLELES | |
16157 * elif data['number'] == '#nonref_alleles': t = self.NT_NR_ALLELES | |
16158 * elif data['number'] == '#genotypes': t = self.NT_GENOTYPES # <<<<<<<<<<<<<< | |
16159 * elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES | |
16160 * elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES | |
16161 */ | |
16162 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L37_except_error) | |
16163 __Pyx_GOTREF(__pyx_t_7); | |
16164 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u_genotypes, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 420, __pyx_L37_except_error) | |
16165 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16166 if (__pyx_t_2) { | |
16167 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L37_except_error) | |
16168 __Pyx_GOTREF(__pyx_t_7); | |
16169 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_7); | |
16170 __pyx_t_7 = 0; | |
16171 goto __pyx_L43; | |
16172 } | |
16173 | |
16174 /* "pysam/libcvcf.pyx":421 | |
16175 * elif data['number'] == '#nonref_alleles': t = self.NT_NR_ALLELES | |
16176 * elif data['number'] == '#genotypes': t = self.NT_GENOTYPES | |
16177 * elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES # <<<<<<<<<<<<<< | |
16178 * elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES | |
16179 * # abbreviations added in VCF version v4.1 | |
16180 */ | |
16181 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L37_except_error) | |
16182 __Pyx_GOTREF(__pyx_t_7); | |
16183 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u_phased_genotypes, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 421, __pyx_L37_except_error) | |
16184 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16185 if (__pyx_t_2) { | |
16186 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L37_except_error) | |
16187 __Pyx_GOTREF(__pyx_t_7); | |
16188 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_7); | |
16189 __pyx_t_7 = 0; | |
16190 goto __pyx_L43; | |
16191 } | |
16192 | |
16193 /* "pysam/libcvcf.pyx":422 | |
16194 * elif data['number'] == '#genotypes': t = self.NT_GENOTYPES | |
16195 * elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES | |
16196 * elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES # <<<<<<<<<<<<<< | |
16197 * # abbreviations added in VCF version v4.1 | |
16198 * elif data['number'] == 'A': t = self.NT_ALLELES | |
16199 */ | |
16200 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L37_except_error) | |
16201 __Pyx_GOTREF(__pyx_t_7); | |
16202 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u_phased_genotypes, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 422, __pyx_L37_except_error) | |
16203 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16204 if (__pyx_t_2) { | |
16205 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L37_except_error) | |
16206 __Pyx_GOTREF(__pyx_t_7); | |
16207 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_7); | |
16208 __pyx_t_7 = 0; | |
16209 goto __pyx_L43; | |
16210 } | |
16211 | |
16212 /* "pysam/libcvcf.pyx":424 | |
16213 * elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES | |
16214 * # abbreviations added in VCF version v4.1 | |
16215 * elif data['number'] == 'A': t = self.NT_ALLELES # <<<<<<<<<<<<<< | |
16216 * elif data['number'] == 'G': t = self.NT_GENOTYPES | |
16217 * else: | |
16218 */ | |
16219 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L37_except_error) | |
16220 __Pyx_GOTREF(__pyx_t_7); | |
16221 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_n_u_A, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 424, __pyx_L37_except_error) | |
16222 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16223 if (__pyx_t_2) { | |
16224 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L37_except_error) | |
16225 __Pyx_GOTREF(__pyx_t_7); | |
16226 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_7); | |
16227 __pyx_t_7 = 0; | |
16228 goto __pyx_L43; | |
16229 } | |
16230 | |
16231 /* "pysam/libcvcf.pyx":425 | |
16232 * # abbreviations added in VCF version v4.1 | |
16233 * elif data['number'] == 'A': t = self.NT_ALLELES | |
16234 * elif data['number'] == 'G': t = self.NT_GENOTYPES # <<<<<<<<<<<<<< | |
16235 * else: | |
16236 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
16237 */ | |
16238 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_number); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L37_except_error) | |
16239 __Pyx_GOTREF(__pyx_t_7); | |
16240 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_n_u_G, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 425, __pyx_L37_except_error) | |
16241 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16242 if (__pyx_t_2) { | |
16243 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L37_except_error) | |
16244 __Pyx_GOTREF(__pyx_t_7); | |
16245 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_7); | |
16246 __pyx_t_7 = 0; | |
16247 goto __pyx_L43; | |
16248 } | |
16249 | |
16250 /* "pysam/libcvcf.pyx":427 | |
16251 * elif data['number'] == 'G': t = self.NT_GENOTYPES | |
16252 * else: | |
16253 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) # <<<<<<<<<<<<<< | |
16254 * # if number is 0 - type must be Flag | |
16255 * if n == 0 and data['type'] != 'Flag': | |
16256 */ | |
16257 /*else*/ { | |
16258 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L37_except_error) | |
16259 __Pyx_GOTREF(__pyx_t_3); | |
16260 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 427, __pyx_L37_except_error) | |
16261 __Pyx_GOTREF(__pyx_t_11); | |
16262 __pyx_t_16 = NULL; | |
16263 __pyx_t_5 = 0; | |
16264 #if CYTHON_UNPACK_METHODS | |
16265 if (likely(PyMethod_Check(__pyx_t_3))) { | |
16266 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); | |
16267 if (likely(__pyx_t_16)) { | |
16268 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
16269 __Pyx_INCREF(__pyx_t_16); | |
16270 __Pyx_INCREF(function); | |
16271 __Pyx_DECREF_SET(__pyx_t_3, function); | |
16272 __pyx_t_5 = 1; | |
16273 } | |
16274 } | |
16275 #endif | |
16276 { | |
16277 PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_v_line, __pyx_t_11}; | |
16278 __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
16279 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
16280 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
16281 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L37_except_error) | |
16282 __Pyx_GOTREF(__pyx_t_7); | |
16283 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
16284 } | |
16285 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16286 } | |
16287 __pyx_L43:; | |
16288 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16289 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
16290 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; | |
16291 goto __pyx_L36_exception_handled; | |
16292 } | |
16293 goto __pyx_L37_except_error; | |
16294 | |
16295 /* "pysam/libcvcf.pyx":412 | |
16296 * else: data['missing'] = '.' | |
16297 * if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
16298 * try: # <<<<<<<<<<<<<< | |
16299 * n = int(data['number']) | |
16300 * t = self.NT_NUMBER | |
16301 */ | |
16302 __pyx_L37_except_error:; | |
16303 __Pyx_XGIVEREF(__pyx_t_12); | |
16304 __Pyx_XGIVEREF(__pyx_t_13); | |
16305 __Pyx_XGIVEREF(__pyx_t_14); | |
16306 __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); | |
16307 goto __pyx_L1_error; | |
16308 __pyx_L36_exception_handled:; | |
16309 __Pyx_XGIVEREF(__pyx_t_12); | |
16310 __Pyx_XGIVEREF(__pyx_t_13); | |
16311 __Pyx_XGIVEREF(__pyx_t_14); | |
16312 __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); | |
16313 __pyx_L40_try_end:; | |
16314 } | |
16315 | |
16316 /* "pysam/libcvcf.pyx":429 | |
16317 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
16318 * # if number is 0 - type must be Flag | |
16319 * if n == 0 and data['type'] != 'Flag': # <<<<<<<<<<<<<< | |
16320 * self.error( line, self.ZERO_FOR_NON_FLAG_FIELD) | |
16321 * # force type 'Flag' if no number | |
16322 */ | |
16323 __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_n, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 429, __pyx_L1_error) | |
16324 if (__pyx_t_6) { | |
16325 } else { | |
16326 __pyx_t_2 = __pyx_t_6; | |
16327 goto __pyx_L45_bool_binop_done; | |
16328 } | |
16329 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 429, __pyx_L1_error) | |
16330 __Pyx_GOTREF(__pyx_t_10); | |
16331 __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_10, __pyx_n_u_Flag, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 429, __pyx_L1_error) | |
16332 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
16333 __pyx_t_2 = __pyx_t_6; | |
16334 __pyx_L45_bool_binop_done:; | |
16335 if (__pyx_t_2) { | |
16336 | |
16337 /* "pysam/libcvcf.pyx":430 | |
16338 * # if number is 0 - type must be Flag | |
16339 * if n == 0 and data['type'] != 'Flag': | |
16340 * self.error( line, self.ZERO_FOR_NON_FLAG_FIELD) # <<<<<<<<<<<<<< | |
16341 * # force type 'Flag' if no number | |
16342 * data['type'] = 'Flag' | |
16343 */ | |
16344 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) | |
16345 __Pyx_GOTREF(__pyx_t_4); | |
16346 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ZERO_FOR_NON_FLAG_FIELD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) | |
16347 __Pyx_GOTREF(__pyx_t_1); | |
16348 __pyx_t_7 = NULL; | |
16349 __pyx_t_5 = 0; | |
16350 #if CYTHON_UNPACK_METHODS | |
16351 if (likely(PyMethod_Check(__pyx_t_4))) { | |
16352 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); | |
16353 if (likely(__pyx_t_7)) { | |
16354 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
16355 __Pyx_INCREF(__pyx_t_7); | |
16356 __Pyx_INCREF(function); | |
16357 __Pyx_DECREF_SET(__pyx_t_4, function); | |
16358 __pyx_t_5 = 1; | |
16359 } | |
16360 } | |
16361 #endif | |
16362 { | |
16363 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_line, __pyx_t_1}; | |
16364 __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); | |
16365 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16366 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16367 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 430, __pyx_L1_error) | |
16368 __Pyx_GOTREF(__pyx_t_10); | |
16369 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
16370 } | |
16371 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
16372 | |
16373 /* "pysam/libcvcf.pyx":432 | |
16374 * self.error( line, self.ZERO_FOR_NON_FLAG_FIELD) | |
16375 * # force type 'Flag' if no number | |
16376 * data['type'] = 'Flag' # <<<<<<<<<<<<<< | |
16377 * | |
16378 * return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing']) | |
16379 */ | |
16380 if (unlikely((PyDict_SetItem(__pyx_v_data, __pyx_n_u_type, __pyx_n_u_Flag) < 0))) __PYX_ERR(0, 432, __pyx_L1_error) | |
16381 | |
16382 /* "pysam/libcvcf.pyx":429 | |
16383 * self.error(line,self.BADLY_FORMATTED_FORMAT_STRING) | |
16384 * # if number is 0 - type must be Flag | |
16385 * if n == 0 and data['type'] != 'Flag': # <<<<<<<<<<<<<< | |
16386 * self.error( line, self.ZERO_FOR_NON_FLAG_FIELD) | |
16387 * # force type 'Flag' if no number | |
16388 */ | |
16389 } | |
16390 | |
16391 /* "pysam/libcvcf.pyx":434 | |
16392 * data['type'] = 'Flag' | |
16393 * | |
16394 * return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing']) # <<<<<<<<<<<<<< | |
16395 * | |
16396 * def format_format( self, fmt, filter=False ): | |
16397 */ | |
16398 __Pyx_XDECREF(__pyx_r); | |
16399 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) | |
16400 __Pyx_GOTREF(__pyx_t_4); | |
16401 __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_id_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) | |
16402 __Pyx_GOTREF(__pyx_t_1); | |
16403 if (unlikely(!__pyx_v_t)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 434, __pyx_L1_error) } | |
16404 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error) | |
16405 __Pyx_GOTREF(__pyx_t_7); | |
16406 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_descr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) | |
16407 __Pyx_GOTREF(__pyx_t_3); | |
16408 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_u_missing); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error) | |
16409 __Pyx_GOTREF(__pyx_t_11); | |
16410 __pyx_t_16 = NULL; | |
16411 __pyx_t_5 = 0; | |
16412 #if CYTHON_UNPACK_METHODS | |
16413 if (unlikely(PyMethod_Check(__pyx_t_4))) { | |
16414 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_4); | |
16415 if (likely(__pyx_t_16)) { | |
16416 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
16417 __Pyx_INCREF(__pyx_t_16); | |
16418 __Pyx_INCREF(function); | |
16419 __Pyx_DECREF_SET(__pyx_t_4, function); | |
16420 __pyx_t_5 = 1; | |
16421 } | |
16422 } | |
16423 #endif | |
16424 { | |
16425 PyObject *__pyx_callargs[7] = {__pyx_t_16, __pyx_t_1, __pyx_v_t, __pyx_v_n, __pyx_t_7, __pyx_t_3, __pyx_t_11}; | |
16426 __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
16427 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
16428 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16429 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
16430 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
16431 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
16432 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 434, __pyx_L1_error) | |
16433 __Pyx_GOTREF(__pyx_t_10); | |
16434 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
16435 } | |
16436 __pyx_r = __pyx_t_10; | |
16437 __pyx_t_10 = 0; | |
16438 goto __pyx_L0; | |
16439 | |
16440 /* "pysam/libcvcf.pyx":364 | |
16441 * raise ValueError(errorstring) | |
16442 * | |
16443 * def parse_format(self,line,format,filter=False): # <<<<<<<<<<<<<< | |
16444 * if self._version == 40: | |
16445 * if not format.startswith('<'): | |
16446 */ | |
16447 | |
16448 /* function exit code */ | |
16449 __pyx_L1_error:; | |
16450 __Pyx_XDECREF(__pyx_t_1); | |
16451 __Pyx_XDECREF(__pyx_t_3); | |
16452 __Pyx_XDECREF(__pyx_t_4); | |
16453 __Pyx_XDECREF(__pyx_t_7); | |
16454 __Pyx_XDECREF(__pyx_t_10); | |
16455 __Pyx_XDECREF(__pyx_t_11); | |
16456 __Pyx_XDECREF(__pyx_t_16); | |
16457 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_format", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16458 __pyx_r = NULL; | |
16459 __pyx_L0:; | |
16460 __Pyx_XDECREF(__pyx_v_data); | |
16461 __Pyx_XDECREF(__pyx_v_idx); | |
16462 __Pyx_XDECREF(__pyx_v_elts); | |
16463 __Pyx_XDECREF(__pyx_v_first); | |
16464 __Pyx_XDECREF(__pyx_v_rest); | |
16465 __Pyx_XDECREF(__pyx_v_n); | |
16466 __Pyx_XDECREF(__pyx_v_t); | |
16467 __Pyx_XDECREF(__pyx_v_format); | |
16468 __Pyx_XGIVEREF(__pyx_r); | |
16469 __Pyx_RefNannyFinishContext(); | |
16470 return __pyx_r; | |
16471 } | |
16472 | |
16473 /* "pysam/libcvcf.pyx":436 | |
16474 * return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing']) | |
16475 * | |
16476 * def format_format( self, fmt, filter=False ): # <<<<<<<<<<<<<< | |
16477 * values = [('ID',fmt.id)] | |
16478 * if fmt.number != None and not filter: | |
16479 */ | |
16480 | |
16481 /* Python wrapper */ | |
16482 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_7format_format(PyObject *__pyx_self, | |
16483 #if CYTHON_METH_FASTCALL | |
16484 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16485 #else | |
16486 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16487 #endif | |
16488 ); /*proto*/ | |
16489 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_6format_format, "VCF.format_format(self, fmt, filter=False)"); | |
16490 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_7format_format = {"format_format", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_7format_format, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_6format_format}; | |
16491 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_7format_format(PyObject *__pyx_self, | |
16492 #if CYTHON_METH_FASTCALL | |
16493 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16494 #else | |
16495 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16496 #endif | |
16497 ) { | |
16498 PyObject *__pyx_v_self = 0; | |
16499 PyObject *__pyx_v_fmt = 0; | |
16500 PyObject *__pyx_v_filter = 0; | |
16501 #if !CYTHON_METH_FASTCALL | |
16502 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
16503 #endif | |
16504 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16505 PyObject* values[3] = {0,0,0}; | |
16506 int __pyx_lineno = 0; | |
16507 const char *__pyx_filename = NULL; | |
16508 int __pyx_clineno = 0; | |
16509 PyObject *__pyx_r = 0; | |
16510 __Pyx_RefNannyDeclarations | |
16511 __Pyx_RefNannySetupContext("format_format (wrapper)", 0); | |
16512 #if !CYTHON_METH_FASTCALL | |
16513 #if CYTHON_ASSUME_SAFE_MACROS | |
16514 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16515 #else | |
16516 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
16517 #endif | |
16518 #endif | |
16519 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
16520 { | |
16521 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_fmt,&__pyx_n_s_filter_2,0}; | |
16522 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); | |
16523 if (__pyx_kwds) { | |
16524 Py_ssize_t kw_args; | |
16525 switch (__pyx_nargs) { | |
16526 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
16527 CYTHON_FALLTHROUGH; | |
16528 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
16529 CYTHON_FALLTHROUGH; | |
16530 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16531 CYTHON_FALLTHROUGH; | |
16532 case 0: break; | |
16533 default: goto __pyx_L5_argtuple_error; | |
16534 } | |
16535 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
16536 switch (__pyx_nargs) { | |
16537 case 0: | |
16538 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
16539 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
16540 kw_args--; | |
16541 } | |
16542 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) | |
16543 else goto __pyx_L5_argtuple_error; | |
16544 CYTHON_FALLTHROUGH; | |
16545 case 1: | |
16546 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fmt)) != 0)) { | |
16547 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
16548 kw_args--; | |
16549 } | |
16550 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) | |
16551 else { | |
16552 __Pyx_RaiseArgtupleInvalid("format_format", 0, 2, 3, 1); __PYX_ERR(0, 436, __pyx_L3_error) | |
16553 } | |
16554 CYTHON_FALLTHROUGH; | |
16555 case 2: | |
16556 if (kw_args > 0) { | |
16557 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filter_2); | |
16558 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
16559 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) | |
16560 } | |
16561 } | |
16562 if (unlikely(kw_args > 0)) { | |
16563 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
16564 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "format_format") < 0)) __PYX_ERR(0, 436, __pyx_L3_error) | |
16565 } | |
16566 } else { | |
16567 switch (__pyx_nargs) { | |
16568 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
16569 CYTHON_FALLTHROUGH; | |
16570 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
16571 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16572 break; | |
16573 default: goto __pyx_L5_argtuple_error; | |
16574 } | |
16575 } | |
16576 __pyx_v_self = values[0]; | |
16577 __pyx_v_fmt = values[1]; | |
16578 __pyx_v_filter = values[2]; | |
16579 } | |
16580 goto __pyx_L6_skip; | |
16581 __pyx_L5_argtuple_error:; | |
16582 __Pyx_RaiseArgtupleInvalid("format_format", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 436, __pyx_L3_error) | |
16583 __pyx_L6_skip:; | |
16584 goto __pyx_L4_argument_unpacking_done; | |
16585 __pyx_L3_error:; | |
16586 { | |
16587 Py_ssize_t __pyx_temp; | |
16588 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16589 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16590 } | |
16591 } | |
16592 __Pyx_AddTraceback("pysam.libcvcf.VCF.format_format", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16593 __Pyx_RefNannyFinishContext(); | |
16594 return NULL; | |
16595 __pyx_L4_argument_unpacking_done:; | |
16596 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_6format_format(__pyx_self, __pyx_v_self, __pyx_v_fmt, __pyx_v_filter); | |
16597 | |
16598 /* function exit code */ | |
16599 { | |
16600 Py_ssize_t __pyx_temp; | |
16601 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16602 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16603 } | |
16604 } | |
16605 __Pyx_RefNannyFinishContext(); | |
16606 return __pyx_r; | |
16607 } | |
16608 | |
16609 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_6format_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fmt, PyObject *__pyx_v_filter) { | |
16610 PyObject *__pyx_v_values = NULL; | |
16611 PyObject *__pyx_v_nmb = NULL; | |
16612 PyObject *__pyx_v_format = NULL; | |
16613 CYTHON_UNUSED PyObject *__pyx_7genexpr__pyx_v_k = NULL; | |
16614 PyObject *__pyx_7genexpr__pyx_v_v = NULL; | |
16615 PyObject *__pyx_8genexpr1__pyx_v_k = NULL; | |
16616 PyObject *__pyx_8genexpr1__pyx_v_v = NULL; | |
16617 PyObject *__pyx_r = NULL; | |
16618 __Pyx_RefNannyDeclarations | |
16619 PyObject *__pyx_t_1 = NULL; | |
16620 PyObject *__pyx_t_2 = NULL; | |
16621 int __pyx_t_3; | |
16622 int __pyx_t_4; | |
16623 int __pyx_t_5; | |
16624 PyObject *__pyx_t_6 = NULL; | |
16625 int __pyx_t_7; | |
16626 Py_ssize_t __pyx_t_8; | |
16627 PyObject *__pyx_t_9 = NULL; | |
16628 PyObject *__pyx_t_10 = NULL; | |
16629 PyObject *__pyx_t_11 = NULL; | |
16630 PyObject *(*__pyx_t_12)(PyObject *); | |
16631 Py_ssize_t __pyx_t_13; | |
16632 Py_UCS4 __pyx_t_14; | |
16633 int __pyx_lineno = 0; | |
16634 const char *__pyx_filename = NULL; | |
16635 int __pyx_clineno = 0; | |
16636 __Pyx_RefNannySetupContext("format_format", 1); | |
16637 | |
16638 /* "pysam/libcvcf.pyx":437 | |
16639 * | |
16640 * def format_format( self, fmt, filter=False ): | |
16641 * values = [('ID',fmt.id)] # <<<<<<<<<<<<<< | |
16642 * if fmt.number != None and not filter: | |
16643 * if fmt.numbertype == self.NT_UNKNOWN: nmb = "." | |
16644 */ | |
16645 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_id_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) | |
16646 __Pyx_GOTREF(__pyx_t_1); | |
16647 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) | |
16648 __Pyx_GOTREF(__pyx_t_2); | |
16649 __Pyx_INCREF(__pyx_n_u_ID_2); | |
16650 __Pyx_GIVEREF(__pyx_n_u_ID_2); | |
16651 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_ID_2)) __PYX_ERR(0, 437, __pyx_L1_error); | |
16652 __Pyx_GIVEREF(__pyx_t_1); | |
16653 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error); | |
16654 __pyx_t_1 = 0; | |
16655 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) | |
16656 __Pyx_GOTREF(__pyx_t_1); | |
16657 __Pyx_GIVEREF(__pyx_t_2); | |
16658 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error); | |
16659 __pyx_t_2 = 0; | |
16660 __pyx_v_values = ((PyObject*)__pyx_t_1); | |
16661 __pyx_t_1 = 0; | |
16662 | |
16663 /* "pysam/libcvcf.pyx":438 | |
16664 * def format_format( self, fmt, filter=False ): | |
16665 * values = [('ID',fmt.id)] | |
16666 * if fmt.number != None and not filter: # <<<<<<<<<<<<<< | |
16667 * if fmt.numbertype == self.NT_UNKNOWN: nmb = "." | |
16668 * elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number) | |
16669 */ | |
16670 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) | |
16671 __Pyx_GOTREF(__pyx_t_1); | |
16672 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) | |
16673 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16674 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 438, __pyx_L1_error) | |
16675 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16676 if (__pyx_t_4) { | |
16677 } else { | |
16678 __pyx_t_3 = __pyx_t_4; | |
16679 goto __pyx_L4_bool_binop_done; | |
16680 } | |
16681 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 438, __pyx_L1_error) | |
16682 __pyx_t_5 = (!__pyx_t_4); | |
16683 __pyx_t_3 = __pyx_t_5; | |
16684 __pyx_L4_bool_binop_done:; | |
16685 if (__pyx_t_3) { | |
16686 | |
16687 /* "pysam/libcvcf.pyx":439 | |
16688 * values = [('ID',fmt.id)] | |
16689 * if fmt.number != None and not filter: | |
16690 * if fmt.numbertype == self.NT_UNKNOWN: nmb = "." # <<<<<<<<<<<<<< | |
16691 * elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number) | |
16692 * elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles" | |
16693 */ | |
16694 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) | |
16695 __Pyx_GOTREF(__pyx_t_2); | |
16696 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) | |
16697 __Pyx_GOTREF(__pyx_t_1); | |
16698 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) | |
16699 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16700 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16701 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 439, __pyx_L1_error) | |
16702 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
16703 if (__pyx_t_3) { | |
16704 __Pyx_INCREF(__pyx_kp_u__5); | |
16705 __pyx_v_nmb = __pyx_kp_u__5; | |
16706 goto __pyx_L6; | |
16707 } | |
16708 | |
16709 /* "pysam/libcvcf.pyx":440 | |
16710 * if fmt.number != None and not filter: | |
16711 * if fmt.numbertype == self.NT_UNKNOWN: nmb = "." | |
16712 * elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number) # <<<<<<<<<<<<<< | |
16713 * elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles" | |
16714 * elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles" | |
16715 */ | |
16716 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L1_error) | |
16717 __Pyx_GOTREF(__pyx_t_6); | |
16718 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) | |
16719 __Pyx_GOTREF(__pyx_t_1); | |
16720 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) | |
16721 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
16722 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16723 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 440, __pyx_L1_error) | |
16724 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16725 if (__pyx_t_3) { | |
16726 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) | |
16727 __Pyx_GOTREF(__pyx_t_2); | |
16728 __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) | |
16729 __Pyx_GOTREF(__pyx_t_1); | |
16730 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16731 __pyx_v_nmb = __pyx_t_1; | |
16732 __pyx_t_1 = 0; | |
16733 goto __pyx_L6; | |
16734 } | |
16735 | |
16736 /* "pysam/libcvcf.pyx":441 | |
16737 * if fmt.numbertype == self.NT_UNKNOWN: nmb = "." | |
16738 * elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number) | |
16739 * elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles" # <<<<<<<<<<<<<< | |
16740 * elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles" | |
16741 * elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes" | |
16742 */ | |
16743 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) | |
16744 __Pyx_GOTREF(__pyx_t_1); | |
16745 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) | |
16746 __Pyx_GOTREF(__pyx_t_2); | |
16747 __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error) | |
16748 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16749 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16750 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) | |
16751 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
16752 if (__pyx_t_3) { | |
16753 __Pyx_INCREF(__pyx_kp_u_alleles); | |
16754 __pyx_v_nmb = __pyx_kp_u_alleles; | |
16755 goto __pyx_L6; | |
16756 } | |
16757 | |
16758 /* "pysam/libcvcf.pyx":442 | |
16759 * elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number) | |
16760 * elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles" | |
16761 * elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles" # <<<<<<<<<<<<<< | |
16762 * elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes" | |
16763 * elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes" | |
16764 */ | |
16765 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) | |
16766 __Pyx_GOTREF(__pyx_t_6); | |
16767 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NR_ALLELES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error) | |
16768 __Pyx_GOTREF(__pyx_t_2); | |
16769 __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) | |
16770 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
16771 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16772 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 442, __pyx_L1_error) | |
16773 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16774 if (__pyx_t_3) { | |
16775 __Pyx_INCREF(__pyx_kp_u_nonref_alleles); | |
16776 __pyx_v_nmb = __pyx_kp_u_nonref_alleles; | |
16777 goto __pyx_L6; | |
16778 } | |
16779 | |
16780 /* "pysam/libcvcf.pyx":443 | |
16781 * elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles" | |
16782 * elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles" | |
16783 * elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes" # <<<<<<<<<<<<<< | |
16784 * elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes" | |
16785 * else: | |
16786 */ | |
16787 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) | |
16788 __Pyx_GOTREF(__pyx_t_1); | |
16789 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) | |
16790 __Pyx_GOTREF(__pyx_t_2); | |
16791 __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error) | |
16792 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16793 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16794 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 443, __pyx_L1_error) | |
16795 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
16796 if (__pyx_t_3) { | |
16797 __Pyx_INCREF(__pyx_kp_u_genotypes); | |
16798 __pyx_v_nmb = __pyx_kp_u_genotypes; | |
16799 goto __pyx_L6; | |
16800 } | |
16801 | |
16802 /* "pysam/libcvcf.pyx":444 | |
16803 * elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles" | |
16804 * elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes" | |
16805 * elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes" # <<<<<<<<<<<<<< | |
16806 * else: | |
16807 * raise ValueError("Unknown number type encountered: %s" % fmt.numbertype) | |
16808 */ | |
16809 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error) | |
16810 __Pyx_GOTREF(__pyx_t_6); | |
16811 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) | |
16812 __Pyx_GOTREF(__pyx_t_2); | |
16813 __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) | |
16814 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
16815 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16816 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 444, __pyx_L1_error) | |
16817 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16818 if (likely(__pyx_t_3)) { | |
16819 __Pyx_INCREF(__pyx_kp_u_phased_genotypes); | |
16820 __pyx_v_nmb = __pyx_kp_u_phased_genotypes; | |
16821 goto __pyx_L6; | |
16822 } | |
16823 | |
16824 /* "pysam/libcvcf.pyx":446 | |
16825 * elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes" | |
16826 * else: | |
16827 * raise ValueError("Unknown number type encountered: %s" % fmt.numbertype) # <<<<<<<<<<<<<< | |
16828 * values.append( ('Number',nmb) ) | |
16829 * values.append( ('Type', fmt.type) ) | |
16830 */ | |
16831 /*else*/ { | |
16832 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) | |
16833 __Pyx_GOTREF(__pyx_t_1); | |
16834 __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Unknown_number_type_encountered, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) | |
16835 __Pyx_GOTREF(__pyx_t_2); | |
16836 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16837 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) | |
16838 __Pyx_GOTREF(__pyx_t_1); | |
16839 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16840 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
16841 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16842 __PYX_ERR(0, 446, __pyx_L1_error) | |
16843 } | |
16844 __pyx_L6:; | |
16845 | |
16846 /* "pysam/libcvcf.pyx":447 | |
16847 * else: | |
16848 * raise ValueError("Unknown number type encountered: %s" % fmt.numbertype) | |
16849 * values.append( ('Number',nmb) ) # <<<<<<<<<<<<<< | |
16850 * values.append( ('Type', fmt.type) ) | |
16851 * values.append( ('Description', '"' + fmt.description + '"') ) | |
16852 */ | |
16853 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) | |
16854 __Pyx_GOTREF(__pyx_t_1); | |
16855 __Pyx_INCREF(__pyx_n_u_Number_2); | |
16856 __Pyx_GIVEREF(__pyx_n_u_Number_2); | |
16857 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_Number_2)) __PYX_ERR(0, 447, __pyx_L1_error); | |
16858 __Pyx_INCREF(__pyx_v_nmb); | |
16859 __Pyx_GIVEREF(__pyx_v_nmb); | |
16860 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nmb)) __PYX_ERR(0, 447, __pyx_L1_error); | |
16861 __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 447, __pyx_L1_error) | |
16862 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16863 | |
16864 /* "pysam/libcvcf.pyx":448 | |
16865 * raise ValueError("Unknown number type encountered: %s" % fmt.numbertype) | |
16866 * values.append( ('Number',nmb) ) | |
16867 * values.append( ('Type', fmt.type) ) # <<<<<<<<<<<<<< | |
16868 * values.append( ('Description', '"' + fmt.description + '"') ) | |
16869 * if self._version == 33: | |
16870 */ | |
16871 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) | |
16872 __Pyx_GOTREF(__pyx_t_1); | |
16873 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) | |
16874 __Pyx_GOTREF(__pyx_t_2); | |
16875 __Pyx_INCREF(__pyx_n_u_Type_2); | |
16876 __Pyx_GIVEREF(__pyx_n_u_Type_2); | |
16877 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_Type_2)) __PYX_ERR(0, 448, __pyx_L1_error); | |
16878 __Pyx_GIVEREF(__pyx_t_1); | |
16879 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error); | |
16880 __pyx_t_1 = 0; | |
16881 __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 448, __pyx_L1_error) | |
16882 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16883 | |
16884 /* "pysam/libcvcf.pyx":438 | |
16885 * def format_format( self, fmt, filter=False ): | |
16886 * values = [('ID',fmt.id)] | |
16887 * if fmt.number != None and not filter: # <<<<<<<<<<<<<< | |
16888 * if fmt.numbertype == self.NT_UNKNOWN: nmb = "." | |
16889 * elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number) | |
16890 */ | |
16891 } | |
16892 | |
16893 /* "pysam/libcvcf.pyx":449 | |
16894 * values.append( ('Number',nmb) ) | |
16895 * values.append( ('Type', fmt.type) ) | |
16896 * values.append( ('Description', '"' + fmt.description + '"') ) # <<<<<<<<<<<<<< | |
16897 * if self._version == 33: | |
16898 * format = ",".join([v for k,v in values]) | |
16899 */ | |
16900 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_description); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) | |
16901 __Pyx_GOTREF(__pyx_t_2); | |
16902 __pyx_t_1 = PyNumber_Add(__pyx_kp_u__19, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) | |
16903 __Pyx_GOTREF(__pyx_t_1); | |
16904 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16905 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) | |
16906 __Pyx_GOTREF(__pyx_t_2); | |
16907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16908 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) | |
16909 __Pyx_GOTREF(__pyx_t_1); | |
16910 __Pyx_INCREF(__pyx_n_u_Description_2); | |
16911 __Pyx_GIVEREF(__pyx_n_u_Description_2); | |
16912 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_Description_2)) __PYX_ERR(0, 449, __pyx_L1_error); | |
16913 __Pyx_GIVEREF(__pyx_t_2); | |
16914 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error); | |
16915 __pyx_t_2 = 0; | |
16916 __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 449, __pyx_L1_error) | |
16917 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16918 | |
16919 /* "pysam/libcvcf.pyx":450 | |
16920 * values.append( ('Type', fmt.type) ) | |
16921 * values.append( ('Description', '"' + fmt.description + '"') ) | |
16922 * if self._version == 33: # <<<<<<<<<<<<<< | |
16923 * format = ",".join([v for k,v in values]) | |
16924 * else: | |
16925 */ | |
16926 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) | |
16927 __Pyx_GOTREF(__pyx_t_1); | |
16928 __pyx_t_3 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_33, 33, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 450, __pyx_L1_error) | |
16929 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16930 if (__pyx_t_3) { | |
16931 | |
16932 /* "pysam/libcvcf.pyx":451 | |
16933 * values.append( ('Description', '"' + fmt.description + '"') ) | |
16934 * if self._version == 33: | |
16935 * format = ",".join([v for k,v in values]) # <<<<<<<<<<<<<< | |
16936 * else: | |
16937 * format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">" | |
16938 */ | |
16939 { /* enter inner scope */ | |
16940 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L10_error) | |
16941 __Pyx_GOTREF(__pyx_t_1); | |
16942 __pyx_t_2 = __pyx_v_values; __Pyx_INCREF(__pyx_t_2); | |
16943 __pyx_t_8 = 0; | |
16944 for (;;) { | |
16945 { | |
16946 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
16947 #if !CYTHON_ASSUME_SAFE_MACROS | |
16948 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L10_error) | |
16949 #endif | |
16950 if (__pyx_t_8 >= __pyx_temp) break; | |
16951 } | |
16952 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
16953 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 451, __pyx_L10_error) | |
16954 #else | |
16955 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L10_error) | |
16956 __Pyx_GOTREF(__pyx_t_6); | |
16957 #endif | |
16958 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { | |
16959 PyObject* sequence = __pyx_t_6; | |
16960 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
16961 if (unlikely(size != 2)) { | |
16962 if (size > 2) __Pyx_RaiseTooManyValuesError(2); | |
16963 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
16964 __PYX_ERR(0, 451, __pyx_L10_error) | |
16965 } | |
16966 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
16967 if (likely(PyTuple_CheckExact(sequence))) { | |
16968 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); | |
16969 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); | |
16970 } else { | |
16971 __pyx_t_9 = PyList_GET_ITEM(sequence, 0); | |
16972 __pyx_t_10 = PyList_GET_ITEM(sequence, 1); | |
16973 } | |
16974 __Pyx_INCREF(__pyx_t_9); | |
16975 __Pyx_INCREF(__pyx_t_10); | |
16976 #else | |
16977 __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 451, __pyx_L10_error) | |
16978 __Pyx_GOTREF(__pyx_t_9); | |
16979 __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 451, __pyx_L10_error) | |
16980 __Pyx_GOTREF(__pyx_t_10); | |
16981 #endif | |
16982 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
16983 } else { | |
16984 Py_ssize_t index = -1; | |
16985 __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 451, __pyx_L10_error) | |
16986 __Pyx_GOTREF(__pyx_t_11); | |
16987 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
16988 __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); | |
16989 index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; | |
16990 __Pyx_GOTREF(__pyx_t_9); | |
16991 index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed; | |
16992 __Pyx_GOTREF(__pyx_t_10); | |
16993 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 451, __pyx_L10_error) | |
16994 __pyx_t_12 = NULL; | |
16995 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
16996 goto __pyx_L14_unpacking_done; | |
16997 __pyx_L13_unpacking_failed:; | |
16998 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
16999 __pyx_t_12 = NULL; | |
17000 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
17001 __PYX_ERR(0, 451, __pyx_L10_error) | |
17002 __pyx_L14_unpacking_done:; | |
17003 } | |
17004 __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_9); | |
17005 __pyx_t_9 = 0; | |
17006 __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_10); | |
17007 __pyx_t_10 = 0; | |
17008 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_v))) __PYX_ERR(0, 451, __pyx_L10_error) | |
17009 } | |
17010 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17011 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; | |
17012 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); __pyx_7genexpr__pyx_v_v = 0; | |
17013 goto __pyx_L16_exit_scope; | |
17014 __pyx_L10_error:; | |
17015 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; | |
17016 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); __pyx_7genexpr__pyx_v_v = 0; | |
17017 goto __pyx_L1_error; | |
17018 __pyx_L16_exit_scope:; | |
17019 } /* exit inner scope */ | |
17020 __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) | |
17021 __Pyx_GOTREF(__pyx_t_2); | |
17022 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17023 __pyx_v_format = ((PyObject*)__pyx_t_2); | |
17024 __pyx_t_2 = 0; | |
17025 | |
17026 /* "pysam/libcvcf.pyx":450 | |
17027 * values.append( ('Type', fmt.type) ) | |
17028 * values.append( ('Description', '"' + fmt.description + '"') ) | |
17029 * if self._version == 33: # <<<<<<<<<<<<<< | |
17030 * format = ",".join([v for k,v in values]) | |
17031 * else: | |
17032 */ | |
17033 goto __pyx_L7; | |
17034 } | |
17035 | |
17036 /* "pysam/libcvcf.pyx":453 | |
17037 * format = ",".join([v for k,v in values]) | |
17038 * else: | |
17039 * format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">" # <<<<<<<<<<<<<< | |
17040 * return format | |
17041 * | |
17042 */ | |
17043 /*else*/ { | |
17044 { /* enter inner scope */ | |
17045 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L19_error) | |
17046 __Pyx_GOTREF(__pyx_t_2); | |
17047 __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); | |
17048 __pyx_t_8 = 0; | |
17049 for (;;) { | |
17050 { | |
17051 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
17052 #if !CYTHON_ASSUME_SAFE_MACROS | |
17053 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 453, __pyx_L19_error) | |
17054 #endif | |
17055 if (__pyx_t_8 >= __pyx_temp) break; | |
17056 } | |
17057 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
17058 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 453, __pyx_L19_error) | |
17059 #else | |
17060 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 453, __pyx_L19_error) | |
17061 __Pyx_GOTREF(__pyx_t_6); | |
17062 #endif | |
17063 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { | |
17064 PyObject* sequence = __pyx_t_6; | |
17065 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
17066 if (unlikely(size != 2)) { | |
17067 if (size > 2) __Pyx_RaiseTooManyValuesError(2); | |
17068 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
17069 __PYX_ERR(0, 453, __pyx_L19_error) | |
17070 } | |
17071 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
17072 if (likely(PyTuple_CheckExact(sequence))) { | |
17073 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); | |
17074 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); | |
17075 } else { | |
17076 __pyx_t_10 = PyList_GET_ITEM(sequence, 0); | |
17077 __pyx_t_9 = PyList_GET_ITEM(sequence, 1); | |
17078 } | |
17079 __Pyx_INCREF(__pyx_t_10); | |
17080 __Pyx_INCREF(__pyx_t_9); | |
17081 #else | |
17082 __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 453, __pyx_L19_error) | |
17083 __Pyx_GOTREF(__pyx_t_10); | |
17084 __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 453, __pyx_L19_error) | |
17085 __Pyx_GOTREF(__pyx_t_9); | |
17086 #endif | |
17087 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
17088 } else { | |
17089 Py_ssize_t index = -1; | |
17090 __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 453, __pyx_L19_error) | |
17091 __Pyx_GOTREF(__pyx_t_11); | |
17092 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
17093 __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); | |
17094 index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L22_unpacking_failed; | |
17095 __Pyx_GOTREF(__pyx_t_10); | |
17096 index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L22_unpacking_failed; | |
17097 __Pyx_GOTREF(__pyx_t_9); | |
17098 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 453, __pyx_L19_error) | |
17099 __pyx_t_12 = NULL; | |
17100 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
17101 goto __pyx_L23_unpacking_done; | |
17102 __pyx_L22_unpacking_failed:; | |
17103 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
17104 __pyx_t_12 = NULL; | |
17105 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
17106 __PYX_ERR(0, 453, __pyx_L19_error) | |
17107 __pyx_L23_unpacking_done:; | |
17108 } | |
17109 __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_k, __pyx_t_10); | |
17110 __pyx_t_10 = 0; | |
17111 __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_v, __pyx_t_9); | |
17112 __pyx_t_9 = 0; | |
17113 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 453, __pyx_L19_error) | |
17114 __Pyx_GOTREF(__pyx_t_6); | |
17115 __pyx_t_13 = 0; | |
17116 __pyx_t_14 = 127; | |
17117 __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_8genexpr1__pyx_v_k), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 453, __pyx_L19_error) | |
17118 __Pyx_GOTREF(__pyx_t_9); | |
17119 __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_14; | |
17120 __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); | |
17121 __Pyx_GIVEREF(__pyx_t_9); | |
17122 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); | |
17123 __pyx_t_9 = 0; | |
17124 __Pyx_INCREF(__pyx_kp_u__7); | |
17125 __pyx_t_13 += 1; | |
17126 __Pyx_GIVEREF(__pyx_kp_u__7); | |
17127 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__7); | |
17128 __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_8genexpr1__pyx_v_v), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 453, __pyx_L19_error) | |
17129 __Pyx_GOTREF(__pyx_t_9); | |
17130 __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_14; | |
17131 __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); | |
17132 __Pyx_GIVEREF(__pyx_t_9); | |
17133 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_9); | |
17134 __pyx_t_9 = 0; | |
17135 __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 453, __pyx_L19_error) | |
17136 __Pyx_GOTREF(__pyx_t_9); | |
17137 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
17138 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 453, __pyx_L19_error) | |
17139 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
17140 } | |
17141 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17142 __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k); __pyx_8genexpr1__pyx_v_k = 0; | |
17143 __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_v); __pyx_8genexpr1__pyx_v_v = 0; | |
17144 goto __pyx_L25_exit_scope; | |
17145 __pyx_L19_error:; | |
17146 __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k); __pyx_8genexpr1__pyx_v_k = 0; | |
17147 __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_v); __pyx_8genexpr1__pyx_v_v = 0; | |
17148 goto __pyx_L1_error; | |
17149 __pyx_L25_exit_scope:; | |
17150 } /* exit inner scope */ | |
17151 __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) | |
17152 __Pyx_GOTREF(__pyx_t_1); | |
17153 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17154 __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u__15, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) | |
17155 __Pyx_GOTREF(__pyx_t_2); | |
17156 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17157 __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_2, __pyx_kp_u__16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) | |
17158 __Pyx_GOTREF(__pyx_t_1); | |
17159 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17160 __pyx_v_format = ((PyObject*)__pyx_t_1); | |
17161 __pyx_t_1 = 0; | |
17162 } | |
17163 __pyx_L7:; | |
17164 | |
17165 /* "pysam/libcvcf.pyx":454 | |
17166 * else: | |
17167 * format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">" | |
17168 * return format # <<<<<<<<<<<<<< | |
17169 * | |
17170 * def get_expected(self, format, formatdict, alt): | |
17171 */ | |
17172 __Pyx_XDECREF(__pyx_r); | |
17173 __Pyx_INCREF(__pyx_v_format); | |
17174 __pyx_r = __pyx_v_format; | |
17175 goto __pyx_L0; | |
17176 | |
17177 /* "pysam/libcvcf.pyx":436 | |
17178 * return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing']) | |
17179 * | |
17180 * def format_format( self, fmt, filter=False ): # <<<<<<<<<<<<<< | |
17181 * values = [('ID',fmt.id)] | |
17182 * if fmt.number != None and not filter: | |
17183 */ | |
17184 | |
17185 /* function exit code */ | |
17186 __pyx_L1_error:; | |
17187 __Pyx_XDECREF(__pyx_t_1); | |
17188 __Pyx_XDECREF(__pyx_t_2); | |
17189 __Pyx_XDECREF(__pyx_t_6); | |
17190 __Pyx_XDECREF(__pyx_t_9); | |
17191 __Pyx_XDECREF(__pyx_t_10); | |
17192 __Pyx_XDECREF(__pyx_t_11); | |
17193 __Pyx_AddTraceback("pysam.libcvcf.VCF.format_format", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17194 __pyx_r = NULL; | |
17195 __pyx_L0:; | |
17196 __Pyx_XDECREF(__pyx_v_values); | |
17197 __Pyx_XDECREF(__pyx_v_nmb); | |
17198 __Pyx_XDECREF(__pyx_v_format); | |
17199 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); | |
17200 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); | |
17201 __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k); | |
17202 __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_v); | |
17203 __Pyx_XGIVEREF(__pyx_r); | |
17204 __Pyx_RefNannyFinishContext(); | |
17205 return __pyx_r; | |
17206 } | |
17207 | |
17208 /* "pysam/libcvcf.pyx":456 | |
17209 * return format | |
17210 * | |
17211 * def get_expected(self, format, formatdict, alt): # <<<<<<<<<<<<<< | |
17212 * fmt = formatdict[format] | |
17213 * if fmt.numbertype == self.NT_UNKNOWN: return -1 | |
17214 */ | |
17215 | |
17216 /* Python wrapper */ | |
17217 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_9get_expected(PyObject *__pyx_self, | |
17218 #if CYTHON_METH_FASTCALL | |
17219 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17220 #else | |
17221 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17222 #endif | |
17223 ); /*proto*/ | |
17224 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_8get_expected, "VCF.get_expected(self, format, formatdict, alt)"); | |
17225 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_9get_expected = {"get_expected", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_9get_expected, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_8get_expected}; | |
17226 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_9get_expected(PyObject *__pyx_self, | |
17227 #if CYTHON_METH_FASTCALL | |
17228 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17229 #else | |
17230 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17231 #endif | |
17232 ) { | |
17233 PyObject *__pyx_v_self = 0; | |
17234 PyObject *__pyx_v_format = 0; | |
17235 PyObject *__pyx_v_formatdict = 0; | |
17236 PyObject *__pyx_v_alt = 0; | |
17237 #if !CYTHON_METH_FASTCALL | |
17238 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
17239 #endif | |
17240 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17241 PyObject* values[4] = {0,0,0,0}; | |
17242 int __pyx_lineno = 0; | |
17243 const char *__pyx_filename = NULL; | |
17244 int __pyx_clineno = 0; | |
17245 PyObject *__pyx_r = 0; | |
17246 __Pyx_RefNannyDeclarations | |
17247 __Pyx_RefNannySetupContext("get_expected (wrapper)", 0); | |
17248 #if !CYTHON_METH_FASTCALL | |
17249 #if CYTHON_ASSUME_SAFE_MACROS | |
17250 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
17251 #else | |
17252 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
17253 #endif | |
17254 #endif | |
17255 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
17256 { | |
17257 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_format,&__pyx_n_s_formatdict,&__pyx_n_s_alt,0}; | |
17258 if (__pyx_kwds) { | |
17259 Py_ssize_t kw_args; | |
17260 switch (__pyx_nargs) { | |
17261 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
17262 CYTHON_FALLTHROUGH; | |
17263 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
17264 CYTHON_FALLTHROUGH; | |
17265 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
17266 CYTHON_FALLTHROUGH; | |
17267 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
17268 CYTHON_FALLTHROUGH; | |
17269 case 0: break; | |
17270 default: goto __pyx_L5_argtuple_error; | |
17271 } | |
17272 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
17273 switch (__pyx_nargs) { | |
17274 case 0: | |
17275 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
17276 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
17277 kw_args--; | |
17278 } | |
17279 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) | |
17280 else goto __pyx_L5_argtuple_error; | |
17281 CYTHON_FALLTHROUGH; | |
17282 case 1: | |
17283 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) { | |
17284 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
17285 kw_args--; | |
17286 } | |
17287 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) | |
17288 else { | |
17289 __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 1); __PYX_ERR(0, 456, __pyx_L3_error) | |
17290 } | |
17291 CYTHON_FALLTHROUGH; | |
17292 case 2: | |
17293 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_formatdict)) != 0)) { | |
17294 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
17295 kw_args--; | |
17296 } | |
17297 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) | |
17298 else { | |
17299 __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 2); __PYX_ERR(0, 456, __pyx_L3_error) | |
17300 } | |
17301 CYTHON_FALLTHROUGH; | |
17302 case 3: | |
17303 if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alt)) != 0)) { | |
17304 (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); | |
17305 kw_args--; | |
17306 } | |
17307 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) | |
17308 else { | |
17309 __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 3); __PYX_ERR(0, 456, __pyx_L3_error) | |
17310 } | |
17311 } | |
17312 if (unlikely(kw_args > 0)) { | |
17313 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
17314 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_expected") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) | |
17315 } | |
17316 } else if (unlikely(__pyx_nargs != 4)) { | |
17317 goto __pyx_L5_argtuple_error; | |
17318 } else { | |
17319 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
17320 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
17321 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
17322 values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
17323 } | |
17324 __pyx_v_self = values[0]; | |
17325 __pyx_v_format = values[1]; | |
17326 __pyx_v_formatdict = values[2]; | |
17327 __pyx_v_alt = values[3]; | |
17328 } | |
17329 goto __pyx_L6_skip; | |
17330 __pyx_L5_argtuple_error:; | |
17331 __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 456, __pyx_L3_error) | |
17332 __pyx_L6_skip:; | |
17333 goto __pyx_L4_argument_unpacking_done; | |
17334 __pyx_L3_error:; | |
17335 { | |
17336 Py_ssize_t __pyx_temp; | |
17337 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17338 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
17339 } | |
17340 } | |
17341 __Pyx_AddTraceback("pysam.libcvcf.VCF.get_expected", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17342 __Pyx_RefNannyFinishContext(); | |
17343 return NULL; | |
17344 __pyx_L4_argument_unpacking_done:; | |
17345 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_8get_expected(__pyx_self, __pyx_v_self, __pyx_v_format, __pyx_v_formatdict, __pyx_v_alt); | |
17346 | |
17347 /* function exit code */ | |
17348 { | |
17349 Py_ssize_t __pyx_temp; | |
17350 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17351 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
17352 } | |
17353 } | |
17354 __Pyx_RefNannyFinishContext(); | |
17355 return __pyx_r; | |
17356 } | |
17357 | |
17358 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_8get_expected(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_alt) { | |
17359 PyObject *__pyx_v_fmt = NULL; | |
17360 PyObject *__pyx_r = NULL; | |
17361 __Pyx_RefNannyDeclarations | |
17362 PyObject *__pyx_t_1 = NULL; | |
17363 PyObject *__pyx_t_2 = NULL; | |
17364 PyObject *__pyx_t_3 = NULL; | |
17365 int __pyx_t_4; | |
17366 Py_ssize_t __pyx_t_5; | |
17367 Py_ssize_t __pyx_t_6; | |
17368 int __pyx_lineno = 0; | |
17369 const char *__pyx_filename = NULL; | |
17370 int __pyx_clineno = 0; | |
17371 __Pyx_RefNannySetupContext("get_expected", 1); | |
17372 | |
17373 /* "pysam/libcvcf.pyx":457 | |
17374 * | |
17375 * def get_expected(self, format, formatdict, alt): | |
17376 * fmt = formatdict[format] # <<<<<<<<<<<<<< | |
17377 * if fmt.numbertype == self.NT_UNKNOWN: return -1 | |
17378 * if fmt.numbertype == self.NT_NUMBER: return fmt.number | |
17379 */ | |
17380 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_formatdict, __pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) | |
17381 __Pyx_GOTREF(__pyx_t_1); | |
17382 __pyx_v_fmt = __pyx_t_1; | |
17383 __pyx_t_1 = 0; | |
17384 | |
17385 /* "pysam/libcvcf.pyx":458 | |
17386 * def get_expected(self, format, formatdict, alt): | |
17387 * fmt = formatdict[format] | |
17388 * if fmt.numbertype == self.NT_UNKNOWN: return -1 # <<<<<<<<<<<<<< | |
17389 * if fmt.numbertype == self.NT_NUMBER: return fmt.number | |
17390 * if fmt.numbertype == self.NT_ALLELES: return len(alt)+1 | |
17391 */ | |
17392 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) | |
17393 __Pyx_GOTREF(__pyx_t_1); | |
17394 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) | |
17395 __Pyx_GOTREF(__pyx_t_2); | |
17396 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) | |
17397 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17398 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17399 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 458, __pyx_L1_error) | |
17400 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17401 if (__pyx_t_4) { | |
17402 __Pyx_XDECREF(__pyx_r); | |
17403 __Pyx_INCREF(__pyx_int_neg_1); | |
17404 __pyx_r = __pyx_int_neg_1; | |
17405 goto __pyx_L0; | |
17406 } | |
17407 | |
17408 /* "pysam/libcvcf.pyx":459 | |
17409 * fmt = formatdict[format] | |
17410 * if fmt.numbertype == self.NT_UNKNOWN: return -1 | |
17411 * if fmt.numbertype == self.NT_NUMBER: return fmt.number # <<<<<<<<<<<<<< | |
17412 * if fmt.numbertype == self.NT_ALLELES: return len(alt)+1 | |
17413 * if fmt.numbertype == self.NT_NR_ALLELES: return len(alt) | |
17414 */ | |
17415 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) | |
17416 __Pyx_GOTREF(__pyx_t_3); | |
17417 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) | |
17418 __Pyx_GOTREF(__pyx_t_2); | |
17419 __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error) | |
17420 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17422 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) | |
17423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17424 if (__pyx_t_4) { | |
17425 __Pyx_XDECREF(__pyx_r); | |
17426 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error) | |
17427 __Pyx_GOTREF(__pyx_t_1); | |
17428 __pyx_r = __pyx_t_1; | |
17429 __pyx_t_1 = 0; | |
17430 goto __pyx_L0; | |
17431 } | |
17432 | |
17433 /* "pysam/libcvcf.pyx":460 | |
17434 * if fmt.numbertype == self.NT_UNKNOWN: return -1 | |
17435 * if fmt.numbertype == self.NT_NUMBER: return fmt.number | |
17436 * if fmt.numbertype == self.NT_ALLELES: return len(alt)+1 # <<<<<<<<<<<<<< | |
17437 * if fmt.numbertype == self.NT_NR_ALLELES: return len(alt) | |
17438 * if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2 | |
17439 */ | |
17440 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) | |
17441 __Pyx_GOTREF(__pyx_t_1); | |
17442 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) | |
17443 __Pyx_GOTREF(__pyx_t_2); | |
17444 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) | |
17445 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17446 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17447 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 460, __pyx_L1_error) | |
17448 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17449 if (__pyx_t_4) { | |
17450 __Pyx_XDECREF(__pyx_r); | |
17451 __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 460, __pyx_L1_error) | |
17452 __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_5 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) | |
17453 __Pyx_GOTREF(__pyx_t_3); | |
17454 __pyx_r = __pyx_t_3; | |
17455 __pyx_t_3 = 0; | |
17456 goto __pyx_L0; | |
17457 } | |
17458 | |
17459 /* "pysam/libcvcf.pyx":461 | |
17460 * if fmt.numbertype == self.NT_NUMBER: return fmt.number | |
17461 * if fmt.numbertype == self.NT_ALLELES: return len(alt)+1 | |
17462 * if fmt.numbertype == self.NT_NR_ALLELES: return len(alt) # <<<<<<<<<<<<<< | |
17463 * if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2 | |
17464 * if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1) | |
17465 */ | |
17466 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) | |
17467 __Pyx_GOTREF(__pyx_t_3); | |
17468 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NR_ALLELES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error) | |
17469 __Pyx_GOTREF(__pyx_t_2); | |
17470 __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) | |
17471 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17472 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17473 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 461, __pyx_L1_error) | |
17474 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17475 if (__pyx_t_4) { | |
17476 __Pyx_XDECREF(__pyx_r); | |
17477 __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 461, __pyx_L1_error) | |
17478 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) | |
17479 __Pyx_GOTREF(__pyx_t_1); | |
17480 __pyx_r = __pyx_t_1; | |
17481 __pyx_t_1 = 0; | |
17482 goto __pyx_L0; | |
17483 } | |
17484 | |
17485 /* "pysam/libcvcf.pyx":462 | |
17486 * if fmt.numbertype == self.NT_ALLELES: return len(alt)+1 | |
17487 * if fmt.numbertype == self.NT_NR_ALLELES: return len(alt) | |
17488 * if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2 # <<<<<<<<<<<<<< | |
17489 * if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1) | |
17490 * return 0 | |
17491 */ | |
17492 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) | |
17493 __Pyx_GOTREF(__pyx_t_1); | |
17494 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) | |
17495 __Pyx_GOTREF(__pyx_t_2); | |
17496 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error) | |
17497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17498 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17499 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 462, __pyx_L1_error) | |
17500 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17501 if (__pyx_t_4) { | |
17502 __Pyx_XDECREF(__pyx_r); | |
17503 __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 462, __pyx_L1_error) | |
17504 __pyx_t_6 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 462, __pyx_L1_error) | |
17505 __pyx_t_3 = PyInt_FromSsize_t(__Pyx_div_Py_ssize_t(((__pyx_t_5 + 1) * (__pyx_t_6 + 2)), 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error) | |
17506 __Pyx_GOTREF(__pyx_t_3); | |
17507 __pyx_r = __pyx_t_3; | |
17508 __pyx_t_3 = 0; | |
17509 goto __pyx_L0; | |
17510 } | |
17511 | |
17512 /* "pysam/libcvcf.pyx":463 | |
17513 * if fmt.numbertype == self.NT_NR_ALLELES: return len(alt) | |
17514 * if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2 | |
17515 * if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1) # <<<<<<<<<<<<<< | |
17516 * return 0 | |
17517 * | |
17518 */ | |
17519 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error) | |
17520 __Pyx_GOTREF(__pyx_t_3); | |
17521 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) | |
17522 __Pyx_GOTREF(__pyx_t_2); | |
17523 __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) | |
17524 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17525 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17526 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) | |
17527 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17528 if (__pyx_t_4) { | |
17529 __Pyx_XDECREF(__pyx_r); | |
17530 __pyx_t_6 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 463, __pyx_L1_error) | |
17531 __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 463, __pyx_L1_error) | |
17532 __pyx_t_1 = PyInt_FromSsize_t(((__pyx_t_6 + 1) * (__pyx_t_5 + 1))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) | |
17533 __Pyx_GOTREF(__pyx_t_1); | |
17534 __pyx_r = __pyx_t_1; | |
17535 __pyx_t_1 = 0; | |
17536 goto __pyx_L0; | |
17537 } | |
17538 | |
17539 /* "pysam/libcvcf.pyx":464 | |
17540 * if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2 | |
17541 * if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1) | |
17542 * return 0 # <<<<<<<<<<<<<< | |
17543 * | |
17544 * | |
17545 */ | |
17546 __Pyx_XDECREF(__pyx_r); | |
17547 __Pyx_INCREF(__pyx_int_0); | |
17548 __pyx_r = __pyx_int_0; | |
17549 goto __pyx_L0; | |
17550 | |
17551 /* "pysam/libcvcf.pyx":456 | |
17552 * return format | |
17553 * | |
17554 * def get_expected(self, format, formatdict, alt): # <<<<<<<<<<<<<< | |
17555 * fmt = formatdict[format] | |
17556 * if fmt.numbertype == self.NT_UNKNOWN: return -1 | |
17557 */ | |
17558 | |
17559 /* function exit code */ | |
17560 __pyx_L1_error:; | |
17561 __Pyx_XDECREF(__pyx_t_1); | |
17562 __Pyx_XDECREF(__pyx_t_2); | |
17563 __Pyx_XDECREF(__pyx_t_3); | |
17564 __Pyx_AddTraceback("pysam.libcvcf.VCF.get_expected", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17565 __pyx_r = NULL; | |
17566 __pyx_L0:; | |
17567 __Pyx_XDECREF(__pyx_v_fmt); | |
17568 __Pyx_XGIVEREF(__pyx_r); | |
17569 __Pyx_RefNannyFinishContext(); | |
17570 return __pyx_r; | |
17571 } | |
17572 | |
17573 /* "pysam/libcvcf.pyx":467 | |
17574 * | |
17575 * | |
17576 * def _add_definition(self, formatdict, key, data, line ): # <<<<<<<<<<<<<< | |
17577 * if key in formatdict: return | |
17578 * self.error(line,self.ERROR_UNKNOWN_KEY,key) | |
17579 */ | |
17580 | |
17581 /* Python wrapper */ | |
17582 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_11_add_definition(PyObject *__pyx_self, | |
17583 #if CYTHON_METH_FASTCALL | |
17584 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17585 #else | |
17586 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17587 #endif | |
17588 ); /*proto*/ | |
17589 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_10_add_definition, "VCF._add_definition(self, formatdict, key, data, line)"); | |
17590 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_11_add_definition = {"_add_definition", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_11_add_definition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_10_add_definition}; | |
17591 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_11_add_definition(PyObject *__pyx_self, | |
17592 #if CYTHON_METH_FASTCALL | |
17593 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17594 #else | |
17595 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17596 #endif | |
17597 ) { | |
17598 PyObject *__pyx_v_self = 0; | |
17599 PyObject *__pyx_v_formatdict = 0; | |
17600 PyObject *__pyx_v_key = 0; | |
17601 PyObject *__pyx_v_data = 0; | |
17602 PyObject *__pyx_v_line = 0; | |
17603 #if !CYTHON_METH_FASTCALL | |
17604 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
17605 #endif | |
17606 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17607 PyObject* values[5] = {0,0,0,0,0}; | |
17608 int __pyx_lineno = 0; | |
17609 const char *__pyx_filename = NULL; | |
17610 int __pyx_clineno = 0; | |
17611 PyObject *__pyx_r = 0; | |
17612 __Pyx_RefNannyDeclarations | |
17613 __Pyx_RefNannySetupContext("_add_definition (wrapper)", 0); | |
17614 #if !CYTHON_METH_FASTCALL | |
17615 #if CYTHON_ASSUME_SAFE_MACROS | |
17616 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
17617 #else | |
17618 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
17619 #endif | |
17620 #endif | |
17621 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
17622 { | |
17623 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_formatdict,&__pyx_n_s_key,&__pyx_n_s_data,&__pyx_n_s_line,0}; | |
17624 if (__pyx_kwds) { | |
17625 Py_ssize_t kw_args; | |
17626 switch (__pyx_nargs) { | |
17627 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
17628 CYTHON_FALLTHROUGH; | |
17629 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
17630 CYTHON_FALLTHROUGH; | |
17631 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
17632 CYTHON_FALLTHROUGH; | |
17633 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
17634 CYTHON_FALLTHROUGH; | |
17635 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
17636 CYTHON_FALLTHROUGH; | |
17637 case 0: break; | |
17638 default: goto __pyx_L5_argtuple_error; | |
17639 } | |
17640 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
17641 switch (__pyx_nargs) { | |
17642 case 0: | |
17643 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
17644 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
17645 kw_args--; | |
17646 } | |
17647 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) | |
17648 else goto __pyx_L5_argtuple_error; | |
17649 CYTHON_FALLTHROUGH; | |
17650 case 1: | |
17651 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_formatdict)) != 0)) { | |
17652 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
17653 kw_args--; | |
17654 } | |
17655 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) | |
17656 else { | |
17657 __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 1); __PYX_ERR(0, 467, __pyx_L3_error) | |
17658 } | |
17659 CYTHON_FALLTHROUGH; | |
17660 case 2: | |
17661 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { | |
17662 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
17663 kw_args--; | |
17664 } | |
17665 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) | |
17666 else { | |
17667 __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 2); __PYX_ERR(0, 467, __pyx_L3_error) | |
17668 } | |
17669 CYTHON_FALLTHROUGH; | |
17670 case 3: | |
17671 if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { | |
17672 (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); | |
17673 kw_args--; | |
17674 } | |
17675 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) | |
17676 else { | |
17677 __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 3); __PYX_ERR(0, 467, __pyx_L3_error) | |
17678 } | |
17679 CYTHON_FALLTHROUGH; | |
17680 case 4: | |
17681 if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line)) != 0)) { | |
17682 (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); | |
17683 kw_args--; | |
17684 } | |
17685 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) | |
17686 else { | |
17687 __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 4); __PYX_ERR(0, 467, __pyx_L3_error) | |
17688 } | |
17689 } | |
17690 if (unlikely(kw_args > 0)) { | |
17691 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
17692 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_add_definition") < 0)) __PYX_ERR(0, 467, __pyx_L3_error) | |
17693 } | |
17694 } else if (unlikely(__pyx_nargs != 5)) { | |
17695 goto __pyx_L5_argtuple_error; | |
17696 } else { | |
17697 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
17698 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
17699 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
17700 values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
17701 values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
17702 } | |
17703 __pyx_v_self = values[0]; | |
17704 __pyx_v_formatdict = values[1]; | |
17705 __pyx_v_key = values[2]; | |
17706 __pyx_v_data = values[3]; | |
17707 __pyx_v_line = values[4]; | |
17708 } | |
17709 goto __pyx_L6_skip; | |
17710 __pyx_L5_argtuple_error:; | |
17711 __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 467, __pyx_L3_error) | |
17712 __pyx_L6_skip:; | |
17713 goto __pyx_L4_argument_unpacking_done; | |
17714 __pyx_L3_error:; | |
17715 { | |
17716 Py_ssize_t __pyx_temp; | |
17717 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17718 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
17719 } | |
17720 } | |
17721 __Pyx_AddTraceback("pysam.libcvcf.VCF._add_definition", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17722 __Pyx_RefNannyFinishContext(); | |
17723 return NULL; | |
17724 __pyx_L4_argument_unpacking_done:; | |
17725 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_10_add_definition(__pyx_self, __pyx_v_self, __pyx_v_formatdict, __pyx_v_key, __pyx_v_data, __pyx_v_line); | |
17726 | |
17727 /* function exit code */ | |
17728 { | |
17729 Py_ssize_t __pyx_temp; | |
17730 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17731 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
17732 } | |
17733 } | |
17734 __Pyx_RefNannyFinishContext(); | |
17735 return __pyx_r; | |
17736 } | |
17737 | |
17738 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_10_add_definition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_key, PyObject *__pyx_v_data, PyObject *__pyx_v_line) { | |
17739 PyObject *__pyx_r = NULL; | |
17740 __Pyx_RefNannyDeclarations | |
17741 int __pyx_t_1; | |
17742 PyObject *__pyx_t_2 = NULL; | |
17743 PyObject *__pyx_t_3 = NULL; | |
17744 PyObject *__pyx_t_4 = NULL; | |
17745 PyObject *__pyx_t_5 = NULL; | |
17746 unsigned int __pyx_t_6; | |
17747 int __pyx_lineno = 0; | |
17748 const char *__pyx_filename = NULL; | |
17749 int __pyx_clineno = 0; | |
17750 __Pyx_RefNannySetupContext("_add_definition", 0); | |
17751 __Pyx_INCREF(__pyx_v_data); | |
17752 | |
17753 /* "pysam/libcvcf.pyx":468 | |
17754 * | |
17755 * def _add_definition(self, formatdict, key, data, line ): | |
17756 * if key in formatdict: return # <<<<<<<<<<<<<< | |
17757 * self.error(line,self.ERROR_UNKNOWN_KEY,key) | |
17758 * if data == None: | |
17759 */ | |
17760 __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_formatdict, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 468, __pyx_L1_error) | |
17761 if (__pyx_t_1) { | |
17762 __Pyx_XDECREF(__pyx_r); | |
17763 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
17764 goto __pyx_L0; | |
17765 } | |
17766 | |
17767 /* "pysam/libcvcf.pyx":469 | |
17768 * def _add_definition(self, formatdict, key, data, line ): | |
17769 * if key in formatdict: return | |
17770 * self.error(line,self.ERROR_UNKNOWN_KEY,key) # <<<<<<<<<<<<<< | |
17771 * if data == None: | |
17772 * formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".") | |
17773 */ | |
17774 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) | |
17775 __Pyx_GOTREF(__pyx_t_3); | |
17776 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_UNKNOWN_KEY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error) | |
17777 __Pyx_GOTREF(__pyx_t_4); | |
17778 __pyx_t_5 = NULL; | |
17779 __pyx_t_6 = 0; | |
17780 #if CYTHON_UNPACK_METHODS | |
17781 if (likely(PyMethod_Check(__pyx_t_3))) { | |
17782 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); | |
17783 if (likely(__pyx_t_5)) { | |
17784 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
17785 __Pyx_INCREF(__pyx_t_5); | |
17786 __Pyx_INCREF(function); | |
17787 __Pyx_DECREF_SET(__pyx_t_3, function); | |
17788 __pyx_t_6 = 1; | |
17789 } | |
17790 } | |
17791 #endif | |
17792 { | |
17793 PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_line, __pyx_t_4, __pyx_v_key}; | |
17794 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); | |
17795 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
17796 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
17797 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error) | |
17798 __Pyx_GOTREF(__pyx_t_2); | |
17799 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17800 } | |
17801 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17802 | |
17803 /* "pysam/libcvcf.pyx":470 | |
17804 * if key in formatdict: return | |
17805 * self.error(line,self.ERROR_UNKNOWN_KEY,key) | |
17806 * if data == None: # <<<<<<<<<<<<<< | |
17807 * formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".") | |
17808 * return | |
17809 */ | |
17810 __pyx_t_2 = PyObject_RichCompare(__pyx_v_data, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) | |
17811 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 470, __pyx_L1_error) | |
17812 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17813 if (__pyx_t_1) { | |
17814 | |
17815 /* "pysam/libcvcf.pyx":471 | |
17816 * self.error(line,self.ERROR_UNKNOWN_KEY,key) | |
17817 * if data == None: | |
17818 * formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".") # <<<<<<<<<<<<<< | |
17819 * return | |
17820 * if data == []: data = [""] # unsure what type -- say string | |
17821 */ | |
17822 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error) | |
17823 __Pyx_GOTREF(__pyx_t_3); | |
17824 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error) | |
17825 __Pyx_GOTREF(__pyx_t_4); | |
17826 __pyx_t_5 = NULL; | |
17827 __pyx_t_6 = 0; | |
17828 #if CYTHON_UNPACK_METHODS | |
17829 if (unlikely(PyMethod_Check(__pyx_t_3))) { | |
17830 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); | |
17831 if (likely(__pyx_t_5)) { | |
17832 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
17833 __Pyx_INCREF(__pyx_t_5); | |
17834 __Pyx_INCREF(function); | |
17835 __Pyx_DECREF_SET(__pyx_t_3, function); | |
17836 __pyx_t_6 = 1; | |
17837 } | |
17838 } | |
17839 #endif | |
17840 { | |
17841 PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_key, __pyx_t_4, __pyx_int_0, __pyx_n_u_Flag, __pyx_kp_u_Undefined_tag, __pyx_kp_u__5}; | |
17842 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6); | |
17843 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
17844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
17845 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) | |
17846 __Pyx_GOTREF(__pyx_t_2); | |
17847 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17848 } | |
17849 if (unlikely((PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_2) < 0))) __PYX_ERR(0, 471, __pyx_L1_error) | |
17850 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17851 | |
17852 /* "pysam/libcvcf.pyx":472 | |
17853 * if data == None: | |
17854 * formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".") | |
17855 * return # <<<<<<<<<<<<<< | |
17856 * if data == []: data = [""] # unsure what type -- say string | |
17857 * if type(data[0]) == type(0.0): | |
17858 */ | |
17859 __Pyx_XDECREF(__pyx_r); | |
17860 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
17861 goto __pyx_L0; | |
17862 | |
17863 /* "pysam/libcvcf.pyx":470 | |
17864 * if key in formatdict: return | |
17865 * self.error(line,self.ERROR_UNKNOWN_KEY,key) | |
17866 * if data == None: # <<<<<<<<<<<<<< | |
17867 * formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".") | |
17868 * return | |
17869 */ | |
17870 } | |
17871 | |
17872 /* "pysam/libcvcf.pyx":473 | |
17873 * formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".") | |
17874 * return | |
17875 * if data == []: data = [""] # unsure what type -- say string # <<<<<<<<<<<<<< | |
17876 * if type(data[0]) == type(0.0): | |
17877 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None) | |
17878 */ | |
17879 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error) | |
17880 __Pyx_GOTREF(__pyx_t_2); | |
17881 __pyx_t_3 = PyObject_RichCompare(__pyx_v_data, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) | |
17882 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17883 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 473, __pyx_L1_error) | |
17884 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17885 if (__pyx_t_1) { | |
17886 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) | |
17887 __Pyx_GOTREF(__pyx_t_3); | |
17888 __Pyx_INCREF(__pyx_kp_u_); | |
17889 __Pyx_GIVEREF(__pyx_kp_u_); | |
17890 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_)) __PYX_ERR(0, 473, __pyx_L1_error); | |
17891 __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_3); | |
17892 __pyx_t_3 = 0; | |
17893 } | |
17894 | |
17895 /* "pysam/libcvcf.pyx":474 | |
17896 * return | |
17897 * if data == []: data = [""] # unsure what type -- say string | |
17898 * if type(data[0]) == type(0.0): # <<<<<<<<<<<<<< | |
17899 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None) | |
17900 * return | |
17901 */ | |
17902 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error) | |
17903 __Pyx_GOTREF(__pyx_t_3); | |
17904 __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_3)), ((PyObject *)Py_TYPE(__pyx_float_0_0)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error) | |
17905 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17906 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 474, __pyx_L1_error) | |
17907 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17908 if (__pyx_t_1) { | |
17909 | |
17910 /* "pysam/libcvcf.pyx":475 | |
17911 * if data == []: data = [""] # unsure what type -- say string | |
17912 * if type(data[0]) == type(0.0): | |
17913 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None) # <<<<<<<<<<<<<< | |
17914 * return | |
17915 * if type(data[0]) == type(0): | |
17916 */ | |
17917 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) | |
17918 __Pyx_GOTREF(__pyx_t_3); | |
17919 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error) | |
17920 __Pyx_GOTREF(__pyx_t_4); | |
17921 __pyx_t_5 = NULL; | |
17922 __pyx_t_6 = 0; | |
17923 #if CYTHON_UNPACK_METHODS | |
17924 if (unlikely(PyMethod_Check(__pyx_t_3))) { | |
17925 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); | |
17926 if (likely(__pyx_t_5)) { | |
17927 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
17928 __Pyx_INCREF(__pyx_t_5); | |
17929 __Pyx_INCREF(function); | |
17930 __Pyx_DECREF_SET(__pyx_t_3, function); | |
17931 __pyx_t_6 = 1; | |
17932 } | |
17933 } | |
17934 #endif | |
17935 { | |
17936 PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_key, __pyx_t_4, __pyx_int_neg_1, __pyx_n_u_Float, __pyx_kp_u_Undefined_tag, Py_None}; | |
17937 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6); | |
17938 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
17939 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
17940 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) | |
17941 __Pyx_GOTREF(__pyx_t_2); | |
17942 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17943 } | |
17944 if (unlikely((PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_2) < 0))) __PYX_ERR(0, 475, __pyx_L1_error) | |
17945 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17946 | |
17947 /* "pysam/libcvcf.pyx":476 | |
17948 * if type(data[0]) == type(0.0): | |
17949 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None) | |
17950 * return # <<<<<<<<<<<<<< | |
17951 * if type(data[0]) == type(0): | |
17952 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None) | |
17953 */ | |
17954 __Pyx_XDECREF(__pyx_r); | |
17955 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
17956 goto __pyx_L0; | |
17957 | |
17958 /* "pysam/libcvcf.pyx":474 | |
17959 * return | |
17960 * if data == []: data = [""] # unsure what type -- say string | |
17961 * if type(data[0]) == type(0.0): # <<<<<<<<<<<<<< | |
17962 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None) | |
17963 * return | |
17964 */ | |
17965 } | |
17966 | |
17967 /* "pysam/libcvcf.pyx":477 | |
17968 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None) | |
17969 * return | |
17970 * if type(data[0]) == type(0): # <<<<<<<<<<<<<< | |
17971 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None) | |
17972 * return | |
17973 */ | |
17974 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error) | |
17975 __Pyx_GOTREF(__pyx_t_2); | |
17976 __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_2)), ((PyObject *)Py_TYPE(__pyx_int_0)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error) | |
17977 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
17978 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 477, __pyx_L1_error) | |
17979 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
17980 if (__pyx_t_1) { | |
17981 | |
17982 /* "pysam/libcvcf.pyx":478 | |
17983 * return | |
17984 * if type(data[0]) == type(0): | |
17985 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None) # <<<<<<<<<<<<<< | |
17986 * return | |
17987 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".") | |
17988 */ | |
17989 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) | |
17990 __Pyx_GOTREF(__pyx_t_2); | |
17991 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error) | |
17992 __Pyx_GOTREF(__pyx_t_4); | |
17993 __pyx_t_5 = NULL; | |
17994 __pyx_t_6 = 0; | |
17995 #if CYTHON_UNPACK_METHODS | |
17996 if (unlikely(PyMethod_Check(__pyx_t_2))) { | |
17997 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); | |
17998 if (likely(__pyx_t_5)) { | |
17999 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
18000 __Pyx_INCREF(__pyx_t_5); | |
18001 __Pyx_INCREF(function); | |
18002 __Pyx_DECREF_SET(__pyx_t_2, function); | |
18003 __pyx_t_6 = 1; | |
18004 } | |
18005 } | |
18006 #endif | |
18007 { | |
18008 PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_key, __pyx_t_4, __pyx_int_neg_1, __pyx_n_u_Integer, __pyx_kp_u_Undefined_tag, Py_None}; | |
18009 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6); | |
18010 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18011 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18012 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) | |
18013 __Pyx_GOTREF(__pyx_t_3); | |
18014 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
18015 } | |
18016 if (unlikely((PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_3) < 0))) __PYX_ERR(0, 478, __pyx_L1_error) | |
18017 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
18018 | |
18019 /* "pysam/libcvcf.pyx":479 | |
18020 * if type(data[0]) == type(0): | |
18021 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None) | |
18022 * return # <<<<<<<<<<<<<< | |
18023 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".") | |
18024 * | |
18025 */ | |
18026 __Pyx_XDECREF(__pyx_r); | |
18027 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
18028 goto __pyx_L0; | |
18029 | |
18030 /* "pysam/libcvcf.pyx":477 | |
18031 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None) | |
18032 * return | |
18033 * if type(data[0]) == type(0): # <<<<<<<<<<<<<< | |
18034 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None) | |
18035 * return | |
18036 */ | |
18037 } | |
18038 | |
18039 /* "pysam/libcvcf.pyx":480 | |
18040 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None) | |
18041 * return | |
18042 * formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".") # <<<<<<<<<<<<<< | |
18043 * | |
18044 * | |
18045 */ | |
18046 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) | |
18047 __Pyx_GOTREF(__pyx_t_2); | |
18048 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) | |
18049 __Pyx_GOTREF(__pyx_t_4); | |
18050 __pyx_t_5 = NULL; | |
18051 __pyx_t_6 = 0; | |
18052 #if CYTHON_UNPACK_METHODS | |
18053 if (unlikely(PyMethod_Check(__pyx_t_2))) { | |
18054 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); | |
18055 if (likely(__pyx_t_5)) { | |
18056 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
18057 __Pyx_INCREF(__pyx_t_5); | |
18058 __Pyx_INCREF(function); | |
18059 __Pyx_DECREF_SET(__pyx_t_2, function); | |
18060 __pyx_t_6 = 1; | |
18061 } | |
18062 } | |
18063 #endif | |
18064 { | |
18065 PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_key, __pyx_t_4, __pyx_int_neg_1, __pyx_n_u_String, __pyx_kp_u_Undefined_tag, __pyx_kp_u__5}; | |
18066 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6); | |
18067 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18068 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18069 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) | |
18070 __Pyx_GOTREF(__pyx_t_3); | |
18071 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
18072 } | |
18073 if (unlikely((PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_3) < 0))) __PYX_ERR(0, 480, __pyx_L1_error) | |
18074 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
18075 | |
18076 /* "pysam/libcvcf.pyx":467 | |
18077 * | |
18078 * | |
18079 * def _add_definition(self, formatdict, key, data, line ): # <<<<<<<<<<<<<< | |
18080 * if key in formatdict: return | |
18081 * self.error(line,self.ERROR_UNKNOWN_KEY,key) | |
18082 */ | |
18083 | |
18084 /* function exit code */ | |
18085 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
18086 goto __pyx_L0; | |
18087 __pyx_L1_error:; | |
18088 __Pyx_XDECREF(__pyx_t_2); | |
18089 __Pyx_XDECREF(__pyx_t_3); | |
18090 __Pyx_XDECREF(__pyx_t_4); | |
18091 __Pyx_XDECREF(__pyx_t_5); | |
18092 __Pyx_AddTraceback("pysam.libcvcf.VCF._add_definition", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
18093 __pyx_r = NULL; | |
18094 __pyx_L0:; | |
18095 __Pyx_XDECREF(__pyx_v_data); | |
18096 __Pyx_XGIVEREF(__pyx_r); | |
18097 __Pyx_RefNannyFinishContext(); | |
18098 return __pyx_r; | |
18099 } | |
18100 | |
18101 /* "pysam/libcvcf.pyx":484 | |
18102 * | |
18103 * # todo: trim trailing missing values | |
18104 * def format_formatdata( self, data, format, key=True, value=True, separator=":" ): # <<<<<<<<<<<<<< | |
18105 * output, sdata = [], [] | |
18106 * if type(data) == type([]): # for FORMAT field, make data with dummy values | |
18107 */ | |
18108 | |
18109 /* Python wrapper */ | |
18110 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_13format_formatdata(PyObject *__pyx_self, | |
18111 #if CYTHON_METH_FASTCALL | |
18112 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
18113 #else | |
18114 PyObject *__pyx_args, PyObject *__pyx_kwds | |
18115 #endif | |
18116 ); /*proto*/ | |
18117 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_12format_formatdata, "VCF.format_formatdata(self, data, format, key=True, value=True, separator=u':')"); | |
18118 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_13format_formatdata = {"format_formatdata", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_13format_formatdata, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_12format_formatdata}; | |
18119 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_13format_formatdata(PyObject *__pyx_self, | |
18120 #if CYTHON_METH_FASTCALL | |
18121 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
18122 #else | |
18123 PyObject *__pyx_args, PyObject *__pyx_kwds | |
18124 #endif | |
18125 ) { | |
18126 PyObject *__pyx_v_self = 0; | |
18127 PyObject *__pyx_v_data = 0; | |
18128 PyObject *__pyx_v_format = 0; | |
18129 PyObject *__pyx_v_key = 0; | |
18130 PyObject *__pyx_v_value = 0; | |
18131 PyObject *__pyx_v_separator = 0; | |
18132 #if !CYTHON_METH_FASTCALL | |
18133 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
18134 #endif | |
18135 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
18136 PyObject* values[6] = {0,0,0,0,0,0}; | |
18137 int __pyx_lineno = 0; | |
18138 const char *__pyx_filename = NULL; | |
18139 int __pyx_clineno = 0; | |
18140 PyObject *__pyx_r = 0; | |
18141 __Pyx_RefNannyDeclarations | |
18142 __Pyx_RefNannySetupContext("format_formatdata (wrapper)", 0); | |
18143 #if !CYTHON_METH_FASTCALL | |
18144 #if CYTHON_ASSUME_SAFE_MACROS | |
18145 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
18146 #else | |
18147 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
18148 #endif | |
18149 #endif | |
18150 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
18151 { | |
18152 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,&__pyx_n_s_format,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_separator,0}; | |
18153 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); | |
18154 values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); | |
18155 values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_kp_u__3))); | |
18156 if (__pyx_kwds) { | |
18157 Py_ssize_t kw_args; | |
18158 switch (__pyx_nargs) { | |
18159 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
18160 CYTHON_FALLTHROUGH; | |
18161 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
18162 CYTHON_FALLTHROUGH; | |
18163 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
18164 CYTHON_FALLTHROUGH; | |
18165 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
18166 CYTHON_FALLTHROUGH; | |
18167 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
18168 CYTHON_FALLTHROUGH; | |
18169 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
18170 CYTHON_FALLTHROUGH; | |
18171 case 0: break; | |
18172 default: goto __pyx_L5_argtuple_error; | |
18173 } | |
18174 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
18175 switch (__pyx_nargs) { | |
18176 case 0: | |
18177 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
18178 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
18179 kw_args--; | |
18180 } | |
18181 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) | |
18182 else goto __pyx_L5_argtuple_error; | |
18183 CYTHON_FALLTHROUGH; | |
18184 case 1: | |
18185 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { | |
18186 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
18187 kw_args--; | |
18188 } | |
18189 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) | |
18190 else { | |
18191 __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, 1); __PYX_ERR(0, 484, __pyx_L3_error) | |
18192 } | |
18193 CYTHON_FALLTHROUGH; | |
18194 case 2: | |
18195 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) { | |
18196 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
18197 kw_args--; | |
18198 } | |
18199 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) | |
18200 else { | |
18201 __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, 2); __PYX_ERR(0, 484, __pyx_L3_error) | |
18202 } | |
18203 CYTHON_FALLTHROUGH; | |
18204 case 3: | |
18205 if (kw_args > 0) { | |
18206 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key); | |
18207 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18208 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) | |
18209 } | |
18210 CYTHON_FALLTHROUGH; | |
18211 case 4: | |
18212 if (kw_args > 0) { | |
18213 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value); | |
18214 if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18215 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) | |
18216 } | |
18217 CYTHON_FALLTHROUGH; | |
18218 case 5: | |
18219 if (kw_args > 0) { | |
18220 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_separator); | |
18221 if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18222 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) | |
18223 } | |
18224 } | |
18225 if (unlikely(kw_args > 0)) { | |
18226 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
18227 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "format_formatdata") < 0)) __PYX_ERR(0, 484, __pyx_L3_error) | |
18228 } | |
18229 } else { | |
18230 switch (__pyx_nargs) { | |
18231 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
18232 CYTHON_FALLTHROUGH; | |
18233 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
18234 CYTHON_FALLTHROUGH; | |
18235 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
18236 CYTHON_FALLTHROUGH; | |
18237 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
18238 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
18239 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
18240 break; | |
18241 default: goto __pyx_L5_argtuple_error; | |
18242 } | |
18243 } | |
18244 __pyx_v_self = values[0]; | |
18245 __pyx_v_data = values[1]; | |
18246 __pyx_v_format = values[2]; | |
18247 __pyx_v_key = values[3]; | |
18248 __pyx_v_value = values[4]; | |
18249 __pyx_v_separator = values[5]; | |
18250 } | |
18251 goto __pyx_L6_skip; | |
18252 __pyx_L5_argtuple_error:; | |
18253 __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 484, __pyx_L3_error) | |
18254 __pyx_L6_skip:; | |
18255 goto __pyx_L4_argument_unpacking_done; | |
18256 __pyx_L3_error:; | |
18257 { | |
18258 Py_ssize_t __pyx_temp; | |
18259 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
18260 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
18261 } | |
18262 } | |
18263 __Pyx_AddTraceback("pysam.libcvcf.VCF.format_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
18264 __Pyx_RefNannyFinishContext(); | |
18265 return NULL; | |
18266 __pyx_L4_argument_unpacking_done:; | |
18267 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_12format_formatdata(__pyx_self, __pyx_v_self, __pyx_v_data, __pyx_v_format, __pyx_v_key, __pyx_v_value, __pyx_v_separator); | |
18268 | |
18269 /* function exit code */ | |
18270 { | |
18271 Py_ssize_t __pyx_temp; | |
18272 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
18273 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
18274 } | |
18275 } | |
18276 __Pyx_RefNannyFinishContext(); | |
18277 return __pyx_r; | |
18278 } | |
18279 | |
18280 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_12format_formatdata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_format, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_separator) { | |
18281 PyObject *__pyx_v_output = NULL; | |
18282 PyObject *__pyx_v_sdata = NULL; | |
18283 PyObject *__pyx_v_d = NULL; | |
18284 PyObject *__pyx_v_k = NULL; | |
18285 PyObject *__pyx_v_idx = NULL; | |
18286 PyObject *__pyx_v_v = NULL; | |
18287 PyObject *__pyx_v_last = NULL; | |
18288 PyObject *__pyx_r = NULL; | |
18289 __Pyx_RefNannyDeclarations | |
18290 PyObject *__pyx_t_1 = NULL; | |
18291 PyObject *__pyx_t_2 = NULL; | |
18292 int __pyx_t_3; | |
18293 Py_ssize_t __pyx_t_4; | |
18294 PyObject *(*__pyx_t_5)(PyObject *); | |
18295 PyObject *__pyx_t_6 = NULL; | |
18296 PyObject *__pyx_t_7 = NULL; | |
18297 PyObject *__pyx_t_8 = NULL; | |
18298 unsigned int __pyx_t_9; | |
18299 Py_ssize_t __pyx_t_10; | |
18300 PyObject *(*__pyx_t_11)(PyObject *); | |
18301 int __pyx_t_12; | |
18302 PyObject *(*__pyx_t_13)(PyObject *); | |
18303 int __pyx_t_14; | |
18304 int __pyx_lineno = 0; | |
18305 const char *__pyx_filename = NULL; | |
18306 int __pyx_clineno = 0; | |
18307 __Pyx_RefNannySetupContext("format_formatdata", 0); | |
18308 __Pyx_INCREF(__pyx_v_data); | |
18309 | |
18310 /* "pysam/libcvcf.pyx":485 | |
18311 * # todo: trim trailing missing values | |
18312 * def format_formatdata( self, data, format, key=True, value=True, separator=":" ): | |
18313 * output, sdata = [], [] # <<<<<<<<<<<<<< | |
18314 * if type(data) == type([]): # for FORMAT field, make data with dummy values | |
18315 * d = {} | |
18316 */ | |
18317 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) | |
18318 __Pyx_GOTREF(__pyx_t_1); | |
18319 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) | |
18320 __Pyx_GOTREF(__pyx_t_2); | |
18321 __pyx_v_output = ((PyObject*)__pyx_t_1); | |
18322 __pyx_t_1 = 0; | |
18323 __pyx_v_sdata = ((PyObject*)__pyx_t_2); | |
18324 __pyx_t_2 = 0; | |
18325 | |
18326 /* "pysam/libcvcf.pyx":486 | |
18327 * def format_formatdata( self, data, format, key=True, value=True, separator=":" ): | |
18328 * output, sdata = [], [] | |
18329 * if type(data) == type([]): # for FORMAT field, make data with dummy values # <<<<<<<<<<<<<< | |
18330 * d = {} | |
18331 * for k in data: d[k] = [] | |
18332 */ | |
18333 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) | |
18334 __Pyx_GOTREF(__pyx_t_2); | |
18335 __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(__pyx_t_2)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) | |
18336 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
18337 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) | |
18338 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
18339 if (__pyx_t_3) { | |
18340 | |
18341 /* "pysam/libcvcf.pyx":487 | |
18342 * output, sdata = [], [] | |
18343 * if type(data) == type([]): # for FORMAT field, make data with dummy values | |
18344 * d = {} # <<<<<<<<<<<<<< | |
18345 * for k in data: d[k] = [] | |
18346 * data = d | |
18347 */ | |
18348 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) | |
18349 __Pyx_GOTREF(__pyx_t_1); | |
18350 __pyx_v_d = ((PyObject*)__pyx_t_1); | |
18351 __pyx_t_1 = 0; | |
18352 | |
18353 /* "pysam/libcvcf.pyx":488 | |
18354 * if type(data) == type([]): # for FORMAT field, make data with dummy values | |
18355 * d = {} | |
18356 * for k in data: d[k] = [] # <<<<<<<<<<<<<< | |
18357 * data = d | |
18358 * # convert missing values; and silently add definitions if required | |
18359 */ | |
18360 if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) { | |
18361 __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1); | |
18362 __pyx_t_4 = 0; | |
18363 __pyx_t_5 = NULL; | |
18364 } else { | |
18365 __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) | |
18366 __Pyx_GOTREF(__pyx_t_1); | |
18367 __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error) | |
18368 } | |
18369 for (;;) { | |
18370 if (likely(!__pyx_t_5)) { | |
18371 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
18372 { | |
18373 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
18374 #if !CYTHON_ASSUME_SAFE_MACROS | |
18375 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 488, __pyx_L1_error) | |
18376 #endif | |
18377 if (__pyx_t_4 >= __pyx_temp) break; | |
18378 } | |
18379 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18380 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 488, __pyx_L1_error) | |
18381 #else | |
18382 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) | |
18383 __Pyx_GOTREF(__pyx_t_2); | |
18384 #endif | |
18385 } else { | |
18386 { | |
18387 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
18388 #if !CYTHON_ASSUME_SAFE_MACROS | |
18389 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 488, __pyx_L1_error) | |
18390 #endif | |
18391 if (__pyx_t_4 >= __pyx_temp) break; | |
18392 } | |
18393 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18394 __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, 488, __pyx_L1_error) | |
18395 #else | |
18396 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) | |
18397 __Pyx_GOTREF(__pyx_t_2); | |
18398 #endif | |
18399 } | |
18400 } else { | |
18401 __pyx_t_2 = __pyx_t_5(__pyx_t_1); | |
18402 if (unlikely(!__pyx_t_2)) { | |
18403 PyObject* exc_type = PyErr_Occurred(); | |
18404 if (exc_type) { | |
18405 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
18406 else __PYX_ERR(0, 488, __pyx_L1_error) | |
18407 } | |
18408 break; | |
18409 } | |
18410 __Pyx_GOTREF(__pyx_t_2); | |
18411 } | |
18412 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); | |
18413 __pyx_t_2 = 0; | |
18414 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) | |
18415 __Pyx_GOTREF(__pyx_t_2); | |
18416 if (unlikely((PyDict_SetItem(__pyx_v_d, __pyx_v_k, __pyx_t_2) < 0))) __PYX_ERR(0, 488, __pyx_L1_error) | |
18417 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
18418 } | |
18419 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
18420 | |
18421 /* "pysam/libcvcf.pyx":489 | |
18422 * d = {} | |
18423 * for k in data: d[k] = [] | |
18424 * data = d # <<<<<<<<<<<<<< | |
18425 * # convert missing values; and silently add definitions if required | |
18426 * for k in data: | |
18427 */ | |
18428 __Pyx_INCREF(__pyx_v_d); | |
18429 __Pyx_DECREF_SET(__pyx_v_data, __pyx_v_d); | |
18430 | |
18431 /* "pysam/libcvcf.pyx":486 | |
18432 * def format_formatdata( self, data, format, key=True, value=True, separator=":" ): | |
18433 * output, sdata = [], [] | |
18434 * if type(data) == type([]): # for FORMAT field, make data with dummy values # <<<<<<<<<<<<<< | |
18435 * d = {} | |
18436 * for k in data: d[k] = [] | |
18437 */ | |
18438 } | |
18439 | |
18440 /* "pysam/libcvcf.pyx":491 | |
18441 * data = d | |
18442 * # convert missing values; and silently add definitions if required | |
18443 * for k in data: # <<<<<<<<<<<<<< | |
18444 * self._add_definition( format, k, data[k], "(output)" ) | |
18445 * for idx,v in enumerate(data[k]): | |
18446 */ | |
18447 if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) { | |
18448 __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1); | |
18449 __pyx_t_4 = 0; | |
18450 __pyx_t_5 = NULL; | |
18451 } else { | |
18452 __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error) | |
18453 __Pyx_GOTREF(__pyx_t_1); | |
18454 __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error) | |
18455 } | |
18456 for (;;) { | |
18457 if (likely(!__pyx_t_5)) { | |
18458 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
18459 { | |
18460 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
18461 #if !CYTHON_ASSUME_SAFE_MACROS | |
18462 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 491, __pyx_L1_error) | |
18463 #endif | |
18464 if (__pyx_t_4 >= __pyx_temp) break; | |
18465 } | |
18466 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18467 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 491, __pyx_L1_error) | |
18468 #else | |
18469 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) | |
18470 __Pyx_GOTREF(__pyx_t_2); | |
18471 #endif | |
18472 } else { | |
18473 { | |
18474 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
18475 #if !CYTHON_ASSUME_SAFE_MACROS | |
18476 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 491, __pyx_L1_error) | |
18477 #endif | |
18478 if (__pyx_t_4 >= __pyx_temp) break; | |
18479 } | |
18480 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18481 __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, 491, __pyx_L1_error) | |
18482 #else | |
18483 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) | |
18484 __Pyx_GOTREF(__pyx_t_2); | |
18485 #endif | |
18486 } | |
18487 } else { | |
18488 __pyx_t_2 = __pyx_t_5(__pyx_t_1); | |
18489 if (unlikely(!__pyx_t_2)) { | |
18490 PyObject* exc_type = PyErr_Occurred(); | |
18491 if (exc_type) { | |
18492 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
18493 else __PYX_ERR(0, 491, __pyx_L1_error) | |
18494 } | |
18495 break; | |
18496 } | |
18497 __Pyx_GOTREF(__pyx_t_2); | |
18498 } | |
18499 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); | |
18500 __pyx_t_2 = 0; | |
18501 | |
18502 /* "pysam/libcvcf.pyx":492 | |
18503 * # convert missing values; and silently add definitions if required | |
18504 * for k in data: | |
18505 * self._add_definition( format, k, data[k], "(output)" ) # <<<<<<<<<<<<<< | |
18506 * for idx,v in enumerate(data[k]): | |
18507 * if v == format[k].missingvalue: data[k][idx] = "." | |
18508 */ | |
18509 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_definition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L1_error) | |
18510 __Pyx_GOTREF(__pyx_t_6); | |
18511 __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 492, __pyx_L1_error) | |
18512 __Pyx_GOTREF(__pyx_t_7); | |
18513 __pyx_t_8 = NULL; | |
18514 __pyx_t_9 = 0; | |
18515 #if CYTHON_UNPACK_METHODS | |
18516 if (likely(PyMethod_Check(__pyx_t_6))) { | |
18517 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); | |
18518 if (likely(__pyx_t_8)) { | |
18519 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
18520 __Pyx_INCREF(__pyx_t_8); | |
18521 __Pyx_INCREF(function); | |
18522 __Pyx_DECREF_SET(__pyx_t_6, function); | |
18523 __pyx_t_9 = 1; | |
18524 } | |
18525 } | |
18526 #endif | |
18527 { | |
18528 PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_format, __pyx_v_k, __pyx_t_7, __pyx_kp_u_output}; | |
18529 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9); | |
18530 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
18531 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
18532 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) | |
18533 __Pyx_GOTREF(__pyx_t_2); | |
18534 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18535 } | |
18536 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
18537 | |
18538 /* "pysam/libcvcf.pyx":493 | |
18539 * for k in data: | |
18540 * self._add_definition( format, k, data[k], "(output)" ) | |
18541 * for idx,v in enumerate(data[k]): # <<<<<<<<<<<<<< | |
18542 * if v == format[k].missingvalue: data[k][idx] = "." | |
18543 * # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string | |
18544 */ | |
18545 __Pyx_INCREF(__pyx_int_0); | |
18546 __pyx_t_2 = __pyx_int_0; | |
18547 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error) | |
18548 __Pyx_GOTREF(__pyx_t_6); | |
18549 if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { | |
18550 __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); | |
18551 __pyx_t_10 = 0; | |
18552 __pyx_t_11 = NULL; | |
18553 } else { | |
18554 __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error) | |
18555 __Pyx_GOTREF(__pyx_t_7); | |
18556 __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 493, __pyx_L1_error) | |
18557 } | |
18558 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18559 for (;;) { | |
18560 if (likely(!__pyx_t_11)) { | |
18561 if (likely(PyList_CheckExact(__pyx_t_7))) { | |
18562 { | |
18563 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); | |
18564 #if !CYTHON_ASSUME_SAFE_MACROS | |
18565 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 493, __pyx_L1_error) | |
18566 #endif | |
18567 if (__pyx_t_10 >= __pyx_temp) break; | |
18568 } | |
18569 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18570 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 493, __pyx_L1_error) | |
18571 #else | |
18572 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error) | |
18573 __Pyx_GOTREF(__pyx_t_6); | |
18574 #endif | |
18575 } else { | |
18576 { | |
18577 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); | |
18578 #if !CYTHON_ASSUME_SAFE_MACROS | |
18579 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 493, __pyx_L1_error) | |
18580 #endif | |
18581 if (__pyx_t_10 >= __pyx_temp) break; | |
18582 } | |
18583 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18584 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 493, __pyx_L1_error) | |
18585 #else | |
18586 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error) | |
18587 __Pyx_GOTREF(__pyx_t_6); | |
18588 #endif | |
18589 } | |
18590 } else { | |
18591 __pyx_t_6 = __pyx_t_11(__pyx_t_7); | |
18592 if (unlikely(!__pyx_t_6)) { | |
18593 PyObject* exc_type = PyErr_Occurred(); | |
18594 if (exc_type) { | |
18595 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
18596 else __PYX_ERR(0, 493, __pyx_L1_error) | |
18597 } | |
18598 break; | |
18599 } | |
18600 __Pyx_GOTREF(__pyx_t_6); | |
18601 } | |
18602 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); | |
18603 __pyx_t_6 = 0; | |
18604 __Pyx_INCREF(__pyx_t_2); | |
18605 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_2); | |
18606 __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error) | |
18607 __Pyx_GOTREF(__pyx_t_6); | |
18608 __Pyx_DECREF(__pyx_t_2); | |
18609 __pyx_t_2 = __pyx_t_6; | |
18610 __pyx_t_6 = 0; | |
18611 | |
18612 /* "pysam/libcvcf.pyx":494 | |
18613 * self._add_definition( format, k, data[k], "(output)" ) | |
18614 * for idx,v in enumerate(data[k]): | |
18615 * if v == format[k].missingvalue: data[k][idx] = "." # <<<<<<<<<<<<<< | |
18616 * # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string | |
18617 * for k in data: | |
18618 */ | |
18619 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_format, __pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) | |
18620 __Pyx_GOTREF(__pyx_t_6); | |
18621 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_missingvalue); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error) | |
18622 __Pyx_GOTREF(__pyx_t_8); | |
18623 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18624 __pyx_t_6 = PyObject_RichCompare(__pyx_v_v, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) | |
18625 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
18626 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 494, __pyx_L1_error) | |
18627 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18628 if (__pyx_t_3) { | |
18629 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) | |
18630 __Pyx_GOTREF(__pyx_t_6); | |
18631 if (unlikely((PyObject_SetItem(__pyx_t_6, __pyx_v_idx, __pyx_kp_u__5) < 0))) __PYX_ERR(0, 494, __pyx_L1_error) | |
18632 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18633 } | |
18634 | |
18635 /* "pysam/libcvcf.pyx":493 | |
18636 * for k in data: | |
18637 * self._add_definition( format, k, data[k], "(output)" ) | |
18638 * for idx,v in enumerate(data[k]): # <<<<<<<<<<<<<< | |
18639 * if v == format[k].missingvalue: data[k][idx] = "." | |
18640 * # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string | |
18641 */ | |
18642 } | |
18643 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
18644 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
18645 | |
18646 /* "pysam/libcvcf.pyx":491 | |
18647 * data = d | |
18648 * # convert missing values; and silently add definitions if required | |
18649 * for k in data: # <<<<<<<<<<<<<< | |
18650 * self._add_definition( format, k, data[k], "(output)" ) | |
18651 * for idx,v in enumerate(data[k]): | |
18652 */ | |
18653 } | |
18654 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
18655 | |
18656 /* "pysam/libcvcf.pyx":496 | |
18657 * if v == format[k].missingvalue: data[k][idx] = "." | |
18658 * # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string | |
18659 * for k in data: # <<<<<<<<<<<<<< | |
18660 * if k != 'GT': sdata.append( (k,data[k]) ) | |
18661 * sdata.sort() | |
18662 */ | |
18663 if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) { | |
18664 __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1); | |
18665 __pyx_t_4 = 0; | |
18666 __pyx_t_5 = NULL; | |
18667 } else { | |
18668 __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) | |
18669 __Pyx_GOTREF(__pyx_t_1); | |
18670 __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) | |
18671 } | |
18672 for (;;) { | |
18673 if (likely(!__pyx_t_5)) { | |
18674 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
18675 { | |
18676 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
18677 #if !CYTHON_ASSUME_SAFE_MACROS | |
18678 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 496, __pyx_L1_error) | |
18679 #endif | |
18680 if (__pyx_t_4 >= __pyx_temp) break; | |
18681 } | |
18682 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18683 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 496, __pyx_L1_error) | |
18684 #else | |
18685 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) | |
18686 __Pyx_GOTREF(__pyx_t_2); | |
18687 #endif | |
18688 } else { | |
18689 { | |
18690 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
18691 #if !CYTHON_ASSUME_SAFE_MACROS | |
18692 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 496, __pyx_L1_error) | |
18693 #endif | |
18694 if (__pyx_t_4 >= __pyx_temp) break; | |
18695 } | |
18696 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18697 __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, 496, __pyx_L1_error) | |
18698 #else | |
18699 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) | |
18700 __Pyx_GOTREF(__pyx_t_2); | |
18701 #endif | |
18702 } | |
18703 } else { | |
18704 __pyx_t_2 = __pyx_t_5(__pyx_t_1); | |
18705 if (unlikely(!__pyx_t_2)) { | |
18706 PyObject* exc_type = PyErr_Occurred(); | |
18707 if (exc_type) { | |
18708 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
18709 else __PYX_ERR(0, 496, __pyx_L1_error) | |
18710 } | |
18711 break; | |
18712 } | |
18713 __Pyx_GOTREF(__pyx_t_2); | |
18714 } | |
18715 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); | |
18716 __pyx_t_2 = 0; | |
18717 | |
18718 /* "pysam/libcvcf.pyx":497 | |
18719 * # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string | |
18720 * for k in data: | |
18721 * if k != 'GT': sdata.append( (k,data[k]) ) # <<<<<<<<<<<<<< | |
18722 * sdata.sort() | |
18723 * if 'GT' in data: | |
18724 */ | |
18725 __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_k, __pyx_n_u_GT, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 497, __pyx_L1_error) | |
18726 if (__pyx_t_3) { | |
18727 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error) | |
18728 __Pyx_GOTREF(__pyx_t_2); | |
18729 __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error) | |
18730 __Pyx_GOTREF(__pyx_t_7); | |
18731 __Pyx_INCREF(__pyx_v_k); | |
18732 __Pyx_GIVEREF(__pyx_v_k); | |
18733 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_k)) __PYX_ERR(0, 497, __pyx_L1_error); | |
18734 __Pyx_GIVEREF(__pyx_t_2); | |
18735 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error); | |
18736 __pyx_t_2 = 0; | |
18737 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_sdata, __pyx_t_7); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 497, __pyx_L1_error) | |
18738 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
18739 } | |
18740 | |
18741 /* "pysam/libcvcf.pyx":496 | |
18742 * if v == format[k].missingvalue: data[k][idx] = "." | |
18743 * # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string | |
18744 * for k in data: # <<<<<<<<<<<<<< | |
18745 * if k != 'GT': sdata.append( (k,data[k]) ) | |
18746 * sdata.sort() | |
18747 */ | |
18748 } | |
18749 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
18750 | |
18751 /* "pysam/libcvcf.pyx":498 | |
18752 * for k in data: | |
18753 * if k != 'GT': sdata.append( (k,data[k]) ) | |
18754 * sdata.sort() # <<<<<<<<<<<<<< | |
18755 * if 'GT' in data: | |
18756 * sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata | |
18757 */ | |
18758 __pyx_t_12 = PyList_Sort(__pyx_v_sdata); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 498, __pyx_L1_error) | |
18759 | |
18760 /* "pysam/libcvcf.pyx":499 | |
18761 * if k != 'GT': sdata.append( (k,data[k]) ) | |
18762 * sdata.sort() | |
18763 * if 'GT' in data: # <<<<<<<<<<<<<< | |
18764 * sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata | |
18765 * for k,v in sdata: | |
18766 */ | |
18767 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_GT, __pyx_v_data, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) | |
18768 if (__pyx_t_3) { | |
18769 | |
18770 /* "pysam/libcvcf.pyx":500 | |
18771 * sdata.sort() | |
18772 * if 'GT' in data: | |
18773 * sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata # <<<<<<<<<<<<<< | |
18774 * for k,v in sdata: | |
18775 * if v == []: v = None | |
18776 */ | |
18777 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_convertGTback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) | |
18778 __Pyx_GOTREF(__pyx_t_1); | |
18779 __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_GT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error) | |
18780 __Pyx_GOTREF(__pyx_t_7); | |
18781 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) | |
18782 __Pyx_GOTREF(__pyx_t_2); | |
18783 __Pyx_GIVEREF(__pyx_t_1); | |
18784 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error); | |
18785 __Pyx_GIVEREF(__pyx_t_7); | |
18786 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error); | |
18787 __pyx_t_1 = 0; | |
18788 __pyx_t_7 = 0; | |
18789 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error) | |
18790 __Pyx_GOTREF(__pyx_t_7); | |
18791 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
18792 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) | |
18793 __Pyx_GOTREF(__pyx_t_2); | |
18794 __Pyx_INCREF(__pyx_n_u_GT); | |
18795 __Pyx_GIVEREF(__pyx_n_u_GT); | |
18796 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_GT)) __PYX_ERR(0, 500, __pyx_L1_error); | |
18797 __Pyx_GIVEREF(__pyx_t_7); | |
18798 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error); | |
18799 __pyx_t_7 = 0; | |
18800 __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error) | |
18801 __Pyx_GOTREF(__pyx_t_7); | |
18802 __Pyx_GIVEREF(__pyx_t_2); | |
18803 if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error); | |
18804 __pyx_t_2 = 0; | |
18805 __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_sdata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) | |
18806 __Pyx_GOTREF(__pyx_t_2); | |
18807 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
18808 __Pyx_DECREF_SET(__pyx_v_sdata, ((PyObject*)__pyx_t_2)); | |
18809 __pyx_t_2 = 0; | |
18810 | |
18811 /* "pysam/libcvcf.pyx":499 | |
18812 * if k != 'GT': sdata.append( (k,data[k]) ) | |
18813 * sdata.sort() | |
18814 * if 'GT' in data: # <<<<<<<<<<<<<< | |
18815 * sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata | |
18816 * for k,v in sdata: | |
18817 */ | |
18818 } | |
18819 | |
18820 /* "pysam/libcvcf.pyx":501 | |
18821 * if 'GT' in data: | |
18822 * sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata | |
18823 * for k,v in sdata: # <<<<<<<<<<<<<< | |
18824 * if v == []: v = None | |
18825 * if key and value: | |
18826 */ | |
18827 __pyx_t_2 = __pyx_v_sdata; __Pyx_INCREF(__pyx_t_2); | |
18828 __pyx_t_4 = 0; | |
18829 for (;;) { | |
18830 { | |
18831 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
18832 #if !CYTHON_ASSUME_SAFE_MACROS | |
18833 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 501, __pyx_L1_error) | |
18834 #endif | |
18835 if (__pyx_t_4 >= __pyx_temp) break; | |
18836 } | |
18837 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18838 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 501, __pyx_L1_error) | |
18839 #else | |
18840 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error) | |
18841 __Pyx_GOTREF(__pyx_t_7); | |
18842 #endif | |
18843 if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { | |
18844 PyObject* sequence = __pyx_t_7; | |
18845 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
18846 if (unlikely(size != 2)) { | |
18847 if (size > 2) __Pyx_RaiseTooManyValuesError(2); | |
18848 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
18849 __PYX_ERR(0, 501, __pyx_L1_error) | |
18850 } | |
18851 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
18852 if (likely(PyTuple_CheckExact(sequence))) { | |
18853 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); | |
18854 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); | |
18855 } else { | |
18856 __pyx_t_1 = PyList_GET_ITEM(sequence, 0); | |
18857 __pyx_t_6 = PyList_GET_ITEM(sequence, 1); | |
18858 } | |
18859 __Pyx_INCREF(__pyx_t_1); | |
18860 __Pyx_INCREF(__pyx_t_6); | |
18861 #else | |
18862 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) | |
18863 __Pyx_GOTREF(__pyx_t_1); | |
18864 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error) | |
18865 __Pyx_GOTREF(__pyx_t_6); | |
18866 #endif | |
18867 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
18868 } else { | |
18869 Py_ssize_t index = -1; | |
18870 __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 501, __pyx_L1_error) | |
18871 __Pyx_GOTREF(__pyx_t_8); | |
18872 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
18873 __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); | |
18874 index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L21_unpacking_failed; | |
18875 __Pyx_GOTREF(__pyx_t_1); | |
18876 index = 1; __pyx_t_6 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L21_unpacking_failed; | |
18877 __Pyx_GOTREF(__pyx_t_6); | |
18878 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_8), 2) < 0) __PYX_ERR(0, 501, __pyx_L1_error) | |
18879 __pyx_t_13 = NULL; | |
18880 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
18881 goto __pyx_L22_unpacking_done; | |
18882 __pyx_L21_unpacking_failed:; | |
18883 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
18884 __pyx_t_13 = NULL; | |
18885 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
18886 __PYX_ERR(0, 501, __pyx_L1_error) | |
18887 __pyx_L22_unpacking_done:; | |
18888 } | |
18889 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1); | |
18890 __pyx_t_1 = 0; | |
18891 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); | |
18892 __pyx_t_6 = 0; | |
18893 | |
18894 /* "pysam/libcvcf.pyx":502 | |
18895 * sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata | |
18896 * for k,v in sdata: | |
18897 * if v == []: v = None # <<<<<<<<<<<<<< | |
18898 * if key and value: | |
18899 * if v != None: output.append( k+"="+','.join(map(str,v)) ) | |
18900 */ | |
18901 __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L1_error) | |
18902 __Pyx_GOTREF(__pyx_t_7); | |
18903 __pyx_t_6 = PyObject_RichCompare(__pyx_v_v, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error) | |
18904 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
18905 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 502, __pyx_L1_error) | |
18906 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18907 if (__pyx_t_3) { | |
18908 __Pyx_INCREF(Py_None); | |
18909 __Pyx_DECREF_SET(__pyx_v_v, Py_None); | |
18910 } | |
18911 | |
18912 /* "pysam/libcvcf.pyx":503 | |
18913 * for k,v in sdata: | |
18914 * if v == []: v = None | |
18915 * if key and value: # <<<<<<<<<<<<<< | |
18916 * if v != None: output.append( k+"="+','.join(map(str,v)) ) | |
18917 * else: output.append( k ) | |
18918 */ | |
18919 __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 503, __pyx_L1_error) | |
18920 if (__pyx_t_14) { | |
18921 } else { | |
18922 __pyx_t_3 = __pyx_t_14; | |
18923 goto __pyx_L25_bool_binop_done; | |
18924 } | |
18925 __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 503, __pyx_L1_error) | |
18926 __pyx_t_3 = __pyx_t_14; | |
18927 __pyx_L25_bool_binop_done:; | |
18928 if (__pyx_t_3) { | |
18929 | |
18930 /* "pysam/libcvcf.pyx":504 | |
18931 * if v == []: v = None | |
18932 * if key and value: | |
18933 * if v != None: output.append( k+"="+','.join(map(str,v)) ) # <<<<<<<<<<<<<< | |
18934 * else: output.append( k ) | |
18935 * elif key: output.append(k) | |
18936 */ | |
18937 __pyx_t_6 = PyObject_RichCompare(__pyx_v_v, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) | |
18938 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) | |
18939 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18940 if (__pyx_t_3) { | |
18941 __pyx_t_6 = PyNumber_Add(__pyx_v_k, __pyx_kp_u__7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) | |
18942 __Pyx_GOTREF(__pyx_t_6); | |
18943 __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) | |
18944 __Pyx_GOTREF(__pyx_t_7); | |
18945 __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); | |
18946 __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); | |
18947 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 504, __pyx_L1_error); | |
18948 __Pyx_INCREF(__pyx_v_v); | |
18949 __Pyx_GIVEREF(__pyx_v_v); | |
18950 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_v)) __PYX_ERR(0, 504, __pyx_L1_error); | |
18951 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) | |
18952 __Pyx_GOTREF(__pyx_t_1); | |
18953 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
18954 __pyx_t_7 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) | |
18955 __Pyx_GOTREF(__pyx_t_7); | |
18956 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
18957 __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) | |
18958 __Pyx_GOTREF(__pyx_t_1); | |
18959 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18960 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
18961 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_output, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 504, __pyx_L1_error) | |
18962 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
18963 goto __pyx_L27; | |
18964 } | |
18965 | |
18966 /* "pysam/libcvcf.pyx":505 | |
18967 * if key and value: | |
18968 * if v != None: output.append( k+"="+','.join(map(str,v)) ) | |
18969 * else: output.append( k ) # <<<<<<<<<<<<<< | |
18970 * elif key: output.append(k) | |
18971 * elif value: | |
18972 */ | |
18973 /*else*/ { | |
18974 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_output, __pyx_v_k); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 505, __pyx_L1_error) | |
18975 } | |
18976 __pyx_L27:; | |
18977 | |
18978 /* "pysam/libcvcf.pyx":503 | |
18979 * for k,v in sdata: | |
18980 * if v == []: v = None | |
18981 * if key and value: # <<<<<<<<<<<<<< | |
18982 * if v != None: output.append( k+"="+','.join(map(str,v)) ) | |
18983 * else: output.append( k ) | |
18984 */ | |
18985 goto __pyx_L24; | |
18986 } | |
18987 | |
18988 /* "pysam/libcvcf.pyx":506 | |
18989 * if v != None: output.append( k+"="+','.join(map(str,v)) ) | |
18990 * else: output.append( k ) | |
18991 * elif key: output.append(k) # <<<<<<<<<<<<<< | |
18992 * elif value: | |
18993 * if v != None: output.append( ','.join(map(str,v)) ) | |
18994 */ | |
18995 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 506, __pyx_L1_error) | |
18996 if (__pyx_t_3) { | |
18997 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_output, __pyx_v_k); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 506, __pyx_L1_error) | |
18998 goto __pyx_L24; | |
18999 } | |
19000 | |
19001 /* "pysam/libcvcf.pyx":507 | |
19002 * else: output.append( k ) | |
19003 * elif key: output.append(k) | |
19004 * elif value: # <<<<<<<<<<<<<< | |
19005 * if v != None: output.append( ','.join(map(str,v)) ) | |
19006 * else: output.append( "." ) # should not happen | |
19007 */ | |
19008 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 507, __pyx_L1_error) | |
19009 if (__pyx_t_3) { | |
19010 | |
19011 /* "pysam/libcvcf.pyx":508 | |
19012 * elif key: output.append(k) | |
19013 * elif value: | |
19014 * if v != None: output.append( ','.join(map(str,v)) ) # <<<<<<<<<<<<<< | |
19015 * else: output.append( "." ) # should not happen | |
19016 * # snip off trailing missing data | |
19017 */ | |
19018 __pyx_t_1 = PyObject_RichCompare(__pyx_v_v, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) | |
19019 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 508, __pyx_L1_error) | |
19020 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19021 if (__pyx_t_3) { | |
19022 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) | |
19023 __Pyx_GOTREF(__pyx_t_1); | |
19024 __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); | |
19025 __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); | |
19026 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 508, __pyx_L1_error); | |
19027 __Pyx_INCREF(__pyx_v_v); | |
19028 __Pyx_GIVEREF(__pyx_v_v); | |
19029 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_v)) __PYX_ERR(0, 508, __pyx_L1_error); | |
19030 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error) | |
19031 __Pyx_GOTREF(__pyx_t_7); | |
19032 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19033 __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) | |
19034 __Pyx_GOTREF(__pyx_t_1); | |
19035 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19036 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_output, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 508, __pyx_L1_error) | |
19037 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19038 goto __pyx_L28; | |
19039 } | |
19040 | |
19041 /* "pysam/libcvcf.pyx":509 | |
19042 * elif value: | |
19043 * if v != None: output.append( ','.join(map(str,v)) ) | |
19044 * else: output.append( "." ) # should not happen # <<<<<<<<<<<<<< | |
19045 * # snip off trailing missing data | |
19046 * while len(output) > 1: | |
19047 */ | |
19048 /*else*/ { | |
19049 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_output, __pyx_kp_u__5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 509, __pyx_L1_error) | |
19050 } | |
19051 __pyx_L28:; | |
19052 | |
19053 /* "pysam/libcvcf.pyx":507 | |
19054 * else: output.append( k ) | |
19055 * elif key: output.append(k) | |
19056 * elif value: # <<<<<<<<<<<<<< | |
19057 * if v != None: output.append( ','.join(map(str,v)) ) | |
19058 * else: output.append( "." ) # should not happen | |
19059 */ | |
19060 } | |
19061 __pyx_L24:; | |
19062 | |
19063 /* "pysam/libcvcf.pyx":501 | |
19064 * if 'GT' in data: | |
19065 * sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata | |
19066 * for k,v in sdata: # <<<<<<<<<<<<<< | |
19067 * if v == []: v = None | |
19068 * if key and value: | |
19069 */ | |
19070 } | |
19071 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19072 | |
19073 /* "pysam/libcvcf.pyx":511 | |
19074 * else: output.append( "." ) # should not happen | |
19075 * # snip off trailing missing data | |
19076 * while len(output) > 1: # <<<<<<<<<<<<<< | |
19077 * last = output[-1].replace(',','').replace('.','') | |
19078 * if len(last)>0: break | |
19079 */ | |
19080 while (1) { | |
19081 __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_v_output); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 511, __pyx_L1_error) | |
19082 __pyx_t_3 = (__pyx_t_4 > 1); | |
19083 if (!__pyx_t_3) break; | |
19084 | |
19085 /* "pysam/libcvcf.pyx":512 | |
19086 * # snip off trailing missing data | |
19087 * while len(output) > 1: | |
19088 * last = output[-1].replace(',','').replace('.','') # <<<<<<<<<<<<<< | |
19089 * if len(last)>0: break | |
19090 * output = output[:-1] | |
19091 */ | |
19092 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_output, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) | |
19093 __Pyx_GOTREF(__pyx_t_2); | |
19094 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) | |
19095 __Pyx_GOTREF(__pyx_t_1); | |
19096 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19097 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) | |
19098 __Pyx_GOTREF(__pyx_t_2); | |
19099 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19100 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) | |
19101 __Pyx_GOTREF(__pyx_t_1); | |
19102 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19103 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) | |
19104 __Pyx_GOTREF(__pyx_t_2); | |
19105 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19106 __Pyx_XDECREF_SET(__pyx_v_last, __pyx_t_2); | |
19107 __pyx_t_2 = 0; | |
19108 | |
19109 /* "pysam/libcvcf.pyx":513 | |
19110 * while len(output) > 1: | |
19111 * last = output[-1].replace(',','').replace('.','') | |
19112 * if len(last)>0: break # <<<<<<<<<<<<<< | |
19113 * output = output[:-1] | |
19114 * return separator.join(output) | |
19115 */ | |
19116 __pyx_t_4 = PyObject_Length(__pyx_v_last); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 513, __pyx_L1_error) | |
19117 __pyx_t_3 = (__pyx_t_4 > 0); | |
19118 if (__pyx_t_3) { | |
19119 goto __pyx_L31_break; | |
19120 } | |
19121 | |
19122 /* "pysam/libcvcf.pyx":514 | |
19123 * last = output[-1].replace(',','').replace('.','') | |
19124 * if len(last)>0: break | |
19125 * output = output[:-1] # <<<<<<<<<<<<<< | |
19126 * return separator.join(output) | |
19127 * | |
19128 */ | |
19129 __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_output, 0, -1L); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) | |
19130 __Pyx_GOTREF(__pyx_t_2); | |
19131 __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_2)); | |
19132 __pyx_t_2 = 0; | |
19133 } | |
19134 __pyx_L31_break:; | |
19135 | |
19136 /* "pysam/libcvcf.pyx":515 | |
19137 * if len(last)>0: break | |
19138 * output = output[:-1] | |
19139 * return separator.join(output) # <<<<<<<<<<<<<< | |
19140 * | |
19141 * | |
19142 */ | |
19143 __Pyx_XDECREF(__pyx_r); | |
19144 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_separator, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) | |
19145 __Pyx_GOTREF(__pyx_t_1); | |
19146 __pyx_t_7 = NULL; | |
19147 __pyx_t_9 = 0; | |
19148 #if CYTHON_UNPACK_METHODS | |
19149 if (likely(PyMethod_Check(__pyx_t_1))) { | |
19150 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); | |
19151 if (likely(__pyx_t_7)) { | |
19152 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
19153 __Pyx_INCREF(__pyx_t_7); | |
19154 __Pyx_INCREF(function); | |
19155 __Pyx_DECREF_SET(__pyx_t_1, function); | |
19156 __pyx_t_9 = 1; | |
19157 } | |
19158 } | |
19159 #endif | |
19160 { | |
19161 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_output}; | |
19162 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); | |
19163 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19164 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) | |
19165 __Pyx_GOTREF(__pyx_t_2); | |
19166 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19167 } | |
19168 __pyx_r = __pyx_t_2; | |
19169 __pyx_t_2 = 0; | |
19170 goto __pyx_L0; | |
19171 | |
19172 /* "pysam/libcvcf.pyx":484 | |
19173 * | |
19174 * # todo: trim trailing missing values | |
19175 * def format_formatdata( self, data, format, key=True, value=True, separator=":" ): # <<<<<<<<<<<<<< | |
19176 * output, sdata = [], [] | |
19177 * if type(data) == type([]): # for FORMAT field, make data with dummy values | |
19178 */ | |
19179 | |
19180 /* function exit code */ | |
19181 __pyx_L1_error:; | |
19182 __Pyx_XDECREF(__pyx_t_1); | |
19183 __Pyx_XDECREF(__pyx_t_2); | |
19184 __Pyx_XDECREF(__pyx_t_6); | |
19185 __Pyx_XDECREF(__pyx_t_7); | |
19186 __Pyx_XDECREF(__pyx_t_8); | |
19187 __Pyx_AddTraceback("pysam.libcvcf.VCF.format_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
19188 __pyx_r = NULL; | |
19189 __pyx_L0:; | |
19190 __Pyx_XDECREF(__pyx_v_output); | |
19191 __Pyx_XDECREF(__pyx_v_sdata); | |
19192 __Pyx_XDECREF(__pyx_v_d); | |
19193 __Pyx_XDECREF(__pyx_v_k); | |
19194 __Pyx_XDECREF(__pyx_v_idx); | |
19195 __Pyx_XDECREF(__pyx_v_v); | |
19196 __Pyx_XDECREF(__pyx_v_last); | |
19197 __Pyx_XDECREF(__pyx_v_data); | |
19198 __Pyx_XGIVEREF(__pyx_r); | |
19199 __Pyx_RefNannyFinishContext(); | |
19200 return __pyx_r; | |
19201 } | |
19202 | |
19203 /* "pysam/libcvcf.pyx":518 | |
19204 * | |
19205 * | |
19206 * def enter_default_format(self): # <<<<<<<<<<<<<< | |
19207 * for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'), | |
19208 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), | |
19209 */ | |
19210 | |
19211 /* Python wrapper */ | |
19212 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_15enter_default_format(PyObject *__pyx_self, | |
19213 #if CYTHON_METH_FASTCALL | |
19214 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
19215 #else | |
19216 PyObject *__pyx_args, PyObject *__pyx_kwds | |
19217 #endif | |
19218 ); /*proto*/ | |
19219 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_14enter_default_format, "VCF.enter_default_format(self)"); | |
19220 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_15enter_default_format = {"enter_default_format", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_15enter_default_format, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_14enter_default_format}; | |
19221 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_15enter_default_format(PyObject *__pyx_self, | |
19222 #if CYTHON_METH_FASTCALL | |
19223 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
19224 #else | |
19225 PyObject *__pyx_args, PyObject *__pyx_kwds | |
19226 #endif | |
19227 ) { | |
19228 PyObject *__pyx_v_self = 0; | |
19229 #if !CYTHON_METH_FASTCALL | |
19230 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
19231 #endif | |
19232 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
19233 PyObject* values[1] = {0}; | |
19234 int __pyx_lineno = 0; | |
19235 const char *__pyx_filename = NULL; | |
19236 int __pyx_clineno = 0; | |
19237 PyObject *__pyx_r = 0; | |
19238 __Pyx_RefNannyDeclarations | |
19239 __Pyx_RefNannySetupContext("enter_default_format (wrapper)", 0); | |
19240 #if !CYTHON_METH_FASTCALL | |
19241 #if CYTHON_ASSUME_SAFE_MACROS | |
19242 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
19243 #else | |
19244 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
19245 #endif | |
19246 #endif | |
19247 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
19248 { | |
19249 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
19250 if (__pyx_kwds) { | |
19251 Py_ssize_t kw_args; | |
19252 switch (__pyx_nargs) { | |
19253 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
19254 CYTHON_FALLTHROUGH; | |
19255 case 0: break; | |
19256 default: goto __pyx_L5_argtuple_error; | |
19257 } | |
19258 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
19259 switch (__pyx_nargs) { | |
19260 case 0: | |
19261 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
19262 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
19263 kw_args--; | |
19264 } | |
19265 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L3_error) | |
19266 else goto __pyx_L5_argtuple_error; | |
19267 } | |
19268 if (unlikely(kw_args > 0)) { | |
19269 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
19270 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "enter_default_format") < 0)) __PYX_ERR(0, 518, __pyx_L3_error) | |
19271 } | |
19272 } else if (unlikely(__pyx_nargs != 1)) { | |
19273 goto __pyx_L5_argtuple_error; | |
19274 } else { | |
19275 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
19276 } | |
19277 __pyx_v_self = values[0]; | |
19278 } | |
19279 goto __pyx_L6_skip; | |
19280 __pyx_L5_argtuple_error:; | |
19281 __Pyx_RaiseArgtupleInvalid("enter_default_format", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 518, __pyx_L3_error) | |
19282 __pyx_L6_skip:; | |
19283 goto __pyx_L4_argument_unpacking_done; | |
19284 __pyx_L3_error:; | |
19285 { | |
19286 Py_ssize_t __pyx_temp; | |
19287 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
19288 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
19289 } | |
19290 } | |
19291 __Pyx_AddTraceback("pysam.libcvcf.VCF.enter_default_format", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
19292 __Pyx_RefNannyFinishContext(); | |
19293 return NULL; | |
19294 __pyx_L4_argument_unpacking_done:; | |
19295 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_14enter_default_format(__pyx_self, __pyx_v_self); | |
19296 | |
19297 /* function exit code */ | |
19298 { | |
19299 Py_ssize_t __pyx_temp; | |
19300 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
19301 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
19302 } | |
19303 } | |
19304 __Pyx_RefNannyFinishContext(); | |
19305 return __pyx_r; | |
19306 } | |
19307 | |
19308 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_14enter_default_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
19309 PyObject *__pyx_v_f = NULL; | |
19310 PyObject *__pyx_r = NULL; | |
19311 __Pyx_RefNannyDeclarations | |
19312 PyObject *__pyx_t_1 = NULL; | |
19313 PyObject *__pyx_t_2 = NULL; | |
19314 PyObject *__pyx_t_3 = NULL; | |
19315 PyObject *__pyx_t_4 = NULL; | |
19316 unsigned int __pyx_t_5; | |
19317 PyObject *__pyx_t_6 = NULL; | |
19318 PyObject *__pyx_t_7 = NULL; | |
19319 PyObject *__pyx_t_8 = NULL; | |
19320 PyObject *__pyx_t_9 = NULL; | |
19321 PyObject *__pyx_t_10 = NULL; | |
19322 PyObject *__pyx_t_11 = NULL; | |
19323 PyObject *__pyx_t_12 = NULL; | |
19324 PyObject *__pyx_t_13 = NULL; | |
19325 PyObject *__pyx_t_14 = NULL; | |
19326 PyObject *__pyx_t_15 = NULL; | |
19327 PyObject *__pyx_t_16 = NULL; | |
19328 PyObject *__pyx_t_17 = NULL; | |
19329 PyObject *__pyx_t_18 = NULL; | |
19330 Py_ssize_t __pyx_t_19; | |
19331 int __pyx_t_20; | |
19332 int __pyx_lineno = 0; | |
19333 const char *__pyx_filename = NULL; | |
19334 int __pyx_clineno = 0; | |
19335 __Pyx_RefNannySetupContext("enter_default_format", 1); | |
19336 | |
19337 /* "pysam/libcvcf.pyx":519 | |
19338 * | |
19339 * def enter_default_format(self): | |
19340 * for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'), # <<<<<<<<<<<<<< | |
19341 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), | |
19342 * FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'), | |
19343 */ | |
19344 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) | |
19345 __Pyx_GOTREF(__pyx_t_2); | |
19346 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error) | |
19347 __Pyx_GOTREF(__pyx_t_3); | |
19348 __pyx_t_4 = NULL; | |
19349 __pyx_t_5 = 0; | |
19350 #if CYTHON_UNPACK_METHODS | |
19351 if (unlikely(PyMethod_Check(__pyx_t_2))) { | |
19352 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); | |
19353 if (likely(__pyx_t_4)) { | |
19354 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
19355 __Pyx_INCREF(__pyx_t_4); | |
19356 __Pyx_INCREF(function); | |
19357 __Pyx_DECREF_SET(__pyx_t_2, function); | |
19358 __pyx_t_5 = 1; | |
19359 } | |
19360 } | |
19361 #endif | |
19362 { | |
19363 PyObject *__pyx_callargs[7] = {__pyx_t_4, __pyx_n_u_GT, __pyx_t_3, __pyx_int_1, __pyx_n_u_String, __pyx_n_u_Genotype, __pyx_kp_u__5}; | |
19364 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19365 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
19366 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
19367 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) | |
19368 __Pyx_GOTREF(__pyx_t_1); | |
19369 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19370 } | |
19371 | |
19372 /* "pysam/libcvcf.pyx":520 | |
19373 * def enter_default_format(self): | |
19374 * for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'), | |
19375 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), # <<<<<<<<<<<<<< | |
19376 * FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'), | |
19377 * FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), | |
19378 */ | |
19379 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) | |
19380 __Pyx_GOTREF(__pyx_t_3); | |
19381 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) | |
19382 __Pyx_GOTREF(__pyx_t_4); | |
19383 __pyx_t_6 = NULL; | |
19384 __pyx_t_5 = 0; | |
19385 #if CYTHON_UNPACK_METHODS | |
19386 if (unlikely(PyMethod_Check(__pyx_t_3))) { | |
19387 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); | |
19388 if (likely(__pyx_t_6)) { | |
19389 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
19390 __Pyx_INCREF(__pyx_t_6); | |
19391 __Pyx_INCREF(function); | |
19392 __Pyx_DECREF_SET(__pyx_t_3, function); | |
19393 __pyx_t_5 = 1; | |
19394 } | |
19395 } | |
19396 #endif | |
19397 { | |
19398 PyObject *__pyx_callargs[7] = {__pyx_t_6, __pyx_n_u_DP, __pyx_t_4, __pyx_int_1, __pyx_n_u_Integer, __pyx_kp_u_Read_depth_at_this_position_for, __pyx_int_neg_1}; | |
19399 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19400 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
19401 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
19402 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) | |
19403 __Pyx_GOTREF(__pyx_t_2); | |
19404 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
19405 } | |
19406 | |
19407 /* "pysam/libcvcf.pyx":521 | |
19408 * for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'), | |
19409 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), | |
19410 * FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'), # <<<<<<<<<<<<<< | |
19411 * FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), | |
19412 * FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), | |
19413 */ | |
19414 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error) | |
19415 __Pyx_GOTREF(__pyx_t_4); | |
19416 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L1_error) | |
19417 __Pyx_GOTREF(__pyx_t_6); | |
19418 __pyx_t_7 = NULL; | |
19419 __pyx_t_5 = 0; | |
19420 #if CYTHON_UNPACK_METHODS | |
19421 if (unlikely(PyMethod_Check(__pyx_t_4))) { | |
19422 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); | |
19423 if (likely(__pyx_t_7)) { | |
19424 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
19425 __Pyx_INCREF(__pyx_t_7); | |
19426 __Pyx_INCREF(function); | |
19427 __Pyx_DECREF_SET(__pyx_t_4, function); | |
19428 __pyx_t_5 = 1; | |
19429 } | |
19430 } | |
19431 #endif | |
19432 { | |
19433 PyObject *__pyx_callargs[7] = {__pyx_t_7, __pyx_n_u_FT, __pyx_t_6, __pyx_int_1, __pyx_n_u_String, __pyx_kp_u_Sample_Genotype_Filter, __pyx_kp_u__5}; | |
19434 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19435 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19436 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
19437 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error) | |
19438 __Pyx_GOTREF(__pyx_t_3); | |
19439 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
19440 } | |
19441 | |
19442 /* "pysam/libcvcf.pyx":522 | |
19443 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), | |
19444 * FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'), | |
19445 * FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), # <<<<<<<<<<<<<< | |
19446 * FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), | |
19447 * FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1), | |
19448 */ | |
19449 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) | |
19450 __Pyx_GOTREF(__pyx_t_6); | |
19451 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 522, __pyx_L1_error) | |
19452 __Pyx_GOTREF(__pyx_t_7); | |
19453 __pyx_t_8 = NULL; | |
19454 __pyx_t_5 = 0; | |
19455 #if CYTHON_UNPACK_METHODS | |
19456 if (unlikely(PyMethod_Check(__pyx_t_6))) { | |
19457 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); | |
19458 if (likely(__pyx_t_8)) { | |
19459 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
19460 __Pyx_INCREF(__pyx_t_8); | |
19461 __Pyx_INCREF(function); | |
19462 __Pyx_DECREF_SET(__pyx_t_6, function); | |
19463 __pyx_t_5 = 1; | |
19464 } | |
19465 } | |
19466 #endif | |
19467 { | |
19468 PyObject *__pyx_callargs[7] = {__pyx_t_8, __pyx_n_u_GL, __pyx_t_7, __pyx_int_neg_1, __pyx_n_u_Float, __pyx_kp_u_Genotype_likelihoods, __pyx_kp_u__5}; | |
19469 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19470 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19471 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19472 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) | |
19473 __Pyx_GOTREF(__pyx_t_4); | |
19474 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
19475 } | |
19476 | |
19477 /* "pysam/libcvcf.pyx":523 | |
19478 * FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'), | |
19479 * FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), | |
19480 * FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), # <<<<<<<<<<<<<< | |
19481 * FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1), | |
19482 * FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'), | |
19483 */ | |
19484 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 523, __pyx_L1_error) | |
19485 __Pyx_GOTREF(__pyx_t_7); | |
19486 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error) | |
19487 __Pyx_GOTREF(__pyx_t_8); | |
19488 __pyx_t_9 = NULL; | |
19489 __pyx_t_5 = 0; | |
19490 #if CYTHON_UNPACK_METHODS | |
19491 if (unlikely(PyMethod_Check(__pyx_t_7))) { | |
19492 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); | |
19493 if (likely(__pyx_t_9)) { | |
19494 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); | |
19495 __Pyx_INCREF(__pyx_t_9); | |
19496 __Pyx_INCREF(function); | |
19497 __Pyx_DECREF_SET(__pyx_t_7, function); | |
19498 __pyx_t_5 = 1; | |
19499 } | |
19500 } | |
19501 #endif | |
19502 { | |
19503 PyObject *__pyx_callargs[7] = {__pyx_t_9, __pyx_n_u_GLE, __pyx_t_8, __pyx_int_neg_1, __pyx_n_u_Float, __pyx_kp_u_Genotype_likelihoods, __pyx_kp_u__5}; | |
19504 __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19505 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
19506 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19507 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) | |
19508 __Pyx_GOTREF(__pyx_t_6); | |
19509 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19510 } | |
19511 | |
19512 /* "pysam/libcvcf.pyx":524 | |
19513 * FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), | |
19514 * FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), | |
19515 * FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1), # <<<<<<<<<<<<<< | |
19516 * FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'), | |
19517 * FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'), | |
19518 */ | |
19519 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error) | |
19520 __Pyx_GOTREF(__pyx_t_8); | |
19521 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 524, __pyx_L1_error) | |
19522 __Pyx_GOTREF(__pyx_t_9); | |
19523 __pyx_t_10 = NULL; | |
19524 __pyx_t_5 = 0; | |
19525 #if CYTHON_UNPACK_METHODS | |
19526 if (unlikely(PyMethod_Check(__pyx_t_8))) { | |
19527 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); | |
19528 if (likely(__pyx_t_10)) { | |
19529 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); | |
19530 __Pyx_INCREF(__pyx_t_10); | |
19531 __Pyx_INCREF(function); | |
19532 __Pyx_DECREF_SET(__pyx_t_8, function); | |
19533 __pyx_t_5 = 1; | |
19534 } | |
19535 } | |
19536 #endif | |
19537 { | |
19538 PyObject *__pyx_callargs[7] = {__pyx_t_10, __pyx_n_u_GQ, __pyx_t_9, __pyx_int_1, __pyx_n_u_Integer, __pyx_kp_u_Genotype_Quality, __pyx_int_neg_1}; | |
19539 __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19540 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; | |
19541 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
19542 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L1_error) | |
19543 __Pyx_GOTREF(__pyx_t_7); | |
19544 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19545 } | |
19546 | |
19547 /* "pysam/libcvcf.pyx":525 | |
19548 * FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'), | |
19549 * FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1), | |
19550 * FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'), # <<<<<<<<<<<<<< | |
19551 * FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'), | |
19552 * FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'), | |
19553 */ | |
19554 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 525, __pyx_L1_error) | |
19555 __Pyx_GOTREF(__pyx_t_9); | |
19556 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 525, __pyx_L1_error) | |
19557 __Pyx_GOTREF(__pyx_t_10); | |
19558 __pyx_t_11 = NULL; | |
19559 __pyx_t_5 = 0; | |
19560 #if CYTHON_UNPACK_METHODS | |
19561 if (unlikely(PyMethod_Check(__pyx_t_9))) { | |
19562 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); | |
19563 if (likely(__pyx_t_11)) { | |
19564 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); | |
19565 __Pyx_INCREF(__pyx_t_11); | |
19566 __Pyx_INCREF(function); | |
19567 __Pyx_DECREF_SET(__pyx_t_9, function); | |
19568 __pyx_t_5 = 1; | |
19569 } | |
19570 } | |
19571 #endif | |
19572 { | |
19573 PyObject *__pyx_callargs[7] = {__pyx_t_11, __pyx_n_u_PL, __pyx_t_10, __pyx_int_neg_1, __pyx_n_u_Integer, __pyx_kp_u_Phred_scaled_genotype_likelihood, __pyx_kp_u__5}; | |
19574 __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19575 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
19576 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
19577 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error) | |
19578 __Pyx_GOTREF(__pyx_t_8); | |
19579 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
19580 } | |
19581 | |
19582 /* "pysam/libcvcf.pyx":526 | |
19583 * FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1), | |
19584 * FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'), | |
19585 * FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'), # <<<<<<<<<<<<<< | |
19586 * FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'), | |
19587 * FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1), # unknown number, since may be haploid | |
19588 */ | |
19589 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 526, __pyx_L1_error) | |
19590 __Pyx_GOTREF(__pyx_t_10); | |
19591 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 526, __pyx_L1_error) | |
19592 __Pyx_GOTREF(__pyx_t_11); | |
19593 __pyx_t_12 = NULL; | |
19594 __pyx_t_5 = 0; | |
19595 #if CYTHON_UNPACK_METHODS | |
19596 if (unlikely(PyMethod_Check(__pyx_t_10))) { | |
19597 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10); | |
19598 if (likely(__pyx_t_12)) { | |
19599 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); | |
19600 __Pyx_INCREF(__pyx_t_12); | |
19601 __Pyx_INCREF(function); | |
19602 __Pyx_DECREF_SET(__pyx_t_10, function); | |
19603 __pyx_t_5 = 1; | |
19604 } | |
19605 } | |
19606 #endif | |
19607 { | |
19608 PyObject *__pyx_callargs[7] = {__pyx_t_12, __pyx_n_u_GP, __pyx_t_11, __pyx_int_neg_1, __pyx_n_u_Float, __pyx_kp_u_Genotype_posterior_probabilities, __pyx_kp_u__5}; | |
19609 __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19610 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
19611 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
19612 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 526, __pyx_L1_error) | |
19613 __Pyx_GOTREF(__pyx_t_9); | |
19614 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
19615 } | |
19616 | |
19617 /* "pysam/libcvcf.pyx":527 | |
19618 * FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'), | |
19619 * FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'), | |
19620 * FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'), # <<<<<<<<<<<<<< | |
19621 * FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1), # unknown number, since may be haploid | |
19622 * FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'), | |
19623 */ | |
19624 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 527, __pyx_L1_error) | |
19625 __Pyx_GOTREF(__pyx_t_11); | |
19626 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 527, __pyx_L1_error) | |
19627 __Pyx_GOTREF(__pyx_t_12); | |
19628 __pyx_t_13 = NULL; | |
19629 __pyx_t_5 = 0; | |
19630 #if CYTHON_UNPACK_METHODS | |
19631 if (unlikely(PyMethod_Check(__pyx_t_11))) { | |
19632 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11); | |
19633 if (likely(__pyx_t_13)) { | |
19634 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); | |
19635 __Pyx_INCREF(__pyx_t_13); | |
19636 __Pyx_INCREF(function); | |
19637 __Pyx_DECREF_SET(__pyx_t_11, function); | |
19638 __pyx_t_5 = 1; | |
19639 } | |
19640 } | |
19641 #endif | |
19642 { | |
19643 PyObject *__pyx_callargs[7] = {__pyx_t_13, __pyx_n_u_GQ, __pyx_t_12, __pyx_int_neg_1, __pyx_n_u_Integer, __pyx_kp_u_Conditional_genotype_quality, __pyx_kp_u__5}; | |
19644 __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19645 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; | |
19646 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
19647 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 527, __pyx_L1_error) | |
19648 __Pyx_GOTREF(__pyx_t_10); | |
19649 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
19650 } | |
19651 | |
19652 /* "pysam/libcvcf.pyx":528 | |
19653 * FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'), | |
19654 * FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'), | |
19655 * FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1), # unknown number, since may be haploid # <<<<<<<<<<<<<< | |
19656 * FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'), | |
19657 * FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1), | |
19658 */ | |
19659 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 528, __pyx_L1_error) | |
19660 __Pyx_GOTREF(__pyx_t_12); | |
19661 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 528, __pyx_L1_error) | |
19662 __Pyx_GOTREF(__pyx_t_13); | |
19663 __pyx_t_14 = NULL; | |
19664 __pyx_t_5 = 0; | |
19665 #if CYTHON_UNPACK_METHODS | |
19666 if (unlikely(PyMethod_Check(__pyx_t_12))) { | |
19667 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); | |
19668 if (likely(__pyx_t_14)) { | |
19669 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); | |
19670 __Pyx_INCREF(__pyx_t_14); | |
19671 __Pyx_INCREF(function); | |
19672 __Pyx_DECREF_SET(__pyx_t_12, function); | |
19673 __pyx_t_5 = 1; | |
19674 } | |
19675 } | |
19676 #endif | |
19677 { | |
19678 PyObject *__pyx_callargs[7] = {__pyx_t_14, __pyx_n_u_HQ, __pyx_t_13, __pyx_int_neg_1, __pyx_n_u_Integer, __pyx_kp_u_Haplotype_Quality, __pyx_int_neg_1}; | |
19679 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19680 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; | |
19681 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; | |
19682 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 528, __pyx_L1_error) | |
19683 __Pyx_GOTREF(__pyx_t_11); | |
19684 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
19685 } | |
19686 | |
19687 /* "pysam/libcvcf.pyx":529 | |
19688 * FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'), | |
19689 * FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1), # unknown number, since may be haploid | |
19690 * FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'), # <<<<<<<<<<<<<< | |
19691 * FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1), | |
19692 * FORMAT('EC',self.NT_ALLELES,1,'Integer','Expected alternate allel counts',-1), | |
19693 */ | |
19694 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 529, __pyx_L1_error) | |
19695 __Pyx_GOTREF(__pyx_t_13); | |
19696 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 529, __pyx_L1_error) | |
19697 __Pyx_GOTREF(__pyx_t_14); | |
19698 __pyx_t_15 = NULL; | |
19699 __pyx_t_5 = 0; | |
19700 #if CYTHON_UNPACK_METHODS | |
19701 if (unlikely(PyMethod_Check(__pyx_t_13))) { | |
19702 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13); | |
19703 if (likely(__pyx_t_15)) { | |
19704 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); | |
19705 __Pyx_INCREF(__pyx_t_15); | |
19706 __Pyx_INCREF(function); | |
19707 __Pyx_DECREF_SET(__pyx_t_13, function); | |
19708 __pyx_t_5 = 1; | |
19709 } | |
19710 } | |
19711 #endif | |
19712 { | |
19713 PyObject *__pyx_callargs[7] = {__pyx_t_15, __pyx_n_u_PS, __pyx_t_14, __pyx_int_neg_1, __pyx_n_u_Integer, __pyx_kp_u_Phase_set, __pyx_kp_u__5}; | |
19714 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19715 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; | |
19716 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; | |
19717 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 529, __pyx_L1_error) | |
19718 __Pyx_GOTREF(__pyx_t_12); | |
19719 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; | |
19720 } | |
19721 | |
19722 /* "pysam/libcvcf.pyx":530 | |
19723 * FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1), # unknown number, since may be haploid | |
19724 * FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'), | |
19725 * FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1), # <<<<<<<<<<<<<< | |
19726 * FORMAT('EC',self.NT_ALLELES,1,'Integer','Expected alternate allel counts',-1), | |
19727 * FORMAT('MQ',self.NT_NUMBER,1,'Integer','RMS mapping quality',-1), | |
19728 */ | |
19729 __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 530, __pyx_L1_error) | |
19730 __Pyx_GOTREF(__pyx_t_14); | |
19731 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 530, __pyx_L1_error) | |
19732 __Pyx_GOTREF(__pyx_t_15); | |
19733 __pyx_t_16 = NULL; | |
19734 __pyx_t_5 = 0; | |
19735 #if CYTHON_UNPACK_METHODS | |
19736 if (unlikely(PyMethod_Check(__pyx_t_14))) { | |
19737 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_14); | |
19738 if (likely(__pyx_t_16)) { | |
19739 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); | |
19740 __Pyx_INCREF(__pyx_t_16); | |
19741 __Pyx_INCREF(function); | |
19742 __Pyx_DECREF_SET(__pyx_t_14, function); | |
19743 __pyx_t_5 = 1; | |
19744 } | |
19745 } | |
19746 #endif | |
19747 { | |
19748 PyObject *__pyx_callargs[7] = {__pyx_t_16, __pyx_n_u_PQ, __pyx_t_15, __pyx_int_1, __pyx_n_u_Integer, __pyx_kp_u_Phasing_quality, __pyx_int_neg_1}; | |
19749 __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19750 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
19751 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
19752 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 530, __pyx_L1_error) | |
19753 __Pyx_GOTREF(__pyx_t_13); | |
19754 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; | |
19755 } | |
19756 | |
19757 /* "pysam/libcvcf.pyx":531 | |
19758 * FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'), | |
19759 * FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1), | |
19760 * FORMAT('EC',self.NT_ALLELES,1,'Integer','Expected alternate allel counts',-1), # <<<<<<<<<<<<<< | |
19761 * FORMAT('MQ',self.NT_NUMBER,1,'Integer','RMS mapping quality',-1), | |
19762 * ]: | |
19763 */ | |
19764 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 531, __pyx_L1_error) | |
19765 __Pyx_GOTREF(__pyx_t_15); | |
19766 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 531, __pyx_L1_error) | |
19767 __Pyx_GOTREF(__pyx_t_16); | |
19768 __pyx_t_17 = NULL; | |
19769 __pyx_t_5 = 0; | |
19770 #if CYTHON_UNPACK_METHODS | |
19771 if (unlikely(PyMethod_Check(__pyx_t_15))) { | |
19772 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_15); | |
19773 if (likely(__pyx_t_17)) { | |
19774 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); | |
19775 __Pyx_INCREF(__pyx_t_17); | |
19776 __Pyx_INCREF(function); | |
19777 __Pyx_DECREF_SET(__pyx_t_15, function); | |
19778 __pyx_t_5 = 1; | |
19779 } | |
19780 } | |
19781 #endif | |
19782 { | |
19783 PyObject *__pyx_callargs[7] = {__pyx_t_17, __pyx_n_u_EC, __pyx_t_16, __pyx_int_1, __pyx_n_u_Integer, __pyx_kp_u_Expected_alternate_allel_counts, __pyx_int_neg_1}; | |
19784 __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19785 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; | |
19786 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
19787 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 531, __pyx_L1_error) | |
19788 __Pyx_GOTREF(__pyx_t_14); | |
19789 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
19790 } | |
19791 | |
19792 /* "pysam/libcvcf.pyx":532 | |
19793 * FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1), | |
19794 * FORMAT('EC',self.NT_ALLELES,1,'Integer','Expected alternate allel counts',-1), | |
19795 * FORMAT('MQ',self.NT_NUMBER,1,'Integer','RMS mapping quality',-1), # <<<<<<<<<<<<<< | |
19796 * ]: | |
19797 * if f.id not in self._format: | |
19798 */ | |
19799 __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_FORMAT); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 532, __pyx_L1_error) | |
19800 __Pyx_GOTREF(__pyx_t_16); | |
19801 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 532, __pyx_L1_error) | |
19802 __Pyx_GOTREF(__pyx_t_17); | |
19803 __pyx_t_18 = NULL; | |
19804 __pyx_t_5 = 0; | |
19805 #if CYTHON_UNPACK_METHODS | |
19806 if (unlikely(PyMethod_Check(__pyx_t_16))) { | |
19807 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_16); | |
19808 if (likely(__pyx_t_18)) { | |
19809 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); | |
19810 __Pyx_INCREF(__pyx_t_18); | |
19811 __Pyx_INCREF(function); | |
19812 __Pyx_DECREF_SET(__pyx_t_16, function); | |
19813 __pyx_t_5 = 1; | |
19814 } | |
19815 } | |
19816 #endif | |
19817 { | |
19818 PyObject *__pyx_callargs[7] = {__pyx_t_18, __pyx_n_u_MQ, __pyx_t_17, __pyx_int_1, __pyx_n_u_Integer, __pyx_kp_u_RMS_mapping_quality, __pyx_int_neg_1}; | |
19819 __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); | |
19820 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; | |
19821 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; | |
19822 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 532, __pyx_L1_error) | |
19823 __Pyx_GOTREF(__pyx_t_15); | |
19824 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
19825 } | |
19826 | |
19827 /* "pysam/libcvcf.pyx":519 | |
19828 * | |
19829 * def enter_default_format(self): | |
19830 * for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'), # <<<<<<<<<<<<<< | |
19831 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), | |
19832 * FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'), | |
19833 */ | |
19834 __pyx_t_16 = PyTuple_New(14); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 519, __pyx_L1_error) | |
19835 __Pyx_GOTREF(__pyx_t_16); | |
19836 __Pyx_GIVEREF(__pyx_t_1); | |
19837 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19838 __Pyx_GIVEREF(__pyx_t_2); | |
19839 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19840 __Pyx_GIVEREF(__pyx_t_3); | |
19841 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19842 __Pyx_GIVEREF(__pyx_t_4); | |
19843 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19844 __Pyx_GIVEREF(__pyx_t_6); | |
19845 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19846 __Pyx_GIVEREF(__pyx_t_7); | |
19847 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_7)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19848 __Pyx_GIVEREF(__pyx_t_8); | |
19849 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_8)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19850 __Pyx_GIVEREF(__pyx_t_9); | |
19851 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_9)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19852 __Pyx_GIVEREF(__pyx_t_10); | |
19853 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 8, __pyx_t_10)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19854 __Pyx_GIVEREF(__pyx_t_11); | |
19855 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 9, __pyx_t_11)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19856 __Pyx_GIVEREF(__pyx_t_12); | |
19857 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 10, __pyx_t_12)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19858 __Pyx_GIVEREF(__pyx_t_13); | |
19859 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 11, __pyx_t_13)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19860 __Pyx_GIVEREF(__pyx_t_14); | |
19861 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 12, __pyx_t_14)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19862 __Pyx_GIVEREF(__pyx_t_15); | |
19863 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 13, __pyx_t_15)) __PYX_ERR(0, 519, __pyx_L1_error); | |
19864 __pyx_t_1 = 0; | |
19865 __pyx_t_2 = 0; | |
19866 __pyx_t_3 = 0; | |
19867 __pyx_t_4 = 0; | |
19868 __pyx_t_6 = 0; | |
19869 __pyx_t_7 = 0; | |
19870 __pyx_t_8 = 0; | |
19871 __pyx_t_9 = 0; | |
19872 __pyx_t_10 = 0; | |
19873 __pyx_t_11 = 0; | |
19874 __pyx_t_12 = 0; | |
19875 __pyx_t_13 = 0; | |
19876 __pyx_t_14 = 0; | |
19877 __pyx_t_15 = 0; | |
19878 __pyx_t_15 = __pyx_t_16; __Pyx_INCREF(__pyx_t_15); | |
19879 __pyx_t_19 = 0; | |
19880 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
19881 for (;;) { | |
19882 if (__pyx_t_19 >= 14) break; | |
19883 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
19884 __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_19); __Pyx_INCREF(__pyx_t_16); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 519, __pyx_L1_error) | |
19885 #else | |
19886 __pyx_t_16 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 519, __pyx_L1_error) | |
19887 __Pyx_GOTREF(__pyx_t_16); | |
19888 #endif | |
19889 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_16); | |
19890 __pyx_t_16 = 0; | |
19891 | |
19892 /* "pysam/libcvcf.pyx":534 | |
19893 * FORMAT('MQ',self.NT_NUMBER,1,'Integer','RMS mapping quality',-1), | |
19894 * ]: | |
19895 * if f.id not in self._format: # <<<<<<<<<<<<<< | |
19896 * self._format[f.id] = f | |
19897 * | |
19898 */ | |
19899 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 534, __pyx_L1_error) | |
19900 __Pyx_GOTREF(__pyx_t_16); | |
19901 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 534, __pyx_L1_error) | |
19902 __Pyx_GOTREF(__pyx_t_14); | |
19903 __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_t_16, __pyx_t_14, Py_NE)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 534, __pyx_L1_error) | |
19904 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
19905 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; | |
19906 if (__pyx_t_20) { | |
19907 | |
19908 /* "pysam/libcvcf.pyx":535 | |
19909 * ]: | |
19910 * if f.id not in self._format: | |
19911 * self._format[f.id] = f # <<<<<<<<<<<<<< | |
19912 * | |
19913 * def parse_header(self, line): | |
19914 */ | |
19915 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 535, __pyx_L1_error) | |
19916 __Pyx_GOTREF(__pyx_t_14); | |
19917 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 535, __pyx_L1_error) | |
19918 __Pyx_GOTREF(__pyx_t_16); | |
19919 if (unlikely((PyObject_SetItem(__pyx_t_14, __pyx_t_16, __pyx_v_f) < 0))) __PYX_ERR(0, 535, __pyx_L1_error) | |
19920 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; | |
19921 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
19922 | |
19923 /* "pysam/libcvcf.pyx":534 | |
19924 * FORMAT('MQ',self.NT_NUMBER,1,'Integer','RMS mapping quality',-1), | |
19925 * ]: | |
19926 * if f.id not in self._format: # <<<<<<<<<<<<<< | |
19927 * self._format[f.id] = f | |
19928 * | |
19929 */ | |
19930 } | |
19931 | |
19932 /* "pysam/libcvcf.pyx":519 | |
19933 * | |
19934 * def enter_default_format(self): | |
19935 * for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'), # <<<<<<<<<<<<<< | |
19936 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), | |
19937 * FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'), | |
19938 */ | |
19939 } | |
19940 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
19941 | |
19942 /* "pysam/libcvcf.pyx":518 | |
19943 * | |
19944 * | |
19945 * def enter_default_format(self): # <<<<<<<<<<<<<< | |
19946 * for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'), | |
19947 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), | |
19948 */ | |
19949 | |
19950 /* function exit code */ | |
19951 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
19952 goto __pyx_L0; | |
19953 __pyx_L1_error:; | |
19954 __Pyx_XDECREF(__pyx_t_1); | |
19955 __Pyx_XDECREF(__pyx_t_2); | |
19956 __Pyx_XDECREF(__pyx_t_3); | |
19957 __Pyx_XDECREF(__pyx_t_4); | |
19958 __Pyx_XDECREF(__pyx_t_6); | |
19959 __Pyx_XDECREF(__pyx_t_7); | |
19960 __Pyx_XDECREF(__pyx_t_8); | |
19961 __Pyx_XDECREF(__pyx_t_9); | |
19962 __Pyx_XDECREF(__pyx_t_10); | |
19963 __Pyx_XDECREF(__pyx_t_11); | |
19964 __Pyx_XDECREF(__pyx_t_12); | |
19965 __Pyx_XDECREF(__pyx_t_13); | |
19966 __Pyx_XDECREF(__pyx_t_14); | |
19967 __Pyx_XDECREF(__pyx_t_15); | |
19968 __Pyx_XDECREF(__pyx_t_16); | |
19969 __Pyx_XDECREF(__pyx_t_17); | |
19970 __Pyx_XDECREF(__pyx_t_18); | |
19971 __Pyx_AddTraceback("pysam.libcvcf.VCF.enter_default_format", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
19972 __pyx_r = NULL; | |
19973 __pyx_L0:; | |
19974 __Pyx_XDECREF(__pyx_v_f); | |
19975 __Pyx_XGIVEREF(__pyx_r); | |
19976 __Pyx_RefNannyFinishContext(); | |
19977 return __pyx_r; | |
19978 } | |
19979 | |
19980 /* "pysam/libcvcf.pyx":537 | |
19981 * self._format[f.id] = f | |
19982 * | |
19983 * def parse_header(self, line): # <<<<<<<<<<<<<< | |
19984 * | |
19985 * assert line.startswith('##') | |
19986 */ | |
19987 | |
19988 /* Python wrapper */ | |
19989 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_17parse_header(PyObject *__pyx_self, | |
19990 #if CYTHON_METH_FASTCALL | |
19991 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
19992 #else | |
19993 PyObject *__pyx_args, PyObject *__pyx_kwds | |
19994 #endif | |
19995 ); /*proto*/ | |
19996 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_16parse_header, "VCF.parse_header(self, line)"); | |
19997 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_17parse_header = {"parse_header", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_17parse_header, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_16parse_header}; | |
19998 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_17parse_header(PyObject *__pyx_self, | |
19999 #if CYTHON_METH_FASTCALL | |
20000 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
20001 #else | |
20002 PyObject *__pyx_args, PyObject *__pyx_kwds | |
20003 #endif | |
20004 ) { | |
20005 PyObject *__pyx_v_self = 0; | |
20006 PyObject *__pyx_v_line = 0; | |
20007 #if !CYTHON_METH_FASTCALL | |
20008 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
20009 #endif | |
20010 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
20011 PyObject* values[2] = {0,0}; | |
20012 int __pyx_lineno = 0; | |
20013 const char *__pyx_filename = NULL; | |
20014 int __pyx_clineno = 0; | |
20015 PyObject *__pyx_r = 0; | |
20016 __Pyx_RefNannyDeclarations | |
20017 __Pyx_RefNannySetupContext("parse_header (wrapper)", 0); | |
20018 #if !CYTHON_METH_FASTCALL | |
20019 #if CYTHON_ASSUME_SAFE_MACROS | |
20020 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
20021 #else | |
20022 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
20023 #endif | |
20024 #endif | |
20025 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
20026 { | |
20027 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,0}; | |
20028 if (__pyx_kwds) { | |
20029 Py_ssize_t kw_args; | |
20030 switch (__pyx_nargs) { | |
20031 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
20032 CYTHON_FALLTHROUGH; | |
20033 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
20034 CYTHON_FALLTHROUGH; | |
20035 case 0: break; | |
20036 default: goto __pyx_L5_argtuple_error; | |
20037 } | |
20038 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
20039 switch (__pyx_nargs) { | |
20040 case 0: | |
20041 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
20042 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
20043 kw_args--; | |
20044 } | |
20045 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 537, __pyx_L3_error) | |
20046 else goto __pyx_L5_argtuple_error; | |
20047 CYTHON_FALLTHROUGH; | |
20048 case 1: | |
20049 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line)) != 0)) { | |
20050 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
20051 kw_args--; | |
20052 } | |
20053 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 537, __pyx_L3_error) | |
20054 else { | |
20055 __Pyx_RaiseArgtupleInvalid("parse_header", 1, 2, 2, 1); __PYX_ERR(0, 537, __pyx_L3_error) | |
20056 } | |
20057 } | |
20058 if (unlikely(kw_args > 0)) { | |
20059 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
20060 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_header") < 0)) __PYX_ERR(0, 537, __pyx_L3_error) | |
20061 } | |
20062 } else if (unlikely(__pyx_nargs != 2)) { | |
20063 goto __pyx_L5_argtuple_error; | |
20064 } else { | |
20065 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
20066 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
20067 } | |
20068 __pyx_v_self = values[0]; | |
20069 __pyx_v_line = values[1]; | |
20070 } | |
20071 goto __pyx_L6_skip; | |
20072 __pyx_L5_argtuple_error:; | |
20073 __Pyx_RaiseArgtupleInvalid("parse_header", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 537, __pyx_L3_error) | |
20074 __pyx_L6_skip:; | |
20075 goto __pyx_L4_argument_unpacking_done; | |
20076 __pyx_L3_error:; | |
20077 { | |
20078 Py_ssize_t __pyx_temp; | |
20079 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
20080 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
20081 } | |
20082 } | |
20083 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_header", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
20084 __Pyx_RefNannyFinishContext(); | |
20085 return NULL; | |
20086 __pyx_L4_argument_unpacking_done:; | |
20087 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_16parse_header(__pyx_self, __pyx_v_self, __pyx_v_line); | |
20088 | |
20089 /* function exit code */ | |
20090 { | |
20091 Py_ssize_t __pyx_temp; | |
20092 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
20093 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
20094 } | |
20095 } | |
20096 __Pyx_RefNannyFinishContext(); | |
20097 return __pyx_r; | |
20098 } | |
20099 | |
20100 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_16parse_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line) { | |
20101 PyObject *__pyx_v_elts = NULL; | |
20102 PyObject *__pyx_v_key = NULL; | |
20103 PyObject *__pyx_v_value = NULL; | |
20104 PyObject *__pyx_v_f = NULL; | |
20105 PyObject *__pyx_r = NULL; | |
20106 __Pyx_RefNannyDeclarations | |
20107 PyObject *__pyx_t_1 = NULL; | |
20108 PyObject *__pyx_t_2 = NULL; | |
20109 PyObject *__pyx_t_3 = NULL; | |
20110 unsigned int __pyx_t_4; | |
20111 int __pyx_t_5; | |
20112 PyObject *__pyx_t_6 = NULL; | |
20113 int __pyx_t_7; | |
20114 int __pyx_lineno = 0; | |
20115 const char *__pyx_filename = NULL; | |
20116 int __pyx_clineno = 0; | |
20117 __Pyx_RefNannySetupContext("parse_header", 1); | |
20118 | |
20119 /* "pysam/libcvcf.pyx":539 | |
20120 * def parse_header(self, line): | |
20121 * | |
20122 * assert line.startswith('##') # <<<<<<<<<<<<<< | |
20123 * elts = line[2:].split('=') | |
20124 * key = elts[0].strip() | |
20125 */ | |
20126 #ifndef CYTHON_WITHOUT_ASSERTIONS | |
20127 if (unlikely(__pyx_assertions_enabled())) { | |
20128 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) | |
20129 __Pyx_GOTREF(__pyx_t_2); | |
20130 __pyx_t_3 = NULL; | |
20131 __pyx_t_4 = 0; | |
20132 #if CYTHON_UNPACK_METHODS | |
20133 if (likely(PyMethod_Check(__pyx_t_2))) { | |
20134 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
20135 if (likely(__pyx_t_3)) { | |
20136 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
20137 __Pyx_INCREF(__pyx_t_3); | |
20138 __Pyx_INCREF(function); | |
20139 __Pyx_DECREF_SET(__pyx_t_2, function); | |
20140 __pyx_t_4 = 1; | |
20141 } | |
20142 } | |
20143 #endif | |
20144 { | |
20145 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__23}; | |
20146 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
20147 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20148 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) | |
20149 __Pyx_GOTREF(__pyx_t_1); | |
20150 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20151 } | |
20152 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 539, __pyx_L1_error) | |
20153 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20154 if (unlikely(!__pyx_t_5)) { | |
20155 __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); | |
20156 __PYX_ERR(0, 539, __pyx_L1_error) | |
20157 } | |
20158 } | |
20159 #else | |
20160 if ((1)); else __PYX_ERR(0, 539, __pyx_L1_error) | |
20161 #endif | |
20162 | |
20163 /* "pysam/libcvcf.pyx":540 | |
20164 * | |
20165 * assert line.startswith('##') | |
20166 * elts = line[2:].split('=') # <<<<<<<<<<<<<< | |
20167 * key = elts[0].strip() | |
20168 * value = '='.join(elts[1:]).strip() | |
20169 */ | |
20170 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_line, 2, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) | |
20171 __Pyx_GOTREF(__pyx_t_2); | |
20172 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) | |
20173 __Pyx_GOTREF(__pyx_t_3); | |
20174 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20175 __pyx_t_2 = NULL; | |
20176 __pyx_t_4 = 0; | |
20177 #if CYTHON_UNPACK_METHODS | |
20178 if (likely(PyMethod_Check(__pyx_t_3))) { | |
20179 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); | |
20180 if (likely(__pyx_t_2)) { | |
20181 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
20182 __Pyx_INCREF(__pyx_t_2); | |
20183 __Pyx_INCREF(function); | |
20184 __Pyx_DECREF_SET(__pyx_t_3, function); | |
20185 __pyx_t_4 = 1; | |
20186 } | |
20187 } | |
20188 #endif | |
20189 { | |
20190 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u__7}; | |
20191 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
20192 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20193 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) | |
20194 __Pyx_GOTREF(__pyx_t_1); | |
20195 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20196 } | |
20197 __pyx_v_elts = __pyx_t_1; | |
20198 __pyx_t_1 = 0; | |
20199 | |
20200 /* "pysam/libcvcf.pyx":541 | |
20201 * assert line.startswith('##') | |
20202 * elts = line[2:].split('=') | |
20203 * key = elts[0].strip() # <<<<<<<<<<<<<< | |
20204 * value = '='.join(elts[1:]).strip() | |
20205 * if key == "fileformat": | |
20206 */ | |
20207 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) | |
20208 __Pyx_GOTREF(__pyx_t_3); | |
20209 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) | |
20210 __Pyx_GOTREF(__pyx_t_2); | |
20211 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20212 __pyx_t_3 = NULL; | |
20213 __pyx_t_4 = 0; | |
20214 #if CYTHON_UNPACK_METHODS | |
20215 if (likely(PyMethod_Check(__pyx_t_2))) { | |
20216 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
20217 if (likely(__pyx_t_3)) { | |
20218 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
20219 __Pyx_INCREF(__pyx_t_3); | |
20220 __Pyx_INCREF(function); | |
20221 __Pyx_DECREF_SET(__pyx_t_2, function); | |
20222 __pyx_t_4 = 1; | |
20223 } | |
20224 } | |
20225 #endif | |
20226 { | |
20227 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
20228 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
20229 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20230 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) | |
20231 __Pyx_GOTREF(__pyx_t_1); | |
20232 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20233 } | |
20234 __pyx_v_key = __pyx_t_1; | |
20235 __pyx_t_1 = 0; | |
20236 | |
20237 /* "pysam/libcvcf.pyx":542 | |
20238 * elts = line[2:].split('=') | |
20239 * key = elts[0].strip() | |
20240 * value = '='.join(elts[1:]).strip() # <<<<<<<<<<<<<< | |
20241 * if key == "fileformat": | |
20242 * if value == "VCFv3.3": | |
20243 */ | |
20244 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_elts, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) | |
20245 __Pyx_GOTREF(__pyx_t_2); | |
20246 __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) | |
20247 __Pyx_GOTREF(__pyx_t_3); | |
20248 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20249 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) | |
20250 __Pyx_GOTREF(__pyx_t_2); | |
20251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20252 __pyx_t_3 = NULL; | |
20253 __pyx_t_4 = 0; | |
20254 #if CYTHON_UNPACK_METHODS | |
20255 if (likely(PyMethod_Check(__pyx_t_2))) { | |
20256 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
20257 if (likely(__pyx_t_3)) { | |
20258 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
20259 __Pyx_INCREF(__pyx_t_3); | |
20260 __Pyx_INCREF(function); | |
20261 __Pyx_DECREF_SET(__pyx_t_2, function); | |
20262 __pyx_t_4 = 1; | |
20263 } | |
20264 } | |
20265 #endif | |
20266 { | |
20267 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
20268 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
20269 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20270 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) | |
20271 __Pyx_GOTREF(__pyx_t_1); | |
20272 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20273 } | |
20274 __pyx_v_value = __pyx_t_1; | |
20275 __pyx_t_1 = 0; | |
20276 | |
20277 /* "pysam/libcvcf.pyx":543 | |
20278 * key = elts[0].strip() | |
20279 * value = '='.join(elts[1:]).strip() | |
20280 * if key == "fileformat": # <<<<<<<<<<<<<< | |
20281 * if value == "VCFv3.3": | |
20282 * self._version = 33 | |
20283 */ | |
20284 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_key, __pyx_n_u_fileformat, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 543, __pyx_L1_error) | |
20285 if (__pyx_t_5) { | |
20286 | |
20287 /* "pysam/libcvcf.pyx":544 | |
20288 * value = '='.join(elts[1:]).strip() | |
20289 * if key == "fileformat": | |
20290 * if value == "VCFv3.3": # <<<<<<<<<<<<<< | |
20291 * self._version = 33 | |
20292 * elif value == "VCFv4.0": | |
20293 */ | |
20294 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_value, __pyx_kp_u_VCFv3_3, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) | |
20295 if (__pyx_t_5) { | |
20296 | |
20297 /* "pysam/libcvcf.pyx":545 | |
20298 * if key == "fileformat": | |
20299 * if value == "VCFv3.3": | |
20300 * self._version = 33 # <<<<<<<<<<<<<< | |
20301 * elif value == "VCFv4.0": | |
20302 * self._version = 40 | |
20303 */ | |
20304 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_int_33) < 0) __PYX_ERR(0, 545, __pyx_L1_error) | |
20305 | |
20306 /* "pysam/libcvcf.pyx":544 | |
20307 * value = '='.join(elts[1:]).strip() | |
20308 * if key == "fileformat": | |
20309 * if value == "VCFv3.3": # <<<<<<<<<<<<<< | |
20310 * self._version = 33 | |
20311 * elif value == "VCFv4.0": | |
20312 */ | |
20313 goto __pyx_L4; | |
20314 } | |
20315 | |
20316 /* "pysam/libcvcf.pyx":546 | |
20317 * if value == "VCFv3.3": | |
20318 * self._version = 33 | |
20319 * elif value == "VCFv4.0": # <<<<<<<<<<<<<< | |
20320 * self._version = 40 | |
20321 * elif value == "VCFv4.1": | |
20322 */ | |
20323 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_value, __pyx_kp_u_VCFv4_0, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 546, __pyx_L1_error) | |
20324 if (__pyx_t_5) { | |
20325 | |
20326 /* "pysam/libcvcf.pyx":547 | |
20327 * self._version = 33 | |
20328 * elif value == "VCFv4.0": | |
20329 * self._version = 40 # <<<<<<<<<<<<<< | |
20330 * elif value == "VCFv4.1": | |
20331 * # AH - for testing | |
20332 */ | |
20333 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_int_40) < 0) __PYX_ERR(0, 547, __pyx_L1_error) | |
20334 | |
20335 /* "pysam/libcvcf.pyx":546 | |
20336 * if value == "VCFv3.3": | |
20337 * self._version = 33 | |
20338 * elif value == "VCFv4.0": # <<<<<<<<<<<<<< | |
20339 * self._version = 40 | |
20340 * elif value == "VCFv4.1": | |
20341 */ | |
20342 goto __pyx_L4; | |
20343 } | |
20344 | |
20345 /* "pysam/libcvcf.pyx":548 | |
20346 * elif value == "VCFv4.0": | |
20347 * self._version = 40 | |
20348 * elif value == "VCFv4.1": # <<<<<<<<<<<<<< | |
20349 * # AH - for testing | |
20350 * self._version = 40 | |
20351 */ | |
20352 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_value, __pyx_kp_u_VCFv4_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) | |
20353 if (__pyx_t_5) { | |
20354 | |
20355 /* "pysam/libcvcf.pyx":550 | |
20356 * elif value == "VCFv4.1": | |
20357 * # AH - for testing | |
20358 * self._version = 40 # <<<<<<<<<<<<<< | |
20359 * elif value == "VCFv4.2": | |
20360 * # AH - for testing | |
20361 */ | |
20362 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_int_40) < 0) __PYX_ERR(0, 550, __pyx_L1_error) | |
20363 | |
20364 /* "pysam/libcvcf.pyx":548 | |
20365 * elif value == "VCFv4.0": | |
20366 * self._version = 40 | |
20367 * elif value == "VCFv4.1": # <<<<<<<<<<<<<< | |
20368 * # AH - for testing | |
20369 * self._version = 40 | |
20370 */ | |
20371 goto __pyx_L4; | |
20372 } | |
20373 | |
20374 /* "pysam/libcvcf.pyx":551 | |
20375 * # AH - for testing | |
20376 * self._version = 40 | |
20377 * elif value == "VCFv4.2": # <<<<<<<<<<<<<< | |
20378 * # AH - for testing | |
20379 * self._version = 40 | |
20380 */ | |
20381 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_value, __pyx_kp_u_VCFv4_2, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 551, __pyx_L1_error) | |
20382 if (__pyx_t_5) { | |
20383 | |
20384 /* "pysam/libcvcf.pyx":553 | |
20385 * elif value == "VCFv4.2": | |
20386 * # AH - for testing | |
20387 * self._version = 40 # <<<<<<<<<<<<<< | |
20388 * else: | |
20389 * self.error(line,self.UNKNOWN_FORMAT_STRING) | |
20390 */ | |
20391 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_int_40) < 0) __PYX_ERR(0, 553, __pyx_L1_error) | |
20392 | |
20393 /* "pysam/libcvcf.pyx":551 | |
20394 * # AH - for testing | |
20395 * self._version = 40 | |
20396 * elif value == "VCFv4.2": # <<<<<<<<<<<<<< | |
20397 * # AH - for testing | |
20398 * self._version = 40 | |
20399 */ | |
20400 goto __pyx_L4; | |
20401 } | |
20402 | |
20403 /* "pysam/libcvcf.pyx":555 | |
20404 * self._version = 40 | |
20405 * else: | |
20406 * self.error(line,self.UNKNOWN_FORMAT_STRING) # <<<<<<<<<<<<<< | |
20407 * elif key == "INFO": | |
20408 * f = self.parse_format(line, value) | |
20409 */ | |
20410 /*else*/ { | |
20411 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) | |
20412 __Pyx_GOTREF(__pyx_t_2); | |
20413 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_UNKNOWN_FORMAT_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) | |
20414 __Pyx_GOTREF(__pyx_t_3); | |
20415 __pyx_t_6 = NULL; | |
20416 __pyx_t_4 = 0; | |
20417 #if CYTHON_UNPACK_METHODS | |
20418 if (likely(PyMethod_Check(__pyx_t_2))) { | |
20419 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); | |
20420 if (likely(__pyx_t_6)) { | |
20421 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
20422 __Pyx_INCREF(__pyx_t_6); | |
20423 __Pyx_INCREF(function); | |
20424 __Pyx_DECREF_SET(__pyx_t_2, function); | |
20425 __pyx_t_4 = 1; | |
20426 } | |
20427 } | |
20428 #endif | |
20429 { | |
20430 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_line, __pyx_t_3}; | |
20431 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
20432 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
20433 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20434 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) | |
20435 __Pyx_GOTREF(__pyx_t_1); | |
20436 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20437 } | |
20438 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20439 } | |
20440 __pyx_L4:; | |
20441 | |
20442 /* "pysam/libcvcf.pyx":543 | |
20443 * key = elts[0].strip() | |
20444 * value = '='.join(elts[1:]).strip() | |
20445 * if key == "fileformat": # <<<<<<<<<<<<<< | |
20446 * if value == "VCFv3.3": | |
20447 * self._version = 33 | |
20448 */ | |
20449 goto __pyx_L3; | |
20450 } | |
20451 | |
20452 /* "pysam/libcvcf.pyx":556 | |
20453 * else: | |
20454 * self.error(line,self.UNKNOWN_FORMAT_STRING) | |
20455 * elif key == "INFO": # <<<<<<<<<<<<<< | |
20456 * f = self.parse_format(line, value) | |
20457 * self._info[ f.id ] = f | |
20458 */ | |
20459 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_key, __pyx_n_u_INFO, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 556, __pyx_L1_error) | |
20460 if (__pyx_t_5) { | |
20461 | |
20462 /* "pysam/libcvcf.pyx":557 | |
20463 * self.error(line,self.UNKNOWN_FORMAT_STRING) | |
20464 * elif key == "INFO": | |
20465 * f = self.parse_format(line, value) # <<<<<<<<<<<<<< | |
20466 * self._info[ f.id ] = f | |
20467 * elif key == "FILTER": | |
20468 */ | |
20469 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) | |
20470 __Pyx_GOTREF(__pyx_t_2); | |
20471 __pyx_t_3 = NULL; | |
20472 __pyx_t_4 = 0; | |
20473 #if CYTHON_UNPACK_METHODS | |
20474 if (likely(PyMethod_Check(__pyx_t_2))) { | |
20475 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
20476 if (likely(__pyx_t_3)) { | |
20477 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
20478 __Pyx_INCREF(__pyx_t_3); | |
20479 __Pyx_INCREF(function); | |
20480 __Pyx_DECREF_SET(__pyx_t_2, function); | |
20481 __pyx_t_4 = 1; | |
20482 } | |
20483 } | |
20484 #endif | |
20485 { | |
20486 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_line, __pyx_v_value}; | |
20487 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
20488 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20489 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) | |
20490 __Pyx_GOTREF(__pyx_t_1); | |
20491 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20492 } | |
20493 __pyx_v_f = __pyx_t_1; | |
20494 __pyx_t_1 = 0; | |
20495 | |
20496 /* "pysam/libcvcf.pyx":558 | |
20497 * elif key == "INFO": | |
20498 * f = self.parse_format(line, value) | |
20499 * self._info[ f.id ] = f # <<<<<<<<<<<<<< | |
20500 * elif key == "FILTER": | |
20501 * f = self.parse_format(line, value, filter=True) | |
20502 */ | |
20503 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) | |
20504 __Pyx_GOTREF(__pyx_t_1); | |
20505 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) | |
20506 __Pyx_GOTREF(__pyx_t_2); | |
20507 if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_v_f) < 0))) __PYX_ERR(0, 558, __pyx_L1_error) | |
20508 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20509 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20510 | |
20511 /* "pysam/libcvcf.pyx":556 | |
20512 * else: | |
20513 * self.error(line,self.UNKNOWN_FORMAT_STRING) | |
20514 * elif key == "INFO": # <<<<<<<<<<<<<< | |
20515 * f = self.parse_format(line, value) | |
20516 * self._info[ f.id ] = f | |
20517 */ | |
20518 goto __pyx_L3; | |
20519 } | |
20520 | |
20521 /* "pysam/libcvcf.pyx":559 | |
20522 * f = self.parse_format(line, value) | |
20523 * self._info[ f.id ] = f | |
20524 * elif key == "FILTER": # <<<<<<<<<<<<<< | |
20525 * f = self.parse_format(line, value, filter=True) | |
20526 * self._filter[ f.id ] = f | |
20527 */ | |
20528 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_key, __pyx_n_u_FILTER, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 559, __pyx_L1_error) | |
20529 if (__pyx_t_5) { | |
20530 | |
20531 /* "pysam/libcvcf.pyx":560 | |
20532 * self._info[ f.id ] = f | |
20533 * elif key == "FILTER": | |
20534 * f = self.parse_format(line, value, filter=True) # <<<<<<<<<<<<<< | |
20535 * self._filter[ f.id ] = f | |
20536 * elif key == "FORMAT": | |
20537 */ | |
20538 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) | |
20539 __Pyx_GOTREF(__pyx_t_2); | |
20540 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) | |
20541 __Pyx_GOTREF(__pyx_t_1); | |
20542 __Pyx_INCREF(__pyx_v_line); | |
20543 __Pyx_GIVEREF(__pyx_v_line); | |
20544 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line)) __PYX_ERR(0, 560, __pyx_L1_error); | |
20545 __Pyx_INCREF(__pyx_v_value); | |
20546 __Pyx_GIVEREF(__pyx_v_value); | |
20547 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value)) __PYX_ERR(0, 560, __pyx_L1_error); | |
20548 __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) | |
20549 __Pyx_GOTREF(__pyx_t_3); | |
20550 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_filter_2, Py_True) < 0) __PYX_ERR(0, 560, __pyx_L1_error) | |
20551 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error) | |
20552 __Pyx_GOTREF(__pyx_t_6); | |
20553 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20555 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20556 __pyx_v_f = __pyx_t_6; | |
20557 __pyx_t_6 = 0; | |
20558 | |
20559 /* "pysam/libcvcf.pyx":561 | |
20560 * elif key == "FILTER": | |
20561 * f = self.parse_format(line, value, filter=True) | |
20562 * self._filter[ f.id ] = f # <<<<<<<<<<<<<< | |
20563 * elif key == "FORMAT": | |
20564 * f = self.parse_format(line, value) | |
20565 */ | |
20566 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error) | |
20567 __Pyx_GOTREF(__pyx_t_6); | |
20568 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error) | |
20569 __Pyx_GOTREF(__pyx_t_3); | |
20570 if (unlikely((PyObject_SetItem(__pyx_t_6, __pyx_t_3, __pyx_v_f) < 0))) __PYX_ERR(0, 561, __pyx_L1_error) | |
20571 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
20572 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20573 | |
20574 /* "pysam/libcvcf.pyx":559 | |
20575 * f = self.parse_format(line, value) | |
20576 * self._info[ f.id ] = f | |
20577 * elif key == "FILTER": # <<<<<<<<<<<<<< | |
20578 * f = self.parse_format(line, value, filter=True) | |
20579 * self._filter[ f.id ] = f | |
20580 */ | |
20581 goto __pyx_L3; | |
20582 } | |
20583 | |
20584 /* "pysam/libcvcf.pyx":562 | |
20585 * f = self.parse_format(line, value, filter=True) | |
20586 * self._filter[ f.id ] = f | |
20587 * elif key == "FORMAT": # <<<<<<<<<<<<<< | |
20588 * f = self.parse_format(line, value) | |
20589 * self._format[ f.id ] = f | |
20590 */ | |
20591 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_key, __pyx_n_u_FORMAT, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 562, __pyx_L1_error) | |
20592 if (__pyx_t_5) { | |
20593 | |
20594 /* "pysam/libcvcf.pyx":563 | |
20595 * self._filter[ f.id ] = f | |
20596 * elif key == "FORMAT": | |
20597 * f = self.parse_format(line, value) # <<<<<<<<<<<<<< | |
20598 * self._format[ f.id ] = f | |
20599 * else: | |
20600 */ | |
20601 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 563, __pyx_L1_error) | |
20602 __Pyx_GOTREF(__pyx_t_6); | |
20603 __pyx_t_1 = NULL; | |
20604 __pyx_t_4 = 0; | |
20605 #if CYTHON_UNPACK_METHODS | |
20606 if (likely(PyMethod_Check(__pyx_t_6))) { | |
20607 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); | |
20608 if (likely(__pyx_t_1)) { | |
20609 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
20610 __Pyx_INCREF(__pyx_t_1); | |
20611 __Pyx_INCREF(function); | |
20612 __Pyx_DECREF_SET(__pyx_t_6, function); | |
20613 __pyx_t_4 = 1; | |
20614 } | |
20615 } | |
20616 #endif | |
20617 { | |
20618 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_line, __pyx_v_value}; | |
20619 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
20620 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20621 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) | |
20622 __Pyx_GOTREF(__pyx_t_3); | |
20623 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
20624 } | |
20625 __pyx_v_f = __pyx_t_3; | |
20626 __pyx_t_3 = 0; | |
20627 | |
20628 /* "pysam/libcvcf.pyx":564 | |
20629 * elif key == "FORMAT": | |
20630 * f = self.parse_format(line, value) | |
20631 * self._format[ f.id ] = f # <<<<<<<<<<<<<< | |
20632 * else: | |
20633 * # keep other keys in the header field | |
20634 */ | |
20635 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) | |
20636 __Pyx_GOTREF(__pyx_t_3); | |
20637 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 564, __pyx_L1_error) | |
20638 __Pyx_GOTREF(__pyx_t_6); | |
20639 if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_6, __pyx_v_f) < 0))) __PYX_ERR(0, 564, __pyx_L1_error) | |
20640 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20641 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
20642 | |
20643 /* "pysam/libcvcf.pyx":562 | |
20644 * f = self.parse_format(line, value, filter=True) | |
20645 * self._filter[ f.id ] = f | |
20646 * elif key == "FORMAT": # <<<<<<<<<<<<<< | |
20647 * f = self.parse_format(line, value) | |
20648 * self._format[ f.id ] = f | |
20649 */ | |
20650 goto __pyx_L3; | |
20651 } | |
20652 | |
20653 /* "pysam/libcvcf.pyx":567 | |
20654 * else: | |
20655 * # keep other keys in the header field | |
20656 * self._header.append( (key,value) ) # <<<<<<<<<<<<<< | |
20657 * | |
20658 * | |
20659 */ | |
20660 /*else*/ { | |
20661 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) | |
20662 __Pyx_GOTREF(__pyx_t_6); | |
20663 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) | |
20664 __Pyx_GOTREF(__pyx_t_3); | |
20665 __Pyx_INCREF(__pyx_v_key); | |
20666 __Pyx_GIVEREF(__pyx_v_key); | |
20667 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key)) __PYX_ERR(0, 567, __pyx_L1_error); | |
20668 __Pyx_INCREF(__pyx_v_value); | |
20669 __Pyx_GIVEREF(__pyx_v_value); | |
20670 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value)) __PYX_ERR(0, 567, __pyx_L1_error); | |
20671 __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 567, __pyx_L1_error) | |
20672 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
20673 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20674 } | |
20675 __pyx_L3:; | |
20676 | |
20677 /* "pysam/libcvcf.pyx":537 | |
20678 * self._format[f.id] = f | |
20679 * | |
20680 * def parse_header(self, line): # <<<<<<<<<<<<<< | |
20681 * | |
20682 * assert line.startswith('##') | |
20683 */ | |
20684 | |
20685 /* function exit code */ | |
20686 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
20687 goto __pyx_L0; | |
20688 __pyx_L1_error:; | |
20689 __Pyx_XDECREF(__pyx_t_1); | |
20690 __Pyx_XDECREF(__pyx_t_2); | |
20691 __Pyx_XDECREF(__pyx_t_3); | |
20692 __Pyx_XDECREF(__pyx_t_6); | |
20693 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_header", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
20694 __pyx_r = NULL; | |
20695 __pyx_L0:; | |
20696 __Pyx_XDECREF(__pyx_v_elts); | |
20697 __Pyx_XDECREF(__pyx_v_key); | |
20698 __Pyx_XDECREF(__pyx_v_value); | |
20699 __Pyx_XDECREF(__pyx_v_f); | |
20700 __Pyx_XGIVEREF(__pyx_r); | |
20701 __Pyx_RefNannyFinishContext(); | |
20702 return __pyx_r; | |
20703 } | |
20704 | |
20705 /* "pysam/libcvcf.pyx":570 | |
20706 * | |
20707 * | |
20708 * def write_header( self, stream ): # <<<<<<<<<<<<<< | |
20709 * stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10)) | |
20710 * for key,value in self._header: stream.write("##%s=%s\n" % (key,value)) | |
20711 */ | |
20712 | |
20713 /* Python wrapper */ | |
20714 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_19write_header(PyObject *__pyx_self, | |
20715 #if CYTHON_METH_FASTCALL | |
20716 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
20717 #else | |
20718 PyObject *__pyx_args, PyObject *__pyx_kwds | |
20719 #endif | |
20720 ); /*proto*/ | |
20721 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_18write_header, "VCF.write_header(self, stream)"); | |
20722 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_19write_header = {"write_header", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_19write_header, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_18write_header}; | |
20723 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_19write_header(PyObject *__pyx_self, | |
20724 #if CYTHON_METH_FASTCALL | |
20725 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
20726 #else | |
20727 PyObject *__pyx_args, PyObject *__pyx_kwds | |
20728 #endif | |
20729 ) { | |
20730 PyObject *__pyx_v_self = 0; | |
20731 PyObject *__pyx_v_stream = 0; | |
20732 #if !CYTHON_METH_FASTCALL | |
20733 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
20734 #endif | |
20735 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
20736 PyObject* values[2] = {0,0}; | |
20737 int __pyx_lineno = 0; | |
20738 const char *__pyx_filename = NULL; | |
20739 int __pyx_clineno = 0; | |
20740 PyObject *__pyx_r = 0; | |
20741 __Pyx_RefNannyDeclarations | |
20742 __Pyx_RefNannySetupContext("write_header (wrapper)", 0); | |
20743 #if !CYTHON_METH_FASTCALL | |
20744 #if CYTHON_ASSUME_SAFE_MACROS | |
20745 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
20746 #else | |
20747 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
20748 #endif | |
20749 #endif | |
20750 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
20751 { | |
20752 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0}; | |
20753 if (__pyx_kwds) { | |
20754 Py_ssize_t kw_args; | |
20755 switch (__pyx_nargs) { | |
20756 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
20757 CYTHON_FALLTHROUGH; | |
20758 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
20759 CYTHON_FALLTHROUGH; | |
20760 case 0: break; | |
20761 default: goto __pyx_L5_argtuple_error; | |
20762 } | |
20763 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
20764 switch (__pyx_nargs) { | |
20765 case 0: | |
20766 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
20767 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
20768 kw_args--; | |
20769 } | |
20770 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L3_error) | |
20771 else goto __pyx_L5_argtuple_error; | |
20772 CYTHON_FALLTHROUGH; | |
20773 case 1: | |
20774 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream)) != 0)) { | |
20775 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
20776 kw_args--; | |
20777 } | |
20778 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L3_error) | |
20779 else { | |
20780 __Pyx_RaiseArgtupleInvalid("write_header", 1, 2, 2, 1); __PYX_ERR(0, 570, __pyx_L3_error) | |
20781 } | |
20782 } | |
20783 if (unlikely(kw_args > 0)) { | |
20784 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
20785 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write_header") < 0)) __PYX_ERR(0, 570, __pyx_L3_error) | |
20786 } | |
20787 } else if (unlikely(__pyx_nargs != 2)) { | |
20788 goto __pyx_L5_argtuple_error; | |
20789 } else { | |
20790 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
20791 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
20792 } | |
20793 __pyx_v_self = values[0]; | |
20794 __pyx_v_stream = values[1]; | |
20795 } | |
20796 goto __pyx_L6_skip; | |
20797 __pyx_L5_argtuple_error:; | |
20798 __Pyx_RaiseArgtupleInvalid("write_header", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 570, __pyx_L3_error) | |
20799 __pyx_L6_skip:; | |
20800 goto __pyx_L4_argument_unpacking_done; | |
20801 __pyx_L3_error:; | |
20802 { | |
20803 Py_ssize_t __pyx_temp; | |
20804 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
20805 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
20806 } | |
20807 } | |
20808 __Pyx_AddTraceback("pysam.libcvcf.VCF.write_header", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
20809 __Pyx_RefNannyFinishContext(); | |
20810 return NULL; | |
20811 __pyx_L4_argument_unpacking_done:; | |
20812 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_18write_header(__pyx_self, __pyx_v_self, __pyx_v_stream); | |
20813 | |
20814 /* function exit code */ | |
20815 { | |
20816 Py_ssize_t __pyx_temp; | |
20817 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
20818 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
20819 } | |
20820 } | |
20821 __Pyx_RefNannyFinishContext(); | |
20822 return __pyx_r; | |
20823 } | |
20824 | |
20825 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_18write_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) { | |
20826 PyObject *__pyx_v_key = NULL; | |
20827 PyObject *__pyx_v_value = NULL; | |
20828 PyObject *__pyx_v_var = NULL; | |
20829 PyObject *__pyx_v_label = NULL; | |
20830 PyObject *__pyx_v_f = NULL; | |
20831 PyObject *__pyx_r = NULL; | |
20832 __Pyx_RefNannyDeclarations | |
20833 PyObject *__pyx_t_1 = NULL; | |
20834 PyObject *__pyx_t_2 = NULL; | |
20835 PyObject *__pyx_t_3 = NULL; | |
20836 Py_ssize_t __pyx_t_4; | |
20837 Py_UCS4 __pyx_t_5; | |
20838 PyObject *__pyx_t_6 = NULL; | |
20839 PyObject *__pyx_t_7 = NULL; | |
20840 unsigned int __pyx_t_8; | |
20841 PyObject *(*__pyx_t_9)(PyObject *); | |
20842 PyObject *(*__pyx_t_10)(PyObject *); | |
20843 Py_ssize_t __pyx_t_11; | |
20844 Py_ssize_t __pyx_t_12; | |
20845 int __pyx_t_13; | |
20846 int __pyx_t_14; | |
20847 Py_ssize_t __pyx_t_15; | |
20848 PyObject *__pyx_t_16 = NULL; | |
20849 PyObject *__pyx_t_17 = NULL; | |
20850 PyObject *__pyx_t_18 = NULL; | |
20851 PyObject *__pyx_t_19 = NULL; | |
20852 int __pyx_lineno = 0; | |
20853 const char *__pyx_filename = NULL; | |
20854 int __pyx_clineno = 0; | |
20855 __Pyx_RefNannySetupContext("write_header", 1); | |
20856 | |
20857 /* "pysam/libcvcf.pyx":571 | |
20858 * | |
20859 * def write_header( self, stream ): | |
20860 * stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10)) # <<<<<<<<<<<<<< | |
20861 * for key,value in self._header: stream.write("##%s=%s\n" % (key,value)) | |
20862 * for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]: | |
20863 */ | |
20864 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20865 __Pyx_GOTREF(__pyx_t_2); | |
20866 __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20867 __Pyx_GOTREF(__pyx_t_3); | |
20868 __pyx_t_4 = 0; | |
20869 __pyx_t_5 = 127; | |
20870 __Pyx_INCREF(__pyx_kp_u_fileformat_VCFv); | |
20871 __pyx_t_4 += 17; | |
20872 __Pyx_GIVEREF(__pyx_kp_u_fileformat_VCFv); | |
20873 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_fileformat_VCFv); | |
20874 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20875 __Pyx_GOTREF(__pyx_t_6); | |
20876 __pyx_t_7 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_6, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20877 __Pyx_GOTREF(__pyx_t_7); | |
20878 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
20879 __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20880 __Pyx_GOTREF(__pyx_t_6); | |
20881 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
20882 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5; | |
20883 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); | |
20884 __Pyx_GIVEREF(__pyx_t_6); | |
20885 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6); | |
20886 __pyx_t_6 = 0; | |
20887 __Pyx_INCREF(__pyx_kp_u__5); | |
20888 __pyx_t_4 += 1; | |
20889 __Pyx_GIVEREF(__pyx_kp_u__5); | |
20890 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__5); | |
20891 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20892 __Pyx_GOTREF(__pyx_t_6); | |
20893 __pyx_t_7 = __Pyx_PyInt_RemainderObjC(__pyx_t_6, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20894 __Pyx_GOTREF(__pyx_t_7); | |
20895 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
20896 __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20897 __Pyx_GOTREF(__pyx_t_6); | |
20898 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
20899 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5; | |
20900 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); | |
20901 __Pyx_GIVEREF(__pyx_t_6); | |
20902 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6); | |
20903 __pyx_t_6 = 0; | |
20904 __Pyx_INCREF(__pyx_kp_u__14); | |
20905 __pyx_t_4 += 1; | |
20906 __Pyx_GIVEREF(__pyx_kp_u__14); | |
20907 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__14); | |
20908 __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20909 __Pyx_GOTREF(__pyx_t_6); | |
20910 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20911 __pyx_t_3 = NULL; | |
20912 __pyx_t_8 = 0; | |
20913 #if CYTHON_UNPACK_METHODS | |
20914 if (likely(PyMethod_Check(__pyx_t_2))) { | |
20915 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
20916 if (likely(__pyx_t_3)) { | |
20917 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
20918 __Pyx_INCREF(__pyx_t_3); | |
20919 __Pyx_INCREF(function); | |
20920 __Pyx_DECREF_SET(__pyx_t_2, function); | |
20921 __pyx_t_8 = 1; | |
20922 } | |
20923 } | |
20924 #endif | |
20925 { | |
20926 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6}; | |
20927 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
20928 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20929 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
20930 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) | |
20931 __Pyx_GOTREF(__pyx_t_1); | |
20932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
20933 } | |
20934 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20935 | |
20936 /* "pysam/libcvcf.pyx":572 | |
20937 * def write_header( self, stream ): | |
20938 * stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10)) | |
20939 * for key,value in self._header: stream.write("##%s=%s\n" % (key,value)) # <<<<<<<<<<<<<< | |
20940 * for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]: | |
20941 * for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER")))) | |
20942 */ | |
20943 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) | |
20944 __Pyx_GOTREF(__pyx_t_1); | |
20945 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { | |
20946 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); | |
20947 __pyx_t_4 = 0; | |
20948 __pyx_t_9 = NULL; | |
20949 } else { | |
20950 __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) | |
20951 __Pyx_GOTREF(__pyx_t_2); | |
20952 __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 572, __pyx_L1_error) | |
20953 } | |
20954 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20955 for (;;) { | |
20956 if (likely(!__pyx_t_9)) { | |
20957 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
20958 { | |
20959 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
20960 #if !CYTHON_ASSUME_SAFE_MACROS | |
20961 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 572, __pyx_L1_error) | |
20962 #endif | |
20963 if (__pyx_t_4 >= __pyx_temp) break; | |
20964 } | |
20965 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
20966 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 572, __pyx_L1_error) | |
20967 #else | |
20968 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) | |
20969 __Pyx_GOTREF(__pyx_t_1); | |
20970 #endif | |
20971 } else { | |
20972 { | |
20973 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
20974 #if !CYTHON_ASSUME_SAFE_MACROS | |
20975 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 572, __pyx_L1_error) | |
20976 #endif | |
20977 if (__pyx_t_4 >= __pyx_temp) break; | |
20978 } | |
20979 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
20980 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 572, __pyx_L1_error) | |
20981 #else | |
20982 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) | |
20983 __Pyx_GOTREF(__pyx_t_1); | |
20984 #endif | |
20985 } | |
20986 } else { | |
20987 __pyx_t_1 = __pyx_t_9(__pyx_t_2); | |
20988 if (unlikely(!__pyx_t_1)) { | |
20989 PyObject* exc_type = PyErr_Occurred(); | |
20990 if (exc_type) { | |
20991 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
20992 else __PYX_ERR(0, 572, __pyx_L1_error) | |
20993 } | |
20994 break; | |
20995 } | |
20996 __Pyx_GOTREF(__pyx_t_1); | |
20997 } | |
20998 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { | |
20999 PyObject* sequence = __pyx_t_1; | |
21000 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
21001 if (unlikely(size != 2)) { | |
21002 if (size > 2) __Pyx_RaiseTooManyValuesError(2); | |
21003 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
21004 __PYX_ERR(0, 572, __pyx_L1_error) | |
21005 } | |
21006 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
21007 if (likely(PyTuple_CheckExact(sequence))) { | |
21008 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); | |
21009 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); | |
21010 } else { | |
21011 __pyx_t_6 = PyList_GET_ITEM(sequence, 0); | |
21012 __pyx_t_3 = PyList_GET_ITEM(sequence, 1); | |
21013 } | |
21014 __Pyx_INCREF(__pyx_t_6); | |
21015 __Pyx_INCREF(__pyx_t_3); | |
21016 #else | |
21017 __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) | |
21018 __Pyx_GOTREF(__pyx_t_6); | |
21019 __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) | |
21020 __Pyx_GOTREF(__pyx_t_3); | |
21021 #endif | |
21022 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
21023 } else { | |
21024 Py_ssize_t index = -1; | |
21025 __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error) | |
21026 __Pyx_GOTREF(__pyx_t_7); | |
21027 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
21028 __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); | |
21029 index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; | |
21030 __Pyx_GOTREF(__pyx_t_6); | |
21031 index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; | |
21032 __Pyx_GOTREF(__pyx_t_3); | |
21033 if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_7), 2) < 0) __PYX_ERR(0, 572, __pyx_L1_error) | |
21034 __pyx_t_10 = NULL; | |
21035 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
21036 goto __pyx_L6_unpacking_done; | |
21037 __pyx_L5_unpacking_failed:; | |
21038 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
21039 __pyx_t_10 = NULL; | |
21040 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
21041 __PYX_ERR(0, 572, __pyx_L1_error) | |
21042 __pyx_L6_unpacking_done:; | |
21043 } | |
21044 __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); | |
21045 __pyx_t_6 = 0; | |
21046 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); | |
21047 __pyx_t_3 = 0; | |
21048 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) | |
21049 __Pyx_GOTREF(__pyx_t_3); | |
21050 __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) | |
21051 __Pyx_GOTREF(__pyx_t_6); | |
21052 __pyx_t_11 = 0; | |
21053 __pyx_t_5 = 127; | |
21054 __Pyx_INCREF(__pyx_kp_u__23); | |
21055 __pyx_t_11 += 2; | |
21056 __Pyx_GIVEREF(__pyx_kp_u__23); | |
21057 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__23); | |
21058 __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error) | |
21059 __Pyx_GOTREF(__pyx_t_7); | |
21060 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5; | |
21061 __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); | |
21062 __Pyx_GIVEREF(__pyx_t_7); | |
21063 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); | |
21064 __pyx_t_7 = 0; | |
21065 __Pyx_INCREF(__pyx_kp_u__7); | |
21066 __pyx_t_11 += 1; | |
21067 __Pyx_GIVEREF(__pyx_kp_u__7); | |
21068 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__7); | |
21069 __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_value), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error) | |
21070 __Pyx_GOTREF(__pyx_t_7); | |
21071 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5; | |
21072 __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); | |
21073 __Pyx_GIVEREF(__pyx_t_7); | |
21074 PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_7); | |
21075 __pyx_t_7 = 0; | |
21076 __Pyx_INCREF(__pyx_kp_u__14); | |
21077 __pyx_t_11 += 1; | |
21078 __Pyx_GIVEREF(__pyx_kp_u__14); | |
21079 PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__14); | |
21080 __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, __pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error) | |
21081 __Pyx_GOTREF(__pyx_t_7); | |
21082 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
21083 __pyx_t_6 = NULL; | |
21084 __pyx_t_8 = 0; | |
21085 #if CYTHON_UNPACK_METHODS | |
21086 if (likely(PyMethod_Check(__pyx_t_3))) { | |
21087 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); | |
21088 if (likely(__pyx_t_6)) { | |
21089 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
21090 __Pyx_INCREF(__pyx_t_6); | |
21091 __Pyx_INCREF(function); | |
21092 __Pyx_DECREF_SET(__pyx_t_3, function); | |
21093 __pyx_t_8 = 1; | |
21094 } | |
21095 } | |
21096 #endif | |
21097 { | |
21098 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; | |
21099 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
21100 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
21101 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
21102 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) | |
21103 __Pyx_GOTREF(__pyx_t_1); | |
21104 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21105 } | |
21106 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
21107 } | |
21108 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21109 | |
21110 /* "pysam/libcvcf.pyx":573 | |
21111 * stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10)) | |
21112 * for key,value in self._header: stream.write("##%s=%s\n" % (key,value)) | |
21113 * for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]: # <<<<<<<<<<<<<< | |
21114 * for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER")))) | |
21115 * | |
21116 */ | |
21117 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21118 __Pyx_GOTREF(__pyx_t_2); | |
21119 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21120 __Pyx_GOTREF(__pyx_t_1); | |
21121 __Pyx_GIVEREF(__pyx_t_2); | |
21122 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error); | |
21123 __Pyx_INCREF(__pyx_n_u_INFO); | |
21124 __Pyx_GIVEREF(__pyx_n_u_INFO); | |
21125 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_INFO)) __PYX_ERR(0, 573, __pyx_L1_error); | |
21126 __pyx_t_2 = 0; | |
21127 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21128 __Pyx_GOTREF(__pyx_t_2); | |
21129 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21130 __Pyx_GOTREF(__pyx_t_3); | |
21131 __Pyx_GIVEREF(__pyx_t_2); | |
21132 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error); | |
21133 __Pyx_INCREF(__pyx_n_u_FILTER); | |
21134 __Pyx_GIVEREF(__pyx_n_u_FILTER); | |
21135 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_FILTER)) __PYX_ERR(0, 573, __pyx_L1_error); | |
21136 __pyx_t_2 = 0; | |
21137 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21138 __Pyx_GOTREF(__pyx_t_2); | |
21139 __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21140 __Pyx_GOTREF(__pyx_t_7); | |
21141 __Pyx_GIVEREF(__pyx_t_2); | |
21142 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error); | |
21143 __Pyx_INCREF(__pyx_n_u_FORMAT); | |
21144 __Pyx_GIVEREF(__pyx_n_u_FORMAT); | |
21145 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_u_FORMAT)) __PYX_ERR(0, 573, __pyx_L1_error); | |
21146 __pyx_t_2 = 0; | |
21147 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21148 __Pyx_GOTREF(__pyx_t_2); | |
21149 __Pyx_GIVEREF(__pyx_t_1); | |
21150 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error); | |
21151 __Pyx_GIVEREF(__pyx_t_3); | |
21152 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error); | |
21153 __Pyx_GIVEREF(__pyx_t_7); | |
21154 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_7)) __PYX_ERR(0, 573, __pyx_L1_error); | |
21155 __pyx_t_1 = 0; | |
21156 __pyx_t_3 = 0; | |
21157 __pyx_t_7 = 0; | |
21158 __pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7); | |
21159 __pyx_t_4 = 0; | |
21160 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21161 for (;;) { | |
21162 if (__pyx_t_4 >= 3) break; | |
21163 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
21164 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 573, __pyx_L1_error) | |
21165 #else | |
21166 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21167 __Pyx_GOTREF(__pyx_t_2); | |
21168 #endif | |
21169 if (likely(__pyx_t_2 != Py_None)) { | |
21170 PyObject* sequence = __pyx_t_2; | |
21171 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
21172 if (unlikely(size != 2)) { | |
21173 if (size > 2) __Pyx_RaiseTooManyValuesError(2); | |
21174 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
21175 __PYX_ERR(0, 573, __pyx_L1_error) | |
21176 } | |
21177 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
21178 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); | |
21179 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); | |
21180 __Pyx_INCREF(__pyx_t_3); | |
21181 __Pyx_INCREF(__pyx_t_1); | |
21182 #else | |
21183 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21184 __Pyx_GOTREF(__pyx_t_3); | |
21185 __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) | |
21186 __Pyx_GOTREF(__pyx_t_1); | |
21187 #endif | |
21188 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21189 } else { | |
21190 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 573, __pyx_L1_error) | |
21191 } | |
21192 __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); | |
21193 __pyx_t_3 = 0; | |
21194 __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_1); | |
21195 __pyx_t_1 = 0; | |
21196 | |
21197 /* "pysam/libcvcf.pyx":574 | |
21198 * for key,value in self._header: stream.write("##%s=%s\n" % (key,value)) | |
21199 * for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]: | |
21200 * for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER")))) # <<<<<<<<<<<<<< | |
21201 * | |
21202 * | |
21203 */ | |
21204 __pyx_t_11 = 0; | |
21205 if (unlikely(__pyx_v_var == Py_None)) { | |
21206 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "itervalues"); | |
21207 __PYX_ERR(0, 574, __pyx_L1_error) | |
21208 } | |
21209 __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_var, 0, __pyx_n_s_itervalues, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21210 __Pyx_GOTREF(__pyx_t_1); | |
21211 __Pyx_XDECREF(__pyx_t_2); | |
21212 __pyx_t_2 = __pyx_t_1; | |
21213 __pyx_t_1 = 0; | |
21214 while (1) { | |
21215 __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_12, &__pyx_t_11, NULL, &__pyx_t_1, NULL, __pyx_t_13); | |
21216 if (unlikely(__pyx_t_14 == 0)) break; | |
21217 if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21218 __Pyx_GOTREF(__pyx_t_1); | |
21219 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1); | |
21220 __pyx_t_1 = 0; | |
21221 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21222 __Pyx_GOTREF(__pyx_t_3); | |
21223 __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21224 __Pyx_GOTREF(__pyx_t_6); | |
21225 __pyx_t_15 = 0; | |
21226 __pyx_t_5 = 127; | |
21227 __Pyx_INCREF(__pyx_kp_u__23); | |
21228 __pyx_t_15 += 2; | |
21229 __Pyx_GIVEREF(__pyx_kp_u__23); | |
21230 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__23); | |
21231 __pyx_t_16 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_label), __pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21232 __Pyx_GOTREF(__pyx_t_16); | |
21233 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) : __pyx_t_5; | |
21234 __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16); | |
21235 __Pyx_GIVEREF(__pyx_t_16); | |
21236 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_16); | |
21237 __pyx_t_16 = 0; | |
21238 __Pyx_INCREF(__pyx_kp_u__7); | |
21239 __pyx_t_15 += 1; | |
21240 __Pyx_GIVEREF(__pyx_kp_u__7); | |
21241 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__7); | |
21242 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_format); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21243 __Pyx_GOTREF(__pyx_t_16); | |
21244 __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21245 __Pyx_GOTREF(__pyx_t_17); | |
21246 __Pyx_INCREF(__pyx_v_f); | |
21247 __Pyx_GIVEREF(__pyx_v_f); | |
21248 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_f)) __PYX_ERR(0, 574, __pyx_L1_error); | |
21249 __pyx_t_18 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21250 __Pyx_GOTREF(__pyx_t_18); | |
21251 __pyx_t_19 = PyObject_RichCompare(__pyx_v_label, __pyx_n_u_FILTER, Py_EQ); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21252 if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_filter_2, __pyx_t_19) < 0) __PYX_ERR(0, 574, __pyx_L1_error) | |
21253 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; | |
21254 __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21255 __Pyx_GOTREF(__pyx_t_19); | |
21256 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
21257 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; | |
21258 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; | |
21259 __pyx_t_18 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_19), __pyx_empty_unicode); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21260 __Pyx_GOTREF(__pyx_t_18); | |
21261 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; | |
21262 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) : __pyx_t_5; | |
21263 __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18); | |
21264 __Pyx_GIVEREF(__pyx_t_18); | |
21265 PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_18); | |
21266 __pyx_t_18 = 0; | |
21267 __Pyx_INCREF(__pyx_kp_u__14); | |
21268 __pyx_t_15 += 1; | |
21269 __Pyx_GIVEREF(__pyx_kp_u__14); | |
21270 PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__14); | |
21271 __pyx_t_18 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, __pyx_t_15, __pyx_t_5); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21272 __Pyx_GOTREF(__pyx_t_18); | |
21273 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
21274 __pyx_t_6 = NULL; | |
21275 __pyx_t_8 = 0; | |
21276 #if CYTHON_UNPACK_METHODS | |
21277 if (likely(PyMethod_Check(__pyx_t_3))) { | |
21278 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); | |
21279 if (likely(__pyx_t_6)) { | |
21280 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
21281 __Pyx_INCREF(__pyx_t_6); | |
21282 __Pyx_INCREF(function); | |
21283 __Pyx_DECREF_SET(__pyx_t_3, function); | |
21284 __pyx_t_8 = 1; | |
21285 } | |
21286 } | |
21287 #endif | |
21288 { | |
21289 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_18}; | |
21290 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
21291 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
21292 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; | |
21293 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) | |
21294 __Pyx_GOTREF(__pyx_t_1); | |
21295 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21296 } | |
21297 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
21298 } | |
21299 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21300 | |
21301 /* "pysam/libcvcf.pyx":573 | |
21302 * stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10)) | |
21303 * for key,value in self._header: stream.write("##%s=%s\n" % (key,value)) | |
21304 * for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]: # <<<<<<<<<<<<<< | |
21305 * for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER")))) | |
21306 * | |
21307 */ | |
21308 } | |
21309 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
21310 | |
21311 /* "pysam/libcvcf.pyx":570 | |
21312 * | |
21313 * | |
21314 * def write_header( self, stream ): # <<<<<<<<<<<<<< | |
21315 * stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10)) | |
21316 * for key,value in self._header: stream.write("##%s=%s\n" % (key,value)) | |
21317 */ | |
21318 | |
21319 /* function exit code */ | |
21320 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
21321 goto __pyx_L0; | |
21322 __pyx_L1_error:; | |
21323 __Pyx_XDECREF(__pyx_t_1); | |
21324 __Pyx_XDECREF(__pyx_t_2); | |
21325 __Pyx_XDECREF(__pyx_t_3); | |
21326 __Pyx_XDECREF(__pyx_t_6); | |
21327 __Pyx_XDECREF(__pyx_t_7); | |
21328 __Pyx_XDECREF(__pyx_t_16); | |
21329 __Pyx_XDECREF(__pyx_t_17); | |
21330 __Pyx_XDECREF(__pyx_t_18); | |
21331 __Pyx_XDECREF(__pyx_t_19); | |
21332 __Pyx_AddTraceback("pysam.libcvcf.VCF.write_header", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21333 __pyx_r = NULL; | |
21334 __pyx_L0:; | |
21335 __Pyx_XDECREF(__pyx_v_key); | |
21336 __Pyx_XDECREF(__pyx_v_value); | |
21337 __Pyx_XDECREF(__pyx_v_var); | |
21338 __Pyx_XDECREF(__pyx_v_label); | |
21339 __Pyx_XDECREF(__pyx_v_f); | |
21340 __Pyx_XGIVEREF(__pyx_r); | |
21341 __Pyx_RefNannyFinishContext(); | |
21342 return __pyx_r; | |
21343 } | |
21344 | |
21345 /* "pysam/libcvcf.pyx":577 | |
21346 * | |
21347 * | |
21348 * def parse_heading( self, line ): # <<<<<<<<<<<<<< | |
21349 * assert line.startswith('#') | |
21350 * assert not line.startswith('##') | |
21351 */ | |
21352 | |
21353 /* Python wrapper */ | |
21354 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_21parse_heading(PyObject *__pyx_self, | |
21355 #if CYTHON_METH_FASTCALL | |
21356 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21357 #else | |
21358 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21359 #endif | |
21360 ); /*proto*/ | |
21361 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_20parse_heading, "VCF.parse_heading(self, line)"); | |
21362 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_21parse_heading = {"parse_heading", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_21parse_heading, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_20parse_heading}; | |
21363 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_21parse_heading(PyObject *__pyx_self, | |
21364 #if CYTHON_METH_FASTCALL | |
21365 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21366 #else | |
21367 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21368 #endif | |
21369 ) { | |
21370 PyObject *__pyx_v_self = 0; | |
21371 PyObject *__pyx_v_line = 0; | |
21372 #if !CYTHON_METH_FASTCALL | |
21373 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
21374 #endif | |
21375 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
21376 PyObject* values[2] = {0,0}; | |
21377 int __pyx_lineno = 0; | |
21378 const char *__pyx_filename = NULL; | |
21379 int __pyx_clineno = 0; | |
21380 PyObject *__pyx_r = 0; | |
21381 __Pyx_RefNannyDeclarations | |
21382 __Pyx_RefNannySetupContext("parse_heading (wrapper)", 0); | |
21383 #if !CYTHON_METH_FASTCALL | |
21384 #if CYTHON_ASSUME_SAFE_MACROS | |
21385 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
21386 #else | |
21387 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
21388 #endif | |
21389 #endif | |
21390 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
21391 { | |
21392 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,0}; | |
21393 if (__pyx_kwds) { | |
21394 Py_ssize_t kw_args; | |
21395 switch (__pyx_nargs) { | |
21396 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
21397 CYTHON_FALLTHROUGH; | |
21398 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21399 CYTHON_FALLTHROUGH; | |
21400 case 0: break; | |
21401 default: goto __pyx_L5_argtuple_error; | |
21402 } | |
21403 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
21404 switch (__pyx_nargs) { | |
21405 case 0: | |
21406 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
21407 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
21408 kw_args--; | |
21409 } | |
21410 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L3_error) | |
21411 else goto __pyx_L5_argtuple_error; | |
21412 CYTHON_FALLTHROUGH; | |
21413 case 1: | |
21414 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line)) != 0)) { | |
21415 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
21416 kw_args--; | |
21417 } | |
21418 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L3_error) | |
21419 else { | |
21420 __Pyx_RaiseArgtupleInvalid("parse_heading", 1, 2, 2, 1); __PYX_ERR(0, 577, __pyx_L3_error) | |
21421 } | |
21422 } | |
21423 if (unlikely(kw_args > 0)) { | |
21424 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
21425 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_heading") < 0)) __PYX_ERR(0, 577, __pyx_L3_error) | |
21426 } | |
21427 } else if (unlikely(__pyx_nargs != 2)) { | |
21428 goto __pyx_L5_argtuple_error; | |
21429 } else { | |
21430 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21431 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
21432 } | |
21433 __pyx_v_self = values[0]; | |
21434 __pyx_v_line = values[1]; | |
21435 } | |
21436 goto __pyx_L6_skip; | |
21437 __pyx_L5_argtuple_error:; | |
21438 __Pyx_RaiseArgtupleInvalid("parse_heading", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 577, __pyx_L3_error) | |
21439 __pyx_L6_skip:; | |
21440 goto __pyx_L4_argument_unpacking_done; | |
21441 __pyx_L3_error:; | |
21442 { | |
21443 Py_ssize_t __pyx_temp; | |
21444 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21445 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21446 } | |
21447 } | |
21448 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_heading", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21449 __Pyx_RefNannyFinishContext(); | |
21450 return NULL; | |
21451 __pyx_L4_argument_unpacking_done:; | |
21452 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_20parse_heading(__pyx_self, __pyx_v_self, __pyx_v_line); | |
21453 | |
21454 /* function exit code */ | |
21455 { | |
21456 Py_ssize_t __pyx_temp; | |
21457 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21458 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21459 } | |
21460 } | |
21461 __Pyx_RefNannyFinishContext(); | |
21462 return __pyx_r; | |
21463 } | |
21464 | |
21465 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_20parse_heading(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line) { | |
21466 PyObject *__pyx_v_headings = NULL; | |
21467 PyObject *__pyx_v_i = NULL; | |
21468 PyObject *__pyx_v_s = NULL; | |
21469 PyObject *__pyx_v_err = NULL; | |
21470 PyObject *__pyx_8genexpr2__pyx_v_x = NULL; | |
21471 PyObject *__pyx_8genexpr2__pyx_v_y = NULL; | |
21472 PyObject *__pyx_r = NULL; | |
21473 __Pyx_RefNannyDeclarations | |
21474 PyObject *__pyx_t_1 = NULL; | |
21475 PyObject *__pyx_t_2 = NULL; | |
21476 PyObject *__pyx_t_3 = NULL; | |
21477 unsigned int __pyx_t_4; | |
21478 int __pyx_t_5; | |
21479 int __pyx_t_6; | |
21480 Py_ssize_t __pyx_t_7; | |
21481 PyObject *__pyx_t_8 = NULL; | |
21482 PyObject *(*__pyx_t_9)(PyObject *); | |
21483 Py_ssize_t __pyx_t_10; | |
21484 Py_UCS4 __pyx_t_11; | |
21485 PyObject *__pyx_t_12 = NULL; | |
21486 int __pyx_t_13; | |
21487 PyObject *__pyx_t_14 = NULL; | |
21488 int __pyx_lineno = 0; | |
21489 const char *__pyx_filename = NULL; | |
21490 int __pyx_clineno = 0; | |
21491 __Pyx_RefNannySetupContext("parse_heading", 1); | |
21492 | |
21493 /* "pysam/libcvcf.pyx":578 | |
21494 * | |
21495 * def parse_heading( self, line ): | |
21496 * assert line.startswith('#') # <<<<<<<<<<<<<< | |
21497 * assert not line.startswith('##') | |
21498 * headings = line[1:].split('\t') | |
21499 */ | |
21500 #ifndef CYTHON_WITHOUT_ASSERTIONS | |
21501 if (unlikely(__pyx_assertions_enabled())) { | |
21502 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) | |
21503 __Pyx_GOTREF(__pyx_t_2); | |
21504 __pyx_t_3 = NULL; | |
21505 __pyx_t_4 = 0; | |
21506 #if CYTHON_UNPACK_METHODS | |
21507 if (likely(PyMethod_Check(__pyx_t_2))) { | |
21508 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
21509 if (likely(__pyx_t_3)) { | |
21510 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
21511 __Pyx_INCREF(__pyx_t_3); | |
21512 __Pyx_INCREF(function); | |
21513 __Pyx_DECREF_SET(__pyx_t_2, function); | |
21514 __pyx_t_4 = 1; | |
21515 } | |
21516 } | |
21517 #endif | |
21518 { | |
21519 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__24}; | |
21520 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
21521 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21522 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) | |
21523 __Pyx_GOTREF(__pyx_t_1); | |
21524 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21525 } | |
21526 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) | |
21527 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
21528 if (unlikely(!__pyx_t_5)) { | |
21529 __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); | |
21530 __PYX_ERR(0, 578, __pyx_L1_error) | |
21531 } | |
21532 } | |
21533 #else | |
21534 if ((1)); else __PYX_ERR(0, 578, __pyx_L1_error) | |
21535 #endif | |
21536 | |
21537 /* "pysam/libcvcf.pyx":579 | |
21538 * def parse_heading( self, line ): | |
21539 * assert line.startswith('#') | |
21540 * assert not line.startswith('##') # <<<<<<<<<<<<<< | |
21541 * headings = line[1:].split('\t') | |
21542 * # test for 8, as FORMAT field might be missing | |
21543 */ | |
21544 #ifndef CYTHON_WITHOUT_ASSERTIONS | |
21545 if (unlikely(__pyx_assertions_enabled())) { | |
21546 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) | |
21547 __Pyx_GOTREF(__pyx_t_2); | |
21548 __pyx_t_3 = NULL; | |
21549 __pyx_t_4 = 0; | |
21550 #if CYTHON_UNPACK_METHODS | |
21551 if (likely(PyMethod_Check(__pyx_t_2))) { | |
21552 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
21553 if (likely(__pyx_t_3)) { | |
21554 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
21555 __Pyx_INCREF(__pyx_t_3); | |
21556 __Pyx_INCREF(function); | |
21557 __Pyx_DECREF_SET(__pyx_t_2, function); | |
21558 __pyx_t_4 = 1; | |
21559 } | |
21560 } | |
21561 #endif | |
21562 { | |
21563 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__23}; | |
21564 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
21565 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21566 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) | |
21567 __Pyx_GOTREF(__pyx_t_1); | |
21568 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21569 } | |
21570 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) | |
21571 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
21572 __pyx_t_6 = (!__pyx_t_5); | |
21573 if (unlikely(!__pyx_t_6)) { | |
21574 __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); | |
21575 __PYX_ERR(0, 579, __pyx_L1_error) | |
21576 } | |
21577 } | |
21578 #else | |
21579 if ((1)); else __PYX_ERR(0, 579, __pyx_L1_error) | |
21580 #endif | |
21581 | |
21582 /* "pysam/libcvcf.pyx":580 | |
21583 * assert line.startswith('#') | |
21584 * assert not line.startswith('##') | |
21585 * headings = line[1:].split('\t') # <<<<<<<<<<<<<< | |
21586 * # test for 8, as FORMAT field might be missing | |
21587 * if len(headings)==1 and len(line[1:].split()) >= 8: | |
21588 */ | |
21589 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_line, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) | |
21590 __Pyx_GOTREF(__pyx_t_2); | |
21591 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) | |
21592 __Pyx_GOTREF(__pyx_t_3); | |
21593 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21594 __pyx_t_2 = NULL; | |
21595 __pyx_t_4 = 0; | |
21596 #if CYTHON_UNPACK_METHODS | |
21597 if (likely(PyMethod_Check(__pyx_t_3))) { | |
21598 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); | |
21599 if (likely(__pyx_t_2)) { | |
21600 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
21601 __Pyx_INCREF(__pyx_t_2); | |
21602 __Pyx_INCREF(function); | |
21603 __Pyx_DECREF_SET(__pyx_t_3, function); | |
21604 __pyx_t_4 = 1; | |
21605 } | |
21606 } | |
21607 #endif | |
21608 { | |
21609 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u__25}; | |
21610 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
21611 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21612 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) | |
21613 __Pyx_GOTREF(__pyx_t_1); | |
21614 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21615 } | |
21616 __pyx_v_headings = __pyx_t_1; | |
21617 __pyx_t_1 = 0; | |
21618 | |
21619 /* "pysam/libcvcf.pyx":582 | |
21620 * headings = line[1:].split('\t') | |
21621 * # test for 8, as FORMAT field might be missing | |
21622 * if len(headings)==1 and len(line[1:].split()) >= 8: # <<<<<<<<<<<<<< | |
21623 * self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS) | |
21624 * headings = line[1:].split() | |
21625 */ | |
21626 __pyx_t_7 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) | |
21627 __pyx_t_5 = (__pyx_t_7 == 1); | |
21628 if (__pyx_t_5) { | |
21629 } else { | |
21630 __pyx_t_6 = __pyx_t_5; | |
21631 goto __pyx_L4_bool_binop_done; | |
21632 } | |
21633 __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_line, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) | |
21634 __Pyx_GOTREF(__pyx_t_3); | |
21635 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) | |
21636 __Pyx_GOTREF(__pyx_t_2); | |
21637 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21638 __pyx_t_3 = NULL; | |
21639 __pyx_t_4 = 0; | |
21640 #if CYTHON_UNPACK_METHODS | |
21641 if (likely(PyMethod_Check(__pyx_t_2))) { | |
21642 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
21643 if (likely(__pyx_t_3)) { | |
21644 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
21645 __Pyx_INCREF(__pyx_t_3); | |
21646 __Pyx_INCREF(function); | |
21647 __Pyx_DECREF_SET(__pyx_t_2, function); | |
21648 __pyx_t_4 = 1; | |
21649 } | |
21650 } | |
21651 #endif | |
21652 { | |
21653 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
21654 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
21655 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21656 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) | |
21657 __Pyx_GOTREF(__pyx_t_1); | |
21658 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21659 } | |
21660 __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) | |
21661 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
21662 __pyx_t_5 = (__pyx_t_7 >= 8); | |
21663 __pyx_t_6 = __pyx_t_5; | |
21664 __pyx_L4_bool_binop_done:; | |
21665 if (__pyx_t_6) { | |
21666 | |
21667 /* "pysam/libcvcf.pyx":583 | |
21668 * # test for 8, as FORMAT field might be missing | |
21669 * if len(headings)==1 and len(line[1:].split()) >= 8: | |
21670 * self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS) # <<<<<<<<<<<<<< | |
21671 * headings = line[1:].split() | |
21672 * | |
21673 */ | |
21674 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) | |
21675 __Pyx_GOTREF(__pyx_t_2); | |
21676 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) | |
21677 __Pyx_GOTREF(__pyx_t_3); | |
21678 __pyx_t_8 = NULL; | |
21679 __pyx_t_4 = 0; | |
21680 #if CYTHON_UNPACK_METHODS | |
21681 if (likely(PyMethod_Check(__pyx_t_2))) { | |
21682 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); | |
21683 if (likely(__pyx_t_8)) { | |
21684 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
21685 __Pyx_INCREF(__pyx_t_8); | |
21686 __Pyx_INCREF(function); | |
21687 __Pyx_DECREF_SET(__pyx_t_2, function); | |
21688 __pyx_t_4 = 1; | |
21689 } | |
21690 } | |
21691 #endif | |
21692 { | |
21693 PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_line, __pyx_t_3}; | |
21694 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
21695 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
21696 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21697 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) | |
21698 __Pyx_GOTREF(__pyx_t_1); | |
21699 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21700 } | |
21701 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
21702 | |
21703 /* "pysam/libcvcf.pyx":584 | |
21704 * if len(headings)==1 and len(line[1:].split()) >= 8: | |
21705 * self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS) | |
21706 * headings = line[1:].split() # <<<<<<<<<<<<<< | |
21707 * | |
21708 * for i,s in enumerate(self._required): | |
21709 */ | |
21710 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_line, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) | |
21711 __Pyx_GOTREF(__pyx_t_2); | |
21712 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) | |
21713 __Pyx_GOTREF(__pyx_t_3); | |
21714 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21715 __pyx_t_2 = NULL; | |
21716 __pyx_t_4 = 0; | |
21717 #if CYTHON_UNPACK_METHODS | |
21718 if (likely(PyMethod_Check(__pyx_t_3))) { | |
21719 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); | |
21720 if (likely(__pyx_t_2)) { | |
21721 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
21722 __Pyx_INCREF(__pyx_t_2); | |
21723 __Pyx_INCREF(function); | |
21724 __Pyx_DECREF_SET(__pyx_t_3, function); | |
21725 __pyx_t_4 = 1; | |
21726 } | |
21727 } | |
21728 #endif | |
21729 { | |
21730 PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; | |
21731 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
21732 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21733 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) | |
21734 __Pyx_GOTREF(__pyx_t_1); | |
21735 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21736 } | |
21737 __Pyx_DECREF_SET(__pyx_v_headings, __pyx_t_1); | |
21738 __pyx_t_1 = 0; | |
21739 | |
21740 /* "pysam/libcvcf.pyx":582 | |
21741 * headings = line[1:].split('\t') | |
21742 * # test for 8, as FORMAT field might be missing | |
21743 * if len(headings)==1 and len(line[1:].split()) >= 8: # <<<<<<<<<<<<<< | |
21744 * self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS) | |
21745 * headings = line[1:].split() | |
21746 */ | |
21747 } | |
21748 | |
21749 /* "pysam/libcvcf.pyx":586 | |
21750 * headings = line[1:].split() | |
21751 * | |
21752 * for i,s in enumerate(self._required): # <<<<<<<<<<<<<< | |
21753 * | |
21754 * if len(headings)<=i or headings[i] != s: | |
21755 */ | |
21756 __Pyx_INCREF(__pyx_int_0); | |
21757 __pyx_t_1 = __pyx_int_0; | |
21758 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_required); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) | |
21759 __Pyx_GOTREF(__pyx_t_3); | |
21760 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { | |
21761 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); | |
21762 __pyx_t_7 = 0; | |
21763 __pyx_t_9 = NULL; | |
21764 } else { | |
21765 __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error) | |
21766 __Pyx_GOTREF(__pyx_t_2); | |
21767 __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 586, __pyx_L1_error) | |
21768 } | |
21769 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21770 for (;;) { | |
21771 if (likely(!__pyx_t_9)) { | |
21772 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
21773 { | |
21774 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
21775 #if !CYTHON_ASSUME_SAFE_MACROS | |
21776 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 586, __pyx_L1_error) | |
21777 #endif | |
21778 if (__pyx_t_7 >= __pyx_temp) break; | |
21779 } | |
21780 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
21781 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 586, __pyx_L1_error) | |
21782 #else | |
21783 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) | |
21784 __Pyx_GOTREF(__pyx_t_3); | |
21785 #endif | |
21786 } else { | |
21787 { | |
21788 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
21789 #if !CYTHON_ASSUME_SAFE_MACROS | |
21790 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 586, __pyx_L1_error) | |
21791 #endif | |
21792 if (__pyx_t_7 >= __pyx_temp) break; | |
21793 } | |
21794 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
21795 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 586, __pyx_L1_error) | |
21796 #else | |
21797 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) | |
21798 __Pyx_GOTREF(__pyx_t_3); | |
21799 #endif | |
21800 } | |
21801 } else { | |
21802 __pyx_t_3 = __pyx_t_9(__pyx_t_2); | |
21803 if (unlikely(!__pyx_t_3)) { | |
21804 PyObject* exc_type = PyErr_Occurred(); | |
21805 if (exc_type) { | |
21806 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
21807 else __PYX_ERR(0, 586, __pyx_L1_error) | |
21808 } | |
21809 break; | |
21810 } | |
21811 __Pyx_GOTREF(__pyx_t_3); | |
21812 } | |
21813 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3); | |
21814 __pyx_t_3 = 0; | |
21815 __Pyx_INCREF(__pyx_t_1); | |
21816 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); | |
21817 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) | |
21818 __Pyx_GOTREF(__pyx_t_3); | |
21819 __Pyx_DECREF(__pyx_t_1); | |
21820 __pyx_t_1 = __pyx_t_3; | |
21821 __pyx_t_3 = 0; | |
21822 | |
21823 /* "pysam/libcvcf.pyx":588 | |
21824 * for i,s in enumerate(self._required): | |
21825 * | |
21826 * if len(headings)<=i or headings[i] != s: # <<<<<<<<<<<<<< | |
21827 * | |
21828 * if len(headings) <= i: | |
21829 */ | |
21830 __pyx_t_10 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 588, __pyx_L1_error) | |
21831 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) | |
21832 __Pyx_GOTREF(__pyx_t_3); | |
21833 __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 588, __pyx_L1_error) | |
21834 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21835 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) | |
21836 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
21837 if (!__pyx_t_5) { | |
21838 } else { | |
21839 __pyx_t_6 = __pyx_t_5; | |
21840 goto __pyx_L9_bool_binop_done; | |
21841 } | |
21842 __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_headings, __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 588, __pyx_L1_error) | |
21843 __Pyx_GOTREF(__pyx_t_8); | |
21844 __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_v_s, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) | |
21845 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
21846 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) | |
21847 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21848 __pyx_t_6 = __pyx_t_5; | |
21849 __pyx_L9_bool_binop_done:; | |
21850 if (__pyx_t_6) { | |
21851 | |
21852 /* "pysam/libcvcf.pyx":590 | |
21853 * if len(headings)<=i or headings[i] != s: | |
21854 * | |
21855 * if len(headings) <= i: # <<<<<<<<<<<<<< | |
21856 * err = "(%sth entry not found)" % (i+1) | |
21857 * else: | |
21858 */ | |
21859 __pyx_t_10 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 590, __pyx_L1_error) | |
21860 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error) | |
21861 __Pyx_GOTREF(__pyx_t_3); | |
21862 __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 590, __pyx_L1_error) | |
21863 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21864 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) | |
21865 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
21866 if (__pyx_t_6) { | |
21867 | |
21868 /* "pysam/libcvcf.pyx":591 | |
21869 * | |
21870 * if len(headings) <= i: | |
21871 * err = "(%sth entry not found)" % (i+1) # <<<<<<<<<<<<<< | |
21872 * else: | |
21873 * err = "(found %s, expected %s)" % (headings[i],s) | |
21874 */ | |
21875 __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error) | |
21876 __Pyx_GOTREF(__pyx_t_8); | |
21877 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_sth_entry_not_found, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) | |
21878 __Pyx_GOTREF(__pyx_t_3); | |
21879 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
21880 __Pyx_XDECREF_SET(__pyx_v_err, ((PyObject*)__pyx_t_3)); | |
21881 __pyx_t_3 = 0; | |
21882 | |
21883 /* "pysam/libcvcf.pyx":590 | |
21884 * if len(headings)<=i or headings[i] != s: | |
21885 * | |
21886 * if len(headings) <= i: # <<<<<<<<<<<<<< | |
21887 * err = "(%sth entry not found)" % (i+1) | |
21888 * else: | |
21889 */ | |
21890 goto __pyx_L11; | |
21891 } | |
21892 | |
21893 /* "pysam/libcvcf.pyx":593 | |
21894 * err = "(%sth entry not found)" % (i+1) | |
21895 * else: | |
21896 * err = "(found %s, expected %s)" % (headings[i],s) # <<<<<<<<<<<<<< | |
21897 * | |
21898 * #self.error(line,self.BADLY_FORMATTED_HEADING,err) | |
21899 */ | |
21900 /*else*/ { | |
21901 __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) | |
21902 __Pyx_GOTREF(__pyx_t_3); | |
21903 __pyx_t_10 = 0; | |
21904 __pyx_t_11 = 127; | |
21905 __Pyx_INCREF(__pyx_kp_u_found); | |
21906 __pyx_t_10 += 7; | |
21907 __Pyx_GIVEREF(__pyx_kp_u_found); | |
21908 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_found); | |
21909 __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_headings, __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) | |
21910 __Pyx_GOTREF(__pyx_t_8); | |
21911 __pyx_t_12 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_8), __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 593, __pyx_L1_error) | |
21912 __Pyx_GOTREF(__pyx_t_12); | |
21913 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
21914 __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_11; | |
21915 __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12); | |
21916 __Pyx_GIVEREF(__pyx_t_12); | |
21917 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_12); | |
21918 __pyx_t_12 = 0; | |
21919 __Pyx_INCREF(__pyx_kp_u_expected_2); | |
21920 __pyx_t_10 += 11; | |
21921 __Pyx_GIVEREF(__pyx_kp_u_expected_2); | |
21922 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_expected_2); | |
21923 __pyx_t_12 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_s), __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 593, __pyx_L1_error) | |
21924 __Pyx_GOTREF(__pyx_t_12); | |
21925 __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_11; | |
21926 __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12); | |
21927 __Pyx_GIVEREF(__pyx_t_12); | |
21928 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_12); | |
21929 __pyx_t_12 = 0; | |
21930 __Pyx_INCREF(__pyx_kp_u__8); | |
21931 __pyx_t_10 += 1; | |
21932 __Pyx_GIVEREF(__pyx_kp_u__8); | |
21933 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__8); | |
21934 __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 593, __pyx_L1_error) | |
21935 __Pyx_GOTREF(__pyx_t_12); | |
21936 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
21937 __Pyx_XDECREF_SET(__pyx_v_err, ((PyObject*)__pyx_t_12)); | |
21938 __pyx_t_12 = 0; | |
21939 } | |
21940 __pyx_L11:; | |
21941 | |
21942 /* "pysam/libcvcf.pyx":597 | |
21943 * #self.error(line,self.BADLY_FORMATTED_HEADING,err) | |
21944 * # allow FORMAT column to be absent | |
21945 * if len(headings) == 8: # <<<<<<<<<<<<<< | |
21946 * headings.append("FORMAT") | |
21947 * else: | |
21948 */ | |
21949 __pyx_t_10 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) | |
21950 __pyx_t_6 = (__pyx_t_10 == 8); | |
21951 if (__pyx_t_6) { | |
21952 | |
21953 /* "pysam/libcvcf.pyx":598 | |
21954 * # allow FORMAT column to be absent | |
21955 * if len(headings) == 8: | |
21956 * headings.append("FORMAT") # <<<<<<<<<<<<<< | |
21957 * else: | |
21958 * self.error(line,self.BADLY_FORMATTED_HEADING,err) | |
21959 */ | |
21960 __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_headings, __pyx_n_u_FORMAT); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 598, __pyx_L1_error) | |
21961 | |
21962 /* "pysam/libcvcf.pyx":597 | |
21963 * #self.error(line,self.BADLY_FORMATTED_HEADING,err) | |
21964 * # allow FORMAT column to be absent | |
21965 * if len(headings) == 8: # <<<<<<<<<<<<<< | |
21966 * headings.append("FORMAT") | |
21967 * else: | |
21968 */ | |
21969 goto __pyx_L12; | |
21970 } | |
21971 | |
21972 /* "pysam/libcvcf.pyx":600 | |
21973 * headings.append("FORMAT") | |
21974 * else: | |
21975 * self.error(line,self.BADLY_FORMATTED_HEADING,err) # <<<<<<<<<<<<<< | |
21976 * | |
21977 * self._samples = headings[9:] | |
21978 */ | |
21979 /*else*/ { | |
21980 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) | |
21981 __Pyx_GOTREF(__pyx_t_3); | |
21982 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_HEADING); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 600, __pyx_L1_error) | |
21983 __Pyx_GOTREF(__pyx_t_8); | |
21984 __pyx_t_14 = NULL; | |
21985 __pyx_t_4 = 0; | |
21986 #if CYTHON_UNPACK_METHODS | |
21987 if (likely(PyMethod_Check(__pyx_t_3))) { | |
21988 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3); | |
21989 if (likely(__pyx_t_14)) { | |
21990 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
21991 __Pyx_INCREF(__pyx_t_14); | |
21992 __Pyx_INCREF(function); | |
21993 __Pyx_DECREF_SET(__pyx_t_3, function); | |
21994 __pyx_t_4 = 1; | |
21995 } | |
21996 } | |
21997 #endif | |
21998 { | |
21999 PyObject *__pyx_callargs[4] = {__pyx_t_14, __pyx_v_line, __pyx_t_8, __pyx_v_err}; | |
22000 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
22001 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; | |
22002 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
22003 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error) | |
22004 __Pyx_GOTREF(__pyx_t_12); | |
22005 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
22006 } | |
22007 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
22008 } | |
22009 __pyx_L12:; | |
22010 | |
22011 /* "pysam/libcvcf.pyx":588 | |
22012 * for i,s in enumerate(self._required): | |
22013 * | |
22014 * if len(headings)<=i or headings[i] != s: # <<<<<<<<<<<<<< | |
22015 * | |
22016 * if len(headings) <= i: | |
22017 */ | |
22018 } | |
22019 | |
22020 /* "pysam/libcvcf.pyx":586 | |
22021 * headings = line[1:].split() | |
22022 * | |
22023 * for i,s in enumerate(self._required): # <<<<<<<<<<<<<< | |
22024 * | |
22025 * if len(headings)<=i or headings[i] != s: | |
22026 */ | |
22027 } | |
22028 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22029 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
22030 | |
22031 /* "pysam/libcvcf.pyx":602 | |
22032 * self.error(line,self.BADLY_FORMATTED_HEADING,err) | |
22033 * | |
22034 * self._samples = headings[9:] # <<<<<<<<<<<<<< | |
22035 * self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] ) | |
22036 * | |
22037 */ | |
22038 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_headings, 9, 0, NULL, NULL, &__pyx_slice__26, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) | |
22039 __Pyx_GOTREF(__pyx_t_1); | |
22040 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_samples, __pyx_t_1) < 0) __PYX_ERR(0, 602, __pyx_L1_error) | |
22041 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
22042 | |
22043 /* "pysam/libcvcf.pyx":603 | |
22044 * | |
22045 * self._samples = headings[9:] | |
22046 * self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] ) # <<<<<<<<<<<<<< | |
22047 * | |
22048 * def write_heading( self, stream ): | |
22049 */ | |
22050 { /* enter inner scope */ | |
22051 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L16_error) | |
22052 __Pyx_GOTREF(__pyx_t_1); | |
22053 __Pyx_INCREF(__pyx_int_0); | |
22054 __pyx_t_2 = __pyx_int_0; | |
22055 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L16_error) | |
22056 __Pyx_GOTREF(__pyx_t_12); | |
22057 if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { | |
22058 __pyx_t_3 = __pyx_t_12; __Pyx_INCREF(__pyx_t_3); | |
22059 __pyx_t_7 = 0; | |
22060 __pyx_t_9 = NULL; | |
22061 } else { | |
22062 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L16_error) | |
22063 __Pyx_GOTREF(__pyx_t_3); | |
22064 __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 603, __pyx_L16_error) | |
22065 } | |
22066 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
22067 for (;;) { | |
22068 if (likely(!__pyx_t_9)) { | |
22069 if (likely(PyList_CheckExact(__pyx_t_3))) { | |
22070 { | |
22071 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); | |
22072 #if !CYTHON_ASSUME_SAFE_MACROS | |
22073 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 603, __pyx_L16_error) | |
22074 #endif | |
22075 if (__pyx_t_7 >= __pyx_temp) break; | |
22076 } | |
22077 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
22078 __pyx_t_12 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_12); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 603, __pyx_L16_error) | |
22079 #else | |
22080 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L16_error) | |
22081 __Pyx_GOTREF(__pyx_t_12); | |
22082 #endif | |
22083 } else { | |
22084 { | |
22085 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); | |
22086 #if !CYTHON_ASSUME_SAFE_MACROS | |
22087 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 603, __pyx_L16_error) | |
22088 #endif | |
22089 if (__pyx_t_7 >= __pyx_temp) break; | |
22090 } | |
22091 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
22092 __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_12); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 603, __pyx_L16_error) | |
22093 #else | |
22094 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L16_error) | |
22095 __Pyx_GOTREF(__pyx_t_12); | |
22096 #endif | |
22097 } | |
22098 } else { | |
22099 __pyx_t_12 = __pyx_t_9(__pyx_t_3); | |
22100 if (unlikely(!__pyx_t_12)) { | |
22101 PyObject* exc_type = PyErr_Occurred(); | |
22102 if (exc_type) { | |
22103 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
22104 else __PYX_ERR(0, 603, __pyx_L16_error) | |
22105 } | |
22106 break; | |
22107 } | |
22108 __Pyx_GOTREF(__pyx_t_12); | |
22109 } | |
22110 __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_y, __pyx_t_12); | |
22111 __pyx_t_12 = 0; | |
22112 __Pyx_INCREF(__pyx_t_2); | |
22113 __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_x, __pyx_t_2); | |
22114 __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L16_error) | |
22115 __Pyx_GOTREF(__pyx_t_12); | |
22116 __Pyx_DECREF(__pyx_t_2); | |
22117 __pyx_t_2 = __pyx_t_12; | |
22118 __pyx_t_12 = 0; | |
22119 __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_8genexpr2__pyx_v_x, __pyx_int_9, 9, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L16_error) | |
22120 __Pyx_GOTREF(__pyx_t_12); | |
22121 __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L16_error) | |
22122 __Pyx_GOTREF(__pyx_t_8); | |
22123 __Pyx_INCREF(__pyx_8genexpr2__pyx_v_y); | |
22124 __Pyx_GIVEREF(__pyx_8genexpr2__pyx_v_y); | |
22125 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_8genexpr2__pyx_v_y)) __PYX_ERR(0, 603, __pyx_L16_error); | |
22126 __Pyx_GIVEREF(__pyx_t_12); | |
22127 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_12)) __PYX_ERR(0, 603, __pyx_L16_error); | |
22128 __pyx_t_12 = 0; | |
22129 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 603, __pyx_L16_error) | |
22130 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
22131 } | |
22132 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
22133 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22134 __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x); __pyx_8genexpr2__pyx_v_x = 0; | |
22135 __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_y); __pyx_8genexpr2__pyx_v_y = 0; | |
22136 goto __pyx_L20_exit_scope; | |
22137 __pyx_L16_error:; | |
22138 __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x); __pyx_8genexpr2__pyx_v_x = 0; | |
22139 __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_y); __pyx_8genexpr2__pyx_v_y = 0; | |
22140 goto __pyx_L1_error; | |
22141 __pyx_L20_exit_scope:; | |
22142 } /* exit inner scope */ | |
22143 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) | |
22144 __Pyx_GOTREF(__pyx_t_2); | |
22145 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
22146 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sample2column, __pyx_t_2) < 0) __PYX_ERR(0, 603, __pyx_L1_error) | |
22147 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22148 | |
22149 /* "pysam/libcvcf.pyx":577 | |
22150 * | |
22151 * | |
22152 * def parse_heading( self, line ): # <<<<<<<<<<<<<< | |
22153 * assert line.startswith('#') | |
22154 * assert not line.startswith('##') | |
22155 */ | |
22156 | |
22157 /* function exit code */ | |
22158 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
22159 goto __pyx_L0; | |
22160 __pyx_L1_error:; | |
22161 __Pyx_XDECREF(__pyx_t_1); | |
22162 __Pyx_XDECREF(__pyx_t_2); | |
22163 __Pyx_XDECREF(__pyx_t_3); | |
22164 __Pyx_XDECREF(__pyx_t_8); | |
22165 __Pyx_XDECREF(__pyx_t_12); | |
22166 __Pyx_XDECREF(__pyx_t_14); | |
22167 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_heading", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22168 __pyx_r = NULL; | |
22169 __pyx_L0:; | |
22170 __Pyx_XDECREF(__pyx_v_headings); | |
22171 __Pyx_XDECREF(__pyx_v_i); | |
22172 __Pyx_XDECREF(__pyx_v_s); | |
22173 __Pyx_XDECREF(__pyx_v_err); | |
22174 __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x); | |
22175 __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_y); | |
22176 __Pyx_XGIVEREF(__pyx_r); | |
22177 __Pyx_RefNannyFinishContext(); | |
22178 return __pyx_r; | |
22179 } | |
22180 | |
22181 /* "pysam/libcvcf.pyx":605 | |
22182 * self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] ) | |
22183 * | |
22184 * def write_heading( self, stream ): # <<<<<<<<<<<<<< | |
22185 * stream.write("#" + "\t".join(self._required + self._samples) + "\n") | |
22186 * | |
22187 */ | |
22188 | |
22189 /* Python wrapper */ | |
22190 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_23write_heading(PyObject *__pyx_self, | |
22191 #if CYTHON_METH_FASTCALL | |
22192 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22193 #else | |
22194 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22195 #endif | |
22196 ); /*proto*/ | |
22197 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_22write_heading, "VCF.write_heading(self, stream)"); | |
22198 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_23write_heading = {"write_heading", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_23write_heading, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_22write_heading}; | |
22199 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_23write_heading(PyObject *__pyx_self, | |
22200 #if CYTHON_METH_FASTCALL | |
22201 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22202 #else | |
22203 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22204 #endif | |
22205 ) { | |
22206 PyObject *__pyx_v_self = 0; | |
22207 PyObject *__pyx_v_stream = 0; | |
22208 #if !CYTHON_METH_FASTCALL | |
22209 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
22210 #endif | |
22211 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
22212 PyObject* values[2] = {0,0}; | |
22213 int __pyx_lineno = 0; | |
22214 const char *__pyx_filename = NULL; | |
22215 int __pyx_clineno = 0; | |
22216 PyObject *__pyx_r = 0; | |
22217 __Pyx_RefNannyDeclarations | |
22218 __Pyx_RefNannySetupContext("write_heading (wrapper)", 0); | |
22219 #if !CYTHON_METH_FASTCALL | |
22220 #if CYTHON_ASSUME_SAFE_MACROS | |
22221 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
22222 #else | |
22223 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
22224 #endif | |
22225 #endif | |
22226 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
22227 { | |
22228 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0}; | |
22229 if (__pyx_kwds) { | |
22230 Py_ssize_t kw_args; | |
22231 switch (__pyx_nargs) { | |
22232 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22233 CYTHON_FALLTHROUGH; | |
22234 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22235 CYTHON_FALLTHROUGH; | |
22236 case 0: break; | |
22237 default: goto __pyx_L5_argtuple_error; | |
22238 } | |
22239 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
22240 switch (__pyx_nargs) { | |
22241 case 0: | |
22242 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
22243 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
22244 kw_args--; | |
22245 } | |
22246 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L3_error) | |
22247 else goto __pyx_L5_argtuple_error; | |
22248 CYTHON_FALLTHROUGH; | |
22249 case 1: | |
22250 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream)) != 0)) { | |
22251 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
22252 kw_args--; | |
22253 } | |
22254 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L3_error) | |
22255 else { | |
22256 __Pyx_RaiseArgtupleInvalid("write_heading", 1, 2, 2, 1); __PYX_ERR(0, 605, __pyx_L3_error) | |
22257 } | |
22258 } | |
22259 if (unlikely(kw_args > 0)) { | |
22260 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
22261 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write_heading") < 0)) __PYX_ERR(0, 605, __pyx_L3_error) | |
22262 } | |
22263 } else if (unlikely(__pyx_nargs != 2)) { | |
22264 goto __pyx_L5_argtuple_error; | |
22265 } else { | |
22266 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22267 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22268 } | |
22269 __pyx_v_self = values[0]; | |
22270 __pyx_v_stream = values[1]; | |
22271 } | |
22272 goto __pyx_L6_skip; | |
22273 __pyx_L5_argtuple_error:; | |
22274 __Pyx_RaiseArgtupleInvalid("write_heading", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 605, __pyx_L3_error) | |
22275 __pyx_L6_skip:; | |
22276 goto __pyx_L4_argument_unpacking_done; | |
22277 __pyx_L3_error:; | |
22278 { | |
22279 Py_ssize_t __pyx_temp; | |
22280 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22281 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22282 } | |
22283 } | |
22284 __Pyx_AddTraceback("pysam.libcvcf.VCF.write_heading", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22285 __Pyx_RefNannyFinishContext(); | |
22286 return NULL; | |
22287 __pyx_L4_argument_unpacking_done:; | |
22288 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_22write_heading(__pyx_self, __pyx_v_self, __pyx_v_stream); | |
22289 | |
22290 /* function exit code */ | |
22291 { | |
22292 Py_ssize_t __pyx_temp; | |
22293 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22294 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22295 } | |
22296 } | |
22297 __Pyx_RefNannyFinishContext(); | |
22298 return __pyx_r; | |
22299 } | |
22300 | |
22301 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_22write_heading(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) { | |
22302 PyObject *__pyx_r = NULL; | |
22303 __Pyx_RefNannyDeclarations | |
22304 PyObject *__pyx_t_1 = NULL; | |
22305 PyObject *__pyx_t_2 = NULL; | |
22306 PyObject *__pyx_t_3 = NULL; | |
22307 PyObject *__pyx_t_4 = NULL; | |
22308 PyObject *__pyx_t_5 = NULL; | |
22309 unsigned int __pyx_t_6; | |
22310 int __pyx_lineno = 0; | |
22311 const char *__pyx_filename = NULL; | |
22312 int __pyx_clineno = 0; | |
22313 __Pyx_RefNannySetupContext("write_heading", 1); | |
22314 | |
22315 /* "pysam/libcvcf.pyx":606 | |
22316 * | |
22317 * def write_heading( self, stream ): | |
22318 * stream.write("#" + "\t".join(self._required + self._samples) + "\n") # <<<<<<<<<<<<<< | |
22319 * | |
22320 * def convertGT(self, GTstring): | |
22321 */ | |
22322 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error) | |
22323 __Pyx_GOTREF(__pyx_t_2); | |
22324 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_required); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error) | |
22325 __Pyx_GOTREF(__pyx_t_3); | |
22326 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error) | |
22327 __Pyx_GOTREF(__pyx_t_4); | |
22328 __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error) | |
22329 __Pyx_GOTREF(__pyx_t_5); | |
22330 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
22331 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
22332 __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__25, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error) | |
22333 __Pyx_GOTREF(__pyx_t_4); | |
22334 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
22335 __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u__24, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error) | |
22336 __Pyx_GOTREF(__pyx_t_5); | |
22337 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
22338 __pyx_t_4 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_5, __pyx_kp_u__14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error) | |
22339 __Pyx_GOTREF(__pyx_t_4); | |
22340 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
22341 __pyx_t_5 = NULL; | |
22342 __pyx_t_6 = 0; | |
22343 #if CYTHON_UNPACK_METHODS | |
22344 if (likely(PyMethod_Check(__pyx_t_2))) { | |
22345 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); | |
22346 if (likely(__pyx_t_5)) { | |
22347 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
22348 __Pyx_INCREF(__pyx_t_5); | |
22349 __Pyx_INCREF(function); | |
22350 __Pyx_DECREF_SET(__pyx_t_2, function); | |
22351 __pyx_t_6 = 1; | |
22352 } | |
22353 } | |
22354 #endif | |
22355 { | |
22356 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; | |
22357 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); | |
22358 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
22359 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
22360 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) | |
22361 __Pyx_GOTREF(__pyx_t_1); | |
22362 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22363 } | |
22364 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
22365 | |
22366 /* "pysam/libcvcf.pyx":605 | |
22367 * self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] ) | |
22368 * | |
22369 * def write_heading( self, stream ): # <<<<<<<<<<<<<< | |
22370 * stream.write("#" + "\t".join(self._required + self._samples) + "\n") | |
22371 * | |
22372 */ | |
22373 | |
22374 /* function exit code */ | |
22375 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
22376 goto __pyx_L0; | |
22377 __pyx_L1_error:; | |
22378 __Pyx_XDECREF(__pyx_t_1); | |
22379 __Pyx_XDECREF(__pyx_t_2); | |
22380 __Pyx_XDECREF(__pyx_t_3); | |
22381 __Pyx_XDECREF(__pyx_t_4); | |
22382 __Pyx_XDECREF(__pyx_t_5); | |
22383 __Pyx_AddTraceback("pysam.libcvcf.VCF.write_heading", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22384 __pyx_r = NULL; | |
22385 __pyx_L0:; | |
22386 __Pyx_XGIVEREF(__pyx_r); | |
22387 __Pyx_RefNannyFinishContext(); | |
22388 return __pyx_r; | |
22389 } | |
22390 | |
22391 /* "pysam/libcvcf.pyx":608 | |
22392 * stream.write("#" + "\t".join(self._required + self._samples) + "\n") | |
22393 * | |
22394 * def convertGT(self, GTstring): # <<<<<<<<<<<<<< | |
22395 * if GTstring == ".": return ["."] | |
22396 * try: | |
22397 */ | |
22398 | |
22399 /* Python wrapper */ | |
22400 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_25convertGT(PyObject *__pyx_self, | |
22401 #if CYTHON_METH_FASTCALL | |
22402 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22403 #else | |
22404 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22405 #endif | |
22406 ); /*proto*/ | |
22407 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_24convertGT, "VCF.convertGT(self, GTstring)"); | |
22408 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_25convertGT = {"convertGT", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_25convertGT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_24convertGT}; | |
22409 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_25convertGT(PyObject *__pyx_self, | |
22410 #if CYTHON_METH_FASTCALL | |
22411 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22412 #else | |
22413 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22414 #endif | |
22415 ) { | |
22416 PyObject *__pyx_v_self = 0; | |
22417 PyObject *__pyx_v_GTstring = 0; | |
22418 #if !CYTHON_METH_FASTCALL | |
22419 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
22420 #endif | |
22421 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
22422 PyObject* values[2] = {0,0}; | |
22423 int __pyx_lineno = 0; | |
22424 const char *__pyx_filename = NULL; | |
22425 int __pyx_clineno = 0; | |
22426 PyObject *__pyx_r = 0; | |
22427 __Pyx_RefNannyDeclarations | |
22428 __Pyx_RefNannySetupContext("convertGT (wrapper)", 0); | |
22429 #if !CYTHON_METH_FASTCALL | |
22430 #if CYTHON_ASSUME_SAFE_MACROS | |
22431 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
22432 #else | |
22433 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
22434 #endif | |
22435 #endif | |
22436 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
22437 { | |
22438 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_GTstring,0}; | |
22439 if (__pyx_kwds) { | |
22440 Py_ssize_t kw_args; | |
22441 switch (__pyx_nargs) { | |
22442 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22443 CYTHON_FALLTHROUGH; | |
22444 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22445 CYTHON_FALLTHROUGH; | |
22446 case 0: break; | |
22447 default: goto __pyx_L5_argtuple_error; | |
22448 } | |
22449 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
22450 switch (__pyx_nargs) { | |
22451 case 0: | |
22452 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
22453 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
22454 kw_args--; | |
22455 } | |
22456 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 608, __pyx_L3_error) | |
22457 else goto __pyx_L5_argtuple_error; | |
22458 CYTHON_FALLTHROUGH; | |
22459 case 1: | |
22460 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_GTstring)) != 0)) { | |
22461 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
22462 kw_args--; | |
22463 } | |
22464 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 608, __pyx_L3_error) | |
22465 else { | |
22466 __Pyx_RaiseArgtupleInvalid("convertGT", 1, 2, 2, 1); __PYX_ERR(0, 608, __pyx_L3_error) | |
22467 } | |
22468 } | |
22469 if (unlikely(kw_args > 0)) { | |
22470 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
22471 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convertGT") < 0)) __PYX_ERR(0, 608, __pyx_L3_error) | |
22472 } | |
22473 } else if (unlikely(__pyx_nargs != 2)) { | |
22474 goto __pyx_L5_argtuple_error; | |
22475 } else { | |
22476 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22477 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22478 } | |
22479 __pyx_v_self = values[0]; | |
22480 __pyx_v_GTstring = values[1]; | |
22481 } | |
22482 goto __pyx_L6_skip; | |
22483 __pyx_L5_argtuple_error:; | |
22484 __Pyx_RaiseArgtupleInvalid("convertGT", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 608, __pyx_L3_error) | |
22485 __pyx_L6_skip:; | |
22486 goto __pyx_L4_argument_unpacking_done; | |
22487 __pyx_L3_error:; | |
22488 { | |
22489 Py_ssize_t __pyx_temp; | |
22490 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22491 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22492 } | |
22493 } | |
22494 __Pyx_AddTraceback("pysam.libcvcf.VCF.convertGT", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22495 __Pyx_RefNannyFinishContext(); | |
22496 return NULL; | |
22497 __pyx_L4_argument_unpacking_done:; | |
22498 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_24convertGT(__pyx_self, __pyx_v_self, __pyx_v_GTstring); | |
22499 | |
22500 /* function exit code */ | |
22501 { | |
22502 Py_ssize_t __pyx_temp; | |
22503 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22504 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22505 } | |
22506 } | |
22507 __Pyx_RefNannyFinishContext(); | |
22508 return __pyx_r; | |
22509 } | |
22510 | |
22511 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_24convertGT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_GTstring) { | |
22512 PyObject *__pyx_v_gts = NULL; | |
22513 PyObject *__pyx_r = NULL; | |
22514 __Pyx_RefNannyDeclarations | |
22515 int __pyx_t_1; | |
22516 PyObject *__pyx_t_2 = NULL; | |
22517 PyObject *__pyx_t_3 = NULL; | |
22518 PyObject *__pyx_t_4 = NULL; | |
22519 PyObject *__pyx_t_5 = NULL; | |
22520 PyObject *__pyx_t_6 = NULL; | |
22521 PyObject *__pyx_t_7 = NULL; | |
22522 unsigned int __pyx_t_8; | |
22523 Py_ssize_t __pyx_t_9; | |
22524 int __pyx_t_10; | |
22525 Py_ssize_t __pyx_t_11; | |
22526 PyObject *__pyx_t_12 = NULL; | |
22527 int __pyx_t_13; | |
22528 PyObject *__pyx_t_14 = NULL; | |
22529 PyObject *__pyx_t_15 = NULL; | |
22530 PyObject *__pyx_t_16 = NULL; | |
22531 PyObject *__pyx_t_17 = NULL; | |
22532 int __pyx_lineno = 0; | |
22533 const char *__pyx_filename = NULL; | |
22534 int __pyx_clineno = 0; | |
22535 __Pyx_RefNannySetupContext("convertGT", 1); | |
22536 | |
22537 /* "pysam/libcvcf.pyx":609 | |
22538 * | |
22539 * def convertGT(self, GTstring): | |
22540 * if GTstring == ".": return ["."] # <<<<<<<<<<<<<< | |
22541 * try: | |
22542 * gts = gtsRegEx.split(GTstring) | |
22543 */ | |
22544 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_GTstring, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 609, __pyx_L1_error) | |
22545 if (__pyx_t_1) { | |
22546 __Pyx_XDECREF(__pyx_r); | |
22547 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) | |
22548 __Pyx_GOTREF(__pyx_t_2); | |
22549 __Pyx_INCREF(__pyx_kp_u__5); | |
22550 __Pyx_GIVEREF(__pyx_kp_u__5); | |
22551 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__5)) __PYX_ERR(0, 609, __pyx_L1_error); | |
22552 __pyx_r = __pyx_t_2; | |
22553 __pyx_t_2 = 0; | |
22554 goto __pyx_L0; | |
22555 } | |
22556 | |
22557 /* "pysam/libcvcf.pyx":610 | |
22558 * def convertGT(self, GTstring): | |
22559 * if GTstring == ".": return ["."] | |
22560 * try: # <<<<<<<<<<<<<< | |
22561 * gts = gtsRegEx.split(GTstring) | |
22562 * if len(gts) == 1: return [int(gts[0])] | |
22563 */ | |
22564 { | |
22565 __Pyx_PyThreadState_declare | |
22566 __Pyx_PyThreadState_assign | |
22567 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); | |
22568 __Pyx_XGOTREF(__pyx_t_3); | |
22569 __Pyx_XGOTREF(__pyx_t_4); | |
22570 __Pyx_XGOTREF(__pyx_t_5); | |
22571 /*try:*/ { | |
22572 | |
22573 /* "pysam/libcvcf.pyx":611 | |
22574 * if GTstring == ".": return ["."] | |
22575 * try: | |
22576 * gts = gtsRegEx.split(GTstring) # <<<<<<<<<<<<<< | |
22577 * if len(gts) == 1: return [int(gts[0])] | |
22578 * if len(gts) != 2: raise ValueError() | |
22579 */ | |
22580 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_gtsRegEx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 611, __pyx_L4_error) | |
22581 __Pyx_GOTREF(__pyx_t_6); | |
22582 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L4_error) | |
22583 __Pyx_GOTREF(__pyx_t_7); | |
22584 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
22585 __pyx_t_6 = NULL; | |
22586 __pyx_t_8 = 0; | |
22587 #if CYTHON_UNPACK_METHODS | |
22588 if (unlikely(PyMethod_Check(__pyx_t_7))) { | |
22589 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); | |
22590 if (likely(__pyx_t_6)) { | |
22591 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); | |
22592 __Pyx_INCREF(__pyx_t_6); | |
22593 __Pyx_INCREF(function); | |
22594 __Pyx_DECREF_SET(__pyx_t_7, function); | |
22595 __pyx_t_8 = 1; | |
22596 } | |
22597 } | |
22598 #endif | |
22599 { | |
22600 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_GTstring}; | |
22601 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
22602 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
22603 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L4_error) | |
22604 __Pyx_GOTREF(__pyx_t_2); | |
22605 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
22606 } | |
22607 __pyx_v_gts = __pyx_t_2; | |
22608 __pyx_t_2 = 0; | |
22609 | |
22610 /* "pysam/libcvcf.pyx":612 | |
22611 * try: | |
22612 * gts = gtsRegEx.split(GTstring) | |
22613 * if len(gts) == 1: return [int(gts[0])] # <<<<<<<<<<<<<< | |
22614 * if len(gts) != 2: raise ValueError() | |
22615 * if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]] | |
22616 */ | |
22617 __pyx_t_9 = PyObject_Length(__pyx_v_gts); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 612, __pyx_L4_error) | |
22618 __pyx_t_1 = (__pyx_t_9 == 1); | |
22619 if (__pyx_t_1) { | |
22620 __Pyx_XDECREF(__pyx_r); | |
22621 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L4_error) | |
22622 __Pyx_GOTREF(__pyx_t_2); | |
22623 __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 612, __pyx_L4_error) | |
22624 __Pyx_GOTREF(__pyx_t_7); | |
22625 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22626 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L4_error) | |
22627 __Pyx_GOTREF(__pyx_t_2); | |
22628 __Pyx_GIVEREF(__pyx_t_7); | |
22629 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 612, __pyx_L4_error); | |
22630 __pyx_t_7 = 0; | |
22631 __pyx_r = __pyx_t_2; | |
22632 __pyx_t_2 = 0; | |
22633 goto __pyx_L8_try_return; | |
22634 } | |
22635 | |
22636 /* "pysam/libcvcf.pyx":613 | |
22637 * gts = gtsRegEx.split(GTstring) | |
22638 * if len(gts) == 1: return [int(gts[0])] | |
22639 * if len(gts) != 2: raise ValueError() # <<<<<<<<<<<<<< | |
22640 * if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]] | |
22641 * return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])] | |
22642 */ | |
22643 __pyx_t_9 = PyObject_Length(__pyx_v_gts); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 613, __pyx_L4_error) | |
22644 __pyx_t_1 = (__pyx_t_9 != 2); | |
22645 if (unlikely(__pyx_t_1)) { | |
22646 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L4_error) | |
22647 __Pyx_GOTREF(__pyx_t_2); | |
22648 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
22649 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22650 __PYX_ERR(0, 613, __pyx_L4_error) | |
22651 } | |
22652 | |
22653 /* "pysam/libcvcf.pyx":614 | |
22654 * if len(gts) == 1: return [int(gts[0])] | |
22655 * if len(gts) != 2: raise ValueError() | |
22656 * if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]] # <<<<<<<<<<<<<< | |
22657 * return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])] | |
22658 * except ValueError: | |
22659 */ | |
22660 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L4_error) | |
22661 __Pyx_GOTREF(__pyx_t_2); | |
22662 __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 614, __pyx_L4_error) | |
22663 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22664 if (__pyx_t_10) { | |
22665 } else { | |
22666 __pyx_t_1 = __pyx_t_10; | |
22667 goto __pyx_L13_bool_binop_done; | |
22668 } | |
22669 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L4_error) | |
22670 __Pyx_GOTREF(__pyx_t_2); | |
22671 __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 614, __pyx_L4_error) | |
22672 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22673 __pyx_t_1 = __pyx_t_10; | |
22674 __pyx_L13_bool_binop_done:; | |
22675 if (__pyx_t_1) { | |
22676 __Pyx_XDECREF(__pyx_r); | |
22677 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L4_error) | |
22678 __Pyx_GOTREF(__pyx_t_2); | |
22679 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L4_error) | |
22680 __Pyx_GOTREF(__pyx_t_7); | |
22681 __pyx_t_9 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 614, __pyx_L4_error) | |
22682 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
22683 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L4_error) | |
22684 __Pyx_GOTREF(__pyx_t_7); | |
22685 __pyx_t_11 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 614, __pyx_L4_error) | |
22686 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
22687 __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_GTstring, __pyx_t_9, (-__pyx_t_11), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L4_error) | |
22688 __Pyx_GOTREF(__pyx_t_7); | |
22689 __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 614, __pyx_L4_error) | |
22690 __Pyx_GOTREF(__pyx_t_6); | |
22691 __pyx_t_12 = PyList_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 614, __pyx_L4_error) | |
22692 __Pyx_GOTREF(__pyx_t_12); | |
22693 __Pyx_GIVEREF(__pyx_t_2); | |
22694 if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 614, __pyx_L4_error); | |
22695 __Pyx_GIVEREF(__pyx_t_7); | |
22696 if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_7)) __PYX_ERR(0, 614, __pyx_L4_error); | |
22697 __Pyx_GIVEREF(__pyx_t_6); | |
22698 if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_6)) __PYX_ERR(0, 614, __pyx_L4_error); | |
22699 __pyx_t_2 = 0; | |
22700 __pyx_t_7 = 0; | |
22701 __pyx_t_6 = 0; | |
22702 __pyx_r = __pyx_t_12; | |
22703 __pyx_t_12 = 0; | |
22704 goto __pyx_L8_try_return; | |
22705 } | |
22706 | |
22707 /* "pysam/libcvcf.pyx":615 | |
22708 * if len(gts) != 2: raise ValueError() | |
22709 * if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]] | |
22710 * return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])] # <<<<<<<<<<<<<< | |
22711 * except ValueError: | |
22712 * self.error(self._line,self.BAD_GENOTYPE,GTstring) | |
22713 */ | |
22714 __Pyx_XDECREF(__pyx_r); | |
22715 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L4_error) | |
22716 __Pyx_GOTREF(__pyx_t_12); | |
22717 __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L4_error) | |
22718 __Pyx_GOTREF(__pyx_t_6); | |
22719 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
22720 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L4_error) | |
22721 __Pyx_GOTREF(__pyx_t_12); | |
22722 __pyx_t_11 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 615, __pyx_L4_error) | |
22723 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
22724 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L4_error) | |
22725 __Pyx_GOTREF(__pyx_t_12); | |
22726 __pyx_t_9 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 615, __pyx_L4_error) | |
22727 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
22728 __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_GTstring, __pyx_t_11, (-__pyx_t_9), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L4_error) | |
22729 __Pyx_GOTREF(__pyx_t_12); | |
22730 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L4_error) | |
22731 __Pyx_GOTREF(__pyx_t_7); | |
22732 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L4_error) | |
22733 __Pyx_GOTREF(__pyx_t_2); | |
22734 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
22735 __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L4_error) | |
22736 __Pyx_GOTREF(__pyx_t_7); | |
22737 __Pyx_GIVEREF(__pyx_t_6); | |
22738 if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 615, __pyx_L4_error); | |
22739 __Pyx_GIVEREF(__pyx_t_12); | |
22740 if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_12)) __PYX_ERR(0, 615, __pyx_L4_error); | |
22741 __Pyx_GIVEREF(__pyx_t_2); | |
22742 if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_2)) __PYX_ERR(0, 615, __pyx_L4_error); | |
22743 __pyx_t_6 = 0; | |
22744 __pyx_t_12 = 0; | |
22745 __pyx_t_2 = 0; | |
22746 __pyx_r = __pyx_t_7; | |
22747 __pyx_t_7 = 0; | |
22748 goto __pyx_L8_try_return; | |
22749 | |
22750 /* "pysam/libcvcf.pyx":610 | |
22751 * def convertGT(self, GTstring): | |
22752 * if GTstring == ".": return ["."] | |
22753 * try: # <<<<<<<<<<<<<< | |
22754 * gts = gtsRegEx.split(GTstring) | |
22755 * if len(gts) == 1: return [int(gts[0])] | |
22756 */ | |
22757 } | |
22758 __pyx_L4_error:; | |
22759 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
22760 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22761 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
22762 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
22763 | |
22764 /* "pysam/libcvcf.pyx":616 | |
22765 * if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]] | |
22766 * return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])] | |
22767 * except ValueError: # <<<<<<<<<<<<<< | |
22768 * self.error(self._line,self.BAD_GENOTYPE,GTstring) | |
22769 * return [".","|","."] | |
22770 */ | |
22771 __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); | |
22772 if (__pyx_t_13) { | |
22773 __Pyx_AddTraceback("pysam.libcvcf.VCF.convertGT", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22774 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_2, &__pyx_t_12) < 0) __PYX_ERR(0, 616, __pyx_L6_except_error) | |
22775 __Pyx_XGOTREF(__pyx_t_7); | |
22776 __Pyx_XGOTREF(__pyx_t_2); | |
22777 __Pyx_XGOTREF(__pyx_t_12); | |
22778 | |
22779 /* "pysam/libcvcf.pyx":617 | |
22780 * return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])] | |
22781 * except ValueError: | |
22782 * self.error(self._line,self.BAD_GENOTYPE,GTstring) # <<<<<<<<<<<<<< | |
22783 * return [".","|","."] | |
22784 * | |
22785 */ | |
22786 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 617, __pyx_L6_except_error) | |
22787 __Pyx_GOTREF(__pyx_t_14); | |
22788 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_line_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 617, __pyx_L6_except_error) | |
22789 __Pyx_GOTREF(__pyx_t_15); | |
22790 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BAD_GENOTYPE); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 617, __pyx_L6_except_error) | |
22791 __Pyx_GOTREF(__pyx_t_16); | |
22792 __pyx_t_17 = NULL; | |
22793 __pyx_t_8 = 0; | |
22794 #if CYTHON_UNPACK_METHODS | |
22795 if (likely(PyMethod_Check(__pyx_t_14))) { | |
22796 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_14); | |
22797 if (likely(__pyx_t_17)) { | |
22798 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); | |
22799 __Pyx_INCREF(__pyx_t_17); | |
22800 __Pyx_INCREF(function); | |
22801 __Pyx_DECREF_SET(__pyx_t_14, function); | |
22802 __pyx_t_8 = 1; | |
22803 } | |
22804 } | |
22805 #endif | |
22806 { | |
22807 PyObject *__pyx_callargs[4] = {__pyx_t_17, __pyx_t_15, __pyx_t_16, __pyx_v_GTstring}; | |
22808 __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); | |
22809 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; | |
22810 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
22811 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
22812 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __pyx_L6_except_error) | |
22813 __Pyx_GOTREF(__pyx_t_6); | |
22814 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; | |
22815 } | |
22816 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
22817 | |
22818 /* "pysam/libcvcf.pyx":618 | |
22819 * except ValueError: | |
22820 * self.error(self._line,self.BAD_GENOTYPE,GTstring) | |
22821 * return [".","|","."] # <<<<<<<<<<<<<< | |
22822 * | |
22823 * def convertGTback(self, GTdata): | |
22824 */ | |
22825 __Pyx_XDECREF(__pyx_r); | |
22826 __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L6_except_error) | |
22827 __Pyx_GOTREF(__pyx_t_6); | |
22828 __Pyx_INCREF(__pyx_kp_u__5); | |
22829 __Pyx_GIVEREF(__pyx_kp_u__5); | |
22830 if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__5)) __PYX_ERR(0, 618, __pyx_L6_except_error); | |
22831 __Pyx_INCREF(__pyx_kp_u__27); | |
22832 __Pyx_GIVEREF(__pyx_kp_u__27); | |
22833 if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__27)) __PYX_ERR(0, 618, __pyx_L6_except_error); | |
22834 __Pyx_INCREF(__pyx_kp_u__5); | |
22835 __Pyx_GIVEREF(__pyx_kp_u__5); | |
22836 if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__5)) __PYX_ERR(0, 618, __pyx_L6_except_error); | |
22837 __pyx_r = __pyx_t_6; | |
22838 __pyx_t_6 = 0; | |
22839 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22840 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
22841 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
22842 goto __pyx_L7_except_return; | |
22843 } | |
22844 goto __pyx_L6_except_error; | |
22845 | |
22846 /* "pysam/libcvcf.pyx":610 | |
22847 * def convertGT(self, GTstring): | |
22848 * if GTstring == ".": return ["."] | |
22849 * try: # <<<<<<<<<<<<<< | |
22850 * gts = gtsRegEx.split(GTstring) | |
22851 * if len(gts) == 1: return [int(gts[0])] | |
22852 */ | |
22853 __pyx_L6_except_error:; | |
22854 __Pyx_XGIVEREF(__pyx_t_3); | |
22855 __Pyx_XGIVEREF(__pyx_t_4); | |
22856 __Pyx_XGIVEREF(__pyx_t_5); | |
22857 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); | |
22858 goto __pyx_L1_error; | |
22859 __pyx_L8_try_return:; | |
22860 __Pyx_XGIVEREF(__pyx_t_3); | |
22861 __Pyx_XGIVEREF(__pyx_t_4); | |
22862 __Pyx_XGIVEREF(__pyx_t_5); | |
22863 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); | |
22864 goto __pyx_L0; | |
22865 __pyx_L7_except_return:; | |
22866 __Pyx_XGIVEREF(__pyx_t_3); | |
22867 __Pyx_XGIVEREF(__pyx_t_4); | |
22868 __Pyx_XGIVEREF(__pyx_t_5); | |
22869 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); | |
22870 goto __pyx_L0; | |
22871 } | |
22872 | |
22873 /* "pysam/libcvcf.pyx":608 | |
22874 * stream.write("#" + "\t".join(self._required + self._samples) + "\n") | |
22875 * | |
22876 * def convertGT(self, GTstring): # <<<<<<<<<<<<<< | |
22877 * if GTstring == ".": return ["."] | |
22878 * try: | |
22879 */ | |
22880 | |
22881 /* function exit code */ | |
22882 __pyx_L1_error:; | |
22883 __Pyx_XDECREF(__pyx_t_2); | |
22884 __Pyx_XDECREF(__pyx_t_6); | |
22885 __Pyx_XDECREF(__pyx_t_7); | |
22886 __Pyx_XDECREF(__pyx_t_12); | |
22887 __Pyx_XDECREF(__pyx_t_14); | |
22888 __Pyx_XDECREF(__pyx_t_15); | |
22889 __Pyx_XDECREF(__pyx_t_16); | |
22890 __Pyx_XDECREF(__pyx_t_17); | |
22891 __Pyx_AddTraceback("pysam.libcvcf.VCF.convertGT", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22892 __pyx_r = NULL; | |
22893 __pyx_L0:; | |
22894 __Pyx_XDECREF(__pyx_v_gts); | |
22895 __Pyx_XGIVEREF(__pyx_r); | |
22896 __Pyx_RefNannyFinishContext(); | |
22897 return __pyx_r; | |
22898 } | |
22899 | |
22900 /* "pysam/libcvcf.pyx":620 | |
22901 * return [".","|","."] | |
22902 * | |
22903 * def convertGTback(self, GTdata): # <<<<<<<<<<<<<< | |
22904 * return ''.join(map(str,GTdata)) | |
22905 * | |
22906 */ | |
22907 | |
22908 /* Python wrapper */ | |
22909 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_27convertGTback(PyObject *__pyx_self, | |
22910 #if CYTHON_METH_FASTCALL | |
22911 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22912 #else | |
22913 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22914 #endif | |
22915 ); /*proto*/ | |
22916 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_26convertGTback, "VCF.convertGTback(self, GTdata)"); | |
22917 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_27convertGTback = {"convertGTback", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_27convertGTback, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_26convertGTback}; | |
22918 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_27convertGTback(PyObject *__pyx_self, | |
22919 #if CYTHON_METH_FASTCALL | |
22920 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22921 #else | |
22922 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22923 #endif | |
22924 ) { | |
22925 CYTHON_UNUSED PyObject *__pyx_v_self = 0; | |
22926 PyObject *__pyx_v_GTdata = 0; | |
22927 #if !CYTHON_METH_FASTCALL | |
22928 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
22929 #endif | |
22930 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
22931 PyObject* values[2] = {0,0}; | |
22932 int __pyx_lineno = 0; | |
22933 const char *__pyx_filename = NULL; | |
22934 int __pyx_clineno = 0; | |
22935 PyObject *__pyx_r = 0; | |
22936 __Pyx_RefNannyDeclarations | |
22937 __Pyx_RefNannySetupContext("convertGTback (wrapper)", 0); | |
22938 #if !CYTHON_METH_FASTCALL | |
22939 #if CYTHON_ASSUME_SAFE_MACROS | |
22940 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
22941 #else | |
22942 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
22943 #endif | |
22944 #endif | |
22945 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
22946 { | |
22947 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_GTdata,0}; | |
22948 if (__pyx_kwds) { | |
22949 Py_ssize_t kw_args; | |
22950 switch (__pyx_nargs) { | |
22951 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22952 CYTHON_FALLTHROUGH; | |
22953 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22954 CYTHON_FALLTHROUGH; | |
22955 case 0: break; | |
22956 default: goto __pyx_L5_argtuple_error; | |
22957 } | |
22958 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
22959 switch (__pyx_nargs) { | |
22960 case 0: | |
22961 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
22962 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
22963 kw_args--; | |
22964 } | |
22965 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) | |
22966 else goto __pyx_L5_argtuple_error; | |
22967 CYTHON_FALLTHROUGH; | |
22968 case 1: | |
22969 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_GTdata)) != 0)) { | |
22970 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
22971 kw_args--; | |
22972 } | |
22973 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L3_error) | |
22974 else { | |
22975 __Pyx_RaiseArgtupleInvalid("convertGTback", 1, 2, 2, 1); __PYX_ERR(0, 620, __pyx_L3_error) | |
22976 } | |
22977 } | |
22978 if (unlikely(kw_args > 0)) { | |
22979 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
22980 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convertGTback") < 0)) __PYX_ERR(0, 620, __pyx_L3_error) | |
22981 } | |
22982 } else if (unlikely(__pyx_nargs != 2)) { | |
22983 goto __pyx_L5_argtuple_error; | |
22984 } else { | |
22985 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22986 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22987 } | |
22988 __pyx_v_self = values[0]; | |
22989 __pyx_v_GTdata = values[1]; | |
22990 } | |
22991 goto __pyx_L6_skip; | |
22992 __pyx_L5_argtuple_error:; | |
22993 __Pyx_RaiseArgtupleInvalid("convertGTback", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 620, __pyx_L3_error) | |
22994 __pyx_L6_skip:; | |
22995 goto __pyx_L4_argument_unpacking_done; | |
22996 __pyx_L3_error:; | |
22997 { | |
22998 Py_ssize_t __pyx_temp; | |
22999 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
23000 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
23001 } | |
23002 } | |
23003 __Pyx_AddTraceback("pysam.libcvcf.VCF.convertGTback", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23004 __Pyx_RefNannyFinishContext(); | |
23005 return NULL; | |
23006 __pyx_L4_argument_unpacking_done:; | |
23007 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_26convertGTback(__pyx_self, __pyx_v_self, __pyx_v_GTdata); | |
23008 | |
23009 /* function exit code */ | |
23010 { | |
23011 Py_ssize_t __pyx_temp; | |
23012 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
23013 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
23014 } | |
23015 } | |
23016 __Pyx_RefNannyFinishContext(); | |
23017 return __pyx_r; | |
23018 } | |
23019 | |
23020 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_26convertGTback(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_GTdata) { | |
23021 PyObject *__pyx_r = NULL; | |
23022 __Pyx_RefNannyDeclarations | |
23023 PyObject *__pyx_t_1 = NULL; | |
23024 PyObject *__pyx_t_2 = NULL; | |
23025 int __pyx_lineno = 0; | |
23026 const char *__pyx_filename = NULL; | |
23027 int __pyx_clineno = 0; | |
23028 __Pyx_RefNannySetupContext("convertGTback", 1); | |
23029 | |
23030 /* "pysam/libcvcf.pyx":621 | |
23031 * | |
23032 * def convertGTback(self, GTdata): | |
23033 * return ''.join(map(str,GTdata)) # <<<<<<<<<<<<<< | |
23034 * | |
23035 * def parse_formatdata( self, key, value, formatdict, line ): | |
23036 */ | |
23037 __Pyx_XDECREF(__pyx_r); | |
23038 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error) | |
23039 __Pyx_GOTREF(__pyx_t_1); | |
23040 __Pyx_INCREF((PyObject *)(&PyUnicode_Type)); | |
23041 __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type)); | |
23042 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyUnicode_Type)))) __PYX_ERR(0, 621, __pyx_L1_error); | |
23043 __Pyx_INCREF(__pyx_v_GTdata); | |
23044 __Pyx_GIVEREF(__pyx_v_GTdata); | |
23045 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_GTdata)) __PYX_ERR(0, 621, __pyx_L1_error); | |
23046 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) | |
23047 __Pyx_GOTREF(__pyx_t_2); | |
23048 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23049 __pyx_t_1 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error) | |
23050 __Pyx_GOTREF(__pyx_t_1); | |
23051 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23052 __pyx_r = __pyx_t_1; | |
23053 __pyx_t_1 = 0; | |
23054 goto __pyx_L0; | |
23055 | |
23056 /* "pysam/libcvcf.pyx":620 | |
23057 * return [".","|","."] | |
23058 * | |
23059 * def convertGTback(self, GTdata): # <<<<<<<<<<<<<< | |
23060 * return ''.join(map(str,GTdata)) | |
23061 * | |
23062 */ | |
23063 | |
23064 /* function exit code */ | |
23065 __pyx_L1_error:; | |
23066 __Pyx_XDECREF(__pyx_t_1); | |
23067 __Pyx_XDECREF(__pyx_t_2); | |
23068 __Pyx_AddTraceback("pysam.libcvcf.VCF.convertGTback", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23069 __pyx_r = NULL; | |
23070 __pyx_L0:; | |
23071 __Pyx_XGIVEREF(__pyx_r); | |
23072 __Pyx_RefNannyFinishContext(); | |
23073 return __pyx_r; | |
23074 } | |
23075 | |
23076 /* "pysam/libcvcf.pyx":623 | |
23077 * return ''.join(map(str,GTdata)) | |
23078 * | |
23079 * def parse_formatdata( self, key, value, formatdict, line ): # <<<<<<<<<<<<<< | |
23080 * # To do: check that the right number of values is present | |
23081 * f = formatdict.get(key,None) | |
23082 */ | |
23083 | |
23084 /* Python wrapper */ | |
23085 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_29parse_formatdata(PyObject *__pyx_self, | |
23086 #if CYTHON_METH_FASTCALL | |
23087 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
23088 #else | |
23089 PyObject *__pyx_args, PyObject *__pyx_kwds | |
23090 #endif | |
23091 ); /*proto*/ | |
23092 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_28parse_formatdata, "VCF.parse_formatdata(self, key, value, formatdict, line)"); | |
23093 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_29parse_formatdata = {"parse_formatdata", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_29parse_formatdata, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_28parse_formatdata}; | |
23094 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_29parse_formatdata(PyObject *__pyx_self, | |
23095 #if CYTHON_METH_FASTCALL | |
23096 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
23097 #else | |
23098 PyObject *__pyx_args, PyObject *__pyx_kwds | |
23099 #endif | |
23100 ) { | |
23101 PyObject *__pyx_v_self = 0; | |
23102 PyObject *__pyx_v_key = 0; | |
23103 PyObject *__pyx_v_value = 0; | |
23104 PyObject *__pyx_v_formatdict = 0; | |
23105 PyObject *__pyx_v_line = 0; | |
23106 #if !CYTHON_METH_FASTCALL | |
23107 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
23108 #endif | |
23109 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
23110 PyObject* values[5] = {0,0,0,0,0}; | |
23111 int __pyx_lineno = 0; | |
23112 const char *__pyx_filename = NULL; | |
23113 int __pyx_clineno = 0; | |
23114 PyObject *__pyx_r = 0; | |
23115 __Pyx_RefNannyDeclarations | |
23116 __Pyx_RefNannySetupContext("parse_formatdata (wrapper)", 0); | |
23117 #if !CYTHON_METH_FASTCALL | |
23118 #if CYTHON_ASSUME_SAFE_MACROS | |
23119 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
23120 #else | |
23121 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
23122 #endif | |
23123 #endif | |
23124 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
23125 { | |
23126 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_formatdict,&__pyx_n_s_line,0}; | |
23127 if (__pyx_kwds) { | |
23128 Py_ssize_t kw_args; | |
23129 switch (__pyx_nargs) { | |
23130 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
23131 CYTHON_FALLTHROUGH; | |
23132 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
23133 CYTHON_FALLTHROUGH; | |
23134 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
23135 CYTHON_FALLTHROUGH; | |
23136 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
23137 CYTHON_FALLTHROUGH; | |
23138 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
23139 CYTHON_FALLTHROUGH; | |
23140 case 0: break; | |
23141 default: goto __pyx_L5_argtuple_error; | |
23142 } | |
23143 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
23144 switch (__pyx_nargs) { | |
23145 case 0: | |
23146 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
23147 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
23148 kw_args--; | |
23149 } | |
23150 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L3_error) | |
23151 else goto __pyx_L5_argtuple_error; | |
23152 CYTHON_FALLTHROUGH; | |
23153 case 1: | |
23154 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { | |
23155 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
23156 kw_args--; | |
23157 } | |
23158 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L3_error) | |
23159 else { | |
23160 __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 1); __PYX_ERR(0, 623, __pyx_L3_error) | |
23161 } | |
23162 CYTHON_FALLTHROUGH; | |
23163 case 2: | |
23164 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { | |
23165 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
23166 kw_args--; | |
23167 } | |
23168 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L3_error) | |
23169 else { | |
23170 __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 2); __PYX_ERR(0, 623, __pyx_L3_error) | |
23171 } | |
23172 CYTHON_FALLTHROUGH; | |
23173 case 3: | |
23174 if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_formatdict)) != 0)) { | |
23175 (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); | |
23176 kw_args--; | |
23177 } | |
23178 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L3_error) | |
23179 else { | |
23180 __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 3); __PYX_ERR(0, 623, __pyx_L3_error) | |
23181 } | |
23182 CYTHON_FALLTHROUGH; | |
23183 case 4: | |
23184 if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line)) != 0)) { | |
23185 (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); | |
23186 kw_args--; | |
23187 } | |
23188 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L3_error) | |
23189 else { | |
23190 __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 4); __PYX_ERR(0, 623, __pyx_L3_error) | |
23191 } | |
23192 } | |
23193 if (unlikely(kw_args > 0)) { | |
23194 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
23195 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_formatdata") < 0)) __PYX_ERR(0, 623, __pyx_L3_error) | |
23196 } | |
23197 } else if (unlikely(__pyx_nargs != 5)) { | |
23198 goto __pyx_L5_argtuple_error; | |
23199 } else { | |
23200 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
23201 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
23202 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
23203 values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
23204 values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
23205 } | |
23206 __pyx_v_self = values[0]; | |
23207 __pyx_v_key = values[1]; | |
23208 __pyx_v_value = values[2]; | |
23209 __pyx_v_formatdict = values[3]; | |
23210 __pyx_v_line = values[4]; | |
23211 } | |
23212 goto __pyx_L6_skip; | |
23213 __pyx_L5_argtuple_error:; | |
23214 __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 623, __pyx_L3_error) | |
23215 __pyx_L6_skip:; | |
23216 goto __pyx_L4_argument_unpacking_done; | |
23217 __pyx_L3_error:; | |
23218 { | |
23219 Py_ssize_t __pyx_temp; | |
23220 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
23221 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
23222 } | |
23223 } | |
23224 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23225 __Pyx_RefNannyFinishContext(); | |
23226 return NULL; | |
23227 __pyx_L4_argument_unpacking_done:; | |
23228 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_28parse_formatdata(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_formatdict, __pyx_v_line); | |
23229 | |
23230 /* function exit code */ | |
23231 { | |
23232 Py_ssize_t __pyx_temp; | |
23233 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
23234 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
23235 } | |
23236 } | |
23237 __Pyx_RefNannyFinishContext(); | |
23238 return __pyx_r; | |
23239 } | |
23240 | |
23241 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_28parse_formatdata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_line) { | |
23242 PyObject *__pyx_v_f = NULL; | |
23243 PyObject *__pyx_v_values = NULL; | |
23244 PyObject *__pyx_v_idx = NULL; | |
23245 PyObject *__pyx_v_v = NULL; | |
23246 PyObject *__pyx_r = NULL; | |
23247 __Pyx_RefNannyDeclarations | |
23248 PyObject *__pyx_t_1 = NULL; | |
23249 PyObject *__pyx_t_2 = NULL; | |
23250 PyObject *__pyx_t_3 = NULL; | |
23251 unsigned int __pyx_t_4; | |
23252 int __pyx_t_5; | |
23253 PyObject *__pyx_t_6 = NULL; | |
23254 int __pyx_t_7; | |
23255 int __pyx_t_8; | |
23256 Py_ssize_t __pyx_t_9; | |
23257 PyObject *__pyx_t_10 = NULL; | |
23258 PyObject *(*__pyx_t_11)(PyObject *); | |
23259 PyObject *__pyx_t_12 = NULL; | |
23260 PyObject *__pyx_t_13 = NULL; | |
23261 PyObject *__pyx_t_14 = NULL; | |
23262 PyObject *__pyx_t_15 = NULL; | |
23263 PyObject *__pyx_t_16 = NULL; | |
23264 PyObject *__pyx_t_17 = NULL; | |
23265 PyObject *__pyx_t_18 = NULL; | |
23266 Py_ssize_t __pyx_t_19; | |
23267 Py_UCS4 __pyx_t_20; | |
23268 PyObject *__pyx_t_21 = NULL; | |
23269 int __pyx_lineno = 0; | |
23270 const char *__pyx_filename = NULL; | |
23271 int __pyx_clineno = 0; | |
23272 __Pyx_RefNannySetupContext("parse_formatdata", 1); | |
23273 | |
23274 /* "pysam/libcvcf.pyx":625 | |
23275 * def parse_formatdata( self, key, value, formatdict, line ): | |
23276 * # To do: check that the right number of values is present | |
23277 * f = formatdict.get(key,None) # <<<<<<<<<<<<<< | |
23278 * if f == None: | |
23279 * self._add_definition(formatdict, key, value, line ) | |
23280 */ | |
23281 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_formatdict, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error) | |
23282 __Pyx_GOTREF(__pyx_t_2); | |
23283 __pyx_t_3 = NULL; | |
23284 __pyx_t_4 = 0; | |
23285 #if CYTHON_UNPACK_METHODS | |
23286 if (likely(PyMethod_Check(__pyx_t_2))) { | |
23287 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
23288 if (likely(__pyx_t_3)) { | |
23289 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
23290 __Pyx_INCREF(__pyx_t_3); | |
23291 __Pyx_INCREF(function); | |
23292 __Pyx_DECREF_SET(__pyx_t_2, function); | |
23293 __pyx_t_4 = 1; | |
23294 } | |
23295 } | |
23296 #endif | |
23297 { | |
23298 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_key, Py_None}; | |
23299 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
23300 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23301 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error) | |
23302 __Pyx_GOTREF(__pyx_t_1); | |
23303 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23304 } | |
23305 __pyx_v_f = __pyx_t_1; | |
23306 __pyx_t_1 = 0; | |
23307 | |
23308 /* "pysam/libcvcf.pyx":626 | |
23309 * # To do: check that the right number of values is present | |
23310 * f = formatdict.get(key,None) | |
23311 * if f == None: # <<<<<<<<<<<<<< | |
23312 * self._add_definition(formatdict, key, value, line ) | |
23313 * f = formatdict[key] | |
23314 */ | |
23315 __pyx_t_1 = PyObject_RichCompare(__pyx_v_f, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) | |
23316 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 626, __pyx_L1_error) | |
23317 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23318 if (__pyx_t_5) { | |
23319 | |
23320 /* "pysam/libcvcf.pyx":627 | |
23321 * f = formatdict.get(key,None) | |
23322 * if f == None: | |
23323 * self._add_definition(formatdict, key, value, line ) # <<<<<<<<<<<<<< | |
23324 * f = formatdict[key] | |
23325 * if f.type == "Flag": | |
23326 */ | |
23327 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_definition); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error) | |
23328 __Pyx_GOTREF(__pyx_t_2); | |
23329 __pyx_t_3 = NULL; | |
23330 __pyx_t_4 = 0; | |
23331 #if CYTHON_UNPACK_METHODS | |
23332 if (likely(PyMethod_Check(__pyx_t_2))) { | |
23333 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
23334 if (likely(__pyx_t_3)) { | |
23335 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
23336 __Pyx_INCREF(__pyx_t_3); | |
23337 __Pyx_INCREF(function); | |
23338 __Pyx_DECREF_SET(__pyx_t_2, function); | |
23339 __pyx_t_4 = 1; | |
23340 } | |
23341 } | |
23342 #endif | |
23343 { | |
23344 PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_formatdict, __pyx_v_key, __pyx_v_value, __pyx_v_line}; | |
23345 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
23346 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23347 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) | |
23348 __Pyx_GOTREF(__pyx_t_1); | |
23349 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23350 } | |
23351 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23352 | |
23353 /* "pysam/libcvcf.pyx":628 | |
23354 * if f == None: | |
23355 * self._add_definition(formatdict, key, value, line ) | |
23356 * f = formatdict[key] # <<<<<<<<<<<<<< | |
23357 * if f.type == "Flag": | |
23358 * if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE) | |
23359 */ | |
23360 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_formatdict, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) | |
23361 __Pyx_GOTREF(__pyx_t_1); | |
23362 __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_1); | |
23363 __pyx_t_1 = 0; | |
23364 | |
23365 /* "pysam/libcvcf.pyx":626 | |
23366 * # To do: check that the right number of values is present | |
23367 * f = formatdict.get(key,None) | |
23368 * if f == None: # <<<<<<<<<<<<<< | |
23369 * self._add_definition(formatdict, key, value, line ) | |
23370 * f = formatdict[key] | |
23371 */ | |
23372 } | |
23373 | |
23374 /* "pysam/libcvcf.pyx":629 | |
23375 * self._add_definition(formatdict, key, value, line ) | |
23376 * f = formatdict[key] | |
23377 * if f.type == "Flag": # <<<<<<<<<<<<<< | |
23378 * if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE) | |
23379 * return [] | |
23380 */ | |
23381 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error) | |
23382 __Pyx_GOTREF(__pyx_t_1); | |
23383 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_Flag, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 629, __pyx_L1_error) | |
23384 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23385 if (__pyx_t_5) { | |
23386 | |
23387 /* "pysam/libcvcf.pyx":630 | |
23388 * f = formatdict[key] | |
23389 * if f.type == "Flag": | |
23390 * if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE) # <<<<<<<<<<<<<< | |
23391 * return [] | |
23392 * values = value.split(',') | |
23393 */ | |
23394 __pyx_t_5 = (__pyx_v_value != Py_None); | |
23395 if (__pyx_t_5) { | |
23396 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error) | |
23397 __Pyx_GOTREF(__pyx_t_2); | |
23398 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_FLAG_HAS_VALUE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) | |
23399 __Pyx_GOTREF(__pyx_t_3); | |
23400 __pyx_t_6 = NULL; | |
23401 __pyx_t_4 = 0; | |
23402 #if CYTHON_UNPACK_METHODS | |
23403 if (likely(PyMethod_Check(__pyx_t_2))) { | |
23404 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); | |
23405 if (likely(__pyx_t_6)) { | |
23406 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
23407 __Pyx_INCREF(__pyx_t_6); | |
23408 __Pyx_INCREF(function); | |
23409 __Pyx_DECREF_SET(__pyx_t_2, function); | |
23410 __pyx_t_4 = 1; | |
23411 } | |
23412 } | |
23413 #endif | |
23414 { | |
23415 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_line, __pyx_t_3}; | |
23416 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
23417 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23418 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23419 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) | |
23420 __Pyx_GOTREF(__pyx_t_1); | |
23421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23422 } | |
23423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23424 } | |
23425 | |
23426 /* "pysam/libcvcf.pyx":631 | |
23427 * if f.type == "Flag": | |
23428 * if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE) | |
23429 * return [] # <<<<<<<<<<<<<< | |
23430 * values = value.split(',') | |
23431 * # deal with trailing data in some early VCF files | |
23432 */ | |
23433 __Pyx_XDECREF(__pyx_r); | |
23434 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error) | |
23435 __Pyx_GOTREF(__pyx_t_1); | |
23436 __pyx_r = __pyx_t_1; | |
23437 __pyx_t_1 = 0; | |
23438 goto __pyx_L0; | |
23439 | |
23440 /* "pysam/libcvcf.pyx":629 | |
23441 * self._add_definition(formatdict, key, value, line ) | |
23442 * f = formatdict[key] | |
23443 * if f.type == "Flag": # <<<<<<<<<<<<<< | |
23444 * if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE) | |
23445 * return [] | |
23446 */ | |
23447 } | |
23448 | |
23449 /* "pysam/libcvcf.pyx":632 | |
23450 * if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE) | |
23451 * return [] | |
23452 * values = value.split(',') # <<<<<<<<<<<<<< | |
23453 * # deal with trailing data in some early VCF files | |
23454 * if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1: | |
23455 */ | |
23456 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) | |
23457 __Pyx_GOTREF(__pyx_t_2); | |
23458 __pyx_t_3 = NULL; | |
23459 __pyx_t_4 = 0; | |
23460 #if CYTHON_UNPACK_METHODS | |
23461 if (likely(PyMethod_Check(__pyx_t_2))) { | |
23462 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
23463 if (likely(__pyx_t_3)) { | |
23464 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
23465 __Pyx_INCREF(__pyx_t_3); | |
23466 __Pyx_INCREF(function); | |
23467 __Pyx_DECREF_SET(__pyx_t_2, function); | |
23468 __pyx_t_4 = 1; | |
23469 } | |
23470 } | |
23471 #endif | |
23472 { | |
23473 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__2}; | |
23474 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
23475 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23476 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) | |
23477 __Pyx_GOTREF(__pyx_t_1); | |
23478 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23479 } | |
23480 __pyx_v_values = __pyx_t_1; | |
23481 __pyx_t_1 = 0; | |
23482 | |
23483 /* "pysam/libcvcf.pyx":634 | |
23484 * values = value.split(',') | |
23485 * # deal with trailing data in some early VCF files | |
23486 * if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1: # <<<<<<<<<<<<<< | |
23487 * self.error(line,self.ERROR_TRAILING_DATA,values[-1]) | |
23488 * values[-1] = values[-1].split(';')[0] | |
23489 */ | |
23490 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) | |
23491 __Pyx_GOTREF(__pyx_t_1); | |
23492 __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_Float, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) | |
23493 if (!__pyx_t_8) { | |
23494 } else { | |
23495 __pyx_t_7 = __pyx_t_8; | |
23496 goto __pyx_L9_bool_binop_done; | |
23497 } | |
23498 __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_Integer, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) | |
23499 __pyx_t_7 = __pyx_t_8; | |
23500 __pyx_L9_bool_binop_done:; | |
23501 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23502 __pyx_t_8 = __pyx_t_7; | |
23503 if (__pyx_t_8) { | |
23504 } else { | |
23505 __pyx_t_5 = __pyx_t_8; | |
23506 goto __pyx_L7_bool_binop_done; | |
23507 } | |
23508 __pyx_t_9 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 634, __pyx_L1_error) | |
23509 __pyx_t_8 = (__pyx_t_9 > 0); | |
23510 if (__pyx_t_8) { | |
23511 } else { | |
23512 __pyx_t_5 = __pyx_t_8; | |
23513 goto __pyx_L7_bool_binop_done; | |
23514 } | |
23515 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) | |
23516 __Pyx_GOTREF(__pyx_t_2); | |
23517 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_find); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) | |
23518 __Pyx_GOTREF(__pyx_t_3); | |
23519 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23520 __pyx_t_2 = NULL; | |
23521 __pyx_t_4 = 0; | |
23522 #if CYTHON_UNPACK_METHODS | |
23523 if (likely(PyMethod_Check(__pyx_t_3))) { | |
23524 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); | |
23525 if (likely(__pyx_t_2)) { | |
23526 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
23527 __Pyx_INCREF(__pyx_t_2); | |
23528 __Pyx_INCREF(function); | |
23529 __Pyx_DECREF_SET(__pyx_t_3, function); | |
23530 __pyx_t_4 = 1; | |
23531 } | |
23532 } | |
23533 #endif | |
23534 { | |
23535 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u__6}; | |
23536 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
23537 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23538 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) | |
23539 __Pyx_GOTREF(__pyx_t_1); | |
23540 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23541 } | |
23542 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) | |
23543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23544 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) | |
23545 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23546 __pyx_t_5 = __pyx_t_8; | |
23547 __pyx_L7_bool_binop_done:; | |
23548 if (__pyx_t_5) { | |
23549 | |
23550 /* "pysam/libcvcf.pyx":635 | |
23551 * # deal with trailing data in some early VCF files | |
23552 * if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1: | |
23553 * self.error(line,self.ERROR_TRAILING_DATA,values[-1]) # <<<<<<<<<<<<<< | |
23554 * values[-1] = values[-1].split(';')[0] | |
23555 * if f.type == "Integer": | |
23556 */ | |
23557 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) | |
23558 __Pyx_GOTREF(__pyx_t_1); | |
23559 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_TRAILING_DATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error) | |
23560 __Pyx_GOTREF(__pyx_t_2); | |
23561 __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_values, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error) | |
23562 __Pyx_GOTREF(__pyx_t_6); | |
23563 __pyx_t_10 = NULL; | |
23564 __pyx_t_4 = 0; | |
23565 #if CYTHON_UNPACK_METHODS | |
23566 if (likely(PyMethod_Check(__pyx_t_1))) { | |
23567 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); | |
23568 if (likely(__pyx_t_10)) { | |
23569 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
23570 __Pyx_INCREF(__pyx_t_10); | |
23571 __Pyx_INCREF(function); | |
23572 __Pyx_DECREF_SET(__pyx_t_1, function); | |
23573 __pyx_t_4 = 1; | |
23574 } | |
23575 } | |
23576 #endif | |
23577 { | |
23578 PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_line, __pyx_t_2, __pyx_t_6}; | |
23579 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
23580 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; | |
23581 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23582 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23583 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) | |
23584 __Pyx_GOTREF(__pyx_t_3); | |
23585 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23586 } | |
23587 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23588 | |
23589 /* "pysam/libcvcf.pyx":636 | |
23590 * if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1: | |
23591 * self.error(line,self.ERROR_TRAILING_DATA,values[-1]) | |
23592 * values[-1] = values[-1].split(';')[0] # <<<<<<<<<<<<<< | |
23593 * if f.type == "Integer": | |
23594 * for idx,v in enumerate(values): | |
23595 */ | |
23596 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_values, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) | |
23597 __Pyx_GOTREF(__pyx_t_1); | |
23598 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error) | |
23599 __Pyx_GOTREF(__pyx_t_6); | |
23600 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23601 __pyx_t_1 = NULL; | |
23602 __pyx_t_4 = 0; | |
23603 #if CYTHON_UNPACK_METHODS | |
23604 if (likely(PyMethod_Check(__pyx_t_6))) { | |
23605 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); | |
23606 if (likely(__pyx_t_1)) { | |
23607 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
23608 __Pyx_INCREF(__pyx_t_1); | |
23609 __Pyx_INCREF(function); | |
23610 __Pyx_DECREF_SET(__pyx_t_6, function); | |
23611 __pyx_t_4 = 1; | |
23612 } | |
23613 } | |
23614 #endif | |
23615 { | |
23616 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u__6}; | |
23617 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
23618 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23619 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) | |
23620 __Pyx_GOTREF(__pyx_t_3); | |
23621 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23622 } | |
23623 __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error) | |
23624 __Pyx_GOTREF(__pyx_t_6); | |
23625 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23626 if (unlikely((__Pyx_SetItemInt(__pyx_v_values, -1L, __pyx_t_6, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0))) __PYX_ERR(0, 636, __pyx_L1_error) | |
23627 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23628 | |
23629 /* "pysam/libcvcf.pyx":634 | |
23630 * values = value.split(',') | |
23631 * # deal with trailing data in some early VCF files | |
23632 * if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1: # <<<<<<<<<<<<<< | |
23633 * self.error(line,self.ERROR_TRAILING_DATA,values[-1]) | |
23634 * values[-1] = values[-1].split(';')[0] | |
23635 */ | |
23636 } | |
23637 | |
23638 /* "pysam/libcvcf.pyx":637 | |
23639 * self.error(line,self.ERROR_TRAILING_DATA,values[-1]) | |
23640 * values[-1] = values[-1].split(';')[0] | |
23641 * if f.type == "Integer": # <<<<<<<<<<<<<< | |
23642 * for idx,v in enumerate(values): | |
23643 * try: | |
23644 */ | |
23645 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error) | |
23646 __Pyx_GOTREF(__pyx_t_6); | |
23647 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_Integer, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 637, __pyx_L1_error) | |
23648 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23649 if (__pyx_t_5) { | |
23650 | |
23651 /* "pysam/libcvcf.pyx":638 | |
23652 * values[-1] = values[-1].split(';')[0] | |
23653 * if f.type == "Integer": | |
23654 * for idx,v in enumerate(values): # <<<<<<<<<<<<<< | |
23655 * try: | |
23656 * if v == ".": values[idx] = f.missingvalue | |
23657 */ | |
23658 __Pyx_INCREF(__pyx_int_0); | |
23659 __pyx_t_6 = __pyx_int_0; | |
23660 if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) { | |
23661 __pyx_t_3 = __pyx_v_values; __Pyx_INCREF(__pyx_t_3); | |
23662 __pyx_t_9 = 0; | |
23663 __pyx_t_11 = NULL; | |
23664 } else { | |
23665 __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) | |
23666 __Pyx_GOTREF(__pyx_t_3); | |
23667 __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 638, __pyx_L1_error) | |
23668 } | |
23669 for (;;) { | |
23670 if (likely(!__pyx_t_11)) { | |
23671 if (likely(PyList_CheckExact(__pyx_t_3))) { | |
23672 { | |
23673 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); | |
23674 #if !CYTHON_ASSUME_SAFE_MACROS | |
23675 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) | |
23676 #endif | |
23677 if (__pyx_t_9 >= __pyx_temp) break; | |
23678 } | |
23679 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
23680 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 638, __pyx_L1_error) | |
23681 #else | |
23682 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) | |
23683 __Pyx_GOTREF(__pyx_t_1); | |
23684 #endif | |
23685 } else { | |
23686 { | |
23687 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); | |
23688 #if !CYTHON_ASSUME_SAFE_MACROS | |
23689 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) | |
23690 #endif | |
23691 if (__pyx_t_9 >= __pyx_temp) break; | |
23692 } | |
23693 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
23694 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 638, __pyx_L1_error) | |
23695 #else | |
23696 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) | |
23697 __Pyx_GOTREF(__pyx_t_1); | |
23698 #endif | |
23699 } | |
23700 } else { | |
23701 __pyx_t_1 = __pyx_t_11(__pyx_t_3); | |
23702 if (unlikely(!__pyx_t_1)) { | |
23703 PyObject* exc_type = PyErr_Occurred(); | |
23704 if (exc_type) { | |
23705 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
23706 else __PYX_ERR(0, 638, __pyx_L1_error) | |
23707 } | |
23708 break; | |
23709 } | |
23710 __Pyx_GOTREF(__pyx_t_1); | |
23711 } | |
23712 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); | |
23713 __pyx_t_1 = 0; | |
23714 __Pyx_INCREF(__pyx_t_6); | |
23715 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_6); | |
23716 __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) | |
23717 __Pyx_GOTREF(__pyx_t_1); | |
23718 __Pyx_DECREF(__pyx_t_6); | |
23719 __pyx_t_6 = __pyx_t_1; | |
23720 __pyx_t_1 = 0; | |
23721 | |
23722 /* "pysam/libcvcf.pyx":639 | |
23723 * if f.type == "Integer": | |
23724 * for idx,v in enumerate(values): | |
23725 * try: # <<<<<<<<<<<<<< | |
23726 * if v == ".": values[idx] = f.missingvalue | |
23727 * else: values[idx] = int(v) | |
23728 */ | |
23729 { | |
23730 __Pyx_PyThreadState_declare | |
23731 __Pyx_PyThreadState_assign | |
23732 __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); | |
23733 __Pyx_XGOTREF(__pyx_t_12); | |
23734 __Pyx_XGOTREF(__pyx_t_13); | |
23735 __Pyx_XGOTREF(__pyx_t_14); | |
23736 /*try:*/ { | |
23737 | |
23738 /* "pysam/libcvcf.pyx":640 | |
23739 * for idx,v in enumerate(values): | |
23740 * try: | |
23741 * if v == ".": values[idx] = f.missingvalue # <<<<<<<<<<<<<< | |
23742 * else: values[idx] = int(v) | |
23743 * except: | |
23744 */ | |
23745 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_v, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 640, __pyx_L15_error) | |
23746 if (__pyx_t_5) { | |
23747 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_missingvalue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L15_error) | |
23748 __Pyx_GOTREF(__pyx_t_1); | |
23749 if (unlikely((PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_1) < 0))) __PYX_ERR(0, 640, __pyx_L15_error) | |
23750 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23751 goto __pyx_L23; | |
23752 } | |
23753 | |
23754 /* "pysam/libcvcf.pyx":641 | |
23755 * try: | |
23756 * if v == ".": values[idx] = f.missingvalue | |
23757 * else: values[idx] = int(v) # <<<<<<<<<<<<<< | |
23758 * except: | |
23759 * self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values))) | |
23760 */ | |
23761 /*else*/ { | |
23762 __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L15_error) | |
23763 __Pyx_GOTREF(__pyx_t_1); | |
23764 if (unlikely((PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_1) < 0))) __PYX_ERR(0, 641, __pyx_L15_error) | |
23765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23766 } | |
23767 __pyx_L23:; | |
23768 | |
23769 /* "pysam/libcvcf.pyx":639 | |
23770 * if f.type == "Integer": | |
23771 * for idx,v in enumerate(values): | |
23772 * try: # <<<<<<<<<<<<<< | |
23773 * if v == ".": values[idx] = f.missingvalue | |
23774 * else: values[idx] = int(v) | |
23775 */ | |
23776 } | |
23777 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
23778 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; | |
23779 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; | |
23780 goto __pyx_L22_try_end; | |
23781 __pyx_L15_error:; | |
23782 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23783 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; | |
23784 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23785 | |
23786 /* "pysam/libcvcf.pyx":642 | |
23787 * if v == ".": values[idx] = f.missingvalue | |
23788 * else: values[idx] = int(v) | |
23789 * except: # <<<<<<<<<<<<<< | |
23790 * self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values))) | |
23791 * return [0] * len(values) | |
23792 */ | |
23793 /*except:*/ { | |
23794 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23795 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(0, 642, __pyx_L17_except_error) | |
23796 __Pyx_XGOTREF(__pyx_t_1); | |
23797 __Pyx_XGOTREF(__pyx_t_2); | |
23798 __Pyx_XGOTREF(__pyx_t_10); | |
23799 | |
23800 /* "pysam/libcvcf.pyx":643 | |
23801 * else: values[idx] = int(v) | |
23802 * except: | |
23803 * self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values))) # <<<<<<<<<<<<<< | |
23804 * return [0] * len(values) | |
23805 * return values | |
23806 */ | |
23807 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 643, __pyx_L17_except_error) | |
23808 __Pyx_GOTREF(__pyx_t_16); | |
23809 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_FORMAT_NOT_INTEGER); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 643, __pyx_L17_except_error) | |
23810 __Pyx_GOTREF(__pyx_t_17); | |
23811 __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 643, __pyx_L17_except_error) | |
23812 __Pyx_GOTREF(__pyx_t_18); | |
23813 __pyx_t_19 = 0; | |
23814 __pyx_t_20 = 127; | |
23815 __pyx_t_21 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 643, __pyx_L17_except_error) | |
23816 __Pyx_GOTREF(__pyx_t_21); | |
23817 __pyx_t_20 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_21) > __pyx_t_20) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_21) : __pyx_t_20; | |
23818 __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_21); | |
23819 __Pyx_GIVEREF(__pyx_t_21); | |
23820 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_21); | |
23821 __pyx_t_21 = 0; | |
23822 __Pyx_INCREF(__pyx_kp_u__7); | |
23823 __pyx_t_19 += 1; | |
23824 __Pyx_GIVEREF(__pyx_kp_u__7); | |
23825 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_kp_u__7); | |
23826 __pyx_t_21 = __Pyx_PyObject_Unicode(__pyx_v_values); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 643, __pyx_L17_except_error) | |
23827 __Pyx_GOTREF(__pyx_t_21); | |
23828 __pyx_t_20 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_21) > __pyx_t_20) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_21) : __pyx_t_20; | |
23829 __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_21); | |
23830 __Pyx_GIVEREF(__pyx_t_21); | |
23831 PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_21); | |
23832 __pyx_t_21 = 0; | |
23833 __pyx_t_21 = __Pyx_PyUnicode_Join(__pyx_t_18, 3, __pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 643, __pyx_L17_except_error) | |
23834 __Pyx_GOTREF(__pyx_t_21); | |
23835 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; | |
23836 __pyx_t_18 = NULL; | |
23837 __pyx_t_4 = 0; | |
23838 #if CYTHON_UNPACK_METHODS | |
23839 if (likely(PyMethod_Check(__pyx_t_16))) { | |
23840 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_16); | |
23841 if (likely(__pyx_t_18)) { | |
23842 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); | |
23843 __Pyx_INCREF(__pyx_t_18); | |
23844 __Pyx_INCREF(function); | |
23845 __Pyx_DECREF_SET(__pyx_t_16, function); | |
23846 __pyx_t_4 = 1; | |
23847 } | |
23848 } | |
23849 #endif | |
23850 { | |
23851 PyObject *__pyx_callargs[4] = {__pyx_t_18, __pyx_v_line, __pyx_t_17, __pyx_t_21}; | |
23852 __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
23853 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; | |
23854 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; | |
23855 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; | |
23856 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 643, __pyx_L17_except_error) | |
23857 __Pyx_GOTREF(__pyx_t_15); | |
23858 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
23859 } | |
23860 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
23861 | |
23862 /* "pysam/libcvcf.pyx":644 | |
23863 * except: | |
23864 * self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values))) | |
23865 * return [0] * len(values) # <<<<<<<<<<<<<< | |
23866 * return values | |
23867 * elif f.type == "String": | |
23868 */ | |
23869 __Pyx_XDECREF(__pyx_r); | |
23870 __pyx_t_19 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 644, __pyx_L17_except_error) | |
23871 __pyx_t_15 = PyList_New(1 * ((__pyx_t_19<0) ? 0:__pyx_t_19)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 644, __pyx_L17_except_error) | |
23872 __Pyx_GOTREF(__pyx_t_15); | |
23873 { Py_ssize_t __pyx_temp; | |
23874 for (__pyx_temp=0; __pyx_temp < __pyx_t_19; __pyx_temp++) { | |
23875 __Pyx_INCREF(__pyx_int_0); | |
23876 __Pyx_GIVEREF(__pyx_int_0); | |
23877 if (__Pyx_PyList_SET_ITEM(__pyx_t_15, __pyx_temp, __pyx_int_0)) __PYX_ERR(0, 644, __pyx_L17_except_error); | |
23878 } | |
23879 } | |
23880 __pyx_r = __pyx_t_15; | |
23881 __pyx_t_15 = 0; | |
23882 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23883 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
23884 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23885 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23886 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
23887 goto __pyx_L18_except_return; | |
23888 } | |
23889 | |
23890 /* "pysam/libcvcf.pyx":639 | |
23891 * if f.type == "Integer": | |
23892 * for idx,v in enumerate(values): | |
23893 * try: # <<<<<<<<<<<<<< | |
23894 * if v == ".": values[idx] = f.missingvalue | |
23895 * else: values[idx] = int(v) | |
23896 */ | |
23897 __pyx_L17_except_error:; | |
23898 __Pyx_XGIVEREF(__pyx_t_12); | |
23899 __Pyx_XGIVEREF(__pyx_t_13); | |
23900 __Pyx_XGIVEREF(__pyx_t_14); | |
23901 __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); | |
23902 goto __pyx_L1_error; | |
23903 __pyx_L18_except_return:; | |
23904 __Pyx_XGIVEREF(__pyx_t_12); | |
23905 __Pyx_XGIVEREF(__pyx_t_13); | |
23906 __Pyx_XGIVEREF(__pyx_t_14); | |
23907 __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); | |
23908 goto __pyx_L0; | |
23909 __pyx_L22_try_end:; | |
23910 } | |
23911 | |
23912 /* "pysam/libcvcf.pyx":638 | |
23913 * values[-1] = values[-1].split(';')[0] | |
23914 * if f.type == "Integer": | |
23915 * for idx,v in enumerate(values): # <<<<<<<<<<<<<< | |
23916 * try: | |
23917 * if v == ".": values[idx] = f.missingvalue | |
23918 */ | |
23919 } | |
23920 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23921 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23922 | |
23923 /* "pysam/libcvcf.pyx":645 | |
23924 * self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values))) | |
23925 * return [0] * len(values) | |
23926 * return values # <<<<<<<<<<<<<< | |
23927 * elif f.type == "String": | |
23928 * self._line = line | |
23929 */ | |
23930 __Pyx_XDECREF(__pyx_r); | |
23931 __Pyx_INCREF(__pyx_v_values); | |
23932 __pyx_r = __pyx_v_values; | |
23933 goto __pyx_L0; | |
23934 | |
23935 /* "pysam/libcvcf.pyx":637 | |
23936 * self.error(line,self.ERROR_TRAILING_DATA,values[-1]) | |
23937 * values[-1] = values[-1].split(';')[0] | |
23938 * if f.type == "Integer": # <<<<<<<<<<<<<< | |
23939 * for idx,v in enumerate(values): | |
23940 * try: | |
23941 */ | |
23942 } | |
23943 | |
23944 /* "pysam/libcvcf.pyx":646 | |
23945 * return [0] * len(values) | |
23946 * return values | |
23947 * elif f.type == "String": # <<<<<<<<<<<<<< | |
23948 * self._line = line | |
23949 * if f.id == "GT": values = list(map( self.convertGT, values )) | |
23950 */ | |
23951 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 646, __pyx_L1_error) | |
23952 __Pyx_GOTREF(__pyx_t_6); | |
23953 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_String, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 646, __pyx_L1_error) | |
23954 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23955 if (__pyx_t_5) { | |
23956 | |
23957 /* "pysam/libcvcf.pyx":647 | |
23958 * return values | |
23959 * elif f.type == "String": | |
23960 * self._line = line # <<<<<<<<<<<<<< | |
23961 * if f.id == "GT": values = list(map( self.convertGT, values )) | |
23962 * return values | |
23963 */ | |
23964 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_line_2, __pyx_v_line) < 0) __PYX_ERR(0, 647, __pyx_L1_error) | |
23965 | |
23966 /* "pysam/libcvcf.pyx":648 | |
23967 * elif f.type == "String": | |
23968 * self._line = line | |
23969 * if f.id == "GT": values = list(map( self.convertGT, values )) # <<<<<<<<<<<<<< | |
23970 * return values | |
23971 * elif f.type == "Character": | |
23972 */ | |
23973 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) | |
23974 __Pyx_GOTREF(__pyx_t_6); | |
23975 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_GT, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 648, __pyx_L1_error) | |
23976 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23977 if (__pyx_t_5) { | |
23978 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_convertGT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) | |
23979 __Pyx_GOTREF(__pyx_t_6); | |
23980 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) | |
23981 __Pyx_GOTREF(__pyx_t_3); | |
23982 __Pyx_GIVEREF(__pyx_t_6); | |
23983 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error); | |
23984 __Pyx_INCREF(__pyx_v_values); | |
23985 __Pyx_GIVEREF(__pyx_v_values); | |
23986 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values)) __PYX_ERR(0, 648, __pyx_L1_error); | |
23987 __pyx_t_6 = 0; | |
23988 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) | |
23989 __Pyx_GOTREF(__pyx_t_6); | |
23990 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23991 __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) | |
23992 __Pyx_GOTREF(__pyx_t_3); | |
23993 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23994 __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3); | |
23995 __pyx_t_3 = 0; | |
23996 } | |
23997 | |
23998 /* "pysam/libcvcf.pyx":649 | |
23999 * self._line = line | |
24000 * if f.id == "GT": values = list(map( self.convertGT, values )) | |
24001 * return values # <<<<<<<<<<<<<< | |
24002 * elif f.type == "Character": | |
24003 * for v in values: | |
24004 */ | |
24005 __Pyx_XDECREF(__pyx_r); | |
24006 __Pyx_INCREF(__pyx_v_values); | |
24007 __pyx_r = __pyx_v_values; | |
24008 goto __pyx_L0; | |
24009 | |
24010 /* "pysam/libcvcf.pyx":646 | |
24011 * return [0] * len(values) | |
24012 * return values | |
24013 * elif f.type == "String": # <<<<<<<<<<<<<< | |
24014 * self._line = line | |
24015 * if f.id == "GT": values = list(map( self.convertGT, values )) | |
24016 */ | |
24017 } | |
24018 | |
24019 /* "pysam/libcvcf.pyx":650 | |
24020 * if f.id == "GT": values = list(map( self.convertGT, values )) | |
24021 * return values | |
24022 * elif f.type == "Character": # <<<<<<<<<<<<<< | |
24023 * for v in values: | |
24024 * if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR) | |
24025 */ | |
24026 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) | |
24027 __Pyx_GOTREF(__pyx_t_3); | |
24028 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_Character, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 650, __pyx_L1_error) | |
24029 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24030 if (__pyx_t_5) { | |
24031 | |
24032 /* "pysam/libcvcf.pyx":651 | |
24033 * return values | |
24034 * elif f.type == "Character": | |
24035 * for v in values: # <<<<<<<<<<<<<< | |
24036 * if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR) | |
24037 * return values | |
24038 */ | |
24039 if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) { | |
24040 __pyx_t_3 = __pyx_v_values; __Pyx_INCREF(__pyx_t_3); | |
24041 __pyx_t_9 = 0; | |
24042 __pyx_t_11 = NULL; | |
24043 } else { | |
24044 __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error) | |
24045 __Pyx_GOTREF(__pyx_t_3); | |
24046 __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 651, __pyx_L1_error) | |
24047 } | |
24048 for (;;) { | |
24049 if (likely(!__pyx_t_11)) { | |
24050 if (likely(PyList_CheckExact(__pyx_t_3))) { | |
24051 { | |
24052 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); | |
24053 #if !CYTHON_ASSUME_SAFE_MACROS | |
24054 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 651, __pyx_L1_error) | |
24055 #endif | |
24056 if (__pyx_t_9 >= __pyx_temp) break; | |
24057 } | |
24058 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
24059 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 651, __pyx_L1_error) | |
24060 #else | |
24061 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) | |
24062 __Pyx_GOTREF(__pyx_t_6); | |
24063 #endif | |
24064 } else { | |
24065 { | |
24066 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); | |
24067 #if !CYTHON_ASSUME_SAFE_MACROS | |
24068 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 651, __pyx_L1_error) | |
24069 #endif | |
24070 if (__pyx_t_9 >= __pyx_temp) break; | |
24071 } | |
24072 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
24073 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 651, __pyx_L1_error) | |
24074 #else | |
24075 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error) | |
24076 __Pyx_GOTREF(__pyx_t_6); | |
24077 #endif | |
24078 } | |
24079 } else { | |
24080 __pyx_t_6 = __pyx_t_11(__pyx_t_3); | |
24081 if (unlikely(!__pyx_t_6)) { | |
24082 PyObject* exc_type = PyErr_Occurred(); | |
24083 if (exc_type) { | |
24084 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
24085 else __PYX_ERR(0, 651, __pyx_L1_error) | |
24086 } | |
24087 break; | |
24088 } | |
24089 __Pyx_GOTREF(__pyx_t_6); | |
24090 } | |
24091 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); | |
24092 __pyx_t_6 = 0; | |
24093 | |
24094 /* "pysam/libcvcf.pyx":652 | |
24095 * elif f.type == "Character": | |
24096 * for v in values: | |
24097 * if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR) # <<<<<<<<<<<<<< | |
24098 * return values | |
24099 * elif f.type == "Float": | |
24100 */ | |
24101 __pyx_t_19 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 652, __pyx_L1_error) | |
24102 __pyx_t_5 = (__pyx_t_19 != 1); | |
24103 if (__pyx_t_5) { | |
24104 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 652, __pyx_L1_error) | |
24105 __Pyx_GOTREF(__pyx_t_10); | |
24106 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_FORMAT_NOT_CHAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) | |
24107 __Pyx_GOTREF(__pyx_t_2); | |
24108 __pyx_t_1 = NULL; | |
24109 __pyx_t_4 = 0; | |
24110 #if CYTHON_UNPACK_METHODS | |
24111 if (likely(PyMethod_Check(__pyx_t_10))) { | |
24112 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); | |
24113 if (likely(__pyx_t_1)) { | |
24114 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); | |
24115 __Pyx_INCREF(__pyx_t_1); | |
24116 __Pyx_INCREF(function); | |
24117 __Pyx_DECREF_SET(__pyx_t_10, function); | |
24118 __pyx_t_4 = 1; | |
24119 } | |
24120 } | |
24121 #endif | |
24122 { | |
24123 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_line, __pyx_t_2}; | |
24124 __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
24125 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24126 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
24127 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 652, __pyx_L1_error) | |
24128 __Pyx_GOTREF(__pyx_t_6); | |
24129 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
24130 } | |
24131 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
24132 } | |
24133 | |
24134 /* "pysam/libcvcf.pyx":651 | |
24135 * return values | |
24136 * elif f.type == "Character": | |
24137 * for v in values: # <<<<<<<<<<<<<< | |
24138 * if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR) | |
24139 * return values | |
24140 */ | |
24141 } | |
24142 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24143 | |
24144 /* "pysam/libcvcf.pyx":653 | |
24145 * for v in values: | |
24146 * if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR) | |
24147 * return values # <<<<<<<<<<<<<< | |
24148 * elif f.type == "Float": | |
24149 * for idx,v in enumerate(values): | |
24150 */ | |
24151 __Pyx_XDECREF(__pyx_r); | |
24152 __Pyx_INCREF(__pyx_v_values); | |
24153 __pyx_r = __pyx_v_values; | |
24154 goto __pyx_L0; | |
24155 | |
24156 /* "pysam/libcvcf.pyx":650 | |
24157 * if f.id == "GT": values = list(map( self.convertGT, values )) | |
24158 * return values | |
24159 * elif f.type == "Character": # <<<<<<<<<<<<<< | |
24160 * for v in values: | |
24161 * if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR) | |
24162 */ | |
24163 } | |
24164 | |
24165 /* "pysam/libcvcf.pyx":654 | |
24166 * if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR) | |
24167 * return values | |
24168 * elif f.type == "Float": # <<<<<<<<<<<<<< | |
24169 * for idx,v in enumerate(values): | |
24170 * if v == ".": values[idx] = f.missingvalue | |
24171 */ | |
24172 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) | |
24173 __Pyx_GOTREF(__pyx_t_3); | |
24174 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_Float, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) | |
24175 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24176 if (__pyx_t_5) { | |
24177 | |
24178 /* "pysam/libcvcf.pyx":655 | |
24179 * return values | |
24180 * elif f.type == "Float": | |
24181 * for idx,v in enumerate(values): # <<<<<<<<<<<<<< | |
24182 * if v == ".": values[idx] = f.missingvalue | |
24183 * try: return list(map(float,values)) | |
24184 */ | |
24185 __Pyx_INCREF(__pyx_int_0); | |
24186 __pyx_t_3 = __pyx_int_0; | |
24187 if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) { | |
24188 __pyx_t_6 = __pyx_v_values; __Pyx_INCREF(__pyx_t_6); | |
24189 __pyx_t_9 = 0; | |
24190 __pyx_t_11 = NULL; | |
24191 } else { | |
24192 __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 655, __pyx_L1_error) | |
24193 __Pyx_GOTREF(__pyx_t_6); | |
24194 __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 655, __pyx_L1_error) | |
24195 } | |
24196 for (;;) { | |
24197 if (likely(!__pyx_t_11)) { | |
24198 if (likely(PyList_CheckExact(__pyx_t_6))) { | |
24199 { | |
24200 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); | |
24201 #if !CYTHON_ASSUME_SAFE_MACROS | |
24202 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 655, __pyx_L1_error) | |
24203 #endif | |
24204 if (__pyx_t_9 >= __pyx_temp) break; | |
24205 } | |
24206 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
24207 __pyx_t_10 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 655, __pyx_L1_error) | |
24208 #else | |
24209 __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 655, __pyx_L1_error) | |
24210 __Pyx_GOTREF(__pyx_t_10); | |
24211 #endif | |
24212 } else { | |
24213 { | |
24214 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); | |
24215 #if !CYTHON_ASSUME_SAFE_MACROS | |
24216 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 655, __pyx_L1_error) | |
24217 #endif | |
24218 if (__pyx_t_9 >= __pyx_temp) break; | |
24219 } | |
24220 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
24221 __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 655, __pyx_L1_error) | |
24222 #else | |
24223 __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 655, __pyx_L1_error) | |
24224 __Pyx_GOTREF(__pyx_t_10); | |
24225 #endif | |
24226 } | |
24227 } else { | |
24228 __pyx_t_10 = __pyx_t_11(__pyx_t_6); | |
24229 if (unlikely(!__pyx_t_10)) { | |
24230 PyObject* exc_type = PyErr_Occurred(); | |
24231 if (exc_type) { | |
24232 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
24233 else __PYX_ERR(0, 655, __pyx_L1_error) | |
24234 } | |
24235 break; | |
24236 } | |
24237 __Pyx_GOTREF(__pyx_t_10); | |
24238 } | |
24239 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_10); | |
24240 __pyx_t_10 = 0; | |
24241 __Pyx_INCREF(__pyx_t_3); | |
24242 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); | |
24243 __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 655, __pyx_L1_error) | |
24244 __Pyx_GOTREF(__pyx_t_10); | |
24245 __Pyx_DECREF(__pyx_t_3); | |
24246 __pyx_t_3 = __pyx_t_10; | |
24247 __pyx_t_10 = 0; | |
24248 | |
24249 /* "pysam/libcvcf.pyx":656 | |
24250 * elif f.type == "Float": | |
24251 * for idx,v in enumerate(values): | |
24252 * if v == ".": values[idx] = f.missingvalue # <<<<<<<<<<<<<< | |
24253 * try: return list(map(float,values)) | |
24254 * except: | |
24255 */ | |
24256 __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_v, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) | |
24257 if (__pyx_t_5) { | |
24258 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_missingvalue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) | |
24259 __Pyx_GOTREF(__pyx_t_10); | |
24260 if (unlikely((PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_10) < 0))) __PYX_ERR(0, 656, __pyx_L1_error) | |
24261 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
24262 } | |
24263 | |
24264 /* "pysam/libcvcf.pyx":655 | |
24265 * return values | |
24266 * elif f.type == "Float": | |
24267 * for idx,v in enumerate(values): # <<<<<<<<<<<<<< | |
24268 * if v == ".": values[idx] = f.missingvalue | |
24269 * try: return list(map(float,values)) | |
24270 */ | |
24271 } | |
24272 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
24273 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24274 | |
24275 /* "pysam/libcvcf.pyx":657 | |
24276 * for idx,v in enumerate(values): | |
24277 * if v == ".": values[idx] = f.missingvalue | |
24278 * try: return list(map(float,values)) # <<<<<<<<<<<<<< | |
24279 * except: | |
24280 * self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,"%s=%s" % (key, str(values))) | |
24281 */ | |
24282 { | |
24283 __Pyx_PyThreadState_declare | |
24284 __Pyx_PyThreadState_assign | |
24285 __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12); | |
24286 __Pyx_XGOTREF(__pyx_t_14); | |
24287 __Pyx_XGOTREF(__pyx_t_13); | |
24288 __Pyx_XGOTREF(__pyx_t_12); | |
24289 /*try:*/ { | |
24290 __Pyx_XDECREF(__pyx_r); | |
24291 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L36_error) | |
24292 __Pyx_GOTREF(__pyx_t_3); | |
24293 __Pyx_INCREF((PyObject *)(&PyFloat_Type)); | |
24294 __Pyx_GIVEREF((PyObject *)(&PyFloat_Type)); | |
24295 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyFloat_Type)))) __PYX_ERR(0, 657, __pyx_L36_error); | |
24296 __Pyx_INCREF(__pyx_v_values); | |
24297 __Pyx_GIVEREF(__pyx_v_values); | |
24298 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values)) __PYX_ERR(0, 657, __pyx_L36_error); | |
24299 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L36_error) | |
24300 __Pyx_GOTREF(__pyx_t_6); | |
24301 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24302 __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L36_error) | |
24303 __Pyx_GOTREF(__pyx_t_3); | |
24304 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
24305 __pyx_r = __pyx_t_3; | |
24306 __pyx_t_3 = 0; | |
24307 goto __pyx_L40_try_return; | |
24308 } | |
24309 __pyx_L36_error:; | |
24310 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24311 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; | |
24312 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; | |
24313 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
24314 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; | |
24315 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; | |
24316 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
24317 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; | |
24318 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24319 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
24320 | |
24321 /* "pysam/libcvcf.pyx":658 | |
24322 * if v == ".": values[idx] = f.missingvalue | |
24323 * try: return list(map(float,values)) | |
24324 * except: # <<<<<<<<<<<<<< | |
24325 * self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,"%s=%s" % (key, str(values))) | |
24326 * return [0.0] * len(values) | |
24327 */ | |
24328 /*except:*/ { | |
24329 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24330 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(0, 658, __pyx_L38_except_error) | |
24331 __Pyx_XGOTREF(__pyx_t_3); | |
24332 __Pyx_XGOTREF(__pyx_t_6); | |
24333 __Pyx_XGOTREF(__pyx_t_10); | |
24334 | |
24335 /* "pysam/libcvcf.pyx":659 | |
24336 * try: return list(map(float,values)) | |
24337 * except: | |
24338 * self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,"%s=%s" % (key, str(values))) # <<<<<<<<<<<<<< | |
24339 * return [0.0] * len(values) | |
24340 * else: | |
24341 */ | |
24342 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L38_except_error) | |
24343 __Pyx_GOTREF(__pyx_t_1); | |
24344 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 659, __pyx_L38_except_error) | |
24345 __Pyx_GOTREF(__pyx_t_15); | |
24346 __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 659, __pyx_L38_except_error) | |
24347 __Pyx_GOTREF(__pyx_t_16); | |
24348 __pyx_t_9 = 0; | |
24349 __pyx_t_20 = 127; | |
24350 __pyx_t_21 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 659, __pyx_L38_except_error) | |
24351 __Pyx_GOTREF(__pyx_t_21); | |
24352 __pyx_t_20 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_21) > __pyx_t_20) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_21) : __pyx_t_20; | |
24353 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_21); | |
24354 __Pyx_GIVEREF(__pyx_t_21); | |
24355 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_21); | |
24356 __pyx_t_21 = 0; | |
24357 __Pyx_INCREF(__pyx_kp_u__7); | |
24358 __pyx_t_9 += 1; | |
24359 __Pyx_GIVEREF(__pyx_kp_u__7); | |
24360 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_kp_u__7); | |
24361 __pyx_t_21 = __Pyx_PyObject_Unicode(__pyx_v_values); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 659, __pyx_L38_except_error) | |
24362 __Pyx_GOTREF(__pyx_t_21); | |
24363 __pyx_t_20 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_21) > __pyx_t_20) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_21) : __pyx_t_20; | |
24364 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_21); | |
24365 __Pyx_GIVEREF(__pyx_t_21); | |
24366 PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_21); | |
24367 __pyx_t_21 = 0; | |
24368 __pyx_t_21 = __Pyx_PyUnicode_Join(__pyx_t_16, 3, __pyx_t_9, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 659, __pyx_L38_except_error) | |
24369 __Pyx_GOTREF(__pyx_t_21); | |
24370 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
24371 __pyx_t_16 = NULL; | |
24372 __pyx_t_4 = 0; | |
24373 #if CYTHON_UNPACK_METHODS | |
24374 if (likely(PyMethod_Check(__pyx_t_1))) { | |
24375 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_1); | |
24376 if (likely(__pyx_t_16)) { | |
24377 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
24378 __Pyx_INCREF(__pyx_t_16); | |
24379 __Pyx_INCREF(function); | |
24380 __Pyx_DECREF_SET(__pyx_t_1, function); | |
24381 __pyx_t_4 = 1; | |
24382 } | |
24383 } | |
24384 #endif | |
24385 { | |
24386 PyObject *__pyx_callargs[4] = {__pyx_t_16, __pyx_v_line, __pyx_t_15, __pyx_t_21}; | |
24387 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
24388 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
24389 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
24390 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; | |
24391 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L38_except_error) | |
24392 __Pyx_GOTREF(__pyx_t_2); | |
24393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24394 } | |
24395 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
24396 | |
24397 /* "pysam/libcvcf.pyx":660 | |
24398 * except: | |
24399 * self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,"%s=%s" % (key, str(values))) | |
24400 * return [0.0] * len(values) # <<<<<<<<<<<<<< | |
24401 * else: | |
24402 * # can't happen | |
24403 */ | |
24404 __Pyx_XDECREF(__pyx_r); | |
24405 __pyx_t_9 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 660, __pyx_L38_except_error) | |
24406 __pyx_t_2 = PyList_New(1 * ((__pyx_t_9<0) ? 0:__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L38_except_error) | |
24407 __Pyx_GOTREF(__pyx_t_2); | |
24408 { Py_ssize_t __pyx_temp; | |
24409 for (__pyx_temp=0; __pyx_temp < __pyx_t_9; __pyx_temp++) { | |
24410 __Pyx_INCREF(__pyx_float_0_0); | |
24411 __Pyx_GIVEREF(__pyx_float_0_0); | |
24412 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_float_0_0)) __PYX_ERR(0, 660, __pyx_L38_except_error); | |
24413 } | |
24414 } | |
24415 __pyx_r = __pyx_t_2; | |
24416 __pyx_t_2 = 0; | |
24417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24418 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
24419 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
24420 goto __pyx_L39_except_return; | |
24421 } | |
24422 | |
24423 /* "pysam/libcvcf.pyx":657 | |
24424 * for idx,v in enumerate(values): | |
24425 * if v == ".": values[idx] = f.missingvalue | |
24426 * try: return list(map(float,values)) # <<<<<<<<<<<<<< | |
24427 * except: | |
24428 * self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,"%s=%s" % (key, str(values))) | |
24429 */ | |
24430 __pyx_L38_except_error:; | |
24431 __Pyx_XGIVEREF(__pyx_t_14); | |
24432 __Pyx_XGIVEREF(__pyx_t_13); | |
24433 __Pyx_XGIVEREF(__pyx_t_12); | |
24434 __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12); | |
24435 goto __pyx_L1_error; | |
24436 __pyx_L40_try_return:; | |
24437 __Pyx_XGIVEREF(__pyx_t_14); | |
24438 __Pyx_XGIVEREF(__pyx_t_13); | |
24439 __Pyx_XGIVEREF(__pyx_t_12); | |
24440 __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12); | |
24441 goto __pyx_L0; | |
24442 __pyx_L39_except_return:; | |
24443 __Pyx_XGIVEREF(__pyx_t_14); | |
24444 __Pyx_XGIVEREF(__pyx_t_13); | |
24445 __Pyx_XGIVEREF(__pyx_t_12); | |
24446 __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12); | |
24447 goto __pyx_L0; | |
24448 } | |
24449 | |
24450 /* "pysam/libcvcf.pyx":654 | |
24451 * if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR) | |
24452 * return values | |
24453 * elif f.type == "Float": # <<<<<<<<<<<<<< | |
24454 * for idx,v in enumerate(values): | |
24455 * if v == ".": values[idx] = f.missingvalue | |
24456 */ | |
24457 } | |
24458 | |
24459 /* "pysam/libcvcf.pyx":663 | |
24460 * else: | |
24461 * # can't happen | |
24462 * self.error(line,self.ERROR_INFO_STRING) # <<<<<<<<<<<<<< | |
24463 * | |
24464 * def inregion(self, chrom, pos): | |
24465 */ | |
24466 /*else*/ { | |
24467 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error) | |
24468 __Pyx_GOTREF(__pyx_t_6); | |
24469 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_INFO_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) | |
24470 __Pyx_GOTREF(__pyx_t_3); | |
24471 __pyx_t_2 = NULL; | |
24472 __pyx_t_4 = 0; | |
24473 #if CYTHON_UNPACK_METHODS | |
24474 if (likely(PyMethod_Check(__pyx_t_6))) { | |
24475 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); | |
24476 if (likely(__pyx_t_2)) { | |
24477 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
24478 __Pyx_INCREF(__pyx_t_2); | |
24479 __Pyx_INCREF(function); | |
24480 __Pyx_DECREF_SET(__pyx_t_6, function); | |
24481 __pyx_t_4 = 1; | |
24482 } | |
24483 } | |
24484 #endif | |
24485 { | |
24486 PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_line, __pyx_t_3}; | |
24487 __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
24488 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
24489 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24490 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 663, __pyx_L1_error) | |
24491 __Pyx_GOTREF(__pyx_t_10); | |
24492 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
24493 } | |
24494 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
24495 } | |
24496 | |
24497 /* "pysam/libcvcf.pyx":623 | |
24498 * return ''.join(map(str,GTdata)) | |
24499 * | |
24500 * def parse_formatdata( self, key, value, formatdict, line ): # <<<<<<<<<<<<<< | |
24501 * # To do: check that the right number of values is present | |
24502 * f = formatdict.get(key,None) | |
24503 */ | |
24504 | |
24505 /* function exit code */ | |
24506 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
24507 goto __pyx_L0; | |
24508 __pyx_L1_error:; | |
24509 __Pyx_XDECREF(__pyx_t_1); | |
24510 __Pyx_XDECREF(__pyx_t_2); | |
24511 __Pyx_XDECREF(__pyx_t_3); | |
24512 __Pyx_XDECREF(__pyx_t_6); | |
24513 __Pyx_XDECREF(__pyx_t_10); | |
24514 __Pyx_XDECREF(__pyx_t_15); | |
24515 __Pyx_XDECREF(__pyx_t_16); | |
24516 __Pyx_XDECREF(__pyx_t_17); | |
24517 __Pyx_XDECREF(__pyx_t_18); | |
24518 __Pyx_XDECREF(__pyx_t_21); | |
24519 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24520 __pyx_r = NULL; | |
24521 __pyx_L0:; | |
24522 __Pyx_XDECREF(__pyx_v_f); | |
24523 __Pyx_XDECREF(__pyx_v_values); | |
24524 __Pyx_XDECREF(__pyx_v_idx); | |
24525 __Pyx_XDECREF(__pyx_v_v); | |
24526 __Pyx_XGIVEREF(__pyx_r); | |
24527 __Pyx_RefNannyFinishContext(); | |
24528 return __pyx_r; | |
24529 } | |
24530 | |
24531 /* "pysam/libcvcf.pyx":665 | |
24532 * self.error(line,self.ERROR_INFO_STRING) | |
24533 * | |
24534 * def inregion(self, chrom, pos): # <<<<<<<<<<<<<< | |
24535 * if not self._regions: return True | |
24536 * for r in self._regions: | |
24537 */ | |
24538 | |
24539 /* Python wrapper */ | |
24540 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_31inregion(PyObject *__pyx_self, | |
24541 #if CYTHON_METH_FASTCALL | |
24542 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
24543 #else | |
24544 PyObject *__pyx_args, PyObject *__pyx_kwds | |
24545 #endif | |
24546 ); /*proto*/ | |
24547 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_30inregion, "VCF.inregion(self, chrom, pos)"); | |
24548 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_31inregion = {"inregion", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_31inregion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_30inregion}; | |
24549 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_31inregion(PyObject *__pyx_self, | |
24550 #if CYTHON_METH_FASTCALL | |
24551 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
24552 #else | |
24553 PyObject *__pyx_args, PyObject *__pyx_kwds | |
24554 #endif | |
24555 ) { | |
24556 PyObject *__pyx_v_self = 0; | |
24557 PyObject *__pyx_v_chrom = 0; | |
24558 PyObject *__pyx_v_pos = 0; | |
24559 #if !CYTHON_METH_FASTCALL | |
24560 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
24561 #endif | |
24562 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
24563 PyObject* values[3] = {0,0,0}; | |
24564 int __pyx_lineno = 0; | |
24565 const char *__pyx_filename = NULL; | |
24566 int __pyx_clineno = 0; | |
24567 PyObject *__pyx_r = 0; | |
24568 __Pyx_RefNannyDeclarations | |
24569 __Pyx_RefNannySetupContext("inregion (wrapper)", 0); | |
24570 #if !CYTHON_METH_FASTCALL | |
24571 #if CYTHON_ASSUME_SAFE_MACROS | |
24572 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
24573 #else | |
24574 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
24575 #endif | |
24576 #endif | |
24577 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
24578 { | |
24579 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_chrom,&__pyx_n_s_pos,0}; | |
24580 if (__pyx_kwds) { | |
24581 Py_ssize_t kw_args; | |
24582 switch (__pyx_nargs) { | |
24583 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
24584 CYTHON_FALLTHROUGH; | |
24585 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
24586 CYTHON_FALLTHROUGH; | |
24587 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
24588 CYTHON_FALLTHROUGH; | |
24589 case 0: break; | |
24590 default: goto __pyx_L5_argtuple_error; | |
24591 } | |
24592 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
24593 switch (__pyx_nargs) { | |
24594 case 0: | |
24595 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
24596 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
24597 kw_args--; | |
24598 } | |
24599 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) | |
24600 else goto __pyx_L5_argtuple_error; | |
24601 CYTHON_FALLTHROUGH; | |
24602 case 1: | |
24603 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chrom)) != 0)) { | |
24604 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
24605 kw_args--; | |
24606 } | |
24607 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) | |
24608 else { | |
24609 __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, 1); __PYX_ERR(0, 665, __pyx_L3_error) | |
24610 } | |
24611 CYTHON_FALLTHROUGH; | |
24612 case 2: | |
24613 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos)) != 0)) { | |
24614 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
24615 kw_args--; | |
24616 } | |
24617 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error) | |
24618 else { | |
24619 __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, 2); __PYX_ERR(0, 665, __pyx_L3_error) | |
24620 } | |
24621 } | |
24622 if (unlikely(kw_args > 0)) { | |
24623 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
24624 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "inregion") < 0)) __PYX_ERR(0, 665, __pyx_L3_error) | |
24625 } | |
24626 } else if (unlikely(__pyx_nargs != 3)) { | |
24627 goto __pyx_L5_argtuple_error; | |
24628 } else { | |
24629 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
24630 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
24631 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
24632 } | |
24633 __pyx_v_self = values[0]; | |
24634 __pyx_v_chrom = values[1]; | |
24635 __pyx_v_pos = values[2]; | |
24636 } | |
24637 goto __pyx_L6_skip; | |
24638 __pyx_L5_argtuple_error:; | |
24639 __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 665, __pyx_L3_error) | |
24640 __pyx_L6_skip:; | |
24641 goto __pyx_L4_argument_unpacking_done; | |
24642 __pyx_L3_error:; | |
24643 { | |
24644 Py_ssize_t __pyx_temp; | |
24645 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
24646 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
24647 } | |
24648 } | |
24649 __Pyx_AddTraceback("pysam.libcvcf.VCF.inregion", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24650 __Pyx_RefNannyFinishContext(); | |
24651 return NULL; | |
24652 __pyx_L4_argument_unpacking_done:; | |
24653 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_30inregion(__pyx_self, __pyx_v_self, __pyx_v_chrom, __pyx_v_pos); | |
24654 | |
24655 /* function exit code */ | |
24656 { | |
24657 Py_ssize_t __pyx_temp; | |
24658 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
24659 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
24660 } | |
24661 } | |
24662 __Pyx_RefNannyFinishContext(); | |
24663 return __pyx_r; | |
24664 } | |
24665 | |
24666 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_30inregion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_pos) { | |
24667 PyObject *__pyx_v_r = NULL; | |
24668 PyObject *__pyx_r = NULL; | |
24669 __Pyx_RefNannyDeclarations | |
24670 PyObject *__pyx_t_1 = NULL; | |
24671 int __pyx_t_2; | |
24672 int __pyx_t_3; | |
24673 PyObject *__pyx_t_4 = NULL; | |
24674 Py_ssize_t __pyx_t_5; | |
24675 PyObject *(*__pyx_t_6)(PyObject *); | |
24676 PyObject *__pyx_t_7 = NULL; | |
24677 PyObject *__pyx_t_8 = NULL; | |
24678 int __pyx_lineno = 0; | |
24679 const char *__pyx_filename = NULL; | |
24680 int __pyx_clineno = 0; | |
24681 __Pyx_RefNannySetupContext("inregion", 1); | |
24682 | |
24683 /* "pysam/libcvcf.pyx":666 | |
24684 * | |
24685 * def inregion(self, chrom, pos): | |
24686 * if not self._regions: return True # <<<<<<<<<<<<<< | |
24687 * for r in self._regions: | |
24688 * if r[0] == chrom and r[1] <= pos < r[2]: return True | |
24689 */ | |
24690 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_regions_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) | |
24691 __Pyx_GOTREF(__pyx_t_1); | |
24692 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 666, __pyx_L1_error) | |
24693 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24694 __pyx_t_3 = (!__pyx_t_2); | |
24695 if (__pyx_t_3) { | |
24696 __Pyx_XDECREF(__pyx_r); | |
24697 __Pyx_INCREF(Py_True); | |
24698 __pyx_r = Py_True; | |
24699 goto __pyx_L0; | |
24700 } | |
24701 | |
24702 /* "pysam/libcvcf.pyx":667 | |
24703 * def inregion(self, chrom, pos): | |
24704 * if not self._regions: return True | |
24705 * for r in self._regions: # <<<<<<<<<<<<<< | |
24706 * if r[0] == chrom and r[1] <= pos < r[2]: return True | |
24707 * return False | |
24708 */ | |
24709 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_regions_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) | |
24710 __Pyx_GOTREF(__pyx_t_1); | |
24711 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { | |
24712 __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); | |
24713 __pyx_t_5 = 0; | |
24714 __pyx_t_6 = NULL; | |
24715 } else { | |
24716 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error) | |
24717 __Pyx_GOTREF(__pyx_t_4); | |
24718 __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error) | |
24719 } | |
24720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24721 for (;;) { | |
24722 if (likely(!__pyx_t_6)) { | |
24723 if (likely(PyList_CheckExact(__pyx_t_4))) { | |
24724 { | |
24725 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); | |
24726 #if !CYTHON_ASSUME_SAFE_MACROS | |
24727 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 667, __pyx_L1_error) | |
24728 #endif | |
24729 if (__pyx_t_5 >= __pyx_temp) break; | |
24730 } | |
24731 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
24732 __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, 667, __pyx_L1_error) | |
24733 #else | |
24734 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) | |
24735 __Pyx_GOTREF(__pyx_t_1); | |
24736 #endif | |
24737 } else { | |
24738 { | |
24739 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); | |
24740 #if !CYTHON_ASSUME_SAFE_MACROS | |
24741 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 667, __pyx_L1_error) | |
24742 #endif | |
24743 if (__pyx_t_5 >= __pyx_temp) break; | |
24744 } | |
24745 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
24746 __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, 667, __pyx_L1_error) | |
24747 #else | |
24748 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) | |
24749 __Pyx_GOTREF(__pyx_t_1); | |
24750 #endif | |
24751 } | |
24752 } else { | |
24753 __pyx_t_1 = __pyx_t_6(__pyx_t_4); | |
24754 if (unlikely(!__pyx_t_1)) { | |
24755 PyObject* exc_type = PyErr_Occurred(); | |
24756 if (exc_type) { | |
24757 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
24758 else __PYX_ERR(0, 667, __pyx_L1_error) | |
24759 } | |
24760 break; | |
24761 } | |
24762 __Pyx_GOTREF(__pyx_t_1); | |
24763 } | |
24764 __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_1); | |
24765 __pyx_t_1 = 0; | |
24766 | |
24767 /* "pysam/libcvcf.pyx":668 | |
24768 * if not self._regions: return True | |
24769 * for r in self._regions: | |
24770 * if r[0] == chrom and r[1] <= pos < r[2]: return True # <<<<<<<<<<<<<< | |
24771 * return False | |
24772 * | |
24773 */ | |
24774 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_r, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) | |
24775 __Pyx_GOTREF(__pyx_t_1); | |
24776 __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_v_chrom, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error) | |
24777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24778 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) | |
24779 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
24780 if (__pyx_t_2) { | |
24781 } else { | |
24782 __pyx_t_3 = __pyx_t_2; | |
24783 goto __pyx_L7_bool_binop_done; | |
24784 } | |
24785 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_r, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error) | |
24786 __Pyx_GOTREF(__pyx_t_7); | |
24787 __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_v_pos, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) | |
24788 if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { | |
24789 __Pyx_DECREF(__pyx_t_1); | |
24790 __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_r, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error) | |
24791 __Pyx_GOTREF(__pyx_t_8); | |
24792 __pyx_t_1 = PyObject_RichCompare(__pyx_v_pos, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) | |
24793 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
24794 } | |
24795 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
24796 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) | |
24797 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24798 __pyx_t_3 = __pyx_t_2; | |
24799 __pyx_L7_bool_binop_done:; | |
24800 if (__pyx_t_3) { | |
24801 __Pyx_XDECREF(__pyx_r); | |
24802 __Pyx_INCREF(Py_True); | |
24803 __pyx_r = Py_True; | |
24804 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
24805 goto __pyx_L0; | |
24806 } | |
24807 | |
24808 /* "pysam/libcvcf.pyx":667 | |
24809 * def inregion(self, chrom, pos): | |
24810 * if not self._regions: return True | |
24811 * for r in self._regions: # <<<<<<<<<<<<<< | |
24812 * if r[0] == chrom and r[1] <= pos < r[2]: return True | |
24813 * return False | |
24814 */ | |
24815 } | |
24816 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
24817 | |
24818 /* "pysam/libcvcf.pyx":669 | |
24819 * for r in self._regions: | |
24820 * if r[0] == chrom and r[1] <= pos < r[2]: return True | |
24821 * return False # <<<<<<<<<<<<<< | |
24822 * | |
24823 * def parse_data( self, line, lineparse=False ): | |
24824 */ | |
24825 __Pyx_XDECREF(__pyx_r); | |
24826 __Pyx_INCREF(Py_False); | |
24827 __pyx_r = Py_False; | |
24828 goto __pyx_L0; | |
24829 | |
24830 /* "pysam/libcvcf.pyx":665 | |
24831 * self.error(line,self.ERROR_INFO_STRING) | |
24832 * | |
24833 * def inregion(self, chrom, pos): # <<<<<<<<<<<<<< | |
24834 * if not self._regions: return True | |
24835 * for r in self._regions: | |
24836 */ | |
24837 | |
24838 /* function exit code */ | |
24839 __pyx_L1_error:; | |
24840 __Pyx_XDECREF(__pyx_t_1); | |
24841 __Pyx_XDECREF(__pyx_t_4); | |
24842 __Pyx_XDECREF(__pyx_t_7); | |
24843 __Pyx_XDECREF(__pyx_t_8); | |
24844 __Pyx_AddTraceback("pysam.libcvcf.VCF.inregion", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24845 __pyx_r = NULL; | |
24846 __pyx_L0:; | |
24847 __Pyx_XDECREF(__pyx_v_r); | |
24848 __Pyx_XGIVEREF(__pyx_r); | |
24849 __Pyx_RefNannyFinishContext(); | |
24850 return __pyx_r; | |
24851 } | |
24852 | |
24853 /* "pysam/libcvcf.pyx":671 | |
24854 * return False | |
24855 * | |
24856 * def parse_data( self, line, lineparse=False ): # <<<<<<<<<<<<<< | |
24857 * cols = line.split('\t') | |
24858 * if len(cols) != len(self._samples)+9: | |
24859 */ | |
24860 | |
24861 /* Python wrapper */ | |
24862 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_33parse_data(PyObject *__pyx_self, | |
24863 #if CYTHON_METH_FASTCALL | |
24864 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
24865 #else | |
24866 PyObject *__pyx_args, PyObject *__pyx_kwds | |
24867 #endif | |
24868 ); /*proto*/ | |
24869 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_32parse_data, "VCF.parse_data(self, line, lineparse=False)"); | |
24870 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_33parse_data = {"parse_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_33parse_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_32parse_data}; | |
24871 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_33parse_data(PyObject *__pyx_self, | |
24872 #if CYTHON_METH_FASTCALL | |
24873 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
24874 #else | |
24875 PyObject *__pyx_args, PyObject *__pyx_kwds | |
24876 #endif | |
24877 ) { | |
24878 PyObject *__pyx_v_self = 0; | |
24879 PyObject *__pyx_v_line = 0; | |
24880 PyObject *__pyx_v_lineparse = 0; | |
24881 #if !CYTHON_METH_FASTCALL | |
24882 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
24883 #endif | |
24884 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
24885 PyObject* values[3] = {0,0,0}; | |
24886 int __pyx_lineno = 0; | |
24887 const char *__pyx_filename = NULL; | |
24888 int __pyx_clineno = 0; | |
24889 PyObject *__pyx_r = 0; | |
24890 __Pyx_RefNannyDeclarations | |
24891 __Pyx_RefNannySetupContext("parse_data (wrapper)", 0); | |
24892 #if !CYTHON_METH_FASTCALL | |
24893 #if CYTHON_ASSUME_SAFE_MACROS | |
24894 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
24895 #else | |
24896 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
24897 #endif | |
24898 #endif | |
24899 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
24900 { | |
24901 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,&__pyx_n_s_lineparse,0}; | |
24902 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); | |
24903 if (__pyx_kwds) { | |
24904 Py_ssize_t kw_args; | |
24905 switch (__pyx_nargs) { | |
24906 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
24907 CYTHON_FALLTHROUGH; | |
24908 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
24909 CYTHON_FALLTHROUGH; | |
24910 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
24911 CYTHON_FALLTHROUGH; | |
24912 case 0: break; | |
24913 default: goto __pyx_L5_argtuple_error; | |
24914 } | |
24915 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
24916 switch (__pyx_nargs) { | |
24917 case 0: | |
24918 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
24919 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
24920 kw_args--; | |
24921 } | |
24922 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L3_error) | |
24923 else goto __pyx_L5_argtuple_error; | |
24924 CYTHON_FALLTHROUGH; | |
24925 case 1: | |
24926 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line)) != 0)) { | |
24927 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
24928 kw_args--; | |
24929 } | |
24930 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L3_error) | |
24931 else { | |
24932 __Pyx_RaiseArgtupleInvalid("parse_data", 0, 2, 3, 1); __PYX_ERR(0, 671, __pyx_L3_error) | |
24933 } | |
24934 CYTHON_FALLTHROUGH; | |
24935 case 2: | |
24936 if (kw_args > 0) { | |
24937 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lineparse); | |
24938 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
24939 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L3_error) | |
24940 } | |
24941 } | |
24942 if (unlikely(kw_args > 0)) { | |
24943 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
24944 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_data") < 0)) __PYX_ERR(0, 671, __pyx_L3_error) | |
24945 } | |
24946 } else { | |
24947 switch (__pyx_nargs) { | |
24948 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
24949 CYTHON_FALLTHROUGH; | |
24950 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
24951 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
24952 break; | |
24953 default: goto __pyx_L5_argtuple_error; | |
24954 } | |
24955 } | |
24956 __pyx_v_self = values[0]; | |
24957 __pyx_v_line = values[1]; | |
24958 __pyx_v_lineparse = values[2]; | |
24959 } | |
24960 goto __pyx_L6_skip; | |
24961 __pyx_L5_argtuple_error:; | |
24962 __Pyx_RaiseArgtupleInvalid("parse_data", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 671, __pyx_L3_error) | |
24963 __pyx_L6_skip:; | |
24964 goto __pyx_L4_argument_unpacking_done; | |
24965 __pyx_L3_error:; | |
24966 { | |
24967 Py_ssize_t __pyx_temp; | |
24968 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
24969 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
24970 } | |
24971 } | |
24972 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24973 __Pyx_RefNannyFinishContext(); | |
24974 return NULL; | |
24975 __pyx_L4_argument_unpacking_done:; | |
24976 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_32parse_data(__pyx_self, __pyx_v_self, __pyx_v_line, __pyx_v_lineparse); | |
24977 | |
24978 /* function exit code */ | |
24979 { | |
24980 Py_ssize_t __pyx_temp; | |
24981 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
24982 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
24983 } | |
24984 } | |
24985 __Pyx_RefNannyFinishContext(); | |
24986 return __pyx_r; | |
24987 } | |
24988 | |
24989 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_32parse_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_lineparse) { | |
24990 PyObject *__pyx_v_cols = NULL; | |
24991 PyObject *__pyx_v_chrom = NULL; | |
24992 PyObject *__pyx_v_pos = NULL; | |
24993 PyObject *__pyx_v_id = NULL; | |
24994 PyObject *__pyx_v_ref = NULL; | |
24995 PyObject *__pyx_v_c = NULL; | |
24996 PyObject *__pyx_v_left = NULL; | |
24997 PyObject *__pyx_v_faref_leftflank = NULL; | |
24998 PyObject *__pyx_v_faref = NULL; | |
24999 PyObject *__pyx_v_alt = NULL; | |
25000 double __pyx_v_qual; | |
25001 PyObject *__pyx_v_filter = NULL; | |
25002 PyObject *__pyx_v_info = NULL; | |
25003 PyObject *__pyx_v_blurp = NULL; | |
25004 PyObject *__pyx_v_elts = NULL; | |
25005 PyObject *__pyx_v_v = NULL; | |
25006 PyObject *__pyx_v_format = NULL; | |
25007 PyObject *__pyx_v_f = NULL; | |
25008 PyObject *__pyx_v_newalts = NULL; | |
25009 int __pyx_v_have_deletions; | |
25010 PyObject *__pyx_v_a = NULL; | |
25011 PyObject *__pyx_v_l = NULL; | |
25012 PyObject *__pyx_v_addns = NULL; | |
25013 PyObject *__pyx_v_i = NULL; | |
25014 PyObject *__pyx_v_na = NULL; | |
25015 PyObject *__pyx_v_s = NULL; | |
25016 PyObject *__pyx_v_addn = NULL; | |
25017 PyObject *__pyx_v_allele = NULL; | |
25018 int __pyx_v_movable; | |
25019 PyObject *__pyx_v_longest = NULL; | |
25020 PyObject *__pyx_v_shortest = NULL; | |
25021 PyObject *__pyx_v_samples = NULL; | |
25022 PyObject *__pyx_v_sample = NULL; | |
25023 PyObject *__pyx_v_dict = NULL; | |
25024 PyObject *__pyx_v_values = NULL; | |
25025 Py_ssize_t __pyx_v_idx; | |
25026 PyObject *__pyx_v_expected = NULL; | |
25027 PyObject *__pyx_v_value = NULL; | |
25028 PyObject *__pyx_v_d = NULL; | |
25029 PyObject *__pyx_v_key = NULL; | |
25030 PyObject *__pyx_8genexpr3__pyx_v_allele = NULL; | |
25031 PyObject *__pyx_8genexpr4__pyx_v_allele = NULL; | |
25032 PyObject *__pyx_8genexpr5__pyx_v_allele = NULL; | |
25033 PyObject *__pyx_8genexpr6__pyx_v_allele = NULL; | |
25034 PyObject *__pyx_8genexpr7__pyx_v_allele = NULL; | |
25035 PyObject *__pyx_r = NULL; | |
25036 __Pyx_RefNannyDeclarations | |
25037 PyObject *__pyx_t_1 = NULL; | |
25038 PyObject *__pyx_t_2 = NULL; | |
25039 PyObject *__pyx_t_3 = NULL; | |
25040 unsigned int __pyx_t_4; | |
25041 Py_ssize_t __pyx_t_5; | |
25042 Py_ssize_t __pyx_t_6; | |
25043 int __pyx_t_7; | |
25044 int __pyx_t_8; | |
25045 PyObject *__pyx_t_9 = NULL; | |
25046 Py_UCS4 __pyx_t_10; | |
25047 PyObject *__pyx_t_11 = NULL; | |
25048 PyObject *__pyx_t_12 = NULL; | |
25049 PyObject *__pyx_t_13 = NULL; | |
25050 PyObject *__pyx_t_14 = NULL; | |
25051 PyObject *__pyx_t_15 = NULL; | |
25052 PyObject *__pyx_t_16 = NULL; | |
25053 int __pyx_t_17; | |
25054 PyObject *(*__pyx_t_18)(PyObject *); | |
25055 long __pyx_t_19; | |
25056 double __pyx_t_20; | |
25057 int __pyx_t_21; | |
25058 Py_ssize_t __pyx_t_22; | |
25059 PyObject *__pyx_t_23 = NULL; | |
25060 PyObject *__pyx_t_24 = NULL; | |
25061 PyObject *__pyx_t_25 = NULL; | |
25062 int __pyx_t_26; | |
25063 PyObject *__pyx_t_27 = NULL; | |
25064 PyObject *__pyx_t_28 = NULL; | |
25065 PyObject *__pyx_t_29 = NULL; | |
25066 Py_ssize_t __pyx_t_30; | |
25067 Py_ssize_t __pyx_t_31; | |
25068 PyObject *(*__pyx_t_32)(PyObject *); | |
25069 int __pyx_lineno = 0; | |
25070 const char *__pyx_filename = NULL; | |
25071 int __pyx_clineno = 0; | |
25072 __Pyx_RefNannySetupContext("parse_data", 1); | |
25073 | |
25074 /* "pysam/libcvcf.pyx":672 | |
25075 * | |
25076 * def parse_data( self, line, lineparse=False ): | |
25077 * cols = line.split('\t') # <<<<<<<<<<<<<< | |
25078 * if len(cols) != len(self._samples)+9: | |
25079 * # gracefully deal with absent FORMAT column | |
25080 */ | |
25081 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error) | |
25082 __Pyx_GOTREF(__pyx_t_2); | |
25083 __pyx_t_3 = NULL; | |
25084 __pyx_t_4 = 0; | |
25085 #if CYTHON_UNPACK_METHODS | |
25086 if (likely(PyMethod_Check(__pyx_t_2))) { | |
25087 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
25088 if (likely(__pyx_t_3)) { | |
25089 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
25090 __Pyx_INCREF(__pyx_t_3); | |
25091 __Pyx_INCREF(function); | |
25092 __Pyx_DECREF_SET(__pyx_t_2, function); | |
25093 __pyx_t_4 = 1; | |
25094 } | |
25095 } | |
25096 #endif | |
25097 { | |
25098 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__25}; | |
25099 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
25100 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25101 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) | |
25102 __Pyx_GOTREF(__pyx_t_1); | |
25103 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25104 } | |
25105 __pyx_v_cols = __pyx_t_1; | |
25106 __pyx_t_1 = 0; | |
25107 | |
25108 /* "pysam/libcvcf.pyx":673 | |
25109 * def parse_data( self, line, lineparse=False ): | |
25110 * cols = line.split('\t') | |
25111 * if len(cols) != len(self._samples)+9: # <<<<<<<<<<<<<< | |
25112 * # gracefully deal with absent FORMAT column | |
25113 * # and those missing samples | |
25114 */ | |
25115 __pyx_t_5 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 673, __pyx_L1_error) | |
25116 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error) | |
25117 __Pyx_GOTREF(__pyx_t_1); | |
25118 __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 673, __pyx_L1_error) | |
25119 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25120 __pyx_t_7 = (__pyx_t_5 != (__pyx_t_6 + 9)); | |
25121 if (__pyx_t_7) { | |
25122 | |
25123 /* "pysam/libcvcf.pyx":676 | |
25124 * # gracefully deal with absent FORMAT column | |
25125 * # and those missing samples | |
25126 * if len(cols) == 8: # <<<<<<<<<<<<<< | |
25127 * cols.append("") | |
25128 * else: | |
25129 */ | |
25130 __pyx_t_6 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 676, __pyx_L1_error) | |
25131 __pyx_t_7 = (__pyx_t_6 == 8); | |
25132 if (__pyx_t_7) { | |
25133 | |
25134 /* "pysam/libcvcf.pyx":677 | |
25135 * # and those missing samples | |
25136 * if len(cols) == 8: | |
25137 * cols.append("") # <<<<<<<<<<<<<< | |
25138 * else: | |
25139 * self.error(line, | |
25140 */ | |
25141 __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_cols, __pyx_kp_u_); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 677, __pyx_L1_error) | |
25142 | |
25143 /* "pysam/libcvcf.pyx":676 | |
25144 * # gracefully deal with absent FORMAT column | |
25145 * # and those missing samples | |
25146 * if len(cols) == 8: # <<<<<<<<<<<<<< | |
25147 * cols.append("") | |
25148 * else: | |
25149 */ | |
25150 goto __pyx_L4; | |
25151 } | |
25152 | |
25153 /* "pysam/libcvcf.pyx":679 | |
25154 * cols.append("") | |
25155 * else: | |
25156 * self.error(line, # <<<<<<<<<<<<<< | |
25157 * self.BAD_NUMBER_OF_COLUMNS, | |
25158 * "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols))) | |
25159 */ | |
25160 /*else*/ { | |
25161 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) | |
25162 __Pyx_GOTREF(__pyx_t_2); | |
25163 | |
25164 /* "pysam/libcvcf.pyx":680 | |
25165 * else: | |
25166 * self.error(line, | |
25167 * self.BAD_NUMBER_OF_COLUMNS, # <<<<<<<<<<<<<< | |
25168 * "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols))) | |
25169 * | |
25170 */ | |
25171 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BAD_NUMBER_OF_COLUMNS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) | |
25172 __Pyx_GOTREF(__pyx_t_3); | |
25173 | |
25174 /* "pysam/libcvcf.pyx":681 | |
25175 * self.error(line, | |
25176 * self.BAD_NUMBER_OF_COLUMNS, | |
25177 * "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols))) # <<<<<<<<<<<<<< | |
25178 * | |
25179 * chrom = cols[0] | |
25180 */ | |
25181 __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 681, __pyx_L1_error) | |
25182 __Pyx_GOTREF(__pyx_t_9); | |
25183 __pyx_t_6 = 0; | |
25184 __pyx_t_10 = 127; | |
25185 __Pyx_INCREF(__pyx_kp_u_expected_3); | |
25186 __pyx_t_6 += 9; | |
25187 __Pyx_GIVEREF(__pyx_kp_u_expected_3); | |
25188 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_u_expected_3); | |
25189 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 681, __pyx_L1_error) | |
25190 __Pyx_GOTREF(__pyx_t_11); | |
25191 __pyx_t_5 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 681, __pyx_L1_error) | |
25192 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
25193 __pyx_t_11 = __Pyx_PyUnicode_From_Py_ssize_t((__pyx_t_5 + 9), 0, ' ', 'd'); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 681, __pyx_L1_error) | |
25194 __Pyx_GOTREF(__pyx_t_11); | |
25195 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11); | |
25196 __Pyx_GIVEREF(__pyx_t_11); | |
25197 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11); | |
25198 __pyx_t_11 = 0; | |
25199 __Pyx_INCREF(__pyx_kp_u_for); | |
25200 __pyx_t_6 += 5; | |
25201 __Pyx_GIVEREF(__pyx_kp_u_for); | |
25202 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_kp_u_for); | |
25203 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 681, __pyx_L1_error) | |
25204 __Pyx_GOTREF(__pyx_t_11); | |
25205 __pyx_t_5 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 681, __pyx_L1_error) | |
25206 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
25207 __pyx_t_11 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 681, __pyx_L1_error) | |
25208 __Pyx_GOTREF(__pyx_t_11); | |
25209 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11); | |
25210 __Pyx_GIVEREF(__pyx_t_11); | |
25211 PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_11); | |
25212 __pyx_t_11 = 0; | |
25213 __Pyx_INCREF(__pyx_kp_u_samples_2); | |
25214 __pyx_t_6 += 10; | |
25215 __Pyx_GIVEREF(__pyx_kp_u_samples_2); | |
25216 PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_kp_u_samples_2); | |
25217 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 681, __pyx_L1_error) | |
25218 __Pyx_GOTREF(__pyx_t_11); | |
25219 __pyx_t_12 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_11), __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 681, __pyx_L1_error) | |
25220 __Pyx_GOTREF(__pyx_t_12); | |
25221 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
25222 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_10; | |
25223 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12); | |
25224 __Pyx_GIVEREF(__pyx_t_12); | |
25225 PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_12); | |
25226 __pyx_t_12 = 0; | |
25227 __Pyx_INCREF(__pyx_kp_u_got); | |
25228 __pyx_t_6 += 7; | |
25229 __Pyx_GIVEREF(__pyx_kp_u_got); | |
25230 PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_kp_u_got); | |
25231 __pyx_t_5 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 681, __pyx_L1_error) | |
25232 __pyx_t_12 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 681, __pyx_L1_error) | |
25233 __Pyx_GOTREF(__pyx_t_12); | |
25234 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12); | |
25235 __Pyx_GIVEREF(__pyx_t_12); | |
25236 PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_12); | |
25237 __pyx_t_12 = 0; | |
25238 __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_9, 8, __pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 681, __pyx_L1_error) | |
25239 __Pyx_GOTREF(__pyx_t_12); | |
25240 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
25241 __pyx_t_9 = NULL; | |
25242 __pyx_t_4 = 0; | |
25243 #if CYTHON_UNPACK_METHODS | |
25244 if (likely(PyMethod_Check(__pyx_t_2))) { | |
25245 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); | |
25246 if (likely(__pyx_t_9)) { | |
25247 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
25248 __Pyx_INCREF(__pyx_t_9); | |
25249 __Pyx_INCREF(function); | |
25250 __Pyx_DECREF_SET(__pyx_t_2, function); | |
25251 __pyx_t_4 = 1; | |
25252 } | |
25253 } | |
25254 #endif | |
25255 { | |
25256 PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_line, __pyx_t_3, __pyx_t_12}; | |
25257 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
25258 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
25259 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25260 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25261 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) | |
25262 __Pyx_GOTREF(__pyx_t_1); | |
25263 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25264 } | |
25265 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25266 } | |
25267 __pyx_L4:; | |
25268 | |
25269 /* "pysam/libcvcf.pyx":673 | |
25270 * def parse_data( self, line, lineparse=False ): | |
25271 * cols = line.split('\t') | |
25272 * if len(cols) != len(self._samples)+9: # <<<<<<<<<<<<<< | |
25273 * # gracefully deal with absent FORMAT column | |
25274 * # and those missing samples | |
25275 */ | |
25276 } | |
25277 | |
25278 /* "pysam/libcvcf.pyx":683 | |
25279 * "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols))) | |
25280 * | |
25281 * chrom = cols[0] # <<<<<<<<<<<<<< | |
25282 * | |
25283 * # get 0-based position | |
25284 */ | |
25285 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cols, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) | |
25286 __Pyx_GOTREF(__pyx_t_1); | |
25287 __pyx_v_chrom = __pyx_t_1; | |
25288 __pyx_t_1 = 0; | |
25289 | |
25290 /* "pysam/libcvcf.pyx":686 | |
25291 * | |
25292 * # get 0-based position | |
25293 * try: pos = int(cols[1])-1 # <<<<<<<<<<<<<< | |
25294 * except: self.error(line,self.POS_NOT_NUMERICAL) | |
25295 * if pos < 0: self.error(line,self.POS_NOT_POSITIVE) | |
25296 */ | |
25297 { | |
25298 __Pyx_PyThreadState_declare | |
25299 __Pyx_PyThreadState_assign | |
25300 __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); | |
25301 __Pyx_XGOTREF(__pyx_t_13); | |
25302 __Pyx_XGOTREF(__pyx_t_14); | |
25303 __Pyx_XGOTREF(__pyx_t_15); | |
25304 /*try:*/ { | |
25305 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cols, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L5_error) | |
25306 __Pyx_GOTREF(__pyx_t_1); | |
25307 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L5_error) | |
25308 __Pyx_GOTREF(__pyx_t_2); | |
25309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25310 __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L5_error) | |
25311 __Pyx_GOTREF(__pyx_t_1); | |
25312 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25313 __pyx_v_pos = __pyx_t_1; | |
25314 __pyx_t_1 = 0; | |
25315 } | |
25316 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; | |
25317 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; | |
25318 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; | |
25319 goto __pyx_L10_try_end; | |
25320 __pyx_L5_error:; | |
25321 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25322 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
25323 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25324 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25325 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25326 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
25327 | |
25328 /* "pysam/libcvcf.pyx":687 | |
25329 * # get 0-based position | |
25330 * try: pos = int(cols[1])-1 | |
25331 * except: self.error(line,self.POS_NOT_NUMERICAL) # <<<<<<<<<<<<<< | |
25332 * if pos < 0: self.error(line,self.POS_NOT_POSITIVE) | |
25333 * | |
25334 */ | |
25335 /*except:*/ { | |
25336 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
25337 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_12) < 0) __PYX_ERR(0, 687, __pyx_L7_except_error) | |
25338 __Pyx_XGOTREF(__pyx_t_1); | |
25339 __Pyx_XGOTREF(__pyx_t_2); | |
25340 __Pyx_XGOTREF(__pyx_t_12); | |
25341 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 687, __pyx_L7_except_error) | |
25342 __Pyx_GOTREF(__pyx_t_9); | |
25343 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_POS_NOT_NUMERICAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 687, __pyx_L7_except_error) | |
25344 __Pyx_GOTREF(__pyx_t_11); | |
25345 __pyx_t_16 = NULL; | |
25346 __pyx_t_4 = 0; | |
25347 #if CYTHON_UNPACK_METHODS | |
25348 if (likely(PyMethod_Check(__pyx_t_9))) { | |
25349 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_9); | |
25350 if (likely(__pyx_t_16)) { | |
25351 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); | |
25352 __Pyx_INCREF(__pyx_t_16); | |
25353 __Pyx_INCREF(function); | |
25354 __Pyx_DECREF_SET(__pyx_t_9, function); | |
25355 __pyx_t_4 = 1; | |
25356 } | |
25357 } | |
25358 #endif | |
25359 { | |
25360 PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_v_line, __pyx_t_11}; | |
25361 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
25362 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
25363 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
25364 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L7_except_error) | |
25365 __Pyx_GOTREF(__pyx_t_3); | |
25366 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
25367 } | |
25368 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25369 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25370 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25371 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25372 goto __pyx_L6_exception_handled; | |
25373 } | |
25374 | |
25375 /* "pysam/libcvcf.pyx":686 | |
25376 * | |
25377 * # get 0-based position | |
25378 * try: pos = int(cols[1])-1 # <<<<<<<<<<<<<< | |
25379 * except: self.error(line,self.POS_NOT_NUMERICAL) | |
25380 * if pos < 0: self.error(line,self.POS_NOT_POSITIVE) | |
25381 */ | |
25382 __pyx_L7_except_error:; | |
25383 __Pyx_XGIVEREF(__pyx_t_13); | |
25384 __Pyx_XGIVEREF(__pyx_t_14); | |
25385 __Pyx_XGIVEREF(__pyx_t_15); | |
25386 __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); | |
25387 goto __pyx_L1_error; | |
25388 __pyx_L6_exception_handled:; | |
25389 __Pyx_XGIVEREF(__pyx_t_13); | |
25390 __Pyx_XGIVEREF(__pyx_t_14); | |
25391 __Pyx_XGIVEREF(__pyx_t_15); | |
25392 __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); | |
25393 __pyx_L10_try_end:; | |
25394 } | |
25395 | |
25396 /* "pysam/libcvcf.pyx":688 | |
25397 * try: pos = int(cols[1])-1 | |
25398 * except: self.error(line,self.POS_NOT_NUMERICAL) | |
25399 * if pos < 0: self.error(line,self.POS_NOT_POSITIVE) # <<<<<<<<<<<<<< | |
25400 * | |
25401 * # implement filtering | |
25402 */ | |
25403 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 688, __pyx_L1_error) } | |
25404 __pyx_t_12 = PyObject_RichCompare(__pyx_v_pos, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 688, __pyx_L1_error) | |
25405 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 688, __pyx_L1_error) | |
25406 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25407 if (__pyx_t_7) { | |
25408 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error) | |
25409 __Pyx_GOTREF(__pyx_t_2); | |
25410 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_POS_NOT_POSITIVE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) | |
25411 __Pyx_GOTREF(__pyx_t_1); | |
25412 __pyx_t_3 = NULL; | |
25413 __pyx_t_4 = 0; | |
25414 #if CYTHON_UNPACK_METHODS | |
25415 if (likely(PyMethod_Check(__pyx_t_2))) { | |
25416 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
25417 if (likely(__pyx_t_3)) { | |
25418 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
25419 __Pyx_INCREF(__pyx_t_3); | |
25420 __Pyx_INCREF(function); | |
25421 __Pyx_DECREF_SET(__pyx_t_2, function); | |
25422 __pyx_t_4 = 1; | |
25423 } | |
25424 } | |
25425 #endif | |
25426 { | |
25427 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_line, __pyx_t_1}; | |
25428 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
25429 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25430 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25431 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 688, __pyx_L1_error) | |
25432 __Pyx_GOTREF(__pyx_t_12); | |
25433 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25434 } | |
25435 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25436 } | |
25437 | |
25438 /* "pysam/libcvcf.pyx":691 | |
25439 * | |
25440 * # implement filtering | |
25441 * if not self.inregion(chrom,pos): return None # <<<<<<<<<<<<<< | |
25442 * | |
25443 * # end of first-pass parse for sortedVCF | |
25444 */ | |
25445 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inregion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error) | |
25446 __Pyx_GOTREF(__pyx_t_2); | |
25447 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 691, __pyx_L1_error) } | |
25448 __pyx_t_1 = NULL; | |
25449 __pyx_t_4 = 0; | |
25450 #if CYTHON_UNPACK_METHODS | |
25451 if (likely(PyMethod_Check(__pyx_t_2))) { | |
25452 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); | |
25453 if (likely(__pyx_t_1)) { | |
25454 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
25455 __Pyx_INCREF(__pyx_t_1); | |
25456 __Pyx_INCREF(function); | |
25457 __Pyx_DECREF_SET(__pyx_t_2, function); | |
25458 __pyx_t_4 = 1; | |
25459 } | |
25460 } | |
25461 #endif | |
25462 { | |
25463 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_chrom, __pyx_v_pos}; | |
25464 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
25465 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25466 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error) | |
25467 __Pyx_GOTREF(__pyx_t_12); | |
25468 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25469 } | |
25470 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 691, __pyx_L1_error) | |
25471 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25472 __pyx_t_17 = (!__pyx_t_7); | |
25473 if (__pyx_t_17) { | |
25474 __Pyx_XDECREF(__pyx_r); | |
25475 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
25476 goto __pyx_L0; | |
25477 } | |
25478 | |
25479 /* "pysam/libcvcf.pyx":694 | |
25480 * | |
25481 * # end of first-pass parse for sortedVCF | |
25482 * if lineparse: return chrom, pos, line # <<<<<<<<<<<<<< | |
25483 * | |
25484 * id = cols[2] | |
25485 */ | |
25486 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_lineparse); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) | |
25487 if (__pyx_t_17) { | |
25488 __Pyx_XDECREF(__pyx_r); | |
25489 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 694, __pyx_L1_error) } | |
25490 __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 694, __pyx_L1_error) | |
25491 __Pyx_GOTREF(__pyx_t_12); | |
25492 __Pyx_INCREF(__pyx_v_chrom); | |
25493 __Pyx_GIVEREF(__pyx_v_chrom); | |
25494 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_chrom)) __PYX_ERR(0, 694, __pyx_L1_error); | |
25495 __Pyx_INCREF(__pyx_v_pos); | |
25496 __Pyx_GIVEREF(__pyx_v_pos); | |
25497 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_pos)) __PYX_ERR(0, 694, __pyx_L1_error); | |
25498 __Pyx_INCREF(__pyx_v_line); | |
25499 __Pyx_GIVEREF(__pyx_v_line); | |
25500 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_line)) __PYX_ERR(0, 694, __pyx_L1_error); | |
25501 __pyx_r = __pyx_t_12; | |
25502 __pyx_t_12 = 0; | |
25503 goto __pyx_L0; | |
25504 } | |
25505 | |
25506 /* "pysam/libcvcf.pyx":696 | |
25507 * if lineparse: return chrom, pos, line | |
25508 * | |
25509 * id = cols[2] # <<<<<<<<<<<<<< | |
25510 * | |
25511 * ref = cols[3].upper() | |
25512 */ | |
25513 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 696, __pyx_L1_error) | |
25514 __Pyx_GOTREF(__pyx_t_12); | |
25515 __pyx_v_id = __pyx_t_12; | |
25516 __pyx_t_12 = 0; | |
25517 | |
25518 /* "pysam/libcvcf.pyx":698 | |
25519 * id = cols[2] | |
25520 * | |
25521 * ref = cols[3].upper() # <<<<<<<<<<<<<< | |
25522 * if ref == ".": | |
25523 * self.error(line,self.MISSING_REF) | |
25524 */ | |
25525 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) | |
25526 __Pyx_GOTREF(__pyx_t_2); | |
25527 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) | |
25528 __Pyx_GOTREF(__pyx_t_1); | |
25529 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25530 __pyx_t_2 = NULL; | |
25531 __pyx_t_4 = 0; | |
25532 #if CYTHON_UNPACK_METHODS | |
25533 if (likely(PyMethod_Check(__pyx_t_1))) { | |
25534 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); | |
25535 if (likely(__pyx_t_2)) { | |
25536 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
25537 __Pyx_INCREF(__pyx_t_2); | |
25538 __Pyx_INCREF(function); | |
25539 __Pyx_DECREF_SET(__pyx_t_1, function); | |
25540 __pyx_t_4 = 1; | |
25541 } | |
25542 } | |
25543 #endif | |
25544 { | |
25545 PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; | |
25546 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
25547 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25548 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 698, __pyx_L1_error) | |
25549 __Pyx_GOTREF(__pyx_t_12); | |
25550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25551 } | |
25552 __pyx_v_ref = __pyx_t_12; | |
25553 __pyx_t_12 = 0; | |
25554 | |
25555 /* "pysam/libcvcf.pyx":699 | |
25556 * | |
25557 * ref = cols[3].upper() | |
25558 * if ref == ".": # <<<<<<<<<<<<<< | |
25559 * self.error(line,self.MISSING_REF) | |
25560 * if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference) | |
25561 */ | |
25562 __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_v_ref, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 699, __pyx_L1_error) | |
25563 if (__pyx_t_17) { | |
25564 | |
25565 /* "pysam/libcvcf.pyx":700 | |
25566 * ref = cols[3].upper() | |
25567 * if ref == ".": | |
25568 * self.error(line,self.MISSING_REF) # <<<<<<<<<<<<<< | |
25569 * if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference) | |
25570 * else: ref = "" | |
25571 */ | |
25572 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) | |
25573 __Pyx_GOTREF(__pyx_t_1); | |
25574 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MISSING_REF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) | |
25575 __Pyx_GOTREF(__pyx_t_2); | |
25576 __pyx_t_3 = NULL; | |
25577 __pyx_t_4 = 0; | |
25578 #if CYTHON_UNPACK_METHODS | |
25579 if (likely(PyMethod_Check(__pyx_t_1))) { | |
25580 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
25581 if (likely(__pyx_t_3)) { | |
25582 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
25583 __Pyx_INCREF(__pyx_t_3); | |
25584 __Pyx_INCREF(function); | |
25585 __Pyx_DECREF_SET(__pyx_t_1, function); | |
25586 __pyx_t_4 = 1; | |
25587 } | |
25588 } | |
25589 #endif | |
25590 { | |
25591 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_line, __pyx_t_2}; | |
25592 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
25593 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25594 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25595 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 700, __pyx_L1_error) | |
25596 __Pyx_GOTREF(__pyx_t_12); | |
25597 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25598 } | |
25599 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25600 | |
25601 /* "pysam/libcvcf.pyx":701 | |
25602 * if ref == ".": | |
25603 * self.error(line,self.MISSING_REF) | |
25604 * if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference) # <<<<<<<<<<<<<< | |
25605 * else: ref = "" | |
25606 * else: | |
25607 */ | |
25608 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 701, __pyx_L1_error) | |
25609 __Pyx_GOTREF(__pyx_t_12); | |
25610 __pyx_t_17 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_12, __pyx_int_33, 33, 0)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 701, __pyx_L1_error) | |
25611 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25612 if (__pyx_t_17) { | |
25613 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) | |
25614 __Pyx_GOTREF(__pyx_t_1); | |
25615 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 701, __pyx_L1_error) } | |
25616 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 701, __pyx_L1_error) } | |
25617 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_pos, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) | |
25618 __Pyx_GOTREF(__pyx_t_2); | |
25619 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) | |
25620 __Pyx_GOTREF(__pyx_t_3); | |
25621 __pyx_t_9 = NULL; | |
25622 __pyx_t_4 = 0; | |
25623 #if CYTHON_UNPACK_METHODS | |
25624 if (unlikely(PyMethod_Check(__pyx_t_1))) { | |
25625 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); | |
25626 if (likely(__pyx_t_9)) { | |
25627 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
25628 __Pyx_INCREF(__pyx_t_9); | |
25629 __Pyx_INCREF(function); | |
25630 __Pyx_DECREF_SET(__pyx_t_1, function); | |
25631 __pyx_t_4 = 1; | |
25632 } | |
25633 } | |
25634 #endif | |
25635 { | |
25636 PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_v_chrom, __pyx_v_pos, __pyx_t_2, __pyx_t_3}; | |
25637 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
25638 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
25639 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25640 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25641 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 701, __pyx_L1_error) | |
25642 __Pyx_GOTREF(__pyx_t_12); | |
25643 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25644 } | |
25645 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_12); | |
25646 __pyx_t_12 = 0; | |
25647 goto __pyx_L17; | |
25648 } | |
25649 | |
25650 /* "pysam/libcvcf.pyx":702 | |
25651 * self.error(line,self.MISSING_REF) | |
25652 * if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference) | |
25653 * else: ref = "" # <<<<<<<<<<<<<< | |
25654 * else: | |
25655 * for c in ref: | |
25656 */ | |
25657 /*else*/ { | |
25658 __Pyx_INCREF(__pyx_kp_u_); | |
25659 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_kp_u_); | |
25660 } | |
25661 __pyx_L17:; | |
25662 | |
25663 /* "pysam/libcvcf.pyx":699 | |
25664 * | |
25665 * ref = cols[3].upper() | |
25666 * if ref == ".": # <<<<<<<<<<<<<< | |
25667 * self.error(line,self.MISSING_REF) | |
25668 * if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference) | |
25669 */ | |
25670 goto __pyx_L16; | |
25671 } | |
25672 | |
25673 /* "pysam/libcvcf.pyx":704 | |
25674 * else: ref = "" | |
25675 * else: | |
25676 * for c in ref: # <<<<<<<<<<<<<< | |
25677 * if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF) | |
25678 * if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference) | |
25679 */ | |
25680 /*else*/ { | |
25681 if (likely(PyList_CheckExact(__pyx_v_ref)) || PyTuple_CheckExact(__pyx_v_ref)) { | |
25682 __pyx_t_12 = __pyx_v_ref; __Pyx_INCREF(__pyx_t_12); | |
25683 __pyx_t_6 = 0; | |
25684 __pyx_t_18 = NULL; | |
25685 } else { | |
25686 __pyx_t_6 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_ref); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 704, __pyx_L1_error) | |
25687 __Pyx_GOTREF(__pyx_t_12); | |
25688 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 704, __pyx_L1_error) | |
25689 } | |
25690 for (;;) { | |
25691 if (likely(!__pyx_t_18)) { | |
25692 if (likely(PyList_CheckExact(__pyx_t_12))) { | |
25693 { | |
25694 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); | |
25695 #if !CYTHON_ASSUME_SAFE_MACROS | |
25696 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L1_error) | |
25697 #endif | |
25698 if (__pyx_t_6 >= __pyx_temp) break; | |
25699 } | |
25700 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
25701 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 704, __pyx_L1_error) | |
25702 #else | |
25703 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) | |
25704 __Pyx_GOTREF(__pyx_t_1); | |
25705 #endif | |
25706 } else { | |
25707 { | |
25708 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12); | |
25709 #if !CYTHON_ASSUME_SAFE_MACROS | |
25710 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L1_error) | |
25711 #endif | |
25712 if (__pyx_t_6 >= __pyx_temp) break; | |
25713 } | |
25714 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
25715 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 704, __pyx_L1_error) | |
25716 #else | |
25717 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) | |
25718 __Pyx_GOTREF(__pyx_t_1); | |
25719 #endif | |
25720 } | |
25721 } else { | |
25722 __pyx_t_1 = __pyx_t_18(__pyx_t_12); | |
25723 if (unlikely(!__pyx_t_1)) { | |
25724 PyObject* exc_type = PyErr_Occurred(); | |
25725 if (exc_type) { | |
25726 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
25727 else __PYX_ERR(0, 704, __pyx_L1_error) | |
25728 } | |
25729 break; | |
25730 } | |
25731 __Pyx_GOTREF(__pyx_t_1); | |
25732 } | |
25733 __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1); | |
25734 __pyx_t_1 = 0; | |
25735 | |
25736 /* "pysam/libcvcf.pyx":705 | |
25737 * else: | |
25738 * for c in ref: | |
25739 * if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF) # <<<<<<<<<<<<<< | |
25740 * if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference) | |
25741 * | |
25742 */ | |
25743 __pyx_t_17 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_c, __pyx_n_u_ACGTN, Py_NE)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 705, __pyx_L1_error) | |
25744 if (__pyx_t_17) { | |
25745 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error) | |
25746 __Pyx_GOTREF(__pyx_t_3); | |
25747 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_UNKNOWN_CHAR_IN_REF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error) | |
25748 __Pyx_GOTREF(__pyx_t_2); | |
25749 __pyx_t_9 = NULL; | |
25750 __pyx_t_4 = 0; | |
25751 #if CYTHON_UNPACK_METHODS | |
25752 if (likely(PyMethod_Check(__pyx_t_3))) { | |
25753 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); | |
25754 if (likely(__pyx_t_9)) { | |
25755 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
25756 __Pyx_INCREF(__pyx_t_9); | |
25757 __Pyx_INCREF(function); | |
25758 __Pyx_DECREF_SET(__pyx_t_3, function); | |
25759 __pyx_t_4 = 1; | |
25760 } | |
25761 } | |
25762 #endif | |
25763 { | |
25764 PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_line, __pyx_t_2}; | |
25765 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
25766 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
25767 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25768 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) | |
25769 __Pyx_GOTREF(__pyx_t_1); | |
25770 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25771 } | |
25772 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25773 } | |
25774 | |
25775 /* "pysam/libcvcf.pyx":704 | |
25776 * else: ref = "" | |
25777 * else: | |
25778 * for c in ref: # <<<<<<<<<<<<<< | |
25779 * if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF) | |
25780 * if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference) | |
25781 */ | |
25782 } | |
25783 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25784 | |
25785 /* "pysam/libcvcf.pyx":706 | |
25786 * for c in ref: | |
25787 * if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF) | |
25788 * if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference) # <<<<<<<<<<<<<< | |
25789 * | |
25790 * # make sure reference is sane | |
25791 */ | |
25792 __pyx_t_17 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_N, __pyx_v_ref, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 706, __pyx_L1_error) | |
25793 if (__pyx_t_17) { | |
25794 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) | |
25795 __Pyx_GOTREF(__pyx_t_1); | |
25796 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 706, __pyx_L1_error) } | |
25797 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 706, __pyx_L1_error) } | |
25798 __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 706, __pyx_L1_error) | |
25799 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L1_error) | |
25800 __Pyx_GOTREF(__pyx_t_3); | |
25801 __pyx_t_2 = PyNumber_Add(__pyx_v_pos, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error) | |
25802 __Pyx_GOTREF(__pyx_t_2); | |
25803 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25804 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L1_error) | |
25805 __Pyx_GOTREF(__pyx_t_3); | |
25806 __pyx_t_9 = NULL; | |
25807 __pyx_t_4 = 0; | |
25808 #if CYTHON_UNPACK_METHODS | |
25809 if (unlikely(PyMethod_Check(__pyx_t_1))) { | |
25810 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); | |
25811 if (likely(__pyx_t_9)) { | |
25812 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
25813 __Pyx_INCREF(__pyx_t_9); | |
25814 __Pyx_INCREF(function); | |
25815 __Pyx_DECREF_SET(__pyx_t_1, function); | |
25816 __pyx_t_4 = 1; | |
25817 } | |
25818 } | |
25819 #endif | |
25820 { | |
25821 PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_v_chrom, __pyx_v_pos, __pyx_t_2, __pyx_t_3}; | |
25822 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
25823 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
25824 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25825 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25826 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 706, __pyx_L1_error) | |
25827 __Pyx_GOTREF(__pyx_t_12); | |
25828 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25829 } | |
25830 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_12); | |
25831 __pyx_t_12 = 0; | |
25832 } | |
25833 } | |
25834 __pyx_L16:; | |
25835 | |
25836 /* "pysam/libcvcf.pyx":709 | |
25837 * | |
25838 * # make sure reference is sane | |
25839 * if self._reference: # <<<<<<<<<<<<<< | |
25840 * left = max(0,pos-100) | |
25841 * faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference) | |
25842 */ | |
25843 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 709, __pyx_L1_error) | |
25844 __Pyx_GOTREF(__pyx_t_12); | |
25845 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 709, __pyx_L1_error) | |
25846 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25847 if (__pyx_t_17) { | |
25848 | |
25849 /* "pysam/libcvcf.pyx":710 | |
25850 * # make sure reference is sane | |
25851 * if self._reference: | |
25852 * left = max(0,pos-100) # <<<<<<<<<<<<<< | |
25853 * faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference) | |
25854 * faref = faref_leftflank[pos-left:] | |
25855 */ | |
25856 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 710, __pyx_L1_error) } | |
25857 __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_pos, __pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 710, __pyx_L1_error) | |
25858 __Pyx_GOTREF(__pyx_t_12); | |
25859 __pyx_t_19 = 0; | |
25860 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) | |
25861 __Pyx_GOTREF(__pyx_t_3); | |
25862 __pyx_t_2 = PyObject_RichCompare(__pyx_t_12, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) | |
25863 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25864 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 710, __pyx_L1_error) | |
25865 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25866 if (__pyx_t_17) { | |
25867 __Pyx_INCREF(__pyx_t_12); | |
25868 __pyx_t_1 = __pyx_t_12; | |
25869 } else { | |
25870 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) | |
25871 __Pyx_GOTREF(__pyx_t_2); | |
25872 __pyx_t_1 = __pyx_t_2; | |
25873 __pyx_t_2 = 0; | |
25874 } | |
25875 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25876 __pyx_t_12 = __pyx_t_1; | |
25877 __Pyx_INCREF(__pyx_t_12); | |
25878 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25879 __pyx_v_left = __pyx_t_12; | |
25880 __pyx_t_12 = 0; | |
25881 | |
25882 /* "pysam/libcvcf.pyx":711 | |
25883 * if self._reference: | |
25884 * left = max(0,pos-100) | |
25885 * faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference) # <<<<<<<<<<<<<< | |
25886 * faref = faref_leftflank[pos-left:] | |
25887 * if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref)) | |
25888 */ | |
25889 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) | |
25890 __Pyx_GOTREF(__pyx_t_1); | |
25891 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 711, __pyx_L1_error) } | |
25892 __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 711, __pyx_L1_error) | |
25893 __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) | |
25894 __Pyx_GOTREF(__pyx_t_2); | |
25895 __pyx_t_3 = PyNumber_Add(__pyx_v_pos, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error) | |
25896 __Pyx_GOTREF(__pyx_t_3); | |
25897 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25898 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) | |
25899 __Pyx_GOTREF(__pyx_t_2); | |
25900 __pyx_t_9 = NULL; | |
25901 __pyx_t_4 = 0; | |
25902 #if CYTHON_UNPACK_METHODS | |
25903 if (unlikely(PyMethod_Check(__pyx_t_1))) { | |
25904 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); | |
25905 if (likely(__pyx_t_9)) { | |
25906 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
25907 __Pyx_INCREF(__pyx_t_9); | |
25908 __Pyx_INCREF(function); | |
25909 __Pyx_DECREF_SET(__pyx_t_1, function); | |
25910 __pyx_t_4 = 1; | |
25911 } | |
25912 } | |
25913 #endif | |
25914 { | |
25915 PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_v_chrom, __pyx_v_left, __pyx_t_3, __pyx_t_2}; | |
25916 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
25917 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
25918 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25919 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
25920 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 711, __pyx_L1_error) | |
25921 __Pyx_GOTREF(__pyx_t_12); | |
25922 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25923 } | |
25924 __pyx_v_faref_leftflank = __pyx_t_12; | |
25925 __pyx_t_12 = 0; | |
25926 | |
25927 /* "pysam/libcvcf.pyx":712 | |
25928 * left = max(0,pos-100) | |
25929 * faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference) | |
25930 * faref = faref_leftflank[pos-left:] # <<<<<<<<<<<<<< | |
25931 * if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref)) | |
25932 * ref = faref | |
25933 */ | |
25934 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 712, __pyx_L1_error) } | |
25935 __pyx_t_12 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 712, __pyx_L1_error) | |
25936 __Pyx_GOTREF(__pyx_t_12); | |
25937 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_faref_leftflank, 0, 0, &__pyx_t_12, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) | |
25938 __Pyx_GOTREF(__pyx_t_1); | |
25939 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
25940 __pyx_v_faref = __pyx_t_1; | |
25941 __pyx_t_1 = 0; | |
25942 | |
25943 /* "pysam/libcvcf.pyx":713 | |
25944 * faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference) | |
25945 * faref = faref_leftflank[pos-left:] | |
25946 * if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref)) # <<<<<<<<<<<<<< | |
25947 * ref = faref | |
25948 * | |
25949 */ | |
25950 __pyx_t_1 = PyObject_RichCompare(__pyx_v_faref, __pyx_v_ref, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) | |
25951 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 713, __pyx_L1_error) | |
25952 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25953 if (__pyx_t_17) { | |
25954 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 713, __pyx_L1_error) | |
25955 __Pyx_GOTREF(__pyx_t_12); | |
25956 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_WRONG_REF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) | |
25957 __Pyx_GOTREF(__pyx_t_2); | |
25958 __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 713, __pyx_L1_error) | |
25959 __Pyx_GOTREF(__pyx_t_3); | |
25960 __pyx_t_6 = 0; | |
25961 __pyx_t_10 = 127; | |
25962 __Pyx_INCREF(__pyx_kp_u_reference_is); | |
25963 __pyx_t_6 += 14; | |
25964 __Pyx_GIVEREF(__pyx_kp_u_reference_is); | |
25965 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_reference_is); | |
25966 __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_faref), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 713, __pyx_L1_error) | |
25967 __Pyx_GOTREF(__pyx_t_9); | |
25968 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_10; | |
25969 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); | |
25970 __Pyx_GIVEREF(__pyx_t_9); | |
25971 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9); | |
25972 __pyx_t_9 = 0; | |
25973 __Pyx_INCREF(__pyx_kp_u_VCF_says); | |
25974 __pyx_t_6 += 11; | |
25975 __Pyx_GIVEREF(__pyx_kp_u_VCF_says); | |
25976 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_VCF_says); | |
25977 __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_ref), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 713, __pyx_L1_error) | |
25978 __Pyx_GOTREF(__pyx_t_9); | |
25979 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_10; | |
25980 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); | |
25981 __Pyx_GIVEREF(__pyx_t_9); | |
25982 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_9); | |
25983 __pyx_t_9 = 0; | |
25984 __Pyx_INCREF(__pyx_kp_u__8); | |
25985 __pyx_t_6 += 1; | |
25986 __Pyx_GIVEREF(__pyx_kp_u__8); | |
25987 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__8); | |
25988 __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 713, __pyx_L1_error) | |
25989 __Pyx_GOTREF(__pyx_t_9); | |
25990 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25991 __pyx_t_3 = NULL; | |
25992 __pyx_t_4 = 0; | |
25993 #if CYTHON_UNPACK_METHODS | |
25994 if (likely(PyMethod_Check(__pyx_t_12))) { | |
25995 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12); | |
25996 if (likely(__pyx_t_3)) { | |
25997 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); | |
25998 __Pyx_INCREF(__pyx_t_3); | |
25999 __Pyx_INCREF(function); | |
26000 __Pyx_DECREF_SET(__pyx_t_12, function); | |
26001 __pyx_t_4 = 1; | |
26002 } | |
26003 } | |
26004 #endif | |
26005 { | |
26006 PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_line, __pyx_t_2, __pyx_t_9}; | |
26007 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
26008 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
26009 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26010 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26011 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) | |
26012 __Pyx_GOTREF(__pyx_t_1); | |
26013 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26014 } | |
26015 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26016 } | |
26017 | |
26018 /* "pysam/libcvcf.pyx":714 | |
26019 * faref = faref_leftflank[pos-left:] | |
26020 * if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref)) | |
26021 * ref = faref # <<<<<<<<<<<<<< | |
26022 * | |
26023 * # convert v3.3 to v4.0 alleles below | |
26024 */ | |
26025 __Pyx_INCREF(__pyx_v_faref); | |
26026 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_v_faref); | |
26027 | |
26028 /* "pysam/libcvcf.pyx":709 | |
26029 * | |
26030 * # make sure reference is sane | |
26031 * if self._reference: # <<<<<<<<<<<<<< | |
26032 * left = max(0,pos-100) | |
26033 * faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference) | |
26034 */ | |
26035 } | |
26036 | |
26037 /* "pysam/libcvcf.pyx":717 | |
26038 * | |
26039 * # convert v3.3 to v4.0 alleles below | |
26040 * if cols[4] == ".": alt = [] # <<<<<<<<<<<<<< | |
26041 * else: alt = cols[4].upper().split(',') | |
26042 * | |
26043 */ | |
26044 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cols, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) | |
26045 __Pyx_GOTREF(__pyx_t_1); | |
26046 __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) | |
26047 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26048 if (__pyx_t_17) { | |
26049 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) | |
26050 __Pyx_GOTREF(__pyx_t_1); | |
26051 __pyx_v_alt = __pyx_t_1; | |
26052 __pyx_t_1 = 0; | |
26053 goto __pyx_L25; | |
26054 } | |
26055 | |
26056 /* "pysam/libcvcf.pyx":718 | |
26057 * # convert v3.3 to v4.0 alleles below | |
26058 * if cols[4] == ".": alt = [] | |
26059 * else: alt = cols[4].upper().split(',') # <<<<<<<<<<<<<< | |
26060 * | |
26061 * if cols[5] == ".": qual = -1 | |
26062 */ | |
26063 /*else*/ { | |
26064 __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_cols, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 718, __pyx_L1_error) | |
26065 __Pyx_GOTREF(__pyx_t_9); | |
26066 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) | |
26067 __Pyx_GOTREF(__pyx_t_2); | |
26068 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26069 __pyx_t_9 = NULL; | |
26070 __pyx_t_4 = 0; | |
26071 #if CYTHON_UNPACK_METHODS | |
26072 if (likely(PyMethod_Check(__pyx_t_2))) { | |
26073 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); | |
26074 if (likely(__pyx_t_9)) { | |
26075 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
26076 __Pyx_INCREF(__pyx_t_9); | |
26077 __Pyx_INCREF(function); | |
26078 __Pyx_DECREF_SET(__pyx_t_2, function); | |
26079 __pyx_t_4 = 1; | |
26080 } | |
26081 } | |
26082 #endif | |
26083 { | |
26084 PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; | |
26085 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
26086 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26087 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 718, __pyx_L1_error) | |
26088 __Pyx_GOTREF(__pyx_t_12); | |
26089 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26090 } | |
26091 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) | |
26092 __Pyx_GOTREF(__pyx_t_2); | |
26093 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26094 __pyx_t_12 = NULL; | |
26095 __pyx_t_4 = 0; | |
26096 #if CYTHON_UNPACK_METHODS | |
26097 if (likely(PyMethod_Check(__pyx_t_2))) { | |
26098 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); | |
26099 if (likely(__pyx_t_12)) { | |
26100 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
26101 __Pyx_INCREF(__pyx_t_12); | |
26102 __Pyx_INCREF(function); | |
26103 __Pyx_DECREF_SET(__pyx_t_2, function); | |
26104 __pyx_t_4 = 1; | |
26105 } | |
26106 } | |
26107 #endif | |
26108 { | |
26109 PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_kp_u__2}; | |
26110 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
26111 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26112 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) | |
26113 __Pyx_GOTREF(__pyx_t_1); | |
26114 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26115 } | |
26116 __pyx_v_alt = __pyx_t_1; | |
26117 __pyx_t_1 = 0; | |
26118 } | |
26119 __pyx_L25:; | |
26120 | |
26121 /* "pysam/libcvcf.pyx":720 | |
26122 * else: alt = cols[4].upper().split(',') | |
26123 * | |
26124 * if cols[5] == ".": qual = -1 # <<<<<<<<<<<<<< | |
26125 * else: | |
26126 * try: qual = float(cols[5]) | |
26127 */ | |
26128 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cols, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error) | |
26129 __Pyx_GOTREF(__pyx_t_1); | |
26130 __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 720, __pyx_L1_error) | |
26131 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26132 if (__pyx_t_17) { | |
26133 __pyx_v_qual = -1.0; | |
26134 goto __pyx_L26; | |
26135 } | |
26136 | |
26137 /* "pysam/libcvcf.pyx":722 | |
26138 * if cols[5] == ".": qual = -1 | |
26139 * else: | |
26140 * try: qual = float(cols[5]) # <<<<<<<<<<<<<< | |
26141 * except: self.error(line,self.QUAL_NOT_NUMERICAL) | |
26142 * | |
26143 */ | |
26144 /*else*/ { | |
26145 { | |
26146 __Pyx_PyThreadState_declare | |
26147 __Pyx_PyThreadState_assign | |
26148 __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); | |
26149 __Pyx_XGOTREF(__pyx_t_15); | |
26150 __Pyx_XGOTREF(__pyx_t_14); | |
26151 __Pyx_XGOTREF(__pyx_t_13); | |
26152 /*try:*/ { | |
26153 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cols, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L27_error) | |
26154 __Pyx_GOTREF(__pyx_t_1); | |
26155 __pyx_t_20 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_20 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 722, __pyx_L27_error) | |
26156 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26157 __pyx_v_qual = __pyx_t_20; | |
26158 } | |
26159 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; | |
26160 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; | |
26161 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; | |
26162 goto __pyx_L32_try_end; | |
26163 __pyx_L27_error:; | |
26164 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26165 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
26166 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26167 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
26168 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26169 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
26170 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26171 | |
26172 /* "pysam/libcvcf.pyx":723 | |
26173 * else: | |
26174 * try: qual = float(cols[5]) | |
26175 * except: self.error(line,self.QUAL_NOT_NUMERICAL) # <<<<<<<<<<<<<< | |
26176 * | |
26177 * # postpone checking that filters exist. Encode missing filter or no filtering as empty list | |
26178 */ | |
26179 /*except:*/ { | |
26180 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
26181 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_12) < 0) __PYX_ERR(0, 723, __pyx_L29_except_error) | |
26182 __Pyx_XGOTREF(__pyx_t_1); | |
26183 __Pyx_XGOTREF(__pyx_t_2); | |
26184 __Pyx_XGOTREF(__pyx_t_12); | |
26185 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L29_except_error) | |
26186 __Pyx_GOTREF(__pyx_t_3); | |
26187 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_QUAL_NOT_NUMERICAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 723, __pyx_L29_except_error) | |
26188 __Pyx_GOTREF(__pyx_t_11); | |
26189 __pyx_t_16 = NULL; | |
26190 __pyx_t_4 = 0; | |
26191 #if CYTHON_UNPACK_METHODS | |
26192 if (likely(PyMethod_Check(__pyx_t_3))) { | |
26193 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); | |
26194 if (likely(__pyx_t_16)) { | |
26195 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
26196 __Pyx_INCREF(__pyx_t_16); | |
26197 __Pyx_INCREF(function); | |
26198 __Pyx_DECREF_SET(__pyx_t_3, function); | |
26199 __pyx_t_4 = 1; | |
26200 } | |
26201 } | |
26202 #endif | |
26203 { | |
26204 PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_v_line, __pyx_t_11}; | |
26205 __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
26206 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
26207 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
26208 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 723, __pyx_L29_except_error) | |
26209 __Pyx_GOTREF(__pyx_t_9); | |
26210 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
26211 } | |
26212 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26213 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26214 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26215 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26216 goto __pyx_L28_exception_handled; | |
26217 } | |
26218 | |
26219 /* "pysam/libcvcf.pyx":722 | |
26220 * if cols[5] == ".": qual = -1 | |
26221 * else: | |
26222 * try: qual = float(cols[5]) # <<<<<<<<<<<<<< | |
26223 * except: self.error(line,self.QUAL_NOT_NUMERICAL) | |
26224 * | |
26225 */ | |
26226 __pyx_L29_except_error:; | |
26227 __Pyx_XGIVEREF(__pyx_t_15); | |
26228 __Pyx_XGIVEREF(__pyx_t_14); | |
26229 __Pyx_XGIVEREF(__pyx_t_13); | |
26230 __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); | |
26231 goto __pyx_L1_error; | |
26232 __pyx_L28_exception_handled:; | |
26233 __Pyx_XGIVEREF(__pyx_t_15); | |
26234 __Pyx_XGIVEREF(__pyx_t_14); | |
26235 __Pyx_XGIVEREF(__pyx_t_13); | |
26236 __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); | |
26237 __pyx_L32_try_end:; | |
26238 } | |
26239 } | |
26240 __pyx_L26:; | |
26241 | |
26242 /* "pysam/libcvcf.pyx":726 | |
26243 * | |
26244 * # postpone checking that filters exist. Encode missing filter or no filtering as empty list | |
26245 * if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = [] # <<<<<<<<<<<<<< | |
26246 * else: filter = cols[6].split(';') | |
26247 * | |
26248 */ | |
26249 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 726, __pyx_L1_error) | |
26250 __Pyx_GOTREF(__pyx_t_12); | |
26251 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) | |
26252 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26253 if (!__pyx_t_7) { | |
26254 } else { | |
26255 __pyx_t_17 = __pyx_t_7; | |
26256 goto __pyx_L36_bool_binop_done; | |
26257 } | |
26258 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 726, __pyx_L1_error) | |
26259 __Pyx_GOTREF(__pyx_t_12); | |
26260 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_n_u_PASS, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) | |
26261 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26262 if (!__pyx_t_7) { | |
26263 } else { | |
26264 __pyx_t_17 = __pyx_t_7; | |
26265 goto __pyx_L36_bool_binop_done; | |
26266 } | |
26267 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 726, __pyx_L1_error) | |
26268 __Pyx_GOTREF(__pyx_t_12); | |
26269 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_kp_u_0, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) | |
26270 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26271 __pyx_t_17 = __pyx_t_7; | |
26272 __pyx_L36_bool_binop_done:; | |
26273 if (__pyx_t_17) { | |
26274 __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 726, __pyx_L1_error) | |
26275 __Pyx_GOTREF(__pyx_t_12); | |
26276 __pyx_v_filter = __pyx_t_12; | |
26277 __pyx_t_12 = 0; | |
26278 goto __pyx_L35; | |
26279 } | |
26280 | |
26281 /* "pysam/libcvcf.pyx":727 | |
26282 * # postpone checking that filters exist. Encode missing filter or no filtering as empty list | |
26283 * if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = [] | |
26284 * else: filter = cols[6].split(';') # <<<<<<<<<<<<<< | |
26285 * | |
26286 * # dictionary of keys, and list of values | |
26287 */ | |
26288 /*else*/ { | |
26289 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) | |
26290 __Pyx_GOTREF(__pyx_t_2); | |
26291 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) | |
26292 __Pyx_GOTREF(__pyx_t_1); | |
26293 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26294 __pyx_t_2 = NULL; | |
26295 __pyx_t_4 = 0; | |
26296 #if CYTHON_UNPACK_METHODS | |
26297 if (likely(PyMethod_Check(__pyx_t_1))) { | |
26298 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); | |
26299 if (likely(__pyx_t_2)) { | |
26300 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
26301 __Pyx_INCREF(__pyx_t_2); | |
26302 __Pyx_INCREF(function); | |
26303 __Pyx_DECREF_SET(__pyx_t_1, function); | |
26304 __pyx_t_4 = 1; | |
26305 } | |
26306 } | |
26307 #endif | |
26308 { | |
26309 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u__6}; | |
26310 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
26311 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26312 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 727, __pyx_L1_error) | |
26313 __Pyx_GOTREF(__pyx_t_12); | |
26314 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26315 } | |
26316 __pyx_v_filter = __pyx_t_12; | |
26317 __pyx_t_12 = 0; | |
26318 } | |
26319 __pyx_L35:; | |
26320 | |
26321 /* "pysam/libcvcf.pyx":730 | |
26322 * | |
26323 * # dictionary of keys, and list of values | |
26324 * info = {} # <<<<<<<<<<<<<< | |
26325 * if cols[7] != ".": | |
26326 * for blurp in cols[7].split(';'): | |
26327 */ | |
26328 __pyx_t_12 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 730, __pyx_L1_error) | |
26329 __Pyx_GOTREF(__pyx_t_12); | |
26330 __pyx_v_info = ((PyObject*)__pyx_t_12); | |
26331 __pyx_t_12 = 0; | |
26332 | |
26333 /* "pysam/libcvcf.pyx":731 | |
26334 * # dictionary of keys, and list of values | |
26335 * info = {} | |
26336 * if cols[7] != ".": # <<<<<<<<<<<<<< | |
26337 * for blurp in cols[7].split(';'): | |
26338 * elts = blurp.split('=') | |
26339 */ | |
26340 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 731, __pyx_L1_error) | |
26341 __Pyx_GOTREF(__pyx_t_12); | |
26342 __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_t_12, __pyx_kp_u__5, Py_NE)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 731, __pyx_L1_error) | |
26343 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26344 if (__pyx_t_17) { | |
26345 | |
26346 /* "pysam/libcvcf.pyx":732 | |
26347 * info = {} | |
26348 * if cols[7] != ".": | |
26349 * for blurp in cols[7].split(';'): # <<<<<<<<<<<<<< | |
26350 * elts = blurp.split('=') | |
26351 * if len(elts) == 1: v = None | |
26352 */ | |
26353 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cols, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error) | |
26354 __Pyx_GOTREF(__pyx_t_1); | |
26355 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) | |
26356 __Pyx_GOTREF(__pyx_t_2); | |
26357 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26358 __pyx_t_1 = NULL; | |
26359 __pyx_t_4 = 0; | |
26360 #if CYTHON_UNPACK_METHODS | |
26361 if (likely(PyMethod_Check(__pyx_t_2))) { | |
26362 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); | |
26363 if (likely(__pyx_t_1)) { | |
26364 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
26365 __Pyx_INCREF(__pyx_t_1); | |
26366 __Pyx_INCREF(function); | |
26367 __Pyx_DECREF_SET(__pyx_t_2, function); | |
26368 __pyx_t_4 = 1; | |
26369 } | |
26370 } | |
26371 #endif | |
26372 { | |
26373 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u__6}; | |
26374 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
26375 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26376 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 732, __pyx_L1_error) | |
26377 __Pyx_GOTREF(__pyx_t_12); | |
26378 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26379 } | |
26380 if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { | |
26381 __pyx_t_2 = __pyx_t_12; __Pyx_INCREF(__pyx_t_2); | |
26382 __pyx_t_6 = 0; | |
26383 __pyx_t_18 = NULL; | |
26384 } else { | |
26385 __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) | |
26386 __Pyx_GOTREF(__pyx_t_2); | |
26387 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 732, __pyx_L1_error) | |
26388 } | |
26389 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26390 for (;;) { | |
26391 if (likely(!__pyx_t_18)) { | |
26392 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
26393 { | |
26394 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
26395 #if !CYTHON_ASSUME_SAFE_MACROS | |
26396 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 732, __pyx_L1_error) | |
26397 #endif | |
26398 if (__pyx_t_6 >= __pyx_temp) break; | |
26399 } | |
26400 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
26401 __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 732, __pyx_L1_error) | |
26402 #else | |
26403 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 732, __pyx_L1_error) | |
26404 __Pyx_GOTREF(__pyx_t_12); | |
26405 #endif | |
26406 } else { | |
26407 { | |
26408 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
26409 #if !CYTHON_ASSUME_SAFE_MACROS | |
26410 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 732, __pyx_L1_error) | |
26411 #endif | |
26412 if (__pyx_t_6 >= __pyx_temp) break; | |
26413 } | |
26414 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
26415 __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 732, __pyx_L1_error) | |
26416 #else | |
26417 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 732, __pyx_L1_error) | |
26418 __Pyx_GOTREF(__pyx_t_12); | |
26419 #endif | |
26420 } | |
26421 } else { | |
26422 __pyx_t_12 = __pyx_t_18(__pyx_t_2); | |
26423 if (unlikely(!__pyx_t_12)) { | |
26424 PyObject* exc_type = PyErr_Occurred(); | |
26425 if (exc_type) { | |
26426 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
26427 else __PYX_ERR(0, 732, __pyx_L1_error) | |
26428 } | |
26429 break; | |
26430 } | |
26431 __Pyx_GOTREF(__pyx_t_12); | |
26432 } | |
26433 __Pyx_XDECREF_SET(__pyx_v_blurp, __pyx_t_12); | |
26434 __pyx_t_12 = 0; | |
26435 | |
26436 /* "pysam/libcvcf.pyx":733 | |
26437 * if cols[7] != ".": | |
26438 * for blurp in cols[7].split(';'): | |
26439 * elts = blurp.split('=') # <<<<<<<<<<<<<< | |
26440 * if len(elts) == 1: v = None | |
26441 * elif len(elts) == 2: v = elts[1] | |
26442 */ | |
26443 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_blurp, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) | |
26444 __Pyx_GOTREF(__pyx_t_1); | |
26445 __pyx_t_9 = NULL; | |
26446 __pyx_t_4 = 0; | |
26447 #if CYTHON_UNPACK_METHODS | |
26448 if (likely(PyMethod_Check(__pyx_t_1))) { | |
26449 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); | |
26450 if (likely(__pyx_t_9)) { | |
26451 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
26452 __Pyx_INCREF(__pyx_t_9); | |
26453 __Pyx_INCREF(function); | |
26454 __Pyx_DECREF_SET(__pyx_t_1, function); | |
26455 __pyx_t_4 = 1; | |
26456 } | |
26457 } | |
26458 #endif | |
26459 { | |
26460 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u__7}; | |
26461 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
26462 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26463 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 733, __pyx_L1_error) | |
26464 __Pyx_GOTREF(__pyx_t_12); | |
26465 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26466 } | |
26467 __Pyx_XDECREF_SET(__pyx_v_elts, __pyx_t_12); | |
26468 __pyx_t_12 = 0; | |
26469 | |
26470 /* "pysam/libcvcf.pyx":734 | |
26471 * for blurp in cols[7].split(';'): | |
26472 * elts = blurp.split('=') | |
26473 * if len(elts) == 1: v = None # <<<<<<<<<<<<<< | |
26474 * elif len(elts) == 2: v = elts[1] | |
26475 * else: self.error(line,self.ERROR_INFO_STRING) | |
26476 */ | |
26477 __pyx_t_5 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 734, __pyx_L1_error) | |
26478 __pyx_t_17 = (__pyx_t_5 == 1); | |
26479 if (__pyx_t_17) { | |
26480 __Pyx_INCREF(Py_None); | |
26481 __Pyx_XDECREF_SET(__pyx_v_v, Py_None); | |
26482 goto __pyx_L42; | |
26483 } | |
26484 | |
26485 /* "pysam/libcvcf.pyx":735 | |
26486 * elts = blurp.split('=') | |
26487 * if len(elts) == 1: v = None | |
26488 * elif len(elts) == 2: v = elts[1] # <<<<<<<<<<<<<< | |
26489 * else: self.error(line,self.ERROR_INFO_STRING) | |
26490 * info[elts[0]] = self.parse_formatdata(elts[0], | |
26491 */ | |
26492 __pyx_t_5 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 735, __pyx_L1_error) | |
26493 __pyx_t_17 = (__pyx_t_5 == 2); | |
26494 if (__pyx_t_17) { | |
26495 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 735, __pyx_L1_error) | |
26496 __Pyx_GOTREF(__pyx_t_12); | |
26497 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_12); | |
26498 __pyx_t_12 = 0; | |
26499 goto __pyx_L42; | |
26500 } | |
26501 | |
26502 /* "pysam/libcvcf.pyx":736 | |
26503 * if len(elts) == 1: v = None | |
26504 * elif len(elts) == 2: v = elts[1] | |
26505 * else: self.error(line,self.ERROR_INFO_STRING) # <<<<<<<<<<<<<< | |
26506 * info[elts[0]] = self.parse_formatdata(elts[0], | |
26507 * v, | |
26508 */ | |
26509 /*else*/ { | |
26510 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error) | |
26511 __Pyx_GOTREF(__pyx_t_1); | |
26512 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_INFO_STRING); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 736, __pyx_L1_error) | |
26513 __Pyx_GOTREF(__pyx_t_9); | |
26514 __pyx_t_3 = NULL; | |
26515 __pyx_t_4 = 0; | |
26516 #if CYTHON_UNPACK_METHODS | |
26517 if (likely(PyMethod_Check(__pyx_t_1))) { | |
26518 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
26519 if (likely(__pyx_t_3)) { | |
26520 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
26521 __Pyx_INCREF(__pyx_t_3); | |
26522 __Pyx_INCREF(function); | |
26523 __Pyx_DECREF_SET(__pyx_t_1, function); | |
26524 __pyx_t_4 = 1; | |
26525 } | |
26526 } | |
26527 #endif | |
26528 { | |
26529 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_line, __pyx_t_9}; | |
26530 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
26531 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
26532 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26533 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 736, __pyx_L1_error) | |
26534 __Pyx_GOTREF(__pyx_t_12); | |
26535 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26536 } | |
26537 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26538 } | |
26539 __pyx_L42:; | |
26540 | |
26541 /* "pysam/libcvcf.pyx":737 | |
26542 * elif len(elts) == 2: v = elts[1] | |
26543 * else: self.error(line,self.ERROR_INFO_STRING) | |
26544 * info[elts[0]] = self.parse_formatdata(elts[0], # <<<<<<<<<<<<<< | |
26545 * v, | |
26546 * self._info, | |
26547 */ | |
26548 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_formatdata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) | |
26549 __Pyx_GOTREF(__pyx_t_1); | |
26550 __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 737, __pyx_L1_error) | |
26551 __Pyx_GOTREF(__pyx_t_9); | |
26552 | |
26553 /* "pysam/libcvcf.pyx":738 | |
26554 * else: self.error(line,self.ERROR_INFO_STRING) | |
26555 * info[elts[0]] = self.parse_formatdata(elts[0], | |
26556 * v, # <<<<<<<<<<<<<< | |
26557 * self._info, | |
26558 * line) | |
26559 */ | |
26560 if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 738, __pyx_L1_error) } | |
26561 | |
26562 /* "pysam/libcvcf.pyx":739 | |
26563 * info[elts[0]] = self.parse_formatdata(elts[0], | |
26564 * v, | |
26565 * self._info, # <<<<<<<<<<<<<< | |
26566 * line) | |
26567 * | |
26568 */ | |
26569 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error) | |
26570 __Pyx_GOTREF(__pyx_t_3); | |
26571 | |
26572 /* "pysam/libcvcf.pyx":740 | |
26573 * v, | |
26574 * self._info, | |
26575 * line) # <<<<<<<<<<<<<< | |
26576 * | |
26577 * # Gracefully deal with absent FORMAT column | |
26578 */ | |
26579 __pyx_t_11 = NULL; | |
26580 __pyx_t_4 = 0; | |
26581 #if CYTHON_UNPACK_METHODS | |
26582 if (likely(PyMethod_Check(__pyx_t_1))) { | |
26583 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); | |
26584 if (likely(__pyx_t_11)) { | |
26585 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
26586 __Pyx_INCREF(__pyx_t_11); | |
26587 __Pyx_INCREF(function); | |
26588 __Pyx_DECREF_SET(__pyx_t_1, function); | |
26589 __pyx_t_4 = 1; | |
26590 } | |
26591 } | |
26592 #endif | |
26593 { | |
26594 PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_t_9, __pyx_v_v, __pyx_t_3, __pyx_v_line}; | |
26595 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
26596 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
26597 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26598 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
26599 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 737, __pyx_L1_error) | |
26600 __Pyx_GOTREF(__pyx_t_12); | |
26601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26602 } | |
26603 | |
26604 /* "pysam/libcvcf.pyx":737 | |
26605 * elif len(elts) == 2: v = elts[1] | |
26606 * else: self.error(line,self.ERROR_INFO_STRING) | |
26607 * info[elts[0]] = self.parse_formatdata(elts[0], # <<<<<<<<<<<<<< | |
26608 * v, | |
26609 * self._info, | |
26610 */ | |
26611 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) | |
26612 __Pyx_GOTREF(__pyx_t_1); | |
26613 if (unlikely((PyDict_SetItem(__pyx_v_info, __pyx_t_1, __pyx_t_12) < 0))) __PYX_ERR(0, 737, __pyx_L1_error) | |
26614 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26615 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26616 | |
26617 /* "pysam/libcvcf.pyx":732 | |
26618 * info = {} | |
26619 * if cols[7] != ".": | |
26620 * for blurp in cols[7].split(';'): # <<<<<<<<<<<<<< | |
26621 * elts = blurp.split('=') | |
26622 * if len(elts) == 1: v = None | |
26623 */ | |
26624 } | |
26625 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26626 | |
26627 /* "pysam/libcvcf.pyx":731 | |
26628 * # dictionary of keys, and list of values | |
26629 * info = {} | |
26630 * if cols[7] != ".": # <<<<<<<<<<<<<< | |
26631 * for blurp in cols[7].split(';'): | |
26632 * elts = blurp.split('=') | |
26633 */ | |
26634 } | |
26635 | |
26636 /* "pysam/libcvcf.pyx":743 | |
26637 * | |
26638 * # Gracefully deal with absent FORMAT column | |
26639 * if cols[8] == "": format = [] # <<<<<<<<<<<<<< | |
26640 * else: format = cols[8].split(':') | |
26641 * | |
26642 */ | |
26643 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error) | |
26644 __Pyx_GOTREF(__pyx_t_2); | |
26645 __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u_, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 743, __pyx_L1_error) | |
26646 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26647 if (__pyx_t_17) { | |
26648 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error) | |
26649 __Pyx_GOTREF(__pyx_t_2); | |
26650 __pyx_v_format = __pyx_t_2; | |
26651 __pyx_t_2 = 0; | |
26652 goto __pyx_L44; | |
26653 } | |
26654 | |
26655 /* "pysam/libcvcf.pyx":744 | |
26656 * # Gracefully deal with absent FORMAT column | |
26657 * if cols[8] == "": format = [] | |
26658 * else: format = cols[8].split(':') # <<<<<<<<<<<<<< | |
26659 * | |
26660 * # check: all filters are defined | |
26661 */ | |
26662 /*else*/ { | |
26663 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 744, __pyx_L1_error) | |
26664 __Pyx_GOTREF(__pyx_t_12); | |
26665 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) | |
26666 __Pyx_GOTREF(__pyx_t_1); | |
26667 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26668 __pyx_t_12 = NULL; | |
26669 __pyx_t_4 = 0; | |
26670 #if CYTHON_UNPACK_METHODS | |
26671 if (likely(PyMethod_Check(__pyx_t_1))) { | |
26672 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); | |
26673 if (likely(__pyx_t_12)) { | |
26674 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
26675 __Pyx_INCREF(__pyx_t_12); | |
26676 __Pyx_INCREF(function); | |
26677 __Pyx_DECREF_SET(__pyx_t_1, function); | |
26678 __pyx_t_4 = 1; | |
26679 } | |
26680 } | |
26681 #endif | |
26682 { | |
26683 PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_kp_u__3}; | |
26684 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
26685 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26686 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) | |
26687 __Pyx_GOTREF(__pyx_t_2); | |
26688 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26689 } | |
26690 __pyx_v_format = __pyx_t_2; | |
26691 __pyx_t_2 = 0; | |
26692 } | |
26693 __pyx_L44:; | |
26694 | |
26695 /* "pysam/libcvcf.pyx":747 | |
26696 * | |
26697 * # check: all filters are defined | |
26698 * for f in filter: # <<<<<<<<<<<<<< | |
26699 * if f not in self._filter: self.error(line,self.FILTER_NOT_DEFINED, f) | |
26700 * | |
26701 */ | |
26702 if (likely(PyList_CheckExact(__pyx_v_filter)) || PyTuple_CheckExact(__pyx_v_filter)) { | |
26703 __pyx_t_2 = __pyx_v_filter; __Pyx_INCREF(__pyx_t_2); | |
26704 __pyx_t_6 = 0; | |
26705 __pyx_t_18 = NULL; | |
26706 } else { | |
26707 __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_filter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) | |
26708 __Pyx_GOTREF(__pyx_t_2); | |
26709 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 747, __pyx_L1_error) | |
26710 } | |
26711 for (;;) { | |
26712 if (likely(!__pyx_t_18)) { | |
26713 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
26714 { | |
26715 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
26716 #if !CYTHON_ASSUME_SAFE_MACROS | |
26717 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 747, __pyx_L1_error) | |
26718 #endif | |
26719 if (__pyx_t_6 >= __pyx_temp) break; | |
26720 } | |
26721 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
26722 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) | |
26723 #else | |
26724 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) | |
26725 __Pyx_GOTREF(__pyx_t_1); | |
26726 #endif | |
26727 } else { | |
26728 { | |
26729 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
26730 #if !CYTHON_ASSUME_SAFE_MACROS | |
26731 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 747, __pyx_L1_error) | |
26732 #endif | |
26733 if (__pyx_t_6 >= __pyx_temp) break; | |
26734 } | |
26735 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
26736 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) | |
26737 #else | |
26738 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) | |
26739 __Pyx_GOTREF(__pyx_t_1); | |
26740 #endif | |
26741 } | |
26742 } else { | |
26743 __pyx_t_1 = __pyx_t_18(__pyx_t_2); | |
26744 if (unlikely(!__pyx_t_1)) { | |
26745 PyObject* exc_type = PyErr_Occurred(); | |
26746 if (exc_type) { | |
26747 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
26748 else __PYX_ERR(0, 747, __pyx_L1_error) | |
26749 } | |
26750 break; | |
26751 } | |
26752 __Pyx_GOTREF(__pyx_t_1); | |
26753 } | |
26754 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1); | |
26755 __pyx_t_1 = 0; | |
26756 | |
26757 /* "pysam/libcvcf.pyx":748 | |
26758 * # check: all filters are defined | |
26759 * for f in filter: | |
26760 * if f not in self._filter: self.error(line,self.FILTER_NOT_DEFINED, f) # <<<<<<<<<<<<<< | |
26761 * | |
26762 * # check: format fields are defined | |
26763 */ | |
26764 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) | |
26765 __Pyx_GOTREF(__pyx_t_1); | |
26766 __pyx_t_17 = (__Pyx_PySequence_ContainsTF(__pyx_v_f, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 748, __pyx_L1_error) | |
26767 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26768 if (__pyx_t_17) { | |
26769 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 748, __pyx_L1_error) | |
26770 __Pyx_GOTREF(__pyx_t_12); | |
26771 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FILTER_NOT_DEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error) | |
26772 __Pyx_GOTREF(__pyx_t_3); | |
26773 __pyx_t_9 = NULL; | |
26774 __pyx_t_4 = 0; | |
26775 #if CYTHON_UNPACK_METHODS | |
26776 if (likely(PyMethod_Check(__pyx_t_12))) { | |
26777 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); | |
26778 if (likely(__pyx_t_9)) { | |
26779 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); | |
26780 __Pyx_INCREF(__pyx_t_9); | |
26781 __Pyx_INCREF(function); | |
26782 __Pyx_DECREF_SET(__pyx_t_12, function); | |
26783 __pyx_t_4 = 1; | |
26784 } | |
26785 } | |
26786 #endif | |
26787 { | |
26788 PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_line, __pyx_t_3, __pyx_v_f}; | |
26789 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
26790 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26791 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
26792 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) | |
26793 __Pyx_GOTREF(__pyx_t_1); | |
26794 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26795 } | |
26796 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26797 } | |
26798 | |
26799 /* "pysam/libcvcf.pyx":747 | |
26800 * | |
26801 * # check: all filters are defined | |
26802 * for f in filter: # <<<<<<<<<<<<<< | |
26803 * if f not in self._filter: self.error(line,self.FILTER_NOT_DEFINED, f) | |
26804 * | |
26805 */ | |
26806 } | |
26807 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26808 | |
26809 /* "pysam/libcvcf.pyx":751 | |
26810 * | |
26811 * # check: format fields are defined | |
26812 * if self._format: # <<<<<<<<<<<<<< | |
26813 * for f in format: | |
26814 * if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f) | |
26815 */ | |
26816 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) | |
26817 __Pyx_GOTREF(__pyx_t_2); | |
26818 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 751, __pyx_L1_error) | |
26819 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26820 if (__pyx_t_17) { | |
26821 | |
26822 /* "pysam/libcvcf.pyx":752 | |
26823 * # check: format fields are defined | |
26824 * if self._format: | |
26825 * for f in format: # <<<<<<<<<<<<<< | |
26826 * if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f) | |
26827 * | |
26828 */ | |
26829 if (likely(PyList_CheckExact(__pyx_v_format)) || PyTuple_CheckExact(__pyx_v_format)) { | |
26830 __pyx_t_2 = __pyx_v_format; __Pyx_INCREF(__pyx_t_2); | |
26831 __pyx_t_6 = 0; | |
26832 __pyx_t_18 = NULL; | |
26833 } else { | |
26834 __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error) | |
26835 __Pyx_GOTREF(__pyx_t_2); | |
26836 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 752, __pyx_L1_error) | |
26837 } | |
26838 for (;;) { | |
26839 if (likely(!__pyx_t_18)) { | |
26840 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
26841 { | |
26842 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
26843 #if !CYTHON_ASSUME_SAFE_MACROS | |
26844 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 752, __pyx_L1_error) | |
26845 #endif | |
26846 if (__pyx_t_6 >= __pyx_temp) break; | |
26847 } | |
26848 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
26849 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) | |
26850 #else | |
26851 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) | |
26852 __Pyx_GOTREF(__pyx_t_1); | |
26853 #endif | |
26854 } else { | |
26855 { | |
26856 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
26857 #if !CYTHON_ASSUME_SAFE_MACROS | |
26858 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 752, __pyx_L1_error) | |
26859 #endif | |
26860 if (__pyx_t_6 >= __pyx_temp) break; | |
26861 } | |
26862 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
26863 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) | |
26864 #else | |
26865 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) | |
26866 __Pyx_GOTREF(__pyx_t_1); | |
26867 #endif | |
26868 } | |
26869 } else { | |
26870 __pyx_t_1 = __pyx_t_18(__pyx_t_2); | |
26871 if (unlikely(!__pyx_t_1)) { | |
26872 PyObject* exc_type = PyErr_Occurred(); | |
26873 if (exc_type) { | |
26874 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
26875 else __PYX_ERR(0, 752, __pyx_L1_error) | |
26876 } | |
26877 break; | |
26878 } | |
26879 __Pyx_GOTREF(__pyx_t_1); | |
26880 } | |
26881 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1); | |
26882 __pyx_t_1 = 0; | |
26883 | |
26884 /* "pysam/libcvcf.pyx":753 | |
26885 * if self._format: | |
26886 * for f in format: | |
26887 * if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f) # <<<<<<<<<<<<<< | |
26888 * | |
26889 * # convert v3.3 alleles | |
26890 */ | |
26891 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error) | |
26892 __Pyx_GOTREF(__pyx_t_1); | |
26893 __pyx_t_17 = (__Pyx_PySequence_ContainsTF(__pyx_v_f, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 753, __pyx_L1_error) | |
26894 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26895 if (__pyx_t_17) { | |
26896 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 753, __pyx_L1_error) | |
26897 __Pyx_GOTREF(__pyx_t_12); | |
26898 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FORMAT_NOT_DEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) | |
26899 __Pyx_GOTREF(__pyx_t_3); | |
26900 __pyx_t_9 = NULL; | |
26901 __pyx_t_4 = 0; | |
26902 #if CYTHON_UNPACK_METHODS | |
26903 if (likely(PyMethod_Check(__pyx_t_12))) { | |
26904 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); | |
26905 if (likely(__pyx_t_9)) { | |
26906 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); | |
26907 __Pyx_INCREF(__pyx_t_9); | |
26908 __Pyx_INCREF(function); | |
26909 __Pyx_DECREF_SET(__pyx_t_12, function); | |
26910 __pyx_t_4 = 1; | |
26911 } | |
26912 } | |
26913 #endif | |
26914 { | |
26915 PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_line, __pyx_t_3, __pyx_v_f}; | |
26916 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
26917 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
26918 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
26919 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error) | |
26920 __Pyx_GOTREF(__pyx_t_1); | |
26921 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26922 } | |
26923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26924 } | |
26925 | |
26926 /* "pysam/libcvcf.pyx":752 | |
26927 * # check: format fields are defined | |
26928 * if self._format: | |
26929 * for f in format: # <<<<<<<<<<<<<< | |
26930 * if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f) | |
26931 * | |
26932 */ | |
26933 } | |
26934 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26935 | |
26936 /* "pysam/libcvcf.pyx":751 | |
26937 * | |
26938 * # check: format fields are defined | |
26939 * if self._format: # <<<<<<<<<<<<<< | |
26940 * for f in format: | |
26941 * if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f) | |
26942 */ | |
26943 } | |
26944 | |
26945 /* "pysam/libcvcf.pyx":756 | |
26946 * | |
26947 * # convert v3.3 alleles | |
26948 * if self._version == 33: # <<<<<<<<<<<<<< | |
26949 * if len(ref) != 1: self.error(line,self.V33_BAD_REF) | |
26950 * newalts = [] | |
26951 */ | |
26952 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) | |
26953 __Pyx_GOTREF(__pyx_t_2); | |
26954 __pyx_t_17 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_2, __pyx_int_33, 33, 0)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 756, __pyx_L1_error) | |
26955 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26956 if (__pyx_t_17) { | |
26957 | |
26958 /* "pysam/libcvcf.pyx":757 | |
26959 * # convert v3.3 alleles | |
26960 * if self._version == 33: | |
26961 * if len(ref) != 1: self.error(line,self.V33_BAD_REF) # <<<<<<<<<<<<<< | |
26962 * newalts = [] | |
26963 * have_deletions = False | |
26964 */ | |
26965 __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 757, __pyx_L1_error) | |
26966 __pyx_t_17 = (__pyx_t_6 != 1); | |
26967 if (__pyx_t_17) { | |
26968 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) | |
26969 __Pyx_GOTREF(__pyx_t_1); | |
26970 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V33_BAD_REF); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 757, __pyx_L1_error) | |
26971 __Pyx_GOTREF(__pyx_t_12); | |
26972 __pyx_t_3 = NULL; | |
26973 __pyx_t_4 = 0; | |
26974 #if CYTHON_UNPACK_METHODS | |
26975 if (likely(PyMethod_Check(__pyx_t_1))) { | |
26976 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
26977 if (likely(__pyx_t_3)) { | |
26978 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
26979 __Pyx_INCREF(__pyx_t_3); | |
26980 __Pyx_INCREF(function); | |
26981 __Pyx_DECREF_SET(__pyx_t_1, function); | |
26982 __pyx_t_4 = 1; | |
26983 } | |
26984 } | |
26985 #endif | |
26986 { | |
26987 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_line, __pyx_t_12}; | |
26988 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
26989 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
26990 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
26991 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error) | |
26992 __Pyx_GOTREF(__pyx_t_2); | |
26993 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
26994 } | |
26995 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
26996 } | |
26997 | |
26998 /* "pysam/libcvcf.pyx":758 | |
26999 * if self._version == 33: | |
27000 * if len(ref) != 1: self.error(line,self.V33_BAD_REF) | |
27001 * newalts = [] # <<<<<<<<<<<<<< | |
27002 * have_deletions = False | |
27003 * for a in alt: | |
27004 */ | |
27005 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __pyx_L1_error) | |
27006 __Pyx_GOTREF(__pyx_t_2); | |
27007 __pyx_v_newalts = ((PyObject*)__pyx_t_2); | |
27008 __pyx_t_2 = 0; | |
27009 | |
27010 /* "pysam/libcvcf.pyx":759 | |
27011 * if len(ref) != 1: self.error(line,self.V33_BAD_REF) | |
27012 * newalts = [] | |
27013 * have_deletions = False # <<<<<<<<<<<<<< | |
27014 * for a in alt: | |
27015 * if len(a) == 1: a = a + ref[1:] # SNP; add trailing reference | |
27016 */ | |
27017 __pyx_v_have_deletions = 0; | |
27018 | |
27019 /* "pysam/libcvcf.pyx":760 | |
27020 * newalts = [] | |
27021 * have_deletions = False | |
27022 * for a in alt: # <<<<<<<<<<<<<< | |
27023 * if len(a) == 1: a = a + ref[1:] # SNP; add trailing reference | |
27024 * elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:] # insertion just beyond pos; add first and trailing reference | |
27025 */ | |
27026 if (likely(PyList_CheckExact(__pyx_v_alt)) || PyTuple_CheckExact(__pyx_v_alt)) { | |
27027 __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2); | |
27028 __pyx_t_6 = 0; | |
27029 __pyx_t_18 = NULL; | |
27030 } else { | |
27031 __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error) | |
27032 __Pyx_GOTREF(__pyx_t_2); | |
27033 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 760, __pyx_L1_error) | |
27034 } | |
27035 for (;;) { | |
27036 if (likely(!__pyx_t_18)) { | |
27037 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
27038 { | |
27039 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
27040 #if !CYTHON_ASSUME_SAFE_MACROS | |
27041 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 760, __pyx_L1_error) | |
27042 #endif | |
27043 if (__pyx_t_6 >= __pyx_temp) break; | |
27044 } | |
27045 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
27046 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) | |
27047 #else | |
27048 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error) | |
27049 __Pyx_GOTREF(__pyx_t_1); | |
27050 #endif | |
27051 } else { | |
27052 { | |
27053 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
27054 #if !CYTHON_ASSUME_SAFE_MACROS | |
27055 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 760, __pyx_L1_error) | |
27056 #endif | |
27057 if (__pyx_t_6 >= __pyx_temp) break; | |
27058 } | |
27059 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
27060 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) | |
27061 #else | |
27062 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error) | |
27063 __Pyx_GOTREF(__pyx_t_1); | |
27064 #endif | |
27065 } | |
27066 } else { | |
27067 __pyx_t_1 = __pyx_t_18(__pyx_t_2); | |
27068 if (unlikely(!__pyx_t_1)) { | |
27069 PyObject* exc_type = PyErr_Occurred(); | |
27070 if (exc_type) { | |
27071 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
27072 else __PYX_ERR(0, 760, __pyx_L1_error) | |
27073 } | |
27074 break; | |
27075 } | |
27076 __Pyx_GOTREF(__pyx_t_1); | |
27077 } | |
27078 __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_1); | |
27079 __pyx_t_1 = 0; | |
27080 | |
27081 /* "pysam/libcvcf.pyx":761 | |
27082 * have_deletions = False | |
27083 * for a in alt: | |
27084 * if len(a) == 1: a = a + ref[1:] # SNP; add trailing reference # <<<<<<<<<<<<<< | |
27085 * elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:] # insertion just beyond pos; add first and trailing reference | |
27086 * elif a.startswith('D'): # allow D<seq> and D<num> | |
27087 */ | |
27088 __pyx_t_5 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 761, __pyx_L1_error) | |
27089 __pyx_t_17 = (__pyx_t_5 == 1); | |
27090 if (__pyx_t_17) { | |
27091 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_ref, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error) | |
27092 __Pyx_GOTREF(__pyx_t_1); | |
27093 __pyx_t_12 = PyNumber_Add(__pyx_v_a, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 761, __pyx_L1_error) | |
27094 __Pyx_GOTREF(__pyx_t_12); | |
27095 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27096 __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_12); | |
27097 __pyx_t_12 = 0; | |
27098 goto __pyx_L58; | |
27099 } | |
27100 | |
27101 /* "pysam/libcvcf.pyx":762 | |
27102 * for a in alt: | |
27103 * if len(a) == 1: a = a + ref[1:] # SNP; add trailing reference | |
27104 * elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:] # insertion just beyond pos; add first and trailing reference # <<<<<<<<<<<<<< | |
27105 * elif a.startswith('D'): # allow D<seq> and D<num> | |
27106 * have_deletions = True | |
27107 */ | |
27108 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error) | |
27109 __Pyx_GOTREF(__pyx_t_1); | |
27110 __pyx_t_3 = NULL; | |
27111 __pyx_t_4 = 0; | |
27112 #if CYTHON_UNPACK_METHODS | |
27113 if (likely(PyMethod_Check(__pyx_t_1))) { | |
27114 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
27115 if (likely(__pyx_t_3)) { | |
27116 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
27117 __Pyx_INCREF(__pyx_t_3); | |
27118 __Pyx_INCREF(function); | |
27119 __Pyx_DECREF_SET(__pyx_t_1, function); | |
27120 __pyx_t_4 = 1; | |
27121 } | |
27122 } | |
27123 #endif | |
27124 { | |
27125 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_I}; | |
27126 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
27127 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27128 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 762, __pyx_L1_error) | |
27129 __Pyx_GOTREF(__pyx_t_12); | |
27130 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27131 } | |
27132 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 762, __pyx_L1_error) | |
27133 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27134 if (__pyx_t_17) { | |
27135 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_ref, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 762, __pyx_L1_error) | |
27136 __Pyx_GOTREF(__pyx_t_12); | |
27137 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_a, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error) | |
27138 __Pyx_GOTREF(__pyx_t_1); | |
27139 __pyx_t_3 = PyNumber_Add(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L1_error) | |
27140 __Pyx_GOTREF(__pyx_t_3); | |
27141 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27142 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27143 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_ref, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error) | |
27144 __Pyx_GOTREF(__pyx_t_1); | |
27145 __pyx_t_12 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 762, __pyx_L1_error) | |
27146 __Pyx_GOTREF(__pyx_t_12); | |
27147 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27149 __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_12); | |
27150 __pyx_t_12 = 0; | |
27151 goto __pyx_L58; | |
27152 } | |
27153 | |
27154 /* "pysam/libcvcf.pyx":763 | |
27155 * if len(a) == 1: a = a + ref[1:] # SNP; add trailing reference | |
27156 * elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:] # insertion just beyond pos; add first and trailing reference | |
27157 * elif a.startswith('D'): # allow D<seq> and D<num> # <<<<<<<<<<<<<< | |
27158 * have_deletions = True | |
27159 * try: | |
27160 */ | |
27161 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) | |
27162 __Pyx_GOTREF(__pyx_t_1); | |
27163 __pyx_t_3 = NULL; | |
27164 __pyx_t_4 = 0; | |
27165 #if CYTHON_UNPACK_METHODS | |
27166 if (likely(PyMethod_Check(__pyx_t_1))) { | |
27167 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
27168 if (likely(__pyx_t_3)) { | |
27169 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
27170 __Pyx_INCREF(__pyx_t_3); | |
27171 __Pyx_INCREF(function); | |
27172 __Pyx_DECREF_SET(__pyx_t_1, function); | |
27173 __pyx_t_4 = 1; | |
27174 } | |
27175 } | |
27176 #endif | |
27177 { | |
27178 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_D}; | |
27179 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
27180 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27181 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 763, __pyx_L1_error) | |
27182 __Pyx_GOTREF(__pyx_t_12); | |
27183 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27184 } | |
27185 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) | |
27186 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27187 if (__pyx_t_17) { | |
27188 | |
27189 /* "pysam/libcvcf.pyx":764 | |
27190 * elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:] # insertion just beyond pos; add first and trailing reference | |
27191 * elif a.startswith('D'): # allow D<seq> and D<num> | |
27192 * have_deletions = True # <<<<<<<<<<<<<< | |
27193 * try: | |
27194 * l = int(a[1:]) # throws ValueError if sequence | |
27195 */ | |
27196 __pyx_v_have_deletions = 1; | |
27197 | |
27198 /* "pysam/libcvcf.pyx":765 | |
27199 * elif a.startswith('D'): # allow D<seq> and D<num> | |
27200 * have_deletions = True | |
27201 * try: # <<<<<<<<<<<<<< | |
27202 * l = int(a[1:]) # throws ValueError if sequence | |
27203 * if len(ref) < l: # add to reference if necessary | |
27204 */ | |
27205 { | |
27206 __Pyx_PyThreadState_declare | |
27207 __Pyx_PyThreadState_assign | |
27208 __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); | |
27209 __Pyx_XGOTREF(__pyx_t_13); | |
27210 __Pyx_XGOTREF(__pyx_t_14); | |
27211 __Pyx_XGOTREF(__pyx_t_15); | |
27212 /*try:*/ { | |
27213 | |
27214 /* "pysam/libcvcf.pyx":766 | |
27215 * have_deletions = True | |
27216 * try: | |
27217 * l = int(a[1:]) # throws ValueError if sequence # <<<<<<<<<<<<<< | |
27218 * if len(ref) < l: # add to reference if necessary | |
27219 * addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference) | |
27220 */ | |
27221 __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_a, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 766, __pyx_L59_error) | |
27222 __Pyx_GOTREF(__pyx_t_12); | |
27223 __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L59_error) | |
27224 __Pyx_GOTREF(__pyx_t_1); | |
27225 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27226 __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_1); | |
27227 __pyx_t_1 = 0; | |
27228 | |
27229 /* "pysam/libcvcf.pyx":767 | |
27230 * try: | |
27231 * l = int(a[1:]) # throws ValueError if sequence | |
27232 * if len(ref) < l: # add to reference if necessary # <<<<<<<<<<<<<< | |
27233 * addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference) | |
27234 * ref += addns | |
27235 */ | |
27236 __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 767, __pyx_L59_error) | |
27237 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L59_error) | |
27238 __Pyx_GOTREF(__pyx_t_1); | |
27239 __pyx_t_12 = PyObject_RichCompare(__pyx_t_1, __pyx_v_l, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 767, __pyx_L59_error) | |
27240 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27241 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 767, __pyx_L59_error) | |
27242 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27243 if (__pyx_t_17) { | |
27244 | |
27245 /* "pysam/libcvcf.pyx":768 | |
27246 * l = int(a[1:]) # throws ValueError if sequence | |
27247 * if len(ref) < l: # add to reference if necessary | |
27248 * addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference) # <<<<<<<<<<<<<< | |
27249 * ref += addns | |
27250 * for i,na in enumerate(newalts): newalts[i] = na+addns | |
27251 */ | |
27252 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L59_error) | |
27253 __Pyx_GOTREF(__pyx_t_1); | |
27254 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 768, __pyx_L59_error) } | |
27255 __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 768, __pyx_L59_error) | |
27256 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L59_error) | |
27257 __Pyx_GOTREF(__pyx_t_3); | |
27258 __pyx_t_9 = PyNumber_Add(__pyx_v_pos, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 768, __pyx_L59_error) | |
27259 __Pyx_GOTREF(__pyx_t_9); | |
27260 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27261 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 768, __pyx_L59_error) } | |
27262 __pyx_t_3 = PyNumber_Add(__pyx_v_pos, __pyx_v_l); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L59_error) | |
27263 __Pyx_GOTREF(__pyx_t_3); | |
27264 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 768, __pyx_L59_error) | |
27265 __Pyx_GOTREF(__pyx_t_11); | |
27266 __pyx_t_16 = NULL; | |
27267 __pyx_t_4 = 0; | |
27268 #if CYTHON_UNPACK_METHODS | |
27269 if (unlikely(PyMethod_Check(__pyx_t_1))) { | |
27270 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_1); | |
27271 if (likely(__pyx_t_16)) { | |
27272 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
27273 __Pyx_INCREF(__pyx_t_16); | |
27274 __Pyx_INCREF(function); | |
27275 __Pyx_DECREF_SET(__pyx_t_1, function); | |
27276 __pyx_t_4 = 1; | |
27277 } | |
27278 } | |
27279 #endif | |
27280 { | |
27281 PyObject *__pyx_callargs[5] = {__pyx_t_16, __pyx_v_chrom, __pyx_t_9, __pyx_t_3, __pyx_t_11}; | |
27282 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
27283 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
27284 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
27285 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27286 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
27287 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 768, __pyx_L59_error) | |
27288 __Pyx_GOTREF(__pyx_t_12); | |
27289 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27290 } | |
27291 __Pyx_XDECREF_SET(__pyx_v_addns, __pyx_t_12); | |
27292 __pyx_t_12 = 0; | |
27293 | |
27294 /* "pysam/libcvcf.pyx":769 | |
27295 * if len(ref) < l: # add to reference if necessary | |
27296 * addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference) | |
27297 * ref += addns # <<<<<<<<<<<<<< | |
27298 * for i,na in enumerate(newalts): newalts[i] = na+addns | |
27299 * a = ref[l:] # new deletion, deleting pos...pos+l | |
27300 */ | |
27301 __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addns); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 769, __pyx_L59_error) | |
27302 __Pyx_GOTREF(__pyx_t_12); | |
27303 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_12); | |
27304 __pyx_t_12 = 0; | |
27305 | |
27306 /* "pysam/libcvcf.pyx":770 | |
27307 * addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference) | |
27308 * ref += addns | |
27309 * for i,na in enumerate(newalts): newalts[i] = na+addns # <<<<<<<<<<<<<< | |
27310 * a = ref[l:] # new deletion, deleting pos...pos+l | |
27311 * except ValueError: | |
27312 */ | |
27313 __Pyx_INCREF(__pyx_int_0); | |
27314 __pyx_t_12 = __pyx_int_0; | |
27315 __pyx_t_1 = __pyx_v_newalts; __Pyx_INCREF(__pyx_t_1); | |
27316 __pyx_t_5 = 0; | |
27317 for (;;) { | |
27318 { | |
27319 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
27320 #if !CYTHON_ASSUME_SAFE_MACROS | |
27321 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 770, __pyx_L59_error) | |
27322 #endif | |
27323 if (__pyx_t_5 >= __pyx_temp) break; | |
27324 } | |
27325 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
27326 __pyx_t_11 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_11); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 770, __pyx_L59_error) | |
27327 #else | |
27328 __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 770, __pyx_L59_error) | |
27329 __Pyx_GOTREF(__pyx_t_11); | |
27330 #endif | |
27331 __Pyx_XDECREF_SET(__pyx_v_na, __pyx_t_11); | |
27332 __pyx_t_11 = 0; | |
27333 __Pyx_INCREF(__pyx_t_12); | |
27334 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_12); | |
27335 __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 770, __pyx_L59_error) | |
27336 __Pyx_GOTREF(__pyx_t_11); | |
27337 __Pyx_DECREF(__pyx_t_12); | |
27338 __pyx_t_12 = __pyx_t_11; | |
27339 __pyx_t_11 = 0; | |
27340 __pyx_t_11 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 770, __pyx_L59_error) | |
27341 __Pyx_GOTREF(__pyx_t_11); | |
27342 if (unlikely((PyObject_SetItem(__pyx_v_newalts, __pyx_v_i, __pyx_t_11) < 0))) __PYX_ERR(0, 770, __pyx_L59_error) | |
27343 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
27344 } | |
27345 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27346 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27347 | |
27348 /* "pysam/libcvcf.pyx":767 | |
27349 * try: | |
27350 * l = int(a[1:]) # throws ValueError if sequence | |
27351 * if len(ref) < l: # add to reference if necessary # <<<<<<<<<<<<<< | |
27352 * addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference) | |
27353 * ref += addns | |
27354 */ | |
27355 } | |
27356 | |
27357 /* "pysam/libcvcf.pyx":771 | |
27358 * ref += addns | |
27359 * for i,na in enumerate(newalts): newalts[i] = na+addns | |
27360 * a = ref[l:] # new deletion, deleting pos...pos+l # <<<<<<<<<<<<<< | |
27361 * except ValueError: | |
27362 * s = a[1:] | |
27363 */ | |
27364 __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_ref, 0, 0, &__pyx_v_l, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 771, __pyx_L59_error) | |
27365 __Pyx_GOTREF(__pyx_t_12); | |
27366 __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_12); | |
27367 __pyx_t_12 = 0; | |
27368 | |
27369 /* "pysam/libcvcf.pyx":765 | |
27370 * elif a.startswith('D'): # allow D<seq> and D<num> | |
27371 * have_deletions = True | |
27372 * try: # <<<<<<<<<<<<<< | |
27373 * l = int(a[1:]) # throws ValueError if sequence | |
27374 * if len(ref) < l: # add to reference if necessary | |
27375 */ | |
27376 } | |
27377 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; | |
27378 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; | |
27379 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; | |
27380 goto __pyx_L66_try_end; | |
27381 __pyx_L59_error:; | |
27382 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27383 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
27384 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27385 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
27386 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27387 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
27388 | |
27389 /* "pysam/libcvcf.pyx":772 | |
27390 * for i,na in enumerate(newalts): newalts[i] = na+addns | |
27391 * a = ref[l:] # new deletion, deleting pos...pos+l | |
27392 * except ValueError: # <<<<<<<<<<<<<< | |
27393 * s = a[1:] | |
27394 * if len(ref) < len(s): # add Ns to reference if necessary | |
27395 */ | |
27396 __pyx_t_21 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); | |
27397 if (__pyx_t_21) { | |
27398 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
27399 if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_1, &__pyx_t_11) < 0) __PYX_ERR(0, 772, __pyx_L61_except_error) | |
27400 __Pyx_XGOTREF(__pyx_t_12); | |
27401 __Pyx_XGOTREF(__pyx_t_1); | |
27402 __Pyx_XGOTREF(__pyx_t_11); | |
27403 | |
27404 /* "pysam/libcvcf.pyx":773 | |
27405 * a = ref[l:] # new deletion, deleting pos...pos+l | |
27406 * except ValueError: | |
27407 * s = a[1:] # <<<<<<<<<<<<<< | |
27408 * if len(ref) < len(s): # add Ns to reference if necessary | |
27409 * addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference) | |
27410 */ | |
27411 __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_a, 1, 0, NULL, NULL, &__pyx_slice__18, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L61_except_error) | |
27412 __Pyx_GOTREF(__pyx_t_3); | |
27413 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3); | |
27414 __pyx_t_3 = 0; | |
27415 | |
27416 /* "pysam/libcvcf.pyx":774 | |
27417 * except ValueError: | |
27418 * s = a[1:] | |
27419 * if len(ref) < len(s): # add Ns to reference if necessary # <<<<<<<<<<<<<< | |
27420 * addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference) | |
27421 * if not s.endswith(addns) and addns != 'N'*len(addns): | |
27422 */ | |
27423 __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 774, __pyx_L61_except_error) | |
27424 __pyx_t_22 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 774, __pyx_L61_except_error) | |
27425 __pyx_t_17 = (__pyx_t_5 < __pyx_t_22); | |
27426 if (__pyx_t_17) { | |
27427 | |
27428 /* "pysam/libcvcf.pyx":775 | |
27429 * s = a[1:] | |
27430 * if len(ref) < len(s): # add Ns to reference if necessary | |
27431 * addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference) # <<<<<<<<<<<<<< | |
27432 * if not s.endswith(addns) and addns != 'N'*len(addns): | |
27433 * self.error(line,self.V33_UNMATCHED_DELETION, | |
27434 */ | |
27435 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 775, __pyx_L61_except_error) | |
27436 __Pyx_GOTREF(__pyx_t_9); | |
27437 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 775, __pyx_L61_except_error) } | |
27438 __pyx_t_22 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 775, __pyx_L61_except_error) | |
27439 __pyx_t_16 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 775, __pyx_L61_except_error) | |
27440 __Pyx_GOTREF(__pyx_t_16); | |
27441 __pyx_t_23 = PyNumber_Add(__pyx_v_pos, __pyx_t_16); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 775, __pyx_L61_except_error) | |
27442 __Pyx_GOTREF(__pyx_t_23); | |
27443 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
27444 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 775, __pyx_L61_except_error) } | |
27445 __pyx_t_22 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 775, __pyx_L61_except_error) | |
27446 __pyx_t_16 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 775, __pyx_L61_except_error) | |
27447 __Pyx_GOTREF(__pyx_t_16); | |
27448 __pyx_t_24 = PyNumber_Add(__pyx_v_pos, __pyx_t_16); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 775, __pyx_L61_except_error) | |
27449 __Pyx_GOTREF(__pyx_t_24); | |
27450 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
27451 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 775, __pyx_L61_except_error) | |
27452 __Pyx_GOTREF(__pyx_t_16); | |
27453 __pyx_t_25 = NULL; | |
27454 __pyx_t_4 = 0; | |
27455 #if CYTHON_UNPACK_METHODS | |
27456 if (unlikely(PyMethod_Check(__pyx_t_9))) { | |
27457 __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_9); | |
27458 if (likely(__pyx_t_25)) { | |
27459 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); | |
27460 __Pyx_INCREF(__pyx_t_25); | |
27461 __Pyx_INCREF(function); | |
27462 __Pyx_DECREF_SET(__pyx_t_9, function); | |
27463 __pyx_t_4 = 1; | |
27464 } | |
27465 } | |
27466 #endif | |
27467 { | |
27468 PyObject *__pyx_callargs[5] = {__pyx_t_25, __pyx_v_chrom, __pyx_t_23, __pyx_t_24, __pyx_t_16}; | |
27469 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
27470 __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; | |
27471 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; | |
27472 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; | |
27473 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
27474 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L61_except_error) | |
27475 __Pyx_GOTREF(__pyx_t_3); | |
27476 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
27477 } | |
27478 __Pyx_XDECREF_SET(__pyx_v_addns, __pyx_t_3); | |
27479 __pyx_t_3 = 0; | |
27480 | |
27481 /* "pysam/libcvcf.pyx":776 | |
27482 * if len(ref) < len(s): # add Ns to reference if necessary | |
27483 * addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference) | |
27484 * if not s.endswith(addns) and addns != 'N'*len(addns): # <<<<<<<<<<<<<< | |
27485 * self.error(line,self.V33_UNMATCHED_DELETION, | |
27486 * "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference))) | |
27487 */ | |
27488 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_endswith); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 776, __pyx_L61_except_error) | |
27489 __Pyx_GOTREF(__pyx_t_9); | |
27490 __pyx_t_16 = NULL; | |
27491 __pyx_t_4 = 0; | |
27492 #if CYTHON_UNPACK_METHODS | |
27493 if (likely(PyMethod_Check(__pyx_t_9))) { | |
27494 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_9); | |
27495 if (likely(__pyx_t_16)) { | |
27496 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); | |
27497 __Pyx_INCREF(__pyx_t_16); | |
27498 __Pyx_INCREF(function); | |
27499 __Pyx_DECREF_SET(__pyx_t_9, function); | |
27500 __pyx_t_4 = 1; | |
27501 } | |
27502 } | |
27503 #endif | |
27504 { | |
27505 PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_v_addns}; | |
27506 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
27507 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; | |
27508 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L61_except_error) | |
27509 __Pyx_GOTREF(__pyx_t_3); | |
27510 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
27511 } | |
27512 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 776, __pyx_L61_except_error) | |
27513 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27514 __pyx_t_26 = (!__pyx_t_7); | |
27515 if (__pyx_t_26) { | |
27516 } else { | |
27517 __pyx_t_17 = __pyx_t_26; | |
27518 goto __pyx_L75_bool_binop_done; | |
27519 } | |
27520 __pyx_t_22 = PyObject_Length(__pyx_v_addns); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 776, __pyx_L61_except_error) | |
27521 __pyx_t_3 = __Pyx_PySequence_Multiply(__pyx_n_u_N, __pyx_t_22); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L61_except_error) | |
27522 __Pyx_GOTREF(__pyx_t_3); | |
27523 __pyx_t_26 = (__Pyx_PyUnicode_Equals(__pyx_v_addns, __pyx_t_3, Py_NE)); if (unlikely((__pyx_t_26 < 0))) __PYX_ERR(0, 776, __pyx_L61_except_error) | |
27524 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27525 __pyx_t_17 = __pyx_t_26; | |
27526 __pyx_L75_bool_binop_done:; | |
27527 if (__pyx_t_17) { | |
27528 | |
27529 /* "pysam/libcvcf.pyx":777 | |
27530 * addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference) | |
27531 * if not s.endswith(addns) and addns != 'N'*len(addns): | |
27532 * self.error(line,self.V33_UNMATCHED_DELETION, # <<<<<<<<<<<<<< | |
27533 * "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference))) | |
27534 * ref += addns | |
27535 */ | |
27536 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 777, __pyx_L61_except_error) | |
27537 __Pyx_GOTREF(__pyx_t_9); | |
27538 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V33_UNMATCHED_DELETION); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 777, __pyx_L61_except_error) | |
27539 __Pyx_GOTREF(__pyx_t_16); | |
27540 | |
27541 /* "pysam/libcvcf.pyx":778 | |
27542 * if not s.endswith(addns) and addns != 'N'*len(addns): | |
27543 * self.error(line,self.V33_UNMATCHED_DELETION, | |
27544 * "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference))) # <<<<<<<<<<<<<< | |
27545 * ref += addns | |
27546 * for i,na in enumerate(newalts): newalts[i] = na+addns | |
27547 */ | |
27548 __pyx_t_24 = PyTuple_New(5); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27549 __Pyx_GOTREF(__pyx_t_24); | |
27550 __pyx_t_22 = 0; | |
27551 __pyx_t_10 = 127; | |
27552 __Pyx_INCREF(__pyx_kp_u_deletion_is); | |
27553 __pyx_t_22 += 13; | |
27554 __Pyx_GIVEREF(__pyx_kp_u_deletion_is); | |
27555 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_kp_u_deletion_is); | |
27556 __pyx_t_23 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_a), __pyx_empty_unicode); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27557 __Pyx_GOTREF(__pyx_t_23); | |
27558 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_23) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_23) : __pyx_t_10; | |
27559 __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_23); | |
27560 __Pyx_GIVEREF(__pyx_t_23); | |
27561 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_23); | |
27562 __pyx_t_23 = 0; | |
27563 __Pyx_INCREF(__pyx_kp_u_reference_is_2); | |
27564 __pyx_t_22 += 15; | |
27565 __Pyx_GIVEREF(__pyx_kp_u_reference_is_2); | |
27566 PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_kp_u_reference_is_2); | |
27567 __Pyx_GetModuleGlobalName(__pyx_t_25, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27568 __Pyx_GOTREF(__pyx_t_25); | |
27569 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 778, __pyx_L61_except_error) } | |
27570 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 778, __pyx_L61_except_error) } | |
27571 __pyx_t_5 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27572 __pyx_t_27 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27573 __Pyx_GOTREF(__pyx_t_27); | |
27574 __pyx_t_28 = PyNumber_Add(__pyx_v_pos, __pyx_t_27); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27575 __Pyx_GOTREF(__pyx_t_28); | |
27576 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; | |
27577 __pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27578 __Pyx_GOTREF(__pyx_t_27); | |
27579 __pyx_t_29 = NULL; | |
27580 __pyx_t_4 = 0; | |
27581 #if CYTHON_UNPACK_METHODS | |
27582 if (unlikely(PyMethod_Check(__pyx_t_25))) { | |
27583 __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_25); | |
27584 if (likely(__pyx_t_29)) { | |
27585 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_25); | |
27586 __Pyx_INCREF(__pyx_t_29); | |
27587 __Pyx_INCREF(function); | |
27588 __Pyx_DECREF_SET(__pyx_t_25, function); | |
27589 __pyx_t_4 = 1; | |
27590 } | |
27591 } | |
27592 #endif | |
27593 { | |
27594 PyObject *__pyx_callargs[5] = {__pyx_t_29, __pyx_v_chrom, __pyx_v_pos, __pyx_t_28, __pyx_t_27}; | |
27595 __pyx_t_23 = __Pyx_PyObject_FastCall(__pyx_t_25, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
27596 __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0; | |
27597 __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; | |
27598 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; | |
27599 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27600 __Pyx_GOTREF(__pyx_t_23); | |
27601 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; | |
27602 } | |
27603 __pyx_t_25 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_23), __pyx_empty_unicode); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27604 __Pyx_GOTREF(__pyx_t_25); | |
27605 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; | |
27606 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25) : __pyx_t_10; | |
27607 __pyx_t_22 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_25); | |
27608 __Pyx_GIVEREF(__pyx_t_25); | |
27609 PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_25); | |
27610 __pyx_t_25 = 0; | |
27611 __Pyx_INCREF(__pyx_kp_u__8); | |
27612 __pyx_t_22 += 1; | |
27613 __Pyx_GIVEREF(__pyx_kp_u__8); | |
27614 PyTuple_SET_ITEM(__pyx_t_24, 4, __pyx_kp_u__8); | |
27615 __pyx_t_25 = __Pyx_PyUnicode_Join(__pyx_t_24, 5, __pyx_t_22, __pyx_t_10); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 778, __pyx_L61_except_error) | |
27616 __Pyx_GOTREF(__pyx_t_25); | |
27617 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; | |
27618 __pyx_t_24 = NULL; | |
27619 __pyx_t_4 = 0; | |
27620 #if CYTHON_UNPACK_METHODS | |
27621 if (likely(PyMethod_Check(__pyx_t_9))) { | |
27622 __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_9); | |
27623 if (likely(__pyx_t_24)) { | |
27624 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); | |
27625 __Pyx_INCREF(__pyx_t_24); | |
27626 __Pyx_INCREF(function); | |
27627 __Pyx_DECREF_SET(__pyx_t_9, function); | |
27628 __pyx_t_4 = 1; | |
27629 } | |
27630 } | |
27631 #endif | |
27632 { | |
27633 PyObject *__pyx_callargs[4] = {__pyx_t_24, __pyx_v_line, __pyx_t_16, __pyx_t_25}; | |
27634 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
27635 __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; | |
27636 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
27637 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; | |
27638 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L61_except_error) | |
27639 __Pyx_GOTREF(__pyx_t_3); | |
27640 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
27641 } | |
27642 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27643 | |
27644 /* "pysam/libcvcf.pyx":776 | |
27645 * if len(ref) < len(s): # add Ns to reference if necessary | |
27646 * addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference) | |
27647 * if not s.endswith(addns) and addns != 'N'*len(addns): # <<<<<<<<<<<<<< | |
27648 * self.error(line,self.V33_UNMATCHED_DELETION, | |
27649 * "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference))) | |
27650 */ | |
27651 } | |
27652 | |
27653 /* "pysam/libcvcf.pyx":779 | |
27654 * self.error(line,self.V33_UNMATCHED_DELETION, | |
27655 * "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference))) | |
27656 * ref += addns # <<<<<<<<<<<<<< | |
27657 * for i,na in enumerate(newalts): newalts[i] = na+addns | |
27658 * a = ref[len(s):] # new deletion, deleting from pos | |
27659 */ | |
27660 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L61_except_error) | |
27661 __Pyx_GOTREF(__pyx_t_3); | |
27662 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_3); | |
27663 __pyx_t_3 = 0; | |
27664 | |
27665 /* "pysam/libcvcf.pyx":780 | |
27666 * "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference))) | |
27667 * ref += addns | |
27668 * for i,na in enumerate(newalts): newalts[i] = na+addns # <<<<<<<<<<<<<< | |
27669 * a = ref[len(s):] # new deletion, deleting from pos | |
27670 * else: | |
27671 */ | |
27672 __Pyx_INCREF(__pyx_int_0); | |
27673 __pyx_t_3 = __pyx_int_0; | |
27674 __pyx_t_9 = __pyx_v_newalts; __Pyx_INCREF(__pyx_t_9); | |
27675 __pyx_t_22 = 0; | |
27676 for (;;) { | |
27677 { | |
27678 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); | |
27679 #if !CYTHON_ASSUME_SAFE_MACROS | |
27680 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 780, __pyx_L61_except_error) | |
27681 #endif | |
27682 if (__pyx_t_22 >= __pyx_temp) break; | |
27683 } | |
27684 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
27685 __pyx_t_25 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_22); __Pyx_INCREF(__pyx_t_25); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 780, __pyx_L61_except_error) | |
27686 #else | |
27687 __pyx_t_25 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 780, __pyx_L61_except_error) | |
27688 __Pyx_GOTREF(__pyx_t_25); | |
27689 #endif | |
27690 __Pyx_XDECREF_SET(__pyx_v_na, __pyx_t_25); | |
27691 __pyx_t_25 = 0; | |
27692 __Pyx_INCREF(__pyx_t_3); | |
27693 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); | |
27694 __pyx_t_25 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 780, __pyx_L61_except_error) | |
27695 __Pyx_GOTREF(__pyx_t_25); | |
27696 __Pyx_DECREF(__pyx_t_3); | |
27697 __pyx_t_3 = __pyx_t_25; | |
27698 __pyx_t_25 = 0; | |
27699 __pyx_t_25 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 780, __pyx_L61_except_error) | |
27700 __Pyx_GOTREF(__pyx_t_25); | |
27701 if (unlikely((PyObject_SetItem(__pyx_v_newalts, __pyx_v_i, __pyx_t_25) < 0))) __PYX_ERR(0, 780, __pyx_L61_except_error) | |
27702 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; | |
27703 } | |
27704 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
27705 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27706 | |
27707 /* "pysam/libcvcf.pyx":774 | |
27708 * except ValueError: | |
27709 * s = a[1:] | |
27710 * if len(ref) < len(s): # add Ns to reference if necessary # <<<<<<<<<<<<<< | |
27711 * addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference) | |
27712 * if not s.endswith(addns) and addns != 'N'*len(addns): | |
27713 */ | |
27714 } | |
27715 | |
27716 /* "pysam/libcvcf.pyx":781 | |
27717 * ref += addns | |
27718 * for i,na in enumerate(newalts): newalts[i] = na+addns | |
27719 * a = ref[len(s):] # new deletion, deleting from pos # <<<<<<<<<<<<<< | |
27720 * else: | |
27721 * self.error(line,self.V33_BAD_ALLELE) | |
27722 */ | |
27723 __pyx_t_22 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 781, __pyx_L61_except_error) | |
27724 __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_ref, __pyx_t_22, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L61_except_error) | |
27725 __Pyx_GOTREF(__pyx_t_3); | |
27726 __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_3); | |
27727 __pyx_t_3 = 0; | |
27728 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27729 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27730 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
27731 goto __pyx_L60_exception_handled; | |
27732 } | |
27733 goto __pyx_L61_except_error; | |
27734 | |
27735 /* "pysam/libcvcf.pyx":765 | |
27736 * elif a.startswith('D'): # allow D<seq> and D<num> | |
27737 * have_deletions = True | |
27738 * try: # <<<<<<<<<<<<<< | |
27739 * l = int(a[1:]) # throws ValueError if sequence | |
27740 * if len(ref) < l: # add to reference if necessary | |
27741 */ | |
27742 __pyx_L61_except_error:; | |
27743 __Pyx_XGIVEREF(__pyx_t_13); | |
27744 __Pyx_XGIVEREF(__pyx_t_14); | |
27745 __Pyx_XGIVEREF(__pyx_t_15); | |
27746 __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); | |
27747 goto __pyx_L1_error; | |
27748 __pyx_L60_exception_handled:; | |
27749 __Pyx_XGIVEREF(__pyx_t_13); | |
27750 __Pyx_XGIVEREF(__pyx_t_14); | |
27751 __Pyx_XGIVEREF(__pyx_t_15); | |
27752 __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); | |
27753 __pyx_L66_try_end:; | |
27754 } | |
27755 | |
27756 /* "pysam/libcvcf.pyx":763 | |
27757 * if len(a) == 1: a = a + ref[1:] # SNP; add trailing reference | |
27758 * elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:] # insertion just beyond pos; add first and trailing reference | |
27759 * elif a.startswith('D'): # allow D<seq> and D<num> # <<<<<<<<<<<<<< | |
27760 * have_deletions = True | |
27761 * try: | |
27762 */ | |
27763 goto __pyx_L58; | |
27764 } | |
27765 | |
27766 /* "pysam/libcvcf.pyx":783 | |
27767 * a = ref[len(s):] # new deletion, deleting from pos | |
27768 * else: | |
27769 * self.error(line,self.V33_BAD_ALLELE) # <<<<<<<<<<<<<< | |
27770 * newalts.append(a) | |
27771 * alt = newalts | |
27772 */ | |
27773 /*else*/ { | |
27774 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) | |
27775 __Pyx_GOTREF(__pyx_t_1); | |
27776 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V33_BAD_ALLELE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 783, __pyx_L1_error) | |
27777 __Pyx_GOTREF(__pyx_t_12); | |
27778 __pyx_t_3 = NULL; | |
27779 __pyx_t_4 = 0; | |
27780 #if CYTHON_UNPACK_METHODS | |
27781 if (likely(PyMethod_Check(__pyx_t_1))) { | |
27782 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
27783 if (likely(__pyx_t_3)) { | |
27784 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
27785 __Pyx_INCREF(__pyx_t_3); | |
27786 __Pyx_INCREF(function); | |
27787 __Pyx_DECREF_SET(__pyx_t_1, function); | |
27788 __pyx_t_4 = 1; | |
27789 } | |
27790 } | |
27791 #endif | |
27792 { | |
27793 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_line, __pyx_t_12}; | |
27794 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
27795 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27796 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27797 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 783, __pyx_L1_error) | |
27798 __Pyx_GOTREF(__pyx_t_11); | |
27799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27800 } | |
27801 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
27802 } | |
27803 __pyx_L58:; | |
27804 | |
27805 /* "pysam/libcvcf.pyx":784 | |
27806 * else: | |
27807 * self.error(line,self.V33_BAD_ALLELE) | |
27808 * newalts.append(a) # <<<<<<<<<<<<<< | |
27809 * alt = newalts | |
27810 * # deletion alleles exist, add dummy 1st reference allele, and account for leading base | |
27811 */ | |
27812 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_newalts, __pyx_v_a); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 784, __pyx_L1_error) | |
27813 | |
27814 /* "pysam/libcvcf.pyx":760 | |
27815 * newalts = [] | |
27816 * have_deletions = False | |
27817 * for a in alt: # <<<<<<<<<<<<<< | |
27818 * if len(a) == 1: a = a + ref[1:] # SNP; add trailing reference | |
27819 * elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:] # insertion just beyond pos; add first and trailing reference | |
27820 */ | |
27821 } | |
27822 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
27823 | |
27824 /* "pysam/libcvcf.pyx":785 | |
27825 * self.error(line,self.V33_BAD_ALLELE) | |
27826 * newalts.append(a) | |
27827 * alt = newalts # <<<<<<<<<<<<<< | |
27828 * # deletion alleles exist, add dummy 1st reference allele, and account for leading base | |
27829 * if have_deletions: | |
27830 */ | |
27831 __Pyx_INCREF(__pyx_v_newalts); | |
27832 __Pyx_DECREF_SET(__pyx_v_alt, __pyx_v_newalts); | |
27833 | |
27834 /* "pysam/libcvcf.pyx":787 | |
27835 * alt = newalts | |
27836 * # deletion alleles exist, add dummy 1st reference allele, and account for leading base | |
27837 * if have_deletions: # <<<<<<<<<<<<<< | |
27838 * if pos == 0: | |
27839 * # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1 | |
27840 */ | |
27841 if (__pyx_v_have_deletions) { | |
27842 | |
27843 /* "pysam/libcvcf.pyx":788 | |
27844 * # deletion alleles exist, add dummy 1st reference allele, and account for leading base | |
27845 * if have_deletions: | |
27846 * if pos == 0: # <<<<<<<<<<<<<< | |
27847 * # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1 | |
27848 * addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference) | |
27849 */ | |
27850 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 788, __pyx_L1_error) } | |
27851 __pyx_t_17 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_pos, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 788, __pyx_L1_error) | |
27852 if (__pyx_t_17) { | |
27853 | |
27854 /* "pysam/libcvcf.pyx":790 | |
27855 * if pos == 0: | |
27856 * # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1 | |
27857 * addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference) # <<<<<<<<<<<<<< | |
27858 * ref += addn | |
27859 * alt = [allele+addn for allele in alt] | |
27860 */ | |
27861 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 790, __pyx_L1_error) | |
27862 __Pyx_GOTREF(__pyx_t_11); | |
27863 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 790, __pyx_L1_error) } | |
27864 __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 790, __pyx_L1_error) | |
27865 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) | |
27866 __Pyx_GOTREF(__pyx_t_1); | |
27867 __pyx_t_12 = PyNumber_Add(__pyx_v_pos, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 790, __pyx_L1_error) | |
27868 __Pyx_GOTREF(__pyx_t_12); | |
27869 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27870 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 790, __pyx_L1_error) } | |
27871 __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 790, __pyx_L1_error) | |
27872 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) | |
27873 __Pyx_GOTREF(__pyx_t_1); | |
27874 __pyx_t_3 = PyNumber_Add(__pyx_v_pos, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error) | |
27875 __Pyx_GOTREF(__pyx_t_3); | |
27876 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27877 __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) | |
27878 __Pyx_GOTREF(__pyx_t_1); | |
27879 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27880 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error) | |
27881 __Pyx_GOTREF(__pyx_t_3); | |
27882 __pyx_t_9 = NULL; | |
27883 __pyx_t_4 = 0; | |
27884 #if CYTHON_UNPACK_METHODS | |
27885 if (unlikely(PyMethod_Check(__pyx_t_11))) { | |
27886 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); | |
27887 if (likely(__pyx_t_9)) { | |
27888 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); | |
27889 __Pyx_INCREF(__pyx_t_9); | |
27890 __Pyx_INCREF(function); | |
27891 __Pyx_DECREF_SET(__pyx_t_11, function); | |
27892 __pyx_t_4 = 1; | |
27893 } | |
27894 } | |
27895 #endif | |
27896 { | |
27897 PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_v_chrom, __pyx_t_12, __pyx_t_1, __pyx_t_3}; | |
27898 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
27899 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
27900 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
27901 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
27902 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27903 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error) | |
27904 __Pyx_GOTREF(__pyx_t_2); | |
27905 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
27906 } | |
27907 __pyx_v_addn = __pyx_t_2; | |
27908 __pyx_t_2 = 0; | |
27909 | |
27910 /* "pysam/libcvcf.pyx":791 | |
27911 * # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1 | |
27912 * addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference) | |
27913 * ref += addn # <<<<<<<<<<<<<< | |
27914 * alt = [allele+addn for allele in alt] | |
27915 * else: | |
27916 */ | |
27917 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) | |
27918 __Pyx_GOTREF(__pyx_t_2); | |
27919 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_2); | |
27920 __pyx_t_2 = 0; | |
27921 | |
27922 /* "pysam/libcvcf.pyx":792 | |
27923 * addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference) | |
27924 * ref += addn | |
27925 * alt = [allele+addn for allele in alt] # <<<<<<<<<<<<<< | |
27926 * else: | |
27927 * addn = get_sequence(chrom,pos-1,pos,self._reference) | |
27928 */ | |
27929 { /* enter inner scope */ | |
27930 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L85_error) | |
27931 __Pyx_GOTREF(__pyx_t_2); | |
27932 if (likely(PyList_CheckExact(__pyx_v_alt)) || PyTuple_CheckExact(__pyx_v_alt)) { | |
27933 __pyx_t_11 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_11); | |
27934 __pyx_t_6 = 0; | |
27935 __pyx_t_18 = NULL; | |
27936 } else { | |
27937 __pyx_t_6 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 792, __pyx_L85_error) | |
27938 __Pyx_GOTREF(__pyx_t_11); | |
27939 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 792, __pyx_L85_error) | |
27940 } | |
27941 for (;;) { | |
27942 if (likely(!__pyx_t_18)) { | |
27943 if (likely(PyList_CheckExact(__pyx_t_11))) { | |
27944 { | |
27945 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); | |
27946 #if !CYTHON_ASSUME_SAFE_MACROS | |
27947 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 792, __pyx_L85_error) | |
27948 #endif | |
27949 if (__pyx_t_6 >= __pyx_temp) break; | |
27950 } | |
27951 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
27952 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 792, __pyx_L85_error) | |
27953 #else | |
27954 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L85_error) | |
27955 __Pyx_GOTREF(__pyx_t_3); | |
27956 #endif | |
27957 } else { | |
27958 { | |
27959 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); | |
27960 #if !CYTHON_ASSUME_SAFE_MACROS | |
27961 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 792, __pyx_L85_error) | |
27962 #endif | |
27963 if (__pyx_t_6 >= __pyx_temp) break; | |
27964 } | |
27965 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
27966 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 792, __pyx_L85_error) | |
27967 #else | |
27968 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L85_error) | |
27969 __Pyx_GOTREF(__pyx_t_3); | |
27970 #endif | |
27971 } | |
27972 } else { | |
27973 __pyx_t_3 = __pyx_t_18(__pyx_t_11); | |
27974 if (unlikely(!__pyx_t_3)) { | |
27975 PyObject* exc_type = PyErr_Occurred(); | |
27976 if (exc_type) { | |
27977 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
27978 else __PYX_ERR(0, 792, __pyx_L85_error) | |
27979 } | |
27980 break; | |
27981 } | |
27982 __Pyx_GOTREF(__pyx_t_3); | |
27983 } | |
27984 __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_allele, __pyx_t_3); | |
27985 __pyx_t_3 = 0; | |
27986 __pyx_t_3 = PyNumber_Add(__pyx_8genexpr3__pyx_v_allele, __pyx_v_addn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L85_error) | |
27987 __Pyx_GOTREF(__pyx_t_3); | |
27988 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 792, __pyx_L85_error) | |
27989 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
27990 } | |
27991 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
27992 __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_allele); __pyx_8genexpr3__pyx_v_allele = 0; | |
27993 goto __pyx_L89_exit_scope; | |
27994 __pyx_L85_error:; | |
27995 __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_allele); __pyx_8genexpr3__pyx_v_allele = 0; | |
27996 goto __pyx_L1_error; | |
27997 __pyx_L89_exit_scope:; | |
27998 } /* exit inner scope */ | |
27999 __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_2); | |
28000 __pyx_t_2 = 0; | |
28001 | |
28002 /* "pysam/libcvcf.pyx":788 | |
28003 * # deletion alleles exist, add dummy 1st reference allele, and account for leading base | |
28004 * if have_deletions: | |
28005 * if pos == 0: # <<<<<<<<<<<<<< | |
28006 * # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1 | |
28007 * addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference) | |
28008 */ | |
28009 goto __pyx_L82; | |
28010 } | |
28011 | |
28012 /* "pysam/libcvcf.pyx":794 | |
28013 * alt = [allele+addn for allele in alt] | |
28014 * else: | |
28015 * addn = get_sequence(chrom,pos-1,pos,self._reference) # <<<<<<<<<<<<<< | |
28016 * ref = addn + ref | |
28017 * alt = [addn + allele for allele in alt] | |
28018 */ | |
28019 /*else*/ { | |
28020 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 794, __pyx_L1_error) | |
28021 __Pyx_GOTREF(__pyx_t_11); | |
28022 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 794, __pyx_L1_error) } | |
28023 __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_pos, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error) | |
28024 __Pyx_GOTREF(__pyx_t_3); | |
28025 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 794, __pyx_L1_error) } | |
28026 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) | |
28027 __Pyx_GOTREF(__pyx_t_1); | |
28028 __pyx_t_12 = NULL; | |
28029 __pyx_t_4 = 0; | |
28030 #if CYTHON_UNPACK_METHODS | |
28031 if (unlikely(PyMethod_Check(__pyx_t_11))) { | |
28032 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); | |
28033 if (likely(__pyx_t_12)) { | |
28034 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); | |
28035 __Pyx_INCREF(__pyx_t_12); | |
28036 __Pyx_INCREF(function); | |
28037 __Pyx_DECREF_SET(__pyx_t_11, function); | |
28038 __pyx_t_4 = 1; | |
28039 } | |
28040 } | |
28041 #endif | |
28042 { | |
28043 PyObject *__pyx_callargs[5] = {__pyx_t_12, __pyx_v_chrom, __pyx_t_3, __pyx_v_pos, __pyx_t_1}; | |
28044 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
28045 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28046 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28047 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28048 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 794, __pyx_L1_error) | |
28049 __Pyx_GOTREF(__pyx_t_2); | |
28050 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28051 } | |
28052 __pyx_v_addn = __pyx_t_2; | |
28053 __pyx_t_2 = 0; | |
28054 | |
28055 /* "pysam/libcvcf.pyx":795 | |
28056 * else: | |
28057 * addn = get_sequence(chrom,pos-1,pos,self._reference) | |
28058 * ref = addn + ref # <<<<<<<<<<<<<< | |
28059 * alt = [addn + allele for allele in alt] | |
28060 * pos -= 1 | |
28061 */ | |
28062 __pyx_t_2 = PyNumber_Add(__pyx_v_addn, __pyx_v_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error) | |
28063 __Pyx_GOTREF(__pyx_t_2); | |
28064 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_2); | |
28065 __pyx_t_2 = 0; | |
28066 | |
28067 /* "pysam/libcvcf.pyx":796 | |
28068 * addn = get_sequence(chrom,pos-1,pos,self._reference) | |
28069 * ref = addn + ref | |
28070 * alt = [addn + allele for allele in alt] # <<<<<<<<<<<<<< | |
28071 * pos -= 1 | |
28072 * else: | |
28073 */ | |
28074 { /* enter inner scope */ | |
28075 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 796, __pyx_L92_error) | |
28076 __Pyx_GOTREF(__pyx_t_2); | |
28077 if (likely(PyList_CheckExact(__pyx_v_alt)) || PyTuple_CheckExact(__pyx_v_alt)) { | |
28078 __pyx_t_11 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_11); | |
28079 __pyx_t_6 = 0; | |
28080 __pyx_t_18 = NULL; | |
28081 } else { | |
28082 __pyx_t_6 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 796, __pyx_L92_error) | |
28083 __Pyx_GOTREF(__pyx_t_11); | |
28084 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 796, __pyx_L92_error) | |
28085 } | |
28086 for (;;) { | |
28087 if (likely(!__pyx_t_18)) { | |
28088 if (likely(PyList_CheckExact(__pyx_t_11))) { | |
28089 { | |
28090 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); | |
28091 #if !CYTHON_ASSUME_SAFE_MACROS | |
28092 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 796, __pyx_L92_error) | |
28093 #endif | |
28094 if (__pyx_t_6 >= __pyx_temp) break; | |
28095 } | |
28096 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
28097 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 796, __pyx_L92_error) | |
28098 #else | |
28099 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L92_error) | |
28100 __Pyx_GOTREF(__pyx_t_1); | |
28101 #endif | |
28102 } else { | |
28103 { | |
28104 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); | |
28105 #if !CYTHON_ASSUME_SAFE_MACROS | |
28106 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 796, __pyx_L92_error) | |
28107 #endif | |
28108 if (__pyx_t_6 >= __pyx_temp) break; | |
28109 } | |
28110 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
28111 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 796, __pyx_L92_error) | |
28112 #else | |
28113 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L92_error) | |
28114 __Pyx_GOTREF(__pyx_t_1); | |
28115 #endif | |
28116 } | |
28117 } else { | |
28118 __pyx_t_1 = __pyx_t_18(__pyx_t_11); | |
28119 if (unlikely(!__pyx_t_1)) { | |
28120 PyObject* exc_type = PyErr_Occurred(); | |
28121 if (exc_type) { | |
28122 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
28123 else __PYX_ERR(0, 796, __pyx_L92_error) | |
28124 } | |
28125 break; | |
28126 } | |
28127 __Pyx_GOTREF(__pyx_t_1); | |
28128 } | |
28129 __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_allele, __pyx_t_1); | |
28130 __pyx_t_1 = 0; | |
28131 __pyx_t_1 = PyNumber_Add(__pyx_v_addn, __pyx_8genexpr4__pyx_v_allele); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L92_error) | |
28132 __Pyx_GOTREF(__pyx_t_1); | |
28133 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 796, __pyx_L92_error) | |
28134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28135 } | |
28136 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28137 __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_allele); __pyx_8genexpr4__pyx_v_allele = 0; | |
28138 goto __pyx_L96_exit_scope; | |
28139 __pyx_L92_error:; | |
28140 __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_allele); __pyx_8genexpr4__pyx_v_allele = 0; | |
28141 goto __pyx_L1_error; | |
28142 __pyx_L96_exit_scope:; | |
28143 } /* exit inner scope */ | |
28144 __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_2); | |
28145 __pyx_t_2 = 0; | |
28146 | |
28147 /* "pysam/libcvcf.pyx":797 | |
28148 * ref = addn + ref | |
28149 * alt = [addn + allele for allele in alt] | |
28150 * pos -= 1 # <<<<<<<<<<<<<< | |
28151 * else: | |
28152 * # format v4.0 -- just check for nucleotides | |
28153 */ | |
28154 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 797, __pyx_L1_error) } | |
28155 __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pos, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 797, __pyx_L1_error) | |
28156 __Pyx_GOTREF(__pyx_t_2); | |
28157 __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_2); | |
28158 __pyx_t_2 = 0; | |
28159 } | |
28160 __pyx_L82:; | |
28161 | |
28162 /* "pysam/libcvcf.pyx":787 | |
28163 * alt = newalts | |
28164 * # deletion alleles exist, add dummy 1st reference allele, and account for leading base | |
28165 * if have_deletions: # <<<<<<<<<<<<<< | |
28166 * if pos == 0: | |
28167 * # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1 | |
28168 */ | |
28169 } | |
28170 | |
28171 /* "pysam/libcvcf.pyx":756 | |
28172 * | |
28173 * # convert v3.3 alleles | |
28174 * if self._version == 33: # <<<<<<<<<<<<<< | |
28175 * if len(ref) != 1: self.error(line,self.V33_BAD_REF) | |
28176 * newalts = [] | |
28177 */ | |
28178 goto __pyx_L54; | |
28179 } | |
28180 | |
28181 /* "pysam/libcvcf.pyx":800 | |
28182 * else: | |
28183 * # format v4.0 -- just check for nucleotides | |
28184 * for allele in alt: # <<<<<<<<<<<<<< | |
28185 * if not alleleRegEx.match(allele): | |
28186 * self.error(line,self.V40_BAD_ALLELE,allele) | |
28187 */ | |
28188 /*else*/ { | |
28189 if (likely(PyList_CheckExact(__pyx_v_alt)) || PyTuple_CheckExact(__pyx_v_alt)) { | |
28190 __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2); | |
28191 __pyx_t_6 = 0; | |
28192 __pyx_t_18 = NULL; | |
28193 } else { | |
28194 __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error) | |
28195 __Pyx_GOTREF(__pyx_t_2); | |
28196 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 800, __pyx_L1_error) | |
28197 } | |
28198 for (;;) { | |
28199 if (likely(!__pyx_t_18)) { | |
28200 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
28201 { | |
28202 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
28203 #if !CYTHON_ASSUME_SAFE_MACROS | |
28204 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 800, __pyx_L1_error) | |
28205 #endif | |
28206 if (__pyx_t_6 >= __pyx_temp) break; | |
28207 } | |
28208 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
28209 __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 800, __pyx_L1_error) | |
28210 #else | |
28211 __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 800, __pyx_L1_error) | |
28212 __Pyx_GOTREF(__pyx_t_11); | |
28213 #endif | |
28214 } else { | |
28215 { | |
28216 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
28217 #if !CYTHON_ASSUME_SAFE_MACROS | |
28218 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 800, __pyx_L1_error) | |
28219 #endif | |
28220 if (__pyx_t_6 >= __pyx_temp) break; | |
28221 } | |
28222 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
28223 __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 800, __pyx_L1_error) | |
28224 #else | |
28225 __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 800, __pyx_L1_error) | |
28226 __Pyx_GOTREF(__pyx_t_11); | |
28227 #endif | |
28228 } | |
28229 } else { | |
28230 __pyx_t_11 = __pyx_t_18(__pyx_t_2); | |
28231 if (unlikely(!__pyx_t_11)) { | |
28232 PyObject* exc_type = PyErr_Occurred(); | |
28233 if (exc_type) { | |
28234 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
28235 else __PYX_ERR(0, 800, __pyx_L1_error) | |
28236 } | |
28237 break; | |
28238 } | |
28239 __Pyx_GOTREF(__pyx_t_11); | |
28240 } | |
28241 __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_11); | |
28242 __pyx_t_11 = 0; | |
28243 | |
28244 /* "pysam/libcvcf.pyx":801 | |
28245 * # format v4.0 -- just check for nucleotides | |
28246 * for allele in alt: | |
28247 * if not alleleRegEx.match(allele): # <<<<<<<<<<<<<< | |
28248 * self.error(line,self.V40_BAD_ALLELE,allele) | |
28249 * | |
28250 */ | |
28251 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_alleleRegEx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) | |
28252 __Pyx_GOTREF(__pyx_t_1); | |
28253 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) | |
28254 __Pyx_GOTREF(__pyx_t_3); | |
28255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28256 __pyx_t_1 = NULL; | |
28257 __pyx_t_4 = 0; | |
28258 #if CYTHON_UNPACK_METHODS | |
28259 if (unlikely(PyMethod_Check(__pyx_t_3))) { | |
28260 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); | |
28261 if (likely(__pyx_t_1)) { | |
28262 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
28263 __Pyx_INCREF(__pyx_t_1); | |
28264 __Pyx_INCREF(function); | |
28265 __Pyx_DECREF_SET(__pyx_t_3, function); | |
28266 __pyx_t_4 = 1; | |
28267 } | |
28268 } | |
28269 #endif | |
28270 { | |
28271 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_allele}; | |
28272 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
28273 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28274 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 801, __pyx_L1_error) | |
28275 __Pyx_GOTREF(__pyx_t_11); | |
28276 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28277 } | |
28278 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 801, __pyx_L1_error) | |
28279 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28280 __pyx_t_26 = (!__pyx_t_17); | |
28281 if (__pyx_t_26) { | |
28282 | |
28283 /* "pysam/libcvcf.pyx":802 | |
28284 * for allele in alt: | |
28285 * if not alleleRegEx.match(allele): | |
28286 * self.error(line,self.V40_BAD_ALLELE,allele) # <<<<<<<<<<<<<< | |
28287 * | |
28288 * # check for leading nucleotide in indel calls | |
28289 */ | |
28290 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error) | |
28291 __Pyx_GOTREF(__pyx_t_3); | |
28292 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V40_BAD_ALLELE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) | |
28293 __Pyx_GOTREF(__pyx_t_1); | |
28294 __pyx_t_12 = NULL; | |
28295 __pyx_t_4 = 0; | |
28296 #if CYTHON_UNPACK_METHODS | |
28297 if (likely(PyMethod_Check(__pyx_t_3))) { | |
28298 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); | |
28299 if (likely(__pyx_t_12)) { | |
28300 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
28301 __Pyx_INCREF(__pyx_t_12); | |
28302 __Pyx_INCREF(function); | |
28303 __Pyx_DECREF_SET(__pyx_t_3, function); | |
28304 __pyx_t_4 = 1; | |
28305 } | |
28306 } | |
28307 #endif | |
28308 { | |
28309 PyObject *__pyx_callargs[4] = {__pyx_t_12, __pyx_v_line, __pyx_t_1, __pyx_v_allele}; | |
28310 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
28311 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28313 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 802, __pyx_L1_error) | |
28314 __Pyx_GOTREF(__pyx_t_11); | |
28315 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28316 } | |
28317 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28318 | |
28319 /* "pysam/libcvcf.pyx":801 | |
28320 * # format v4.0 -- just check for nucleotides | |
28321 * for allele in alt: | |
28322 * if not alleleRegEx.match(allele): # <<<<<<<<<<<<<< | |
28323 * self.error(line,self.V40_BAD_ALLELE,allele) | |
28324 * | |
28325 */ | |
28326 } | |
28327 | |
28328 /* "pysam/libcvcf.pyx":800 | |
28329 * else: | |
28330 * # format v4.0 -- just check for nucleotides | |
28331 * for allele in alt: # <<<<<<<<<<<<<< | |
28332 * if not alleleRegEx.match(allele): | |
28333 * self.error(line,self.V40_BAD_ALLELE,allele) | |
28334 */ | |
28335 } | |
28336 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28337 } | |
28338 __pyx_L54:; | |
28339 | |
28340 /* "pysam/libcvcf.pyx":805 | |
28341 * | |
28342 * # check for leading nucleotide in indel calls | |
28343 * for allele in alt: # <<<<<<<<<<<<<< | |
28344 * if len(allele) != len(ref): | |
28345 * if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE) | |
28346 */ | |
28347 if (likely(PyList_CheckExact(__pyx_v_alt)) || PyTuple_CheckExact(__pyx_v_alt)) { | |
28348 __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2); | |
28349 __pyx_t_6 = 0; | |
28350 __pyx_t_18 = NULL; | |
28351 } else { | |
28352 __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error) | |
28353 __Pyx_GOTREF(__pyx_t_2); | |
28354 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 805, __pyx_L1_error) | |
28355 } | |
28356 for (;;) { | |
28357 if (likely(!__pyx_t_18)) { | |
28358 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
28359 { | |
28360 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
28361 #if !CYTHON_ASSUME_SAFE_MACROS | |
28362 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __pyx_L1_error) | |
28363 #endif | |
28364 if (__pyx_t_6 >= __pyx_temp) break; | |
28365 } | |
28366 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
28367 __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 805, __pyx_L1_error) | |
28368 #else | |
28369 __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 805, __pyx_L1_error) | |
28370 __Pyx_GOTREF(__pyx_t_11); | |
28371 #endif | |
28372 } else { | |
28373 { | |
28374 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
28375 #if !CYTHON_ASSUME_SAFE_MACROS | |
28376 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __pyx_L1_error) | |
28377 #endif | |
28378 if (__pyx_t_6 >= __pyx_temp) break; | |
28379 } | |
28380 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
28381 __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_11); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 805, __pyx_L1_error) | |
28382 #else | |
28383 __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 805, __pyx_L1_error) | |
28384 __Pyx_GOTREF(__pyx_t_11); | |
28385 #endif | |
28386 } | |
28387 } else { | |
28388 __pyx_t_11 = __pyx_t_18(__pyx_t_2); | |
28389 if (unlikely(!__pyx_t_11)) { | |
28390 PyObject* exc_type = PyErr_Occurred(); | |
28391 if (exc_type) { | |
28392 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
28393 else __PYX_ERR(0, 805, __pyx_L1_error) | |
28394 } | |
28395 break; | |
28396 } | |
28397 __Pyx_GOTREF(__pyx_t_11); | |
28398 } | |
28399 __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_11); | |
28400 __pyx_t_11 = 0; | |
28401 | |
28402 /* "pysam/libcvcf.pyx":806 | |
28403 * # check for leading nucleotide in indel calls | |
28404 * for allele in alt: | |
28405 * if len(allele) != len(ref): # <<<<<<<<<<<<<< | |
28406 * if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE) | |
28407 * if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper(): | |
28408 */ | |
28409 __pyx_t_22 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 806, __pyx_L1_error) | |
28410 __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 806, __pyx_L1_error) | |
28411 __pyx_t_26 = (__pyx_t_22 != __pyx_t_5); | |
28412 if (__pyx_t_26) { | |
28413 | |
28414 /* "pysam/libcvcf.pyx":807 | |
28415 * for allele in alt: | |
28416 * if len(allele) != len(ref): | |
28417 * if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE) # <<<<<<<<<<<<<< | |
28418 * if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper(): | |
28419 * self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE) | |
28420 */ | |
28421 __pyx_t_5 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 807, __pyx_L1_error) | |
28422 __pyx_t_26 = (__pyx_t_5 == 0); | |
28423 if (__pyx_t_26) { | |
28424 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) | |
28425 __Pyx_GOTREF(__pyx_t_3); | |
28426 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ZERO_LENGTH_ALLELE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error) | |
28427 __Pyx_GOTREF(__pyx_t_1); | |
28428 __pyx_t_12 = NULL; | |
28429 __pyx_t_4 = 0; | |
28430 #if CYTHON_UNPACK_METHODS | |
28431 if (likely(PyMethod_Check(__pyx_t_3))) { | |
28432 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); | |
28433 if (likely(__pyx_t_12)) { | |
28434 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
28435 __Pyx_INCREF(__pyx_t_12); | |
28436 __Pyx_INCREF(function); | |
28437 __Pyx_DECREF_SET(__pyx_t_3, function); | |
28438 __pyx_t_4 = 1; | |
28439 } | |
28440 } | |
28441 #endif | |
28442 { | |
28443 PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_line, __pyx_t_1}; | |
28444 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
28445 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28446 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28447 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 807, __pyx_L1_error) | |
28448 __Pyx_GOTREF(__pyx_t_11); | |
28449 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28450 } | |
28451 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28452 } | |
28453 | |
28454 /* "pysam/libcvcf.pyx":808 | |
28455 * if len(allele) != len(ref): | |
28456 * if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE) | |
28457 * if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper(): # <<<<<<<<<<<<<< | |
28458 * self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE) | |
28459 * | |
28460 */ | |
28461 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_ref, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28462 __Pyx_GOTREF(__pyx_t_3); | |
28463 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28464 __Pyx_GOTREF(__pyx_t_1); | |
28465 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28466 __pyx_t_3 = NULL; | |
28467 __pyx_t_4 = 0; | |
28468 #if CYTHON_UNPACK_METHODS | |
28469 if (likely(PyMethod_Check(__pyx_t_1))) { | |
28470 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
28471 if (likely(__pyx_t_3)) { | |
28472 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
28473 __Pyx_INCREF(__pyx_t_3); | |
28474 __Pyx_INCREF(function); | |
28475 __Pyx_DECREF_SET(__pyx_t_1, function); | |
28476 __pyx_t_4 = 1; | |
28477 } | |
28478 } | |
28479 #endif | |
28480 { | |
28481 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
28482 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
28483 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28484 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28485 __Pyx_GOTREF(__pyx_t_11); | |
28486 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28487 } | |
28488 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_allele, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28489 __Pyx_GOTREF(__pyx_t_3); | |
28490 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_upper); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28491 __Pyx_GOTREF(__pyx_t_12); | |
28492 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28493 __pyx_t_3 = NULL; | |
28494 __pyx_t_4 = 0; | |
28495 #if CYTHON_UNPACK_METHODS | |
28496 if (likely(PyMethod_Check(__pyx_t_12))) { | |
28497 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12); | |
28498 if (likely(__pyx_t_3)) { | |
28499 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); | |
28500 __Pyx_INCREF(__pyx_t_3); | |
28501 __Pyx_INCREF(function); | |
28502 __Pyx_DECREF_SET(__pyx_t_12, function); | |
28503 __pyx_t_4 = 1; | |
28504 } | |
28505 } | |
28506 #endif | |
28507 { | |
28508 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
28509 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
28510 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28511 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28512 __Pyx_GOTREF(__pyx_t_1); | |
28513 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28514 } | |
28515 __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28516 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28518 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 808, __pyx_L1_error) | |
28519 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28520 if (__pyx_t_17) { | |
28521 } else { | |
28522 __pyx_t_26 = __pyx_t_17; | |
28523 goto __pyx_L106_bool_binop_done; | |
28524 } | |
28525 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ref, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28526 __Pyx_GOTREF(__pyx_t_1); | |
28527 __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_allele, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28528 __Pyx_GOTREF(__pyx_t_11); | |
28529 __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28530 __Pyx_GOTREF(__pyx_t_3); | |
28531 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28532 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28533 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_upper); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28534 __Pyx_GOTREF(__pyx_t_11); | |
28535 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28536 __pyx_t_3 = NULL; | |
28537 __pyx_t_4 = 0; | |
28538 #if CYTHON_UNPACK_METHODS | |
28539 if (likely(PyMethod_Check(__pyx_t_11))) { | |
28540 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); | |
28541 if (likely(__pyx_t_3)) { | |
28542 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); | |
28543 __Pyx_INCREF(__pyx_t_3); | |
28544 __Pyx_INCREF(function); | |
28545 __Pyx_DECREF_SET(__pyx_t_11, function); | |
28546 __pyx_t_4 = 1; | |
28547 } | |
28548 } | |
28549 #endif | |
28550 { | |
28551 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
28552 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
28553 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28554 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 808, __pyx_L1_error) | |
28555 __Pyx_GOTREF(__pyx_t_12); | |
28556 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28557 } | |
28558 __pyx_t_17 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_N, __pyx_t_12, Py_NE)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 808, __pyx_L1_error) | |
28559 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28560 __pyx_t_26 = __pyx_t_17; | |
28561 __pyx_L106_bool_binop_done:; | |
28562 if (__pyx_t_26) { | |
28563 | |
28564 /* "pysam/libcvcf.pyx":809 | |
28565 * if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE) | |
28566 * if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper(): | |
28567 * self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE) # <<<<<<<<<<<<<< | |
28568 * | |
28569 * # trim trailing bases in alleles | |
28570 */ | |
28571 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 809, __pyx_L1_error) | |
28572 __Pyx_GOTREF(__pyx_t_11); | |
28573 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) | |
28574 __Pyx_GOTREF(__pyx_t_3); | |
28575 __pyx_t_1 = NULL; | |
28576 __pyx_t_4 = 0; | |
28577 #if CYTHON_UNPACK_METHODS | |
28578 if (likely(PyMethod_Check(__pyx_t_11))) { | |
28579 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); | |
28580 if (likely(__pyx_t_1)) { | |
28581 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); | |
28582 __Pyx_INCREF(__pyx_t_1); | |
28583 __Pyx_INCREF(function); | |
28584 __Pyx_DECREF_SET(__pyx_t_11, function); | |
28585 __pyx_t_4 = 1; | |
28586 } | |
28587 } | |
28588 #endif | |
28589 { | |
28590 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_line, __pyx_t_3}; | |
28591 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
28592 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28593 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28594 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 809, __pyx_L1_error) | |
28595 __Pyx_GOTREF(__pyx_t_12); | |
28596 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28597 } | |
28598 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28599 | |
28600 /* "pysam/libcvcf.pyx":808 | |
28601 * if len(allele) != len(ref): | |
28602 * if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE) | |
28603 * if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper(): # <<<<<<<<<<<<<< | |
28604 * self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE) | |
28605 * | |
28606 */ | |
28607 } | |
28608 | |
28609 /* "pysam/libcvcf.pyx":806 | |
28610 * # check for leading nucleotide in indel calls | |
28611 * for allele in alt: | |
28612 * if len(allele) != len(ref): # <<<<<<<<<<<<<< | |
28613 * if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE) | |
28614 * if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper(): | |
28615 */ | |
28616 } | |
28617 | |
28618 /* "pysam/libcvcf.pyx":805 | |
28619 * | |
28620 * # check for leading nucleotide in indel calls | |
28621 * for allele in alt: # <<<<<<<<<<<<<< | |
28622 * if len(allele) != len(ref): | |
28623 * if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE) | |
28624 */ | |
28625 } | |
28626 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28627 | |
28628 /* "pysam/libcvcf.pyx":821 | |
28629 * | |
28630 * # left-align alleles, if a reference is available | |
28631 * if self._leftalign and self._reference: # <<<<<<<<<<<<<< | |
28632 * while left < pos: | |
28633 * movable = True | |
28634 */ | |
28635 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_leftalign_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) | |
28636 __Pyx_GOTREF(__pyx_t_2); | |
28637 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 821, __pyx_L1_error) | |
28638 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28639 if (__pyx_t_17) { | |
28640 } else { | |
28641 __pyx_t_26 = __pyx_t_17; | |
28642 goto __pyx_L110_bool_binop_done; | |
28643 } | |
28644 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) | |
28645 __Pyx_GOTREF(__pyx_t_2); | |
28646 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 821, __pyx_L1_error) | |
28647 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28648 __pyx_t_26 = __pyx_t_17; | |
28649 __pyx_L110_bool_binop_done:; | |
28650 if (__pyx_t_26) { | |
28651 | |
28652 /* "pysam/libcvcf.pyx":822 | |
28653 * # left-align alleles, if a reference is available | |
28654 * if self._leftalign and self._reference: | |
28655 * while left < pos: # <<<<<<<<<<<<<< | |
28656 * movable = True | |
28657 * for allele in alt: | |
28658 */ | |
28659 while (1) { | |
28660 if (unlikely(!__pyx_v_left)) { __Pyx_RaiseUnboundLocalError("left"); __PYX_ERR(0, 822, __pyx_L1_error) } | |
28661 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 822, __pyx_L1_error) } | |
28662 __pyx_t_2 = PyObject_RichCompare(__pyx_v_left, __pyx_v_pos, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error) | |
28663 __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_26 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) | |
28664 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28665 if (!__pyx_t_26) break; | |
28666 | |
28667 /* "pysam/libcvcf.pyx":823 | |
28668 * if self._leftalign and self._reference: | |
28669 * while left < pos: | |
28670 * movable = True # <<<<<<<<<<<<<< | |
28671 * for allele in alt: | |
28672 * if len(allele) > len(ref): | |
28673 */ | |
28674 __pyx_v_movable = 1; | |
28675 | |
28676 /* "pysam/libcvcf.pyx":824 | |
28677 * while left < pos: | |
28678 * movable = True | |
28679 * for allele in alt: # <<<<<<<<<<<<<< | |
28680 * if len(allele) > len(ref): | |
28681 * longest, shortest = allele, ref | |
28682 */ | |
28683 if (likely(PyList_CheckExact(__pyx_v_alt)) || PyTuple_CheckExact(__pyx_v_alt)) { | |
28684 __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2); | |
28685 __pyx_t_6 = 0; | |
28686 __pyx_t_18 = NULL; | |
28687 } else { | |
28688 __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error) | |
28689 __Pyx_GOTREF(__pyx_t_2); | |
28690 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 824, __pyx_L1_error) | |
28691 } | |
28692 for (;;) { | |
28693 if (likely(!__pyx_t_18)) { | |
28694 if (likely(PyList_CheckExact(__pyx_t_2))) { | |
28695 { | |
28696 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); | |
28697 #if !CYTHON_ASSUME_SAFE_MACROS | |
28698 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 824, __pyx_L1_error) | |
28699 #endif | |
28700 if (__pyx_t_6 >= __pyx_temp) break; | |
28701 } | |
28702 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
28703 __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 824, __pyx_L1_error) | |
28704 #else | |
28705 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 824, __pyx_L1_error) | |
28706 __Pyx_GOTREF(__pyx_t_12); | |
28707 #endif | |
28708 } else { | |
28709 { | |
28710 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); | |
28711 #if !CYTHON_ASSUME_SAFE_MACROS | |
28712 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 824, __pyx_L1_error) | |
28713 #endif | |
28714 if (__pyx_t_6 >= __pyx_temp) break; | |
28715 } | |
28716 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
28717 __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 824, __pyx_L1_error) | |
28718 #else | |
28719 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 824, __pyx_L1_error) | |
28720 __Pyx_GOTREF(__pyx_t_12); | |
28721 #endif | |
28722 } | |
28723 } else { | |
28724 __pyx_t_12 = __pyx_t_18(__pyx_t_2); | |
28725 if (unlikely(!__pyx_t_12)) { | |
28726 PyObject* exc_type = PyErr_Occurred(); | |
28727 if (exc_type) { | |
28728 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
28729 else __PYX_ERR(0, 824, __pyx_L1_error) | |
28730 } | |
28731 break; | |
28732 } | |
28733 __Pyx_GOTREF(__pyx_t_12); | |
28734 } | |
28735 __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_12); | |
28736 __pyx_t_12 = 0; | |
28737 | |
28738 /* "pysam/libcvcf.pyx":825 | |
28739 * movable = True | |
28740 * for allele in alt: | |
28741 * if len(allele) > len(ref): # <<<<<<<<<<<<<< | |
28742 * longest, shortest = allele, ref | |
28743 * else: | |
28744 */ | |
28745 __pyx_t_5 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 825, __pyx_L1_error) | |
28746 __pyx_t_22 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 825, __pyx_L1_error) | |
28747 __pyx_t_26 = (__pyx_t_5 > __pyx_t_22); | |
28748 if (__pyx_t_26) { | |
28749 | |
28750 /* "pysam/libcvcf.pyx":826 | |
28751 * for allele in alt: | |
28752 * if len(allele) > len(ref): | |
28753 * longest, shortest = allele, ref # <<<<<<<<<<<<<< | |
28754 * else: | |
28755 * longest, shortest = ref, allele | |
28756 */ | |
28757 __pyx_t_12 = __pyx_v_allele; | |
28758 __Pyx_INCREF(__pyx_t_12); | |
28759 __pyx_t_11 = __pyx_v_ref; | |
28760 __Pyx_INCREF(__pyx_t_11); | |
28761 __Pyx_XDECREF_SET(__pyx_v_longest, __pyx_t_12); | |
28762 __pyx_t_12 = 0; | |
28763 __Pyx_XDECREF_SET(__pyx_v_shortest, __pyx_t_11); | |
28764 __pyx_t_11 = 0; | |
28765 | |
28766 /* "pysam/libcvcf.pyx":825 | |
28767 * movable = True | |
28768 * for allele in alt: | |
28769 * if len(allele) > len(ref): # <<<<<<<<<<<<<< | |
28770 * longest, shortest = allele, ref | |
28771 * else: | |
28772 */ | |
28773 goto __pyx_L116; | |
28774 } | |
28775 | |
28776 /* "pysam/libcvcf.pyx":828 | |
28777 * longest, shortest = allele, ref | |
28778 * else: | |
28779 * longest, shortest = ref, allele # <<<<<<<<<<<<<< | |
28780 * if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper(): | |
28781 * movable = False | |
28782 */ | |
28783 /*else*/ { | |
28784 __pyx_t_11 = __pyx_v_ref; | |
28785 __Pyx_INCREF(__pyx_t_11); | |
28786 __pyx_t_12 = __pyx_v_allele; | |
28787 __Pyx_INCREF(__pyx_t_12); | |
28788 __Pyx_XDECREF_SET(__pyx_v_longest, __pyx_t_11); | |
28789 __pyx_t_11 = 0; | |
28790 __Pyx_XDECREF_SET(__pyx_v_shortest, __pyx_t_12); | |
28791 __pyx_t_12 = 0; | |
28792 } | |
28793 __pyx_L116:; | |
28794 | |
28795 /* "pysam/libcvcf.pyx":829 | |
28796 * else: | |
28797 * longest, shortest = ref, allele | |
28798 * if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper(): # <<<<<<<<<<<<<< | |
28799 * movable = False | |
28800 * if longest[-1].upper() != longest[len(shortest)-1].upper(): | |
28801 */ | |
28802 __pyx_t_22 = PyObject_Length(__pyx_v_longest); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 829, __pyx_L1_error) | |
28803 __pyx_t_5 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 829, __pyx_L1_error) | |
28804 __pyx_t_17 = (__pyx_t_22 == __pyx_t_5); | |
28805 if (!__pyx_t_17) { | |
28806 } else { | |
28807 __pyx_t_26 = __pyx_t_17; | |
28808 goto __pyx_L118_bool_binop_done; | |
28809 } | |
28810 __pyx_t_5 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 829, __pyx_L1_error) | |
28811 __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_longest, 0, __pyx_t_5, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 829, __pyx_L1_error) | |
28812 __Pyx_GOTREF(__pyx_t_11); | |
28813 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_upper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) | |
28814 __Pyx_GOTREF(__pyx_t_3); | |
28815 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28816 __pyx_t_11 = NULL; | |
28817 __pyx_t_4 = 0; | |
28818 #if CYTHON_UNPACK_METHODS | |
28819 if (likely(PyMethod_Check(__pyx_t_3))) { | |
28820 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3); | |
28821 if (likely(__pyx_t_11)) { | |
28822 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
28823 __Pyx_INCREF(__pyx_t_11); | |
28824 __Pyx_INCREF(function); | |
28825 __Pyx_DECREF_SET(__pyx_t_3, function); | |
28826 __pyx_t_4 = 1; | |
28827 } | |
28828 } | |
28829 #endif | |
28830 { | |
28831 PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; | |
28832 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
28833 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28834 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 829, __pyx_L1_error) | |
28835 __Pyx_GOTREF(__pyx_t_12); | |
28836 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28837 } | |
28838 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_shortest, __pyx_n_s_upper); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 829, __pyx_L1_error) | |
28839 __Pyx_GOTREF(__pyx_t_11); | |
28840 __pyx_t_1 = NULL; | |
28841 __pyx_t_4 = 0; | |
28842 #if CYTHON_UNPACK_METHODS | |
28843 if (likely(PyMethod_Check(__pyx_t_11))) { | |
28844 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); | |
28845 if (likely(__pyx_t_1)) { | |
28846 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); | |
28847 __Pyx_INCREF(__pyx_t_1); | |
28848 __Pyx_INCREF(function); | |
28849 __Pyx_DECREF_SET(__pyx_t_11, function); | |
28850 __pyx_t_4 = 1; | |
28851 } | |
28852 } | |
28853 #endif | |
28854 { | |
28855 PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; | |
28856 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
28857 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28858 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) | |
28859 __Pyx_GOTREF(__pyx_t_3); | |
28860 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28861 } | |
28862 __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 829, __pyx_L1_error) | |
28863 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28864 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28865 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 829, __pyx_L1_error) | |
28866 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28867 __pyx_t_26 = __pyx_t_17; | |
28868 __pyx_L118_bool_binop_done:; | |
28869 if (__pyx_t_26) { | |
28870 | |
28871 /* "pysam/libcvcf.pyx":830 | |
28872 * longest, shortest = ref, allele | |
28873 * if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper(): | |
28874 * movable = False # <<<<<<<<<<<<<< | |
28875 * if longest[-1].upper() != longest[len(shortest)-1].upper(): | |
28876 * movable = False | |
28877 */ | |
28878 __pyx_v_movable = 0; | |
28879 | |
28880 /* "pysam/libcvcf.pyx":829 | |
28881 * else: | |
28882 * longest, shortest = ref, allele | |
28883 * if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper(): # <<<<<<<<<<<<<< | |
28884 * movable = False | |
28885 * if longest[-1].upper() != longest[len(shortest)-1].upper(): | |
28886 */ | |
28887 } | |
28888 | |
28889 /* "pysam/libcvcf.pyx":831 | |
28890 * if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper(): | |
28891 * movable = False | |
28892 * if longest[-1].upper() != longest[len(shortest)-1].upper(): # <<<<<<<<<<<<<< | |
28893 * movable = False | |
28894 * if not movable: | |
28895 */ | |
28896 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_longest, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) | |
28897 __Pyx_GOTREF(__pyx_t_3); | |
28898 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_upper); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 831, __pyx_L1_error) | |
28899 __Pyx_GOTREF(__pyx_t_12); | |
28900 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28901 __pyx_t_3 = NULL; | |
28902 __pyx_t_4 = 0; | |
28903 #if CYTHON_UNPACK_METHODS | |
28904 if (likely(PyMethod_Check(__pyx_t_12))) { | |
28905 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12); | |
28906 if (likely(__pyx_t_3)) { | |
28907 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); | |
28908 __Pyx_INCREF(__pyx_t_3); | |
28909 __Pyx_INCREF(function); | |
28910 __Pyx_DECREF_SET(__pyx_t_12, function); | |
28911 __pyx_t_4 = 1; | |
28912 } | |
28913 } | |
28914 #endif | |
28915 { | |
28916 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
28917 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
28918 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28919 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 831, __pyx_L1_error) | |
28920 __Pyx_GOTREF(__pyx_t_11); | |
28921 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28922 } | |
28923 __pyx_t_5 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 831, __pyx_L1_error) | |
28924 __pyx_t_22 = (__pyx_t_5 - 1); | |
28925 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_longest, __pyx_t_22, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) | |
28926 __Pyx_GOTREF(__pyx_t_3); | |
28927 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error) | |
28928 __Pyx_GOTREF(__pyx_t_1); | |
28929 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28930 __pyx_t_3 = NULL; | |
28931 __pyx_t_4 = 0; | |
28932 #if CYTHON_UNPACK_METHODS | |
28933 if (likely(PyMethod_Check(__pyx_t_1))) { | |
28934 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
28935 if (likely(__pyx_t_3)) { | |
28936 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
28937 __Pyx_INCREF(__pyx_t_3); | |
28938 __Pyx_INCREF(function); | |
28939 __Pyx_DECREF_SET(__pyx_t_1, function); | |
28940 __pyx_t_4 = 1; | |
28941 } | |
28942 } | |
28943 #endif | |
28944 { | |
28945 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
28946 __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
28947 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
28948 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 831, __pyx_L1_error) | |
28949 __Pyx_GOTREF(__pyx_t_12); | |
28950 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28951 } | |
28952 __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_12, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error) | |
28953 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
28954 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
28955 __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_26 < 0))) __PYX_ERR(0, 831, __pyx_L1_error) | |
28956 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
28957 if (__pyx_t_26) { | |
28958 | |
28959 /* "pysam/libcvcf.pyx":832 | |
28960 * movable = False | |
28961 * if longest[-1].upper() != longest[len(shortest)-1].upper(): | |
28962 * movable = False # <<<<<<<<<<<<<< | |
28963 * if not movable: | |
28964 * break | |
28965 */ | |
28966 __pyx_v_movable = 0; | |
28967 | |
28968 /* "pysam/libcvcf.pyx":831 | |
28969 * if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper(): | |
28970 * movable = False | |
28971 * if longest[-1].upper() != longest[len(shortest)-1].upper(): # <<<<<<<<<<<<<< | |
28972 * movable = False | |
28973 * if not movable: | |
28974 */ | |
28975 } | |
28976 | |
28977 /* "pysam/libcvcf.pyx":824 | |
28978 * while left < pos: | |
28979 * movable = True | |
28980 * for allele in alt: # <<<<<<<<<<<<<< | |
28981 * if len(allele) > len(ref): | |
28982 * longest, shortest = allele, ref | |
28983 */ | |
28984 } | |
28985 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28986 | |
28987 /* "pysam/libcvcf.pyx":833 | |
28988 * if longest[-1].upper() != longest[len(shortest)-1].upper(): | |
28989 * movable = False | |
28990 * if not movable: # <<<<<<<<<<<<<< | |
28991 * break | |
28992 * ref = ref[:-1] | |
28993 */ | |
28994 __pyx_t_26 = (!__pyx_v_movable); | |
28995 if (__pyx_t_26) { | |
28996 | |
28997 /* "pysam/libcvcf.pyx":834 | |
28998 * movable = False | |
28999 * if not movable: | |
29000 * break # <<<<<<<<<<<<<< | |
29001 * ref = ref[:-1] | |
29002 * alt = [allele[:-1] for allele in alt] | |
29003 */ | |
29004 goto __pyx_L113_break; | |
29005 | |
29006 /* "pysam/libcvcf.pyx":833 | |
29007 * if longest[-1].upper() != longest[len(shortest)-1].upper(): | |
29008 * movable = False | |
29009 * if not movable: # <<<<<<<<<<<<<< | |
29010 * break | |
29011 * ref = ref[:-1] | |
29012 */ | |
29013 } | |
29014 | |
29015 /* "pysam/libcvcf.pyx":835 | |
29016 * if not movable: | |
29017 * break | |
29018 * ref = ref[:-1] # <<<<<<<<<<<<<< | |
29019 * alt = [allele[:-1] for allele in alt] | |
29020 * if min([len(allele) for allele in alt]) == 0 or len(ref) == 0: | |
29021 */ | |
29022 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_ref, 0, -1L, NULL, NULL, &__pyx_slice__28, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 835, __pyx_L1_error) | |
29023 __Pyx_GOTREF(__pyx_t_2); | |
29024 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_2); | |
29025 __pyx_t_2 = 0; | |
29026 | |
29027 /* "pysam/libcvcf.pyx":836 | |
29028 * break | |
29029 * ref = ref[:-1] | |
29030 * alt = [allele[:-1] for allele in alt] # <<<<<<<<<<<<<< | |
29031 * if min([len(allele) for allele in alt]) == 0 or len(ref) == 0: | |
29032 * ref = faref_leftflank[pos-left-1] + ref | |
29033 */ | |
29034 { /* enter inner scope */ | |
29035 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L125_error) | |
29036 __Pyx_GOTREF(__pyx_t_2); | |
29037 if (likely(PyList_CheckExact(__pyx_v_alt)) || PyTuple_CheckExact(__pyx_v_alt)) { | |
29038 __pyx_t_1 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_1); | |
29039 __pyx_t_6 = 0; | |
29040 __pyx_t_18 = NULL; | |
29041 } else { | |
29042 __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L125_error) | |
29043 __Pyx_GOTREF(__pyx_t_1); | |
29044 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 836, __pyx_L125_error) | |
29045 } | |
29046 for (;;) { | |
29047 if (likely(!__pyx_t_18)) { | |
29048 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
29049 { | |
29050 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
29051 #if !CYTHON_ASSUME_SAFE_MACROS | |
29052 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 836, __pyx_L125_error) | |
29053 #endif | |
29054 if (__pyx_t_6 >= __pyx_temp) break; | |
29055 } | |
29056 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
29057 __pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 836, __pyx_L125_error) | |
29058 #else | |
29059 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 836, __pyx_L125_error) | |
29060 __Pyx_GOTREF(__pyx_t_12); | |
29061 #endif | |
29062 } else { | |
29063 { | |
29064 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
29065 #if !CYTHON_ASSUME_SAFE_MACROS | |
29066 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 836, __pyx_L125_error) | |
29067 #endif | |
29068 if (__pyx_t_6 >= __pyx_temp) break; | |
29069 } | |
29070 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
29071 __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 836, __pyx_L125_error) | |
29072 #else | |
29073 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 836, __pyx_L125_error) | |
29074 __Pyx_GOTREF(__pyx_t_12); | |
29075 #endif | |
29076 } | |
29077 } else { | |
29078 __pyx_t_12 = __pyx_t_18(__pyx_t_1); | |
29079 if (unlikely(!__pyx_t_12)) { | |
29080 PyObject* exc_type = PyErr_Occurred(); | |
29081 if (exc_type) { | |
29082 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
29083 else __PYX_ERR(0, 836, __pyx_L125_error) | |
29084 } | |
29085 break; | |
29086 } | |
29087 __Pyx_GOTREF(__pyx_t_12); | |
29088 } | |
29089 __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_allele, __pyx_t_12); | |
29090 __pyx_t_12 = 0; | |
29091 __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_8genexpr5__pyx_v_allele, 0, -1L, NULL, NULL, &__pyx_slice__28, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 836, __pyx_L125_error) | |
29092 __Pyx_GOTREF(__pyx_t_12); | |
29093 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 836, __pyx_L125_error) | |
29094 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29095 } | |
29096 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29097 __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_allele); __pyx_8genexpr5__pyx_v_allele = 0; | |
29098 goto __pyx_L129_exit_scope; | |
29099 __pyx_L125_error:; | |
29100 __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_allele); __pyx_8genexpr5__pyx_v_allele = 0; | |
29101 goto __pyx_L1_error; | |
29102 __pyx_L129_exit_scope:; | |
29103 } /* exit inner scope */ | |
29104 __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_2); | |
29105 __pyx_t_2 = 0; | |
29106 | |
29107 /* "pysam/libcvcf.pyx":837 | |
29108 * ref = ref[:-1] | |
29109 * alt = [allele[:-1] for allele in alt] | |
29110 * if min([len(allele) for allele in alt]) == 0 or len(ref) == 0: # <<<<<<<<<<<<<< | |
29111 * ref = faref_leftflank[pos-left-1] + ref | |
29112 * alt = [faref_leftflank[pos-left-1] + allele for allele in alt] | |
29113 */ | |
29114 { /* enter inner scope */ | |
29115 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L135_error) | |
29116 __Pyx_GOTREF(__pyx_t_2); | |
29117 if (likely(PyList_CheckExact(__pyx_v_alt)) || PyTuple_CheckExact(__pyx_v_alt)) { | |
29118 __pyx_t_1 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_1); | |
29119 __pyx_t_6 = 0; | |
29120 __pyx_t_18 = NULL; | |
29121 } else { | |
29122 __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L135_error) | |
29123 __Pyx_GOTREF(__pyx_t_1); | |
29124 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 837, __pyx_L135_error) | |
29125 } | |
29126 for (;;) { | |
29127 if (likely(!__pyx_t_18)) { | |
29128 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
29129 { | |
29130 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
29131 #if !CYTHON_ASSUME_SAFE_MACROS | |
29132 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 837, __pyx_L135_error) | |
29133 #endif | |
29134 if (__pyx_t_6 >= __pyx_temp) break; | |
29135 } | |
29136 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
29137 __pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 837, __pyx_L135_error) | |
29138 #else | |
29139 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L135_error) | |
29140 __Pyx_GOTREF(__pyx_t_12); | |
29141 #endif | |
29142 } else { | |
29143 { | |
29144 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
29145 #if !CYTHON_ASSUME_SAFE_MACROS | |
29146 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 837, __pyx_L135_error) | |
29147 #endif | |
29148 if (__pyx_t_6 >= __pyx_temp) break; | |
29149 } | |
29150 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
29151 __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 837, __pyx_L135_error) | |
29152 #else | |
29153 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L135_error) | |
29154 __Pyx_GOTREF(__pyx_t_12); | |
29155 #endif | |
29156 } | |
29157 } else { | |
29158 __pyx_t_12 = __pyx_t_18(__pyx_t_1); | |
29159 if (unlikely(!__pyx_t_12)) { | |
29160 PyObject* exc_type = PyErr_Occurred(); | |
29161 if (exc_type) { | |
29162 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
29163 else __PYX_ERR(0, 837, __pyx_L135_error) | |
29164 } | |
29165 break; | |
29166 } | |
29167 __Pyx_GOTREF(__pyx_t_12); | |
29168 } | |
29169 __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_allele, __pyx_t_12); | |
29170 __pyx_t_12 = 0; | |
29171 __pyx_t_22 = PyObject_Length(__pyx_8genexpr6__pyx_v_allele); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 837, __pyx_L135_error) | |
29172 __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L135_error) | |
29173 __Pyx_GOTREF(__pyx_t_12); | |
29174 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 837, __pyx_L135_error) | |
29175 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29176 } | |
29177 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29178 __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_allele); __pyx_8genexpr6__pyx_v_allele = 0; | |
29179 goto __pyx_L139_exit_scope; | |
29180 __pyx_L135_error:; | |
29181 __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_allele); __pyx_8genexpr6__pyx_v_allele = 0; | |
29182 goto __pyx_L1_error; | |
29183 __pyx_L139_exit_scope:; | |
29184 } /* exit inner scope */ | |
29185 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) | |
29186 __Pyx_GOTREF(__pyx_t_1); | |
29187 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29188 __pyx_t_17 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_1, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 837, __pyx_L1_error) | |
29189 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29190 if (!__pyx_t_17) { | |
29191 } else { | |
29192 __pyx_t_26 = __pyx_t_17; | |
29193 goto __pyx_L131_bool_binop_done; | |
29194 } | |
29195 __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 837, __pyx_L1_error) | |
29196 __pyx_t_17 = (__pyx_t_6 == 0); | |
29197 __pyx_t_26 = __pyx_t_17; | |
29198 __pyx_L131_bool_binop_done:; | |
29199 if (__pyx_t_26) { | |
29200 | |
29201 /* "pysam/libcvcf.pyx":838 | |
29202 * alt = [allele[:-1] for allele in alt] | |
29203 * if min([len(allele) for allele in alt]) == 0 or len(ref) == 0: | |
29204 * ref = faref_leftflank[pos-left-1] + ref # <<<<<<<<<<<<<< | |
29205 * alt = [faref_leftflank[pos-left-1] + allele for allele in alt] | |
29206 * pos -= 1 | |
29207 */ | |
29208 if (unlikely(!__pyx_v_faref_leftflank)) { __Pyx_RaiseUnboundLocalError("faref_leftflank"); __PYX_ERR(0, 838, __pyx_L1_error) } | |
29209 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 838, __pyx_L1_error) } | |
29210 if (unlikely(!__pyx_v_left)) { __Pyx_RaiseUnboundLocalError("left"); __PYX_ERR(0, 838, __pyx_L1_error) } | |
29211 __pyx_t_1 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) | |
29212 __Pyx_GOTREF(__pyx_t_1); | |
29213 __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) | |
29214 __Pyx_GOTREF(__pyx_t_2); | |
29215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29216 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) | |
29217 __Pyx_GOTREF(__pyx_t_1); | |
29218 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29219 __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) | |
29220 __Pyx_GOTREF(__pyx_t_2); | |
29221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29222 __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_2); | |
29223 __pyx_t_2 = 0; | |
29224 | |
29225 /* "pysam/libcvcf.pyx":839 | |
29226 * if min([len(allele) for allele in alt]) == 0 or len(ref) == 0: | |
29227 * ref = faref_leftflank[pos-left-1] + ref | |
29228 * alt = [faref_leftflank[pos-left-1] + allele for allele in alt] # <<<<<<<<<<<<<< | |
29229 * pos -= 1 | |
29230 * | |
29231 */ | |
29232 { /* enter inner scope */ | |
29233 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L142_error) | |
29234 __Pyx_GOTREF(__pyx_t_2); | |
29235 if (likely(PyList_CheckExact(__pyx_v_alt)) || PyTuple_CheckExact(__pyx_v_alt)) { | |
29236 __pyx_t_1 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_1); | |
29237 __pyx_t_6 = 0; | |
29238 __pyx_t_18 = NULL; | |
29239 } else { | |
29240 __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L142_error) | |
29241 __Pyx_GOTREF(__pyx_t_1); | |
29242 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 839, __pyx_L142_error) | |
29243 } | |
29244 for (;;) { | |
29245 if (likely(!__pyx_t_18)) { | |
29246 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
29247 { | |
29248 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
29249 #if !CYTHON_ASSUME_SAFE_MACROS | |
29250 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L142_error) | |
29251 #endif | |
29252 if (__pyx_t_6 >= __pyx_temp) break; | |
29253 } | |
29254 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
29255 __pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 839, __pyx_L142_error) | |
29256 #else | |
29257 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 839, __pyx_L142_error) | |
29258 __Pyx_GOTREF(__pyx_t_12); | |
29259 #endif | |
29260 } else { | |
29261 { | |
29262 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
29263 #if !CYTHON_ASSUME_SAFE_MACROS | |
29264 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L142_error) | |
29265 #endif | |
29266 if (__pyx_t_6 >= __pyx_temp) break; | |
29267 } | |
29268 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
29269 __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 839, __pyx_L142_error) | |
29270 #else | |
29271 __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 839, __pyx_L142_error) | |
29272 __Pyx_GOTREF(__pyx_t_12); | |
29273 #endif | |
29274 } | |
29275 } else { | |
29276 __pyx_t_12 = __pyx_t_18(__pyx_t_1); | |
29277 if (unlikely(!__pyx_t_12)) { | |
29278 PyObject* exc_type = PyErr_Occurred(); | |
29279 if (exc_type) { | |
29280 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
29281 else __PYX_ERR(0, 839, __pyx_L142_error) | |
29282 } | |
29283 break; | |
29284 } | |
29285 __Pyx_GOTREF(__pyx_t_12); | |
29286 } | |
29287 __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_allele, __pyx_t_12); | |
29288 __pyx_t_12 = 0; | |
29289 if (unlikely(!__pyx_v_faref_leftflank)) { __Pyx_RaiseUnboundLocalError("faref_leftflank"); __PYX_ERR(0, 839, __pyx_L142_error) } | |
29290 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 839, __pyx_L142_error) } | |
29291 if (unlikely(!__pyx_v_left)) { __Pyx_RaiseUnboundLocalError("left"); __PYX_ERR(0, 839, __pyx_L142_error) } | |
29292 __pyx_t_12 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 839, __pyx_L142_error) | |
29293 __Pyx_GOTREF(__pyx_t_12); | |
29294 __pyx_t_11 = __Pyx_PyInt_SubtractObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 839, __pyx_L142_error) | |
29295 __Pyx_GOTREF(__pyx_t_11); | |
29296 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29297 __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 839, __pyx_L142_error) | |
29298 __Pyx_GOTREF(__pyx_t_12); | |
29299 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29300 __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_8genexpr7__pyx_v_allele); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 839, __pyx_L142_error) | |
29301 __Pyx_GOTREF(__pyx_t_11); | |
29302 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29303 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 839, __pyx_L142_error) | |
29304 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29305 } | |
29306 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29307 __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_allele); __pyx_8genexpr7__pyx_v_allele = 0; | |
29308 goto __pyx_L146_exit_scope; | |
29309 __pyx_L142_error:; | |
29310 __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_allele); __pyx_8genexpr7__pyx_v_allele = 0; | |
29311 goto __pyx_L1_error; | |
29312 __pyx_L146_exit_scope:; | |
29313 } /* exit inner scope */ | |
29314 __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_2); | |
29315 __pyx_t_2 = 0; | |
29316 | |
29317 /* "pysam/libcvcf.pyx":840 | |
29318 * ref = faref_leftflank[pos-left-1] + ref | |
29319 * alt = [faref_leftflank[pos-left-1] + allele for allele in alt] | |
29320 * pos -= 1 # <<<<<<<<<<<<<< | |
29321 * | |
29322 * # parse sample columns | |
29323 */ | |
29324 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 840, __pyx_L1_error) } | |
29325 __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_pos, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L1_error) | |
29326 __Pyx_GOTREF(__pyx_t_2); | |
29327 __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_2); | |
29328 __pyx_t_2 = 0; | |
29329 | |
29330 /* "pysam/libcvcf.pyx":837 | |
29331 * ref = ref[:-1] | |
29332 * alt = [allele[:-1] for allele in alt] | |
29333 * if min([len(allele) for allele in alt]) == 0 or len(ref) == 0: # <<<<<<<<<<<<<< | |
29334 * ref = faref_leftflank[pos-left-1] + ref | |
29335 * alt = [faref_leftflank[pos-left-1] + allele for allele in alt] | |
29336 */ | |
29337 } | |
29338 } | |
29339 __pyx_L113_break:; | |
29340 | |
29341 /* "pysam/libcvcf.pyx":821 | |
29342 * | |
29343 * # left-align alleles, if a reference is available | |
29344 * if self._leftalign and self._reference: # <<<<<<<<<<<<<< | |
29345 * while left < pos: | |
29346 * movable = True | |
29347 */ | |
29348 } | |
29349 | |
29350 /* "pysam/libcvcf.pyx":843 | |
29351 * | |
29352 * # parse sample columns | |
29353 * samples = [] # <<<<<<<<<<<<<< | |
29354 * for sample in cols[9:]: | |
29355 * dict = {} | |
29356 */ | |
29357 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error) | |
29358 __Pyx_GOTREF(__pyx_t_2); | |
29359 __pyx_v_samples = ((PyObject*)__pyx_t_2); | |
29360 __pyx_t_2 = 0; | |
29361 | |
29362 /* "pysam/libcvcf.pyx":844 | |
29363 * # parse sample columns | |
29364 * samples = [] | |
29365 * for sample in cols[9:]: # <<<<<<<<<<<<<< | |
29366 * dict = {} | |
29367 * values = sample.split(':') | |
29368 */ | |
29369 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_cols, 9, 0, NULL, NULL, &__pyx_slice__26, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error) | |
29370 __Pyx_GOTREF(__pyx_t_2); | |
29371 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { | |
29372 __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); | |
29373 __pyx_t_6 = 0; | |
29374 __pyx_t_18 = NULL; | |
29375 } else { | |
29376 __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) | |
29377 __Pyx_GOTREF(__pyx_t_1); | |
29378 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 844, __pyx_L1_error) | |
29379 } | |
29380 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29381 for (;;) { | |
29382 if (likely(!__pyx_t_18)) { | |
29383 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
29384 { | |
29385 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
29386 #if !CYTHON_ASSUME_SAFE_MACROS | |
29387 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 844, __pyx_L1_error) | |
29388 #endif | |
29389 if (__pyx_t_6 >= __pyx_temp) break; | |
29390 } | |
29391 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
29392 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 844, __pyx_L1_error) | |
29393 #else | |
29394 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error) | |
29395 __Pyx_GOTREF(__pyx_t_2); | |
29396 #endif | |
29397 } else { | |
29398 { | |
29399 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
29400 #if !CYTHON_ASSUME_SAFE_MACROS | |
29401 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 844, __pyx_L1_error) | |
29402 #endif | |
29403 if (__pyx_t_6 >= __pyx_temp) break; | |
29404 } | |
29405 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
29406 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 844, __pyx_L1_error) | |
29407 #else | |
29408 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error) | |
29409 __Pyx_GOTREF(__pyx_t_2); | |
29410 #endif | |
29411 } | |
29412 } else { | |
29413 __pyx_t_2 = __pyx_t_18(__pyx_t_1); | |
29414 if (unlikely(!__pyx_t_2)) { | |
29415 PyObject* exc_type = PyErr_Occurred(); | |
29416 if (exc_type) { | |
29417 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
29418 else __PYX_ERR(0, 844, __pyx_L1_error) | |
29419 } | |
29420 break; | |
29421 } | |
29422 __Pyx_GOTREF(__pyx_t_2); | |
29423 } | |
29424 __Pyx_XDECREF_SET(__pyx_v_sample, __pyx_t_2); | |
29425 __pyx_t_2 = 0; | |
29426 | |
29427 /* "pysam/libcvcf.pyx":845 | |
29428 * samples = [] | |
29429 * for sample in cols[9:]: | |
29430 * dict = {} # <<<<<<<<<<<<<< | |
29431 * values = sample.split(':') | |
29432 * if len(values) > len(format): | |
29433 */ | |
29434 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error) | |
29435 __Pyx_GOTREF(__pyx_t_2); | |
29436 __Pyx_XDECREF_SET(__pyx_v_dict, ((PyObject*)__pyx_t_2)); | |
29437 __pyx_t_2 = 0; | |
29438 | |
29439 /* "pysam/libcvcf.pyx":846 | |
29440 * for sample in cols[9:]: | |
29441 * dict = {} | |
29442 * values = sample.split(':') # <<<<<<<<<<<<<< | |
29443 * if len(values) > len(format): | |
29444 * self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format))) | |
29445 */ | |
29446 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_split); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 846, __pyx_L1_error) | |
29447 __Pyx_GOTREF(__pyx_t_11); | |
29448 __pyx_t_12 = NULL; | |
29449 __pyx_t_4 = 0; | |
29450 #if CYTHON_UNPACK_METHODS | |
29451 if (likely(PyMethod_Check(__pyx_t_11))) { | |
29452 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); | |
29453 if (likely(__pyx_t_12)) { | |
29454 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); | |
29455 __Pyx_INCREF(__pyx_t_12); | |
29456 __Pyx_INCREF(function); | |
29457 __Pyx_DECREF_SET(__pyx_t_11, function); | |
29458 __pyx_t_4 = 1; | |
29459 } | |
29460 } | |
29461 #endif | |
29462 { | |
29463 PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_kp_u__3}; | |
29464 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
29465 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29466 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error) | |
29467 __Pyx_GOTREF(__pyx_t_2); | |
29468 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29469 } | |
29470 __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_2); | |
29471 __pyx_t_2 = 0; | |
29472 | |
29473 /* "pysam/libcvcf.pyx":847 | |
29474 * dict = {} | |
29475 * values = sample.split(':') | |
29476 * if len(values) > len(format): # <<<<<<<<<<<<<< | |
29477 * self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format))) | |
29478 * for idx in range(len(format)): | |
29479 */ | |
29480 __pyx_t_22 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 847, __pyx_L1_error) | |
29481 __pyx_t_5 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 847, __pyx_L1_error) | |
29482 __pyx_t_26 = (__pyx_t_22 > __pyx_t_5); | |
29483 if (__pyx_t_26) { | |
29484 | |
29485 /* "pysam/libcvcf.pyx":848 | |
29486 * values = sample.split(':') | |
29487 * if len(values) > len(format): | |
29488 * self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format))) # <<<<<<<<<<<<<< | |
29489 * for idx in range(len(format)): | |
29490 * expected = self.get_expected(format[idx], self._format, alt) | |
29491 */ | |
29492 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 848, __pyx_L1_error) | |
29493 __Pyx_GOTREF(__pyx_t_11); | |
29494 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BAD_NUMBER_OF_VALUES); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 848, __pyx_L1_error) | |
29495 __Pyx_GOTREF(__pyx_t_12); | |
29496 __pyx_t_3 = PyTuple_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) | |
29497 __Pyx_GOTREF(__pyx_t_3); | |
29498 __pyx_t_5 = 0; | |
29499 __pyx_t_10 = 127; | |
29500 __Pyx_INCREF(__pyx_kp_u_found); | |
29501 __pyx_t_5 += 7; | |
29502 __Pyx_GIVEREF(__pyx_kp_u_found); | |
29503 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_found); | |
29504 __pyx_t_22 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 848, __pyx_L1_error) | |
29505 __pyx_t_9 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_22, 0, ' ', 'd'); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 848, __pyx_L1_error) | |
29506 __Pyx_GOTREF(__pyx_t_9); | |
29507 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); | |
29508 __Pyx_GIVEREF(__pyx_t_9); | |
29509 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9); | |
29510 __pyx_t_9 = 0; | |
29511 __Pyx_INCREF(__pyx_kp_u_values_in_element); | |
29512 __pyx_t_5 += 19; | |
29513 __Pyx_GIVEREF(__pyx_kp_u_values_in_element); | |
29514 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_values_in_element); | |
29515 __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_sample), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 848, __pyx_L1_error) | |
29516 __Pyx_GOTREF(__pyx_t_9); | |
29517 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_10; | |
29518 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); | |
29519 __Pyx_GIVEREF(__pyx_t_9); | |
29520 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_9); | |
29521 __pyx_t_9 = 0; | |
29522 __Pyx_INCREF(__pyx_kp_u_expected); | |
29523 __pyx_t_5 += 11; | |
29524 __Pyx_GIVEREF(__pyx_kp_u_expected); | |
29525 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_expected); | |
29526 __pyx_t_22 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_22 == ((Py_ssize_t)-1))) __PYX_ERR(0, 848, __pyx_L1_error) | |
29527 __pyx_t_9 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_22, 0, ' ', 'd'); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 848, __pyx_L1_error) | |
29528 __Pyx_GOTREF(__pyx_t_9); | |
29529 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); | |
29530 __Pyx_GIVEREF(__pyx_t_9); | |
29531 PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_9); | |
29532 __pyx_t_9 = 0; | |
29533 __Pyx_INCREF(__pyx_kp_u__8); | |
29534 __pyx_t_5 += 1; | |
29535 __Pyx_GIVEREF(__pyx_kp_u__8); | |
29536 PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_kp_u__8); | |
29537 __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_3, 7, __pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 848, __pyx_L1_error) | |
29538 __Pyx_GOTREF(__pyx_t_9); | |
29539 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
29540 __pyx_t_3 = NULL; | |
29541 __pyx_t_4 = 0; | |
29542 #if CYTHON_UNPACK_METHODS | |
29543 if (likely(PyMethod_Check(__pyx_t_11))) { | |
29544 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); | |
29545 if (likely(__pyx_t_3)) { | |
29546 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); | |
29547 __Pyx_INCREF(__pyx_t_3); | |
29548 __Pyx_INCREF(function); | |
29549 __Pyx_DECREF_SET(__pyx_t_11, function); | |
29550 __pyx_t_4 = 1; | |
29551 } | |
29552 } | |
29553 #endif | |
29554 { | |
29555 PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_line, __pyx_t_12, __pyx_t_9}; | |
29556 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
29557 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
29558 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29559 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29560 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 848, __pyx_L1_error) | |
29561 __Pyx_GOTREF(__pyx_t_2); | |
29562 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29563 } | |
29564 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29565 | |
29566 /* "pysam/libcvcf.pyx":847 | |
29567 * dict = {} | |
29568 * values = sample.split(':') | |
29569 * if len(values) > len(format): # <<<<<<<<<<<<<< | |
29570 * self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format))) | |
29571 * for idx in range(len(format)): | |
29572 */ | |
29573 } | |
29574 | |
29575 /* "pysam/libcvcf.pyx":849 | |
29576 * if len(values) > len(format): | |
29577 * self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format))) | |
29578 * for idx in range(len(format)): # <<<<<<<<<<<<<< | |
29579 * expected = self.get_expected(format[idx], self._format, alt) | |
29580 * if idx < len(values): value = values[idx] | |
29581 */ | |
29582 __pyx_t_5 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 849, __pyx_L1_error) | |
29583 __pyx_t_22 = __pyx_t_5; | |
29584 for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_22; __pyx_t_30+=1) { | |
29585 __pyx_v_idx = __pyx_t_30; | |
29586 | |
29587 /* "pysam/libcvcf.pyx":850 | |
29588 * self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format))) | |
29589 * for idx in range(len(format)): | |
29590 * expected = self.get_expected(format[idx], self._format, alt) # <<<<<<<<<<<<<< | |
29591 * if idx < len(values): value = values[idx] | |
29592 * else: | |
29593 */ | |
29594 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_expected); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 850, __pyx_L1_error) | |
29595 __Pyx_GOTREF(__pyx_t_11); | |
29596 __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 850, __pyx_L1_error) | |
29597 __Pyx_GOTREF(__pyx_t_9); | |
29598 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 850, __pyx_L1_error) | |
29599 __Pyx_GOTREF(__pyx_t_12); | |
29600 __pyx_t_3 = NULL; | |
29601 __pyx_t_4 = 0; | |
29602 #if CYTHON_UNPACK_METHODS | |
29603 if (likely(PyMethod_Check(__pyx_t_11))) { | |
29604 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); | |
29605 if (likely(__pyx_t_3)) { | |
29606 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); | |
29607 __Pyx_INCREF(__pyx_t_3); | |
29608 __Pyx_INCREF(function); | |
29609 __Pyx_DECREF_SET(__pyx_t_11, function); | |
29610 __pyx_t_4 = 1; | |
29611 } | |
29612 } | |
29613 #endif | |
29614 { | |
29615 PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_9, __pyx_t_12, __pyx_v_alt}; | |
29616 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
29617 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
29618 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29619 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29620 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) | |
29621 __Pyx_GOTREF(__pyx_t_2); | |
29622 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29623 } | |
29624 __Pyx_XDECREF_SET(__pyx_v_expected, __pyx_t_2); | |
29625 __pyx_t_2 = 0; | |
29626 | |
29627 /* "pysam/libcvcf.pyx":851 | |
29628 * for idx in range(len(format)): | |
29629 * expected = self.get_expected(format[idx], self._format, alt) | |
29630 * if idx < len(values): value = values[idx] # <<<<<<<<<<<<<< | |
29631 * else: | |
29632 * if expected == -1: value = "." | |
29633 */ | |
29634 __pyx_t_31 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_31 == ((Py_ssize_t)-1))) __PYX_ERR(0, 851, __pyx_L1_error) | |
29635 __pyx_t_26 = (__pyx_v_idx < __pyx_t_31); | |
29636 if (__pyx_t_26) { | |
29637 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error) | |
29638 __Pyx_GOTREF(__pyx_t_2); | |
29639 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); | |
29640 __pyx_t_2 = 0; | |
29641 goto __pyx_L152; | |
29642 } | |
29643 | |
29644 /* "pysam/libcvcf.pyx":853 | |
29645 * if idx < len(values): value = values[idx] | |
29646 * else: | |
29647 * if expected == -1: value = "." # <<<<<<<<<<<<<< | |
29648 * else: value = ",".join(["."]*expected) | |
29649 * | |
29650 */ | |
29651 /*else*/ { | |
29652 __pyx_t_26 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_expected, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_26 < 0))) __PYX_ERR(0, 853, __pyx_L1_error) | |
29653 if (__pyx_t_26) { | |
29654 __Pyx_INCREF(__pyx_kp_u__5); | |
29655 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_kp_u__5); | |
29656 goto __pyx_L153; | |
29657 } | |
29658 | |
29659 /* "pysam/libcvcf.pyx":854 | |
29660 * else: | |
29661 * if expected == -1: value = "." | |
29662 * else: value = ",".join(["."]*expected) # <<<<<<<<<<<<<< | |
29663 * | |
29664 * dict[format[idx]] = self.parse_formatdata(format[idx], | |
29665 */ | |
29666 /*else*/ { | |
29667 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) | |
29668 __Pyx_GOTREF(__pyx_t_2); | |
29669 __Pyx_INCREF(__pyx_kp_u__5); | |
29670 __Pyx_GIVEREF(__pyx_kp_u__5); | |
29671 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__5)) __PYX_ERR(0, 854, __pyx_L1_error); | |
29672 { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_expected); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 854, __pyx_L1_error) | |
29673 __Pyx_GOTREF(__pyx_temp); | |
29674 __Pyx_DECREF(__pyx_t_2); | |
29675 __pyx_t_2 = __pyx_temp; | |
29676 } | |
29677 __pyx_t_11 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 854, __pyx_L1_error) | |
29678 __Pyx_GOTREF(__pyx_t_11); | |
29679 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29680 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_11); | |
29681 __pyx_t_11 = 0; | |
29682 } | |
29683 __pyx_L153:; | |
29684 } | |
29685 __pyx_L152:; | |
29686 | |
29687 /* "pysam/libcvcf.pyx":856 | |
29688 * else: value = ",".join(["."]*expected) | |
29689 * | |
29690 * dict[format[idx]] = self.parse_formatdata(format[idx], # <<<<<<<<<<<<<< | |
29691 * value, | |
29692 * self._format, | |
29693 */ | |
29694 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_formatdata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) | |
29695 __Pyx_GOTREF(__pyx_t_2); | |
29696 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 856, __pyx_L1_error) | |
29697 __Pyx_GOTREF(__pyx_t_12); | |
29698 | |
29699 /* "pysam/libcvcf.pyx":858 | |
29700 * dict[format[idx]] = self.parse_formatdata(format[idx], | |
29701 * value, | |
29702 * self._format, # <<<<<<<<<<<<<< | |
29703 * line) | |
29704 * if expected != -1 and len(dict[format[idx]]) != expected: | |
29705 */ | |
29706 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 858, __pyx_L1_error) | |
29707 __Pyx_GOTREF(__pyx_t_9); | |
29708 | |
29709 /* "pysam/libcvcf.pyx":859 | |
29710 * value, | |
29711 * self._format, | |
29712 * line) # <<<<<<<<<<<<<< | |
29713 * if expected != -1 and len(dict[format[idx]]) != expected: | |
29714 * self.error(line,self.BAD_NUMBER_OF_PARAMETERS, | |
29715 */ | |
29716 __pyx_t_3 = NULL; | |
29717 __pyx_t_4 = 0; | |
29718 #if CYTHON_UNPACK_METHODS | |
29719 if (likely(PyMethod_Check(__pyx_t_2))) { | |
29720 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
29721 if (likely(__pyx_t_3)) { | |
29722 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
29723 __Pyx_INCREF(__pyx_t_3); | |
29724 __Pyx_INCREF(function); | |
29725 __Pyx_DECREF_SET(__pyx_t_2, function); | |
29726 __pyx_t_4 = 1; | |
29727 } | |
29728 } | |
29729 #endif | |
29730 { | |
29731 PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_t_12, __pyx_v_value, __pyx_t_9, __pyx_v_line}; | |
29732 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); | |
29733 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
29734 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29735 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29736 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 856, __pyx_L1_error) | |
29737 __Pyx_GOTREF(__pyx_t_11); | |
29738 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29739 } | |
29740 | |
29741 /* "pysam/libcvcf.pyx":856 | |
29742 * else: value = ",".join(["."]*expected) | |
29743 * | |
29744 * dict[format[idx]] = self.parse_formatdata(format[idx], # <<<<<<<<<<<<<< | |
29745 * value, | |
29746 * self._format, | |
29747 */ | |
29748 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) | |
29749 __Pyx_GOTREF(__pyx_t_2); | |
29750 if (unlikely((PyDict_SetItem(__pyx_v_dict, __pyx_t_2, __pyx_t_11) < 0))) __PYX_ERR(0, 856, __pyx_L1_error) | |
29751 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29752 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29753 | |
29754 /* "pysam/libcvcf.pyx":860 | |
29755 * self._format, | |
29756 * line) | |
29757 * if expected != -1 and len(dict[format[idx]]) != expected: # <<<<<<<<<<<<<< | |
29758 * self.error(line,self.BAD_NUMBER_OF_PARAMETERS, | |
29759 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]])) | |
29760 */ | |
29761 __pyx_t_17 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_expected, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 860, __pyx_L1_error) | |
29762 if (__pyx_t_17) { | |
29763 } else { | |
29764 __pyx_t_26 = __pyx_t_17; | |
29765 goto __pyx_L155_bool_binop_done; | |
29766 } | |
29767 __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 860, __pyx_L1_error) | |
29768 __Pyx_GOTREF(__pyx_t_11); | |
29769 __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error) | |
29770 __Pyx_GOTREF(__pyx_t_2); | |
29771 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29772 __pyx_t_31 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_31 == ((Py_ssize_t)-1))) __PYX_ERR(0, 860, __pyx_L1_error) | |
29773 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29774 __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_31); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error) | |
29775 __Pyx_GOTREF(__pyx_t_2); | |
29776 __pyx_t_11 = PyObject_RichCompare(__pyx_t_2, __pyx_v_expected, Py_NE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 860, __pyx_L1_error) | |
29777 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29778 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 860, __pyx_L1_error) | |
29779 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29780 __pyx_t_26 = __pyx_t_17; | |
29781 __pyx_L155_bool_binop_done:; | |
29782 if (__pyx_t_26) { | |
29783 | |
29784 /* "pysam/libcvcf.pyx":861 | |
29785 * line) | |
29786 * if expected != -1 and len(dict[format[idx]]) != expected: | |
29787 * self.error(line,self.BAD_NUMBER_OF_PARAMETERS, # <<<<<<<<<<<<<< | |
29788 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]])) | |
29789 * if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]])) | |
29790 */ | |
29791 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error) | |
29792 __Pyx_GOTREF(__pyx_t_2); | |
29793 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BAD_NUMBER_OF_PARAMETERS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 861, __pyx_L1_error) | |
29794 __Pyx_GOTREF(__pyx_t_9); | |
29795 | |
29796 /* "pysam/libcvcf.pyx":862 | |
29797 * if expected != -1 and len(dict[format[idx]]) != expected: | |
29798 * self.error(line,self.BAD_NUMBER_OF_PARAMETERS, | |
29799 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]])) # <<<<<<<<<<<<<< | |
29800 * if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]])) | |
29801 * dict[format[idx]] = dict[format[idx]][:expected] | |
29802 */ | |
29803 __pyx_t_12 = PyTuple_New(6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 862, __pyx_L1_error) | |
29804 __Pyx_GOTREF(__pyx_t_12); | |
29805 __pyx_t_31 = 0; | |
29806 __pyx_t_10 = 127; | |
29807 __Pyx_INCREF(__pyx_kp_u_id); | |
29808 __pyx_t_31 += 3; | |
29809 __Pyx_GIVEREF(__pyx_kp_u_id); | |
29810 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_kp_u_id); | |
29811 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) | |
29812 __Pyx_GOTREF(__pyx_t_3); | |
29813 __pyx_t_25 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 862, __pyx_L1_error) | |
29814 __Pyx_GOTREF(__pyx_t_25); | |
29815 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
29816 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25) : __pyx_t_10; | |
29817 __pyx_t_31 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_25); | |
29818 __Pyx_GIVEREF(__pyx_t_25); | |
29819 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_25); | |
29820 __pyx_t_25 = 0; | |
29821 __Pyx_INCREF(__pyx_kp_u_expected_2); | |
29822 __pyx_t_31 += 11; | |
29823 __Pyx_GIVEREF(__pyx_kp_u_expected_2); | |
29824 PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_kp_u_expected_2); | |
29825 __pyx_t_25 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_expected), __pyx_empty_unicode); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 862, __pyx_L1_error) | |
29826 __Pyx_GOTREF(__pyx_t_25); | |
29827 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25) : __pyx_t_10; | |
29828 __pyx_t_31 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_25); | |
29829 __Pyx_GIVEREF(__pyx_t_25); | |
29830 PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_25); | |
29831 __pyx_t_25 = 0; | |
29832 __Pyx_INCREF(__pyx_kp_u_parameters_got); | |
29833 __pyx_t_31 += 17; | |
29834 __Pyx_GIVEREF(__pyx_kp_u_parameters_got); | |
29835 PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_kp_u_parameters_got); | |
29836 __pyx_t_25 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 862, __pyx_L1_error) | |
29837 __Pyx_GOTREF(__pyx_t_25); | |
29838 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_25); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) | |
29839 __Pyx_GOTREF(__pyx_t_3); | |
29840 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; | |
29841 __pyx_t_25 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 862, __pyx_L1_error) | |
29842 __Pyx_GOTREF(__pyx_t_25); | |
29843 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
29844 __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25) : __pyx_t_10; | |
29845 __pyx_t_31 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_25); | |
29846 __Pyx_GIVEREF(__pyx_t_25); | |
29847 PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_25); | |
29848 __pyx_t_25 = 0; | |
29849 __pyx_t_25 = __Pyx_PyUnicode_Join(__pyx_t_12, 6, __pyx_t_31, __pyx_t_10); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 862, __pyx_L1_error) | |
29850 __Pyx_GOTREF(__pyx_t_25); | |
29851 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29852 __pyx_t_12 = NULL; | |
29853 __pyx_t_4 = 0; | |
29854 #if CYTHON_UNPACK_METHODS | |
29855 if (likely(PyMethod_Check(__pyx_t_2))) { | |
29856 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); | |
29857 if (likely(__pyx_t_12)) { | |
29858 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
29859 __Pyx_INCREF(__pyx_t_12); | |
29860 __Pyx_INCREF(function); | |
29861 __Pyx_DECREF_SET(__pyx_t_2, function); | |
29862 __pyx_t_4 = 1; | |
29863 } | |
29864 } | |
29865 #endif | |
29866 { | |
29867 PyObject *__pyx_callargs[4] = {__pyx_t_12, __pyx_v_line, __pyx_t_9, __pyx_t_25}; | |
29868 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); | |
29869 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29870 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29871 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; | |
29872 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 861, __pyx_L1_error) | |
29873 __Pyx_GOTREF(__pyx_t_11); | |
29874 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29875 } | |
29876 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29877 | |
29878 /* "pysam/libcvcf.pyx":863 | |
29879 * self.error(line,self.BAD_NUMBER_OF_PARAMETERS, | |
29880 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]])) | |
29881 * if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]])) # <<<<<<<<<<<<<< | |
29882 * dict[format[idx]] = dict[format[idx]][:expected] | |
29883 * samples.append( dict ) | |
29884 */ | |
29885 __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29886 __Pyx_GOTREF(__pyx_t_11); | |
29887 __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29888 __Pyx_GOTREF(__pyx_t_2); | |
29889 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29890 __pyx_t_31 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_31 == ((Py_ssize_t)-1))) __PYX_ERR(0, 863, __pyx_L1_error) | |
29891 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29892 __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_31); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29893 __Pyx_GOTREF(__pyx_t_2); | |
29894 __pyx_t_11 = PyObject_RichCompare(__pyx_t_2, __pyx_v_expected, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29895 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29896 __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_26 < 0))) __PYX_ERR(0, 863, __pyx_L1_error) | |
29897 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29898 if (__pyx_t_26) { | |
29899 __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29900 __Pyx_GOTREF(__pyx_t_11); | |
29901 __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29902 __Pyx_GOTREF(__pyx_t_2); | |
29903 __pyx_t_25 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29904 __Pyx_GOTREF(__pyx_t_25); | |
29905 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_25); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29906 __Pyx_GOTREF(__pyx_t_9); | |
29907 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; | |
29908 __pyx_t_25 = __Pyx_GetItemInt(__pyx_t_9, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29909 __Pyx_GOTREF(__pyx_t_25); | |
29910 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29911 __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29912 __Pyx_GOTREF(__pyx_t_9); | |
29913 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29914 __Pyx_GOTREF(__pyx_t_12); | |
29915 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29916 __pyx_t_31 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_31 == ((Py_ssize_t)-1))) __PYX_ERR(0, 863, __pyx_L1_error) | |
29917 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29918 __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_31); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29919 __Pyx_GOTREF(__pyx_t_12); | |
29920 __pyx_t_9 = PyNumber_Subtract(__pyx_v_expected, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29921 __Pyx_GOTREF(__pyx_t_9); | |
29922 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29923 __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29924 __Pyx_GOTREF(__pyx_t_12); | |
29925 __Pyx_GIVEREF(__pyx_t_25); | |
29926 if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_25)) __PYX_ERR(0, 863, __pyx_L1_error); | |
29927 { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_12, __pyx_t_9); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29928 __Pyx_GOTREF(__pyx_temp); | |
29929 __Pyx_DECREF(__pyx_t_12); | |
29930 __pyx_t_12 = __pyx_temp; | |
29931 } | |
29932 __pyx_t_25 = 0; | |
29933 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29934 __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L1_error) | |
29935 __Pyx_GOTREF(__pyx_t_9); | |
29936 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29937 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
29938 if (unlikely((PyDict_SetItem(__pyx_v_dict, __pyx_t_11, __pyx_t_9) < 0))) __PYX_ERR(0, 863, __pyx_L1_error) | |
29939 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29940 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29941 } | |
29942 | |
29943 /* "pysam/libcvcf.pyx":864 | |
29944 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]])) | |
29945 * if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]])) | |
29946 * dict[format[idx]] = dict[format[idx]][:expected] # <<<<<<<<<<<<<< | |
29947 * samples.append( dict ) | |
29948 * | |
29949 */ | |
29950 __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 864, __pyx_L1_error) | |
29951 __Pyx_GOTREF(__pyx_t_11); | |
29952 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 864, __pyx_L1_error) | |
29953 __Pyx_GOTREF(__pyx_t_9); | |
29954 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29955 __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_t_9, 0, 0, NULL, &__pyx_v_expected, NULL, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 864, __pyx_L1_error) | |
29956 __Pyx_GOTREF(__pyx_t_11); | |
29957 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29958 __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 864, __pyx_L1_error) | |
29959 __Pyx_GOTREF(__pyx_t_9); | |
29960 if (unlikely((PyDict_SetItem(__pyx_v_dict, __pyx_t_9, __pyx_t_11) < 0))) __PYX_ERR(0, 864, __pyx_L1_error) | |
29961 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
29962 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
29963 | |
29964 /* "pysam/libcvcf.pyx":860 | |
29965 * self._format, | |
29966 * line) | |
29967 * if expected != -1 and len(dict[format[idx]]) != expected: # <<<<<<<<<<<<<< | |
29968 * self.error(line,self.BAD_NUMBER_OF_PARAMETERS, | |
29969 * "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]])) | |
29970 */ | |
29971 } | |
29972 } | |
29973 | |
29974 /* "pysam/libcvcf.pyx":865 | |
29975 * if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]])) | |
29976 * dict[format[idx]] = dict[format[idx]][:expected] | |
29977 * samples.append( dict ) # <<<<<<<<<<<<<< | |
29978 * | |
29979 * # done | |
29980 */ | |
29981 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_samples, __pyx_v_dict); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 865, __pyx_L1_error) | |
29982 | |
29983 /* "pysam/libcvcf.pyx":844 | |
29984 * # parse sample columns | |
29985 * samples = [] | |
29986 * for sample in cols[9:]: # <<<<<<<<<<<<<< | |
29987 * dict = {} | |
29988 * values = sample.split(':') | |
29989 */ | |
29990 } | |
29991 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29992 | |
29993 /* "pysam/libcvcf.pyx":868 | |
29994 * | |
29995 * # done | |
29996 * d = {'chrom':chrom, # <<<<<<<<<<<<<< | |
29997 * 'pos':pos, # return 0-based position | |
29998 * 'id':id, | |
29999 */ | |
30000 __pyx_t_1 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error) | |
30001 __Pyx_GOTREF(__pyx_t_1); | |
30002 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chrom, __pyx_v_chrom) < 0) __PYX_ERR(0, 868, __pyx_L1_error) | |
30003 | |
30004 /* "pysam/libcvcf.pyx":869 | |
30005 * # done | |
30006 * d = {'chrom':chrom, | |
30007 * 'pos':pos, # return 0-based position # <<<<<<<<<<<<<< | |
30008 * 'id':id, | |
30009 * 'ref':ref, | |
30010 */ | |
30011 if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); __PYX_ERR(0, 869, __pyx_L1_error) } | |
30012 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 868, __pyx_L1_error) | |
30013 | |
30014 /* "pysam/libcvcf.pyx":870 | |
30015 * d = {'chrom':chrom, | |
30016 * 'pos':pos, # return 0-based position | |
30017 * 'id':id, # <<<<<<<<<<<<<< | |
30018 * 'ref':ref, | |
30019 * 'alt':alt, | |
30020 */ | |
30021 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_id_2, __pyx_v_id) < 0) __PYX_ERR(0, 868, __pyx_L1_error) | |
30022 | |
30023 /* "pysam/libcvcf.pyx":871 | |
30024 * 'pos':pos, # return 0-based position | |
30025 * 'id':id, | |
30026 * 'ref':ref, # <<<<<<<<<<<<<< | |
30027 * 'alt':alt, | |
30028 * 'qual':qual, | |
30029 */ | |
30030 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ref, __pyx_v_ref) < 0) __PYX_ERR(0, 868, __pyx_L1_error) | |
30031 | |
30032 /* "pysam/libcvcf.pyx":872 | |
30033 * 'id':id, | |
30034 * 'ref':ref, | |
30035 * 'alt':alt, # <<<<<<<<<<<<<< | |
30036 * 'qual':qual, | |
30037 * 'filter':filter, | |
30038 */ | |
30039 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_alt, __pyx_v_alt) < 0) __PYX_ERR(0, 868, __pyx_L1_error) | |
30040 | |
30041 /* "pysam/libcvcf.pyx":873 | |
30042 * 'ref':ref, | |
30043 * 'alt':alt, | |
30044 * 'qual':qual, # <<<<<<<<<<<<<< | |
30045 * 'filter':filter, | |
30046 * 'info':info, | |
30047 */ | |
30048 __pyx_t_11 = PyFloat_FromDouble(__pyx_v_qual); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 873, __pyx_L1_error) | |
30049 __Pyx_GOTREF(__pyx_t_11); | |
30050 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_qual, __pyx_t_11) < 0) __PYX_ERR(0, 868, __pyx_L1_error) | |
30051 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
30052 | |
30053 /* "pysam/libcvcf.pyx":874 | |
30054 * 'alt':alt, | |
30055 * 'qual':qual, | |
30056 * 'filter':filter, # <<<<<<<<<<<<<< | |
30057 * 'info':info, | |
30058 * 'format':format} | |
30059 */ | |
30060 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_filter_2, __pyx_v_filter) < 0) __PYX_ERR(0, 868, __pyx_L1_error) | |
30061 | |
30062 /* "pysam/libcvcf.pyx":875 | |
30063 * 'qual':qual, | |
30064 * 'filter':filter, | |
30065 * 'info':info, # <<<<<<<<<<<<<< | |
30066 * 'format':format} | |
30067 * for key,value in zip(self._samples,samples): | |
30068 */ | |
30069 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_info_2, __pyx_v_info) < 0) __PYX_ERR(0, 868, __pyx_L1_error) | |
30070 | |
30071 /* "pysam/libcvcf.pyx":876 | |
30072 * 'filter':filter, | |
30073 * 'info':info, | |
30074 * 'format':format} # <<<<<<<<<<<<<< | |
30075 * for key,value in zip(self._samples,samples): | |
30076 * d[key] = value | |
30077 */ | |
30078 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_format, __pyx_v_format) < 0) __PYX_ERR(0, 868, __pyx_L1_error) | |
30079 __pyx_v_d = ((PyObject*)__pyx_t_1); | |
30080 __pyx_t_1 = 0; | |
30081 | |
30082 /* "pysam/libcvcf.pyx":877 | |
30083 * 'info':info, | |
30084 * 'format':format} | |
30085 * for key,value in zip(self._samples,samples): # <<<<<<<<<<<<<< | |
30086 * d[key] = value | |
30087 * | |
30088 */ | |
30089 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30090 __Pyx_GOTREF(__pyx_t_1); | |
30091 __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30092 __Pyx_GOTREF(__pyx_t_11); | |
30093 __Pyx_GIVEREF(__pyx_t_1); | |
30094 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error); | |
30095 __Pyx_INCREF(__pyx_v_samples); | |
30096 __Pyx_GIVEREF(__pyx_v_samples); | |
30097 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_samples)) __PYX_ERR(0, 877, __pyx_L1_error); | |
30098 __pyx_t_1 = 0; | |
30099 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30100 __Pyx_GOTREF(__pyx_t_1); | |
30101 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
30102 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { | |
30103 __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); | |
30104 __pyx_t_6 = 0; | |
30105 __pyx_t_18 = NULL; | |
30106 } else { | |
30107 __pyx_t_6 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30108 __Pyx_GOTREF(__pyx_t_11); | |
30109 __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30110 } | |
30111 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30112 for (;;) { | |
30113 if (likely(!__pyx_t_18)) { | |
30114 if (likely(PyList_CheckExact(__pyx_t_11))) { | |
30115 { | |
30116 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); | |
30117 #if !CYTHON_ASSUME_SAFE_MACROS | |
30118 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 877, __pyx_L1_error) | |
30119 #endif | |
30120 if (__pyx_t_6 >= __pyx_temp) break; | |
30121 } | |
30122 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
30123 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 877, __pyx_L1_error) | |
30124 #else | |
30125 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30126 __Pyx_GOTREF(__pyx_t_1); | |
30127 #endif | |
30128 } else { | |
30129 { | |
30130 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); | |
30131 #if !CYTHON_ASSUME_SAFE_MACROS | |
30132 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 877, __pyx_L1_error) | |
30133 #endif | |
30134 if (__pyx_t_6 >= __pyx_temp) break; | |
30135 } | |
30136 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
30137 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 877, __pyx_L1_error) | |
30138 #else | |
30139 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30140 __Pyx_GOTREF(__pyx_t_1); | |
30141 #endif | |
30142 } | |
30143 } else { | |
30144 __pyx_t_1 = __pyx_t_18(__pyx_t_11); | |
30145 if (unlikely(!__pyx_t_1)) { | |
30146 PyObject* exc_type = PyErr_Occurred(); | |
30147 if (exc_type) { | |
30148 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
30149 else __PYX_ERR(0, 877, __pyx_L1_error) | |
30150 } | |
30151 break; | |
30152 } | |
30153 __Pyx_GOTREF(__pyx_t_1); | |
30154 } | |
30155 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { | |
30156 PyObject* sequence = __pyx_t_1; | |
30157 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
30158 if (unlikely(size != 2)) { | |
30159 if (size > 2) __Pyx_RaiseTooManyValuesError(2); | |
30160 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
30161 __PYX_ERR(0, 877, __pyx_L1_error) | |
30162 } | |
30163 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
30164 if (likely(PyTuple_CheckExact(sequence))) { | |
30165 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); | |
30166 __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); | |
30167 } else { | |
30168 __pyx_t_9 = PyList_GET_ITEM(sequence, 0); | |
30169 __pyx_t_12 = PyList_GET_ITEM(sequence, 1); | |
30170 } | |
30171 __Pyx_INCREF(__pyx_t_9); | |
30172 __Pyx_INCREF(__pyx_t_12); | |
30173 #else | |
30174 __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30175 __Pyx_GOTREF(__pyx_t_9); | |
30176 __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30177 __Pyx_GOTREF(__pyx_t_12); | |
30178 #endif | |
30179 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30180 } else { | |
30181 Py_ssize_t index = -1; | |
30182 __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) | |
30183 __Pyx_GOTREF(__pyx_t_2); | |
30184 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30185 __pyx_t_32 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); | |
30186 index = 0; __pyx_t_9 = __pyx_t_32(__pyx_t_2); if (unlikely(!__pyx_t_9)) goto __pyx_L161_unpacking_failed; | |
30187 __Pyx_GOTREF(__pyx_t_9); | |
30188 index = 1; __pyx_t_12 = __pyx_t_32(__pyx_t_2); if (unlikely(!__pyx_t_12)) goto __pyx_L161_unpacking_failed; | |
30189 __Pyx_GOTREF(__pyx_t_12); | |
30190 if (__Pyx_IternextUnpackEndCheck(__pyx_t_32(__pyx_t_2), 2) < 0) __PYX_ERR(0, 877, __pyx_L1_error) | |
30191 __pyx_t_32 = NULL; | |
30192 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30193 goto __pyx_L162_unpacking_done; | |
30194 __pyx_L161_unpacking_failed:; | |
30195 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30196 __pyx_t_32 = NULL; | |
30197 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
30198 __PYX_ERR(0, 877, __pyx_L1_error) | |
30199 __pyx_L162_unpacking_done:; | |
30200 } | |
30201 __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9); | |
30202 __pyx_t_9 = 0; | |
30203 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_12); | |
30204 __pyx_t_12 = 0; | |
30205 | |
30206 /* "pysam/libcvcf.pyx":878 | |
30207 * 'format':format} | |
30208 * for key,value in zip(self._samples,samples): | |
30209 * d[key] = value # <<<<<<<<<<<<<< | |
30210 * | |
30211 * return d | |
30212 */ | |
30213 if (unlikely((PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_v_value) < 0))) __PYX_ERR(0, 878, __pyx_L1_error) | |
30214 | |
30215 /* "pysam/libcvcf.pyx":877 | |
30216 * 'info':info, | |
30217 * 'format':format} | |
30218 * for key,value in zip(self._samples,samples): # <<<<<<<<<<<<<< | |
30219 * d[key] = value | |
30220 * | |
30221 */ | |
30222 } | |
30223 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
30224 | |
30225 /* "pysam/libcvcf.pyx":880 | |
30226 * d[key] = value | |
30227 * | |
30228 * return d # <<<<<<<<<<<<<< | |
30229 * | |
30230 * | |
30231 */ | |
30232 __Pyx_XDECREF(__pyx_r); | |
30233 __Pyx_INCREF(__pyx_v_d); | |
30234 __pyx_r = __pyx_v_d; | |
30235 goto __pyx_L0; | |
30236 | |
30237 /* "pysam/libcvcf.pyx":671 | |
30238 * return False | |
30239 * | |
30240 * def parse_data( self, line, lineparse=False ): # <<<<<<<<<<<<<< | |
30241 * cols = line.split('\t') | |
30242 * if len(cols) != len(self._samples)+9: | |
30243 */ | |
30244 | |
30245 /* function exit code */ | |
30246 __pyx_L1_error:; | |
30247 __Pyx_XDECREF(__pyx_t_1); | |
30248 __Pyx_XDECREF(__pyx_t_2); | |
30249 __Pyx_XDECREF(__pyx_t_3); | |
30250 __Pyx_XDECREF(__pyx_t_9); | |
30251 __Pyx_XDECREF(__pyx_t_11); | |
30252 __Pyx_XDECREF(__pyx_t_12); | |
30253 __Pyx_XDECREF(__pyx_t_16); | |
30254 __Pyx_XDECREF(__pyx_t_23); | |
30255 __Pyx_XDECREF(__pyx_t_24); | |
30256 __Pyx_XDECREF(__pyx_t_25); | |
30257 __Pyx_XDECREF(__pyx_t_27); | |
30258 __Pyx_XDECREF(__pyx_t_28); | |
30259 __Pyx_XDECREF(__pyx_t_29); | |
30260 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
30261 __pyx_r = NULL; | |
30262 __pyx_L0:; | |
30263 __Pyx_XDECREF(__pyx_v_cols); | |
30264 __Pyx_XDECREF(__pyx_v_chrom); | |
30265 __Pyx_XDECREF(__pyx_v_pos); | |
30266 __Pyx_XDECREF(__pyx_v_id); | |
30267 __Pyx_XDECREF(__pyx_v_ref); | |
30268 __Pyx_XDECREF(__pyx_v_c); | |
30269 __Pyx_XDECREF(__pyx_v_left); | |
30270 __Pyx_XDECREF(__pyx_v_faref_leftflank); | |
30271 __Pyx_XDECREF(__pyx_v_faref); | |
30272 __Pyx_XDECREF(__pyx_v_alt); | |
30273 __Pyx_XDECREF(__pyx_v_filter); | |
30274 __Pyx_XDECREF(__pyx_v_info); | |
30275 __Pyx_XDECREF(__pyx_v_blurp); | |
30276 __Pyx_XDECREF(__pyx_v_elts); | |
30277 __Pyx_XDECREF(__pyx_v_v); | |
30278 __Pyx_XDECREF(__pyx_v_format); | |
30279 __Pyx_XDECREF(__pyx_v_f); | |
30280 __Pyx_XDECREF(__pyx_v_newalts); | |
30281 __Pyx_XDECREF(__pyx_v_a); | |
30282 __Pyx_XDECREF(__pyx_v_l); | |
30283 __Pyx_XDECREF(__pyx_v_addns); | |
30284 __Pyx_XDECREF(__pyx_v_i); | |
30285 __Pyx_XDECREF(__pyx_v_na); | |
30286 __Pyx_XDECREF(__pyx_v_s); | |
30287 __Pyx_XDECREF(__pyx_v_addn); | |
30288 __Pyx_XDECREF(__pyx_v_allele); | |
30289 __Pyx_XDECREF(__pyx_v_longest); | |
30290 __Pyx_XDECREF(__pyx_v_shortest); | |
30291 __Pyx_XDECREF(__pyx_v_samples); | |
30292 __Pyx_XDECREF(__pyx_v_sample); | |
30293 __Pyx_XDECREF(__pyx_v_dict); | |
30294 __Pyx_XDECREF(__pyx_v_values); | |
30295 __Pyx_XDECREF(__pyx_v_expected); | |
30296 __Pyx_XDECREF(__pyx_v_value); | |
30297 __Pyx_XDECREF(__pyx_v_d); | |
30298 __Pyx_XDECREF(__pyx_v_key); | |
30299 __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_allele); | |
30300 __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_allele); | |
30301 __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_allele); | |
30302 __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_allele); | |
30303 __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_allele); | |
30304 __Pyx_XGIVEREF(__pyx_r); | |
30305 __Pyx_RefNannyFinishContext(); | |
30306 return __pyx_r; | |
30307 } | |
30308 | |
30309 /* "pysam/libcvcf.pyx":883 | |
30310 * | |
30311 * | |
30312 * def write_data(self, stream, data): # <<<<<<<<<<<<<< | |
30313 * required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples | |
30314 * for k in required: | |
30315 */ | |
30316 | |
30317 /* Python wrapper */ | |
30318 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_35write_data(PyObject *__pyx_self, | |
30319 #if CYTHON_METH_FASTCALL | |
30320 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
30321 #else | |
30322 PyObject *__pyx_args, PyObject *__pyx_kwds | |
30323 #endif | |
30324 ); /*proto*/ | |
30325 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_34write_data, "VCF.write_data(self, stream, data)"); | |
30326 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_35write_data = {"write_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_35write_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_34write_data}; | |
30327 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_35write_data(PyObject *__pyx_self, | |
30328 #if CYTHON_METH_FASTCALL | |
30329 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
30330 #else | |
30331 PyObject *__pyx_args, PyObject *__pyx_kwds | |
30332 #endif | |
30333 ) { | |
30334 PyObject *__pyx_v_self = 0; | |
30335 PyObject *__pyx_v_stream = 0; | |
30336 PyObject *__pyx_v_data = 0; | |
30337 #if !CYTHON_METH_FASTCALL | |
30338 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
30339 #endif | |
30340 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
30341 PyObject* values[3] = {0,0,0}; | |
30342 int __pyx_lineno = 0; | |
30343 const char *__pyx_filename = NULL; | |
30344 int __pyx_clineno = 0; | |
30345 PyObject *__pyx_r = 0; | |
30346 __Pyx_RefNannyDeclarations | |
30347 __Pyx_RefNannySetupContext("write_data (wrapper)", 0); | |
30348 #if !CYTHON_METH_FASTCALL | |
30349 #if CYTHON_ASSUME_SAFE_MACROS | |
30350 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
30351 #else | |
30352 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
30353 #endif | |
30354 #endif | |
30355 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
30356 { | |
30357 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,&__pyx_n_s_data,0}; | |
30358 if (__pyx_kwds) { | |
30359 Py_ssize_t kw_args; | |
30360 switch (__pyx_nargs) { | |
30361 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
30362 CYTHON_FALLTHROUGH; | |
30363 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
30364 CYTHON_FALLTHROUGH; | |
30365 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
30366 CYTHON_FALLTHROUGH; | |
30367 case 0: break; | |
30368 default: goto __pyx_L5_argtuple_error; | |
30369 } | |
30370 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
30371 switch (__pyx_nargs) { | |
30372 case 0: | |
30373 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
30374 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
30375 kw_args--; | |
30376 } | |
30377 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L3_error) | |
30378 else goto __pyx_L5_argtuple_error; | |
30379 CYTHON_FALLTHROUGH; | |
30380 case 1: | |
30381 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream)) != 0)) { | |
30382 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
30383 kw_args--; | |
30384 } | |
30385 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L3_error) | |
30386 else { | |
30387 __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, 1); __PYX_ERR(0, 883, __pyx_L3_error) | |
30388 } | |
30389 CYTHON_FALLTHROUGH; | |
30390 case 2: | |
30391 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { | |
30392 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
30393 kw_args--; | |
30394 } | |
30395 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L3_error) | |
30396 else { | |
30397 __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, 2); __PYX_ERR(0, 883, __pyx_L3_error) | |
30398 } | |
30399 } | |
30400 if (unlikely(kw_args > 0)) { | |
30401 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
30402 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write_data") < 0)) __PYX_ERR(0, 883, __pyx_L3_error) | |
30403 } | |
30404 } else if (unlikely(__pyx_nargs != 3)) { | |
30405 goto __pyx_L5_argtuple_error; | |
30406 } else { | |
30407 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
30408 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
30409 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
30410 } | |
30411 __pyx_v_self = values[0]; | |
30412 __pyx_v_stream = values[1]; | |
30413 __pyx_v_data = values[2]; | |
30414 } | |
30415 goto __pyx_L6_skip; | |
30416 __pyx_L5_argtuple_error:; | |
30417 __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 883, __pyx_L3_error) | |
30418 __pyx_L6_skip:; | |
30419 goto __pyx_L4_argument_unpacking_done; | |
30420 __pyx_L3_error:; | |
30421 { | |
30422 Py_ssize_t __pyx_temp; | |
30423 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
30424 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
30425 } | |
30426 } | |
30427 __Pyx_AddTraceback("pysam.libcvcf.VCF.write_data", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
30428 __Pyx_RefNannyFinishContext(); | |
30429 return NULL; | |
30430 __pyx_L4_argument_unpacking_done:; | |
30431 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_34write_data(__pyx_self, __pyx_v_self, __pyx_v_stream, __pyx_v_data); | |
30432 | |
30433 /* function exit code */ | |
30434 { | |
30435 Py_ssize_t __pyx_temp; | |
30436 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
30437 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
30438 } | |
30439 } | |
30440 __Pyx_RefNannyFinishContext(); | |
30441 return __pyx_r; | |
30442 } | |
30443 | |
30444 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_34write_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_data) { | |
30445 PyObject *__pyx_v_required = NULL; | |
30446 PyObject *__pyx_v_k = NULL; | |
30447 PyObject *__pyx_v_alt = NULL; | |
30448 PyObject *__pyx_v_filter = NULL; | |
30449 PyObject *__pyx_v_qual = NULL; | |
30450 PyObject *__pyx_v_output = NULL; | |
30451 PyObject *__pyx_v_s = NULL; | |
30452 PyObject *__pyx_r = NULL; | |
30453 __Pyx_RefNannyDeclarations | |
30454 PyObject *__pyx_t_1 = NULL; | |
30455 PyObject *__pyx_t_2 = NULL; | |
30456 PyObject *__pyx_t_3 = NULL; | |
30457 Py_ssize_t __pyx_t_4; | |
30458 PyObject *(*__pyx_t_5)(PyObject *); | |
30459 int __pyx_t_6; | |
30460 PyObject *__pyx_t_7 = NULL; | |
30461 PyObject *__pyx_t_8 = NULL; | |
30462 PyObject *__pyx_t_9 = NULL; | |
30463 PyObject *__pyx_t_10 = NULL; | |
30464 PyObject *__pyx_t_11 = NULL; | |
30465 PyObject *__pyx_t_12 = NULL; | |
30466 int __pyx_t_13; | |
30467 unsigned int __pyx_t_14; | |
30468 int __pyx_lineno = 0; | |
30469 const char *__pyx_filename = NULL; | |
30470 int __pyx_clineno = 0; | |
30471 __Pyx_RefNannySetupContext("write_data", 1); | |
30472 | |
30473 /* "pysam/libcvcf.pyx":884 | |
30474 * | |
30475 * def write_data(self, stream, data): | |
30476 * required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples # <<<<<<<<<<<<<< | |
30477 * for k in required: | |
30478 * if k not in data: raise ValueError("Required key %s not found in data" % str(k)) | |
30479 */ | |
30480 __pyx_t_1 = PyList_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error) | |
30481 __Pyx_GOTREF(__pyx_t_1); | |
30482 __Pyx_INCREF(__pyx_n_u_chrom); | |
30483 __Pyx_GIVEREF(__pyx_n_u_chrom); | |
30484 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_chrom)) __PYX_ERR(0, 884, __pyx_L1_error); | |
30485 __Pyx_INCREF(__pyx_n_u_pos); | |
30486 __Pyx_GIVEREF(__pyx_n_u_pos); | |
30487 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_pos)) __PYX_ERR(0, 884, __pyx_L1_error); | |
30488 __Pyx_INCREF(__pyx_n_u_id_2); | |
30489 __Pyx_GIVEREF(__pyx_n_u_id_2); | |
30490 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_id_2)) __PYX_ERR(0, 884, __pyx_L1_error); | |
30491 __Pyx_INCREF(__pyx_n_u_ref); | |
30492 __Pyx_GIVEREF(__pyx_n_u_ref); | |
30493 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_ref)) __PYX_ERR(0, 884, __pyx_L1_error); | |
30494 __Pyx_INCREF(__pyx_n_u_alt); | |
30495 __Pyx_GIVEREF(__pyx_n_u_alt); | |
30496 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_alt)) __PYX_ERR(0, 884, __pyx_L1_error); | |
30497 __Pyx_INCREF(__pyx_n_u_qual); | |
30498 __Pyx_GIVEREF(__pyx_n_u_qual); | |
30499 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_qual)) __PYX_ERR(0, 884, __pyx_L1_error); | |
30500 __Pyx_INCREF(__pyx_n_u_filter_2); | |
30501 __Pyx_GIVEREF(__pyx_n_u_filter_2); | |
30502 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_filter_2)) __PYX_ERR(0, 884, __pyx_L1_error); | |
30503 __Pyx_INCREF(__pyx_n_u_info_2); | |
30504 __Pyx_GIVEREF(__pyx_n_u_info_2); | |
30505 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_u_info_2)) __PYX_ERR(0, 884, __pyx_L1_error); | |
30506 __Pyx_INCREF(__pyx_n_u_format); | |
30507 __Pyx_GIVEREF(__pyx_n_u_format); | |
30508 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_u_format)) __PYX_ERR(0, 884, __pyx_L1_error); | |
30509 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error) | |
30510 __Pyx_GOTREF(__pyx_t_2); | |
30511 __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error) | |
30512 __Pyx_GOTREF(__pyx_t_3); | |
30513 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30514 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30515 __pyx_v_required = __pyx_t_3; | |
30516 __pyx_t_3 = 0; | |
30517 | |
30518 /* "pysam/libcvcf.pyx":885 | |
30519 * def write_data(self, stream, data): | |
30520 * required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples | |
30521 * for k in required: # <<<<<<<<<<<<<< | |
30522 * if k not in data: raise ValueError("Required key %s not found in data" % str(k)) | |
30523 * if data['alt'] == []: alt = "." | |
30524 */ | |
30525 if (likely(PyList_CheckExact(__pyx_v_required)) || PyTuple_CheckExact(__pyx_v_required)) { | |
30526 __pyx_t_3 = __pyx_v_required; __Pyx_INCREF(__pyx_t_3); | |
30527 __pyx_t_4 = 0; | |
30528 __pyx_t_5 = NULL; | |
30529 } else { | |
30530 __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_required); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) | |
30531 __Pyx_GOTREF(__pyx_t_3); | |
30532 __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 885, __pyx_L1_error) | |
30533 } | |
30534 for (;;) { | |
30535 if (likely(!__pyx_t_5)) { | |
30536 if (likely(PyList_CheckExact(__pyx_t_3))) { | |
30537 { | |
30538 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); | |
30539 #if !CYTHON_ASSUME_SAFE_MACROS | |
30540 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) | |
30541 #endif | |
30542 if (__pyx_t_4 >= __pyx_temp) break; | |
30543 } | |
30544 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
30545 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) | |
30546 #else | |
30547 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error) | |
30548 __Pyx_GOTREF(__pyx_t_2); | |
30549 #endif | |
30550 } else { | |
30551 { | |
30552 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); | |
30553 #if !CYTHON_ASSUME_SAFE_MACROS | |
30554 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) | |
30555 #endif | |
30556 if (__pyx_t_4 >= __pyx_temp) break; | |
30557 } | |
30558 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
30559 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) | |
30560 #else | |
30561 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error) | |
30562 __Pyx_GOTREF(__pyx_t_2); | |
30563 #endif | |
30564 } | |
30565 } else { | |
30566 __pyx_t_2 = __pyx_t_5(__pyx_t_3); | |
30567 if (unlikely(!__pyx_t_2)) { | |
30568 PyObject* exc_type = PyErr_Occurred(); | |
30569 if (exc_type) { | |
30570 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
30571 else __PYX_ERR(0, 885, __pyx_L1_error) | |
30572 } | |
30573 break; | |
30574 } | |
30575 __Pyx_GOTREF(__pyx_t_2); | |
30576 } | |
30577 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); | |
30578 __pyx_t_2 = 0; | |
30579 | |
30580 /* "pysam/libcvcf.pyx":886 | |
30581 * required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples | |
30582 * for k in required: | |
30583 * if k not in data: raise ValueError("Required key %s not found in data" % str(k)) # <<<<<<<<<<<<<< | |
30584 * if data['alt'] == []: alt = "." | |
30585 * else: alt = ",".join(data['alt']) | |
30586 */ | |
30587 __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_data, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 886, __pyx_L1_error) | |
30588 if (unlikely(__pyx_t_6)) { | |
30589 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) | |
30590 __Pyx_GOTREF(__pyx_t_2); | |
30591 __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Required_key_s_not_found_in_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error) | |
30592 __Pyx_GOTREF(__pyx_t_1); | |
30593 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30594 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) | |
30595 __Pyx_GOTREF(__pyx_t_2); | |
30596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30597 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
30598 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30599 __PYX_ERR(0, 886, __pyx_L1_error) | |
30600 } | |
30601 | |
30602 /* "pysam/libcvcf.pyx":885 | |
30603 * def write_data(self, stream, data): | |
30604 * required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples | |
30605 * for k in required: # <<<<<<<<<<<<<< | |
30606 * if k not in data: raise ValueError("Required key %s not found in data" % str(k)) | |
30607 * if data['alt'] == []: alt = "." | |
30608 */ | |
30609 } | |
30610 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30611 | |
30612 /* "pysam/libcvcf.pyx":887 | |
30613 * for k in required: | |
30614 * if k not in data: raise ValueError("Required key %s not found in data" % str(k)) | |
30615 * if data['alt'] == []: alt = "." # <<<<<<<<<<<<<< | |
30616 * else: alt = ",".join(data['alt']) | |
30617 * if data['filter'] == None: filter = "." | |
30618 */ | |
30619 __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_alt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error) | |
30620 __Pyx_GOTREF(__pyx_t_3); | |
30621 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) | |
30622 __Pyx_GOTREF(__pyx_t_2); | |
30623 __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error) | |
30624 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30625 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30626 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) | |
30627 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30628 if (__pyx_t_6) { | |
30629 __Pyx_INCREF(__pyx_kp_u__5); | |
30630 __pyx_v_alt = __pyx_kp_u__5; | |
30631 goto __pyx_L7; | |
30632 } | |
30633 | |
30634 /* "pysam/libcvcf.pyx":888 | |
30635 * if k not in data: raise ValueError("Required key %s not found in data" % str(k)) | |
30636 * if data['alt'] == []: alt = "." | |
30637 * else: alt = ",".join(data['alt']) # <<<<<<<<<<<<<< | |
30638 * if data['filter'] == None: filter = "." | |
30639 * elif data['filter'] == []: | |
30640 */ | |
30641 /*else*/ { | |
30642 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_alt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) | |
30643 __Pyx_GOTREF(__pyx_t_1); | |
30644 __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error) | |
30645 __Pyx_GOTREF(__pyx_t_2); | |
30646 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30647 __pyx_v_alt = ((PyObject*)__pyx_t_2); | |
30648 __pyx_t_2 = 0; | |
30649 } | |
30650 __pyx_L7:; | |
30651 | |
30652 /* "pysam/libcvcf.pyx":889 | |
30653 * if data['alt'] == []: alt = "." | |
30654 * else: alt = ",".join(data['alt']) | |
30655 * if data['filter'] == None: filter = "." # <<<<<<<<<<<<<< | |
30656 * elif data['filter'] == []: | |
30657 * if self._version == 33: filter = "0" | |
30658 */ | |
30659 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_filter_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error) | |
30660 __Pyx_GOTREF(__pyx_t_2); | |
30661 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) | |
30662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30663 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 889, __pyx_L1_error) | |
30664 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30665 if (__pyx_t_6) { | |
30666 __Pyx_INCREF(__pyx_kp_u__5); | |
30667 __pyx_v_filter = __pyx_kp_u__5; | |
30668 goto __pyx_L8; | |
30669 } | |
30670 | |
30671 /* "pysam/libcvcf.pyx":890 | |
30672 * else: alt = ",".join(data['alt']) | |
30673 * if data['filter'] == None: filter = "." | |
30674 * elif data['filter'] == []: # <<<<<<<<<<<<<< | |
30675 * if self._version == 33: filter = "0" | |
30676 * else: filter = "PASS" | |
30677 */ | |
30678 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_filter_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error) | |
30679 __Pyx_GOTREF(__pyx_t_1); | |
30680 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error) | |
30681 __Pyx_GOTREF(__pyx_t_2); | |
30682 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error) | |
30683 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30684 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30685 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 890, __pyx_L1_error) | |
30686 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30687 if (__pyx_t_6) { | |
30688 | |
30689 /* "pysam/libcvcf.pyx":891 | |
30690 * if data['filter'] == None: filter = "." | |
30691 * elif data['filter'] == []: | |
30692 * if self._version == 33: filter = "0" # <<<<<<<<<<<<<< | |
30693 * else: filter = "PASS" | |
30694 * else: filter = ';'.join(data['filter']) | |
30695 */ | |
30696 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error) | |
30697 __Pyx_GOTREF(__pyx_t_3); | |
30698 __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_3, __pyx_int_33, 33, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 891, __pyx_L1_error) | |
30699 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30700 if (__pyx_t_6) { | |
30701 __Pyx_INCREF(__pyx_kp_u_0); | |
30702 __pyx_v_filter = __pyx_kp_u_0; | |
30703 goto __pyx_L9; | |
30704 } | |
30705 | |
30706 /* "pysam/libcvcf.pyx":892 | |
30707 * elif data['filter'] == []: | |
30708 * if self._version == 33: filter = "0" | |
30709 * else: filter = "PASS" # <<<<<<<<<<<<<< | |
30710 * else: filter = ';'.join(data['filter']) | |
30711 * if data['qual'] == -1: qual = "." | |
30712 */ | |
30713 /*else*/ { | |
30714 __Pyx_INCREF(__pyx_n_u_PASS); | |
30715 __pyx_v_filter = __pyx_n_u_PASS; | |
30716 } | |
30717 __pyx_L9:; | |
30718 | |
30719 /* "pysam/libcvcf.pyx":890 | |
30720 * else: alt = ",".join(data['alt']) | |
30721 * if data['filter'] == None: filter = "." | |
30722 * elif data['filter'] == []: # <<<<<<<<<<<<<< | |
30723 * if self._version == 33: filter = "0" | |
30724 * else: filter = "PASS" | |
30725 */ | |
30726 goto __pyx_L8; | |
30727 } | |
30728 | |
30729 /* "pysam/libcvcf.pyx":893 | |
30730 * if self._version == 33: filter = "0" | |
30731 * else: filter = "PASS" | |
30732 * else: filter = ';'.join(data['filter']) # <<<<<<<<<<<<<< | |
30733 * if data['qual'] == -1: qual = "." | |
30734 * else: qual = str(data['qual']) | |
30735 */ | |
30736 /*else*/ { | |
30737 __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_filter_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 893, __pyx_L1_error) | |
30738 __Pyx_GOTREF(__pyx_t_3); | |
30739 __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error) | |
30740 __Pyx_GOTREF(__pyx_t_2); | |
30741 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30742 __pyx_v_filter = ((PyObject*)__pyx_t_2); | |
30743 __pyx_t_2 = 0; | |
30744 } | |
30745 __pyx_L8:; | |
30746 | |
30747 /* "pysam/libcvcf.pyx":894 | |
30748 * else: filter = "PASS" | |
30749 * else: filter = ';'.join(data['filter']) | |
30750 * if data['qual'] == -1: qual = "." # <<<<<<<<<<<<<< | |
30751 * else: qual = str(data['qual']) | |
30752 * | |
30753 */ | |
30754 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_qual); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 894, __pyx_L1_error) | |
30755 __Pyx_GOTREF(__pyx_t_2); | |
30756 __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_t_2, __pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 894, __pyx_L1_error) | |
30757 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30758 if (__pyx_t_6) { | |
30759 __Pyx_INCREF(__pyx_kp_u__5); | |
30760 __pyx_v_qual = __pyx_kp_u__5; | |
30761 goto __pyx_L10; | |
30762 } | |
30763 | |
30764 /* "pysam/libcvcf.pyx":895 | |
30765 * else: filter = ';'.join(data['filter']) | |
30766 * if data['qual'] == -1: qual = "." | |
30767 * else: qual = str(data['qual']) # <<<<<<<<<<<<<< | |
30768 * | |
30769 * output = [data['chrom'], | |
30770 */ | |
30771 /*else*/ { | |
30772 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_qual); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 895, __pyx_L1_error) | |
30773 __Pyx_GOTREF(__pyx_t_2); | |
30774 __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) | |
30775 __Pyx_GOTREF(__pyx_t_3); | |
30776 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30777 __pyx_v_qual = __pyx_t_3; | |
30778 __pyx_t_3 = 0; | |
30779 } | |
30780 __pyx_L10:; | |
30781 | |
30782 /* "pysam/libcvcf.pyx":897 | |
30783 * else: qual = str(data['qual']) | |
30784 * | |
30785 * output = [data['chrom'], # <<<<<<<<<<<<<< | |
30786 * str(data['pos']+1), # change to 1-based position | |
30787 * data['id'], | |
30788 */ | |
30789 __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 897, __pyx_L1_error) | |
30790 __Pyx_GOTREF(__pyx_t_3); | |
30791 | |
30792 /* "pysam/libcvcf.pyx":898 | |
30793 * | |
30794 * output = [data['chrom'], | |
30795 * str(data['pos']+1), # change to 1-based position # <<<<<<<<<<<<<< | |
30796 * data['id'], | |
30797 * data['ref'], | |
30798 */ | |
30799 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) | |
30800 __Pyx_GOTREF(__pyx_t_2); | |
30801 __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) | |
30802 __Pyx_GOTREF(__pyx_t_1); | |
30803 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
30804 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error) | |
30805 __Pyx_GOTREF(__pyx_t_2); | |
30806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
30807 | |
30808 /* "pysam/libcvcf.pyx":899 | |
30809 * output = [data['chrom'], | |
30810 * str(data['pos']+1), # change to 1-based position | |
30811 * data['id'], # <<<<<<<<<<<<<< | |
30812 * data['ref'], | |
30813 * alt, | |
30814 */ | |
30815 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_id_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) | |
30816 __Pyx_GOTREF(__pyx_t_1); | |
30817 | |
30818 /* "pysam/libcvcf.pyx":900 | |
30819 * str(data['pos']+1), # change to 1-based position | |
30820 * data['id'], | |
30821 * data['ref'], # <<<<<<<<<<<<<< | |
30822 * alt, | |
30823 * qual, | |
30824 */ | |
30825 __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_ref); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 900, __pyx_L1_error) | |
30826 __Pyx_GOTREF(__pyx_t_7); | |
30827 | |
30828 /* "pysam/libcvcf.pyx":904 | |
30829 * qual, | |
30830 * filter, | |
30831 * self.format_formatdata( # <<<<<<<<<<<<<< | |
30832 * data['info'], self._info, separator=";"), | |
30833 * self.format_formatdata( | |
30834 */ | |
30835 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_formatdata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 904, __pyx_L1_error) | |
30836 __Pyx_GOTREF(__pyx_t_8); | |
30837 | |
30838 /* "pysam/libcvcf.pyx":905 | |
30839 * filter, | |
30840 * self.format_formatdata( | |
30841 * data['info'], self._info, separator=";"), # <<<<<<<<<<<<<< | |
30842 * self.format_formatdata( | |
30843 * data['format'], self._format, value=False)] | |
30844 */ | |
30845 __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_info_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 905, __pyx_L1_error) | |
30846 __Pyx_GOTREF(__pyx_t_9); | |
30847 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 905, __pyx_L1_error) | |
30848 __Pyx_GOTREF(__pyx_t_10); | |
30849 | |
30850 /* "pysam/libcvcf.pyx":904 | |
30851 * qual, | |
30852 * filter, | |
30853 * self.format_formatdata( # <<<<<<<<<<<<<< | |
30854 * data['info'], self._info, separator=";"), | |
30855 * self.format_formatdata( | |
30856 */ | |
30857 __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 904, __pyx_L1_error) | |
30858 __Pyx_GOTREF(__pyx_t_11); | |
30859 __Pyx_GIVEREF(__pyx_t_9); | |
30860 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9)) __PYX_ERR(0, 904, __pyx_L1_error); | |
30861 __Pyx_GIVEREF(__pyx_t_10); | |
30862 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10)) __PYX_ERR(0, 904, __pyx_L1_error); | |
30863 __pyx_t_9 = 0; | |
30864 __pyx_t_10 = 0; | |
30865 | |
30866 /* "pysam/libcvcf.pyx":905 | |
30867 * filter, | |
30868 * self.format_formatdata( | |
30869 * data['info'], self._info, separator=";"), # <<<<<<<<<<<<<< | |
30870 * self.format_formatdata( | |
30871 * data['format'], self._format, value=False)] | |
30872 */ | |
30873 __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 905, __pyx_L1_error) | |
30874 __Pyx_GOTREF(__pyx_t_10); | |
30875 if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_separator, __pyx_kp_u__6) < 0) __PYX_ERR(0, 905, __pyx_L1_error) | |
30876 | |
30877 /* "pysam/libcvcf.pyx":904 | |
30878 * qual, | |
30879 * filter, | |
30880 * self.format_formatdata( # <<<<<<<<<<<<<< | |
30881 * data['info'], self._info, separator=";"), | |
30882 * self.format_formatdata( | |
30883 */ | |
30884 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 904, __pyx_L1_error) | |
30885 __Pyx_GOTREF(__pyx_t_9); | |
30886 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
30887 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
30888 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
30889 | |
30890 /* "pysam/libcvcf.pyx":906 | |
30891 * self.format_formatdata( | |
30892 * data['info'], self._info, separator=";"), | |
30893 * self.format_formatdata( # <<<<<<<<<<<<<< | |
30894 * data['format'], self._format, value=False)] | |
30895 * | |
30896 */ | |
30897 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_formatdata); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 906, __pyx_L1_error) | |
30898 __Pyx_GOTREF(__pyx_t_10); | |
30899 | |
30900 /* "pysam/libcvcf.pyx":907 | |
30901 * data['info'], self._info, separator=";"), | |
30902 * self.format_formatdata( | |
30903 * data['format'], self._format, value=False)] # <<<<<<<<<<<<<< | |
30904 * | |
30905 * for s in self._samples: | |
30906 */ | |
30907 __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_format); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 907, __pyx_L1_error) | |
30908 __Pyx_GOTREF(__pyx_t_11); | |
30909 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 907, __pyx_L1_error) | |
30910 __Pyx_GOTREF(__pyx_t_8); | |
30911 | |
30912 /* "pysam/libcvcf.pyx":906 | |
30913 * self.format_formatdata( | |
30914 * data['info'], self._info, separator=";"), | |
30915 * self.format_formatdata( # <<<<<<<<<<<<<< | |
30916 * data['format'], self._format, value=False)] | |
30917 * | |
30918 */ | |
30919 __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 906, __pyx_L1_error) | |
30920 __Pyx_GOTREF(__pyx_t_12); | |
30921 __Pyx_GIVEREF(__pyx_t_11); | |
30922 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11)) __PYX_ERR(0, 906, __pyx_L1_error); | |
30923 __Pyx_GIVEREF(__pyx_t_8); | |
30924 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8)) __PYX_ERR(0, 906, __pyx_L1_error); | |
30925 __pyx_t_11 = 0; | |
30926 __pyx_t_8 = 0; | |
30927 | |
30928 /* "pysam/libcvcf.pyx":907 | |
30929 * data['info'], self._info, separator=";"), | |
30930 * self.format_formatdata( | |
30931 * data['format'], self._format, value=False)] # <<<<<<<<<<<<<< | |
30932 * | |
30933 * for s in self._samples: | |
30934 */ | |
30935 __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 907, __pyx_L1_error) | |
30936 __Pyx_GOTREF(__pyx_t_8); | |
30937 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_value, Py_False) < 0) __PYX_ERR(0, 907, __pyx_L1_error) | |
30938 | |
30939 /* "pysam/libcvcf.pyx":906 | |
30940 * self.format_formatdata( | |
30941 * data['info'], self._info, separator=";"), | |
30942 * self.format_formatdata( # <<<<<<<<<<<<<< | |
30943 * data['format'], self._format, value=False)] | |
30944 * | |
30945 */ | |
30946 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 906, __pyx_L1_error) | |
30947 __Pyx_GOTREF(__pyx_t_11); | |
30948 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
30949 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
30950 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
30951 | |
30952 /* "pysam/libcvcf.pyx":897 | |
30953 * else: qual = str(data['qual']) | |
30954 * | |
30955 * output = [data['chrom'], # <<<<<<<<<<<<<< | |
30956 * str(data['pos']+1), # change to 1-based position | |
30957 * data['id'], | |
30958 */ | |
30959 __pyx_t_8 = PyList_New(9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 897, __pyx_L1_error) | |
30960 __Pyx_GOTREF(__pyx_t_8); | |
30961 __Pyx_GIVEREF(__pyx_t_3); | |
30962 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 897, __pyx_L1_error); | |
30963 __Pyx_GIVEREF(__pyx_t_2); | |
30964 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 897, __pyx_L1_error); | |
30965 __Pyx_GIVEREF(__pyx_t_1); | |
30966 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error); | |
30967 __Pyx_GIVEREF(__pyx_t_7); | |
30968 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_7)) __PYX_ERR(0, 897, __pyx_L1_error); | |
30969 __Pyx_INCREF(__pyx_v_alt); | |
30970 __Pyx_GIVEREF(__pyx_v_alt); | |
30971 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 4, __pyx_v_alt)) __PYX_ERR(0, 897, __pyx_L1_error); | |
30972 __Pyx_INCREF(__pyx_v_qual); | |
30973 __Pyx_GIVEREF(__pyx_v_qual); | |
30974 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 5, __pyx_v_qual)) __PYX_ERR(0, 897, __pyx_L1_error); | |
30975 __Pyx_INCREF(__pyx_v_filter); | |
30976 __Pyx_GIVEREF(__pyx_v_filter); | |
30977 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 6, __pyx_v_filter)) __PYX_ERR(0, 897, __pyx_L1_error); | |
30978 __Pyx_GIVEREF(__pyx_t_9); | |
30979 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 7, __pyx_t_9)) __PYX_ERR(0, 897, __pyx_L1_error); | |
30980 __Pyx_GIVEREF(__pyx_t_11); | |
30981 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 8, __pyx_t_11)) __PYX_ERR(0, 897, __pyx_L1_error); | |
30982 __pyx_t_3 = 0; | |
30983 __pyx_t_2 = 0; | |
30984 __pyx_t_1 = 0; | |
30985 __pyx_t_7 = 0; | |
30986 __pyx_t_9 = 0; | |
30987 __pyx_t_11 = 0; | |
30988 __pyx_v_output = ((PyObject*)__pyx_t_8); | |
30989 __pyx_t_8 = 0; | |
30990 | |
30991 /* "pysam/libcvcf.pyx":909 | |
30992 * data['format'], self._format, value=False)] | |
30993 * | |
30994 * for s in self._samples: # <<<<<<<<<<<<<< | |
30995 * output.append(self.format_formatdata( | |
30996 * data[s], self._format, key=False)) | |
30997 */ | |
30998 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 909, __pyx_L1_error) | |
30999 __Pyx_GOTREF(__pyx_t_8); | |
31000 if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { | |
31001 __pyx_t_11 = __pyx_t_8; __Pyx_INCREF(__pyx_t_11); | |
31002 __pyx_t_4 = 0; | |
31003 __pyx_t_5 = NULL; | |
31004 } else { | |
31005 __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 909, __pyx_L1_error) | |
31006 __Pyx_GOTREF(__pyx_t_11); | |
31007 __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error) | |
31008 } | |
31009 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
31010 for (;;) { | |
31011 if (likely(!__pyx_t_5)) { | |
31012 if (likely(PyList_CheckExact(__pyx_t_11))) { | |
31013 { | |
31014 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); | |
31015 #if !CYTHON_ASSUME_SAFE_MACROS | |
31016 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 909, __pyx_L1_error) | |
31017 #endif | |
31018 if (__pyx_t_4 >= __pyx_temp) break; | |
31019 } | |
31020 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
31021 __pyx_t_8 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 909, __pyx_L1_error) | |
31022 #else | |
31023 __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 909, __pyx_L1_error) | |
31024 __Pyx_GOTREF(__pyx_t_8); | |
31025 #endif | |
31026 } else { | |
31027 { | |
31028 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); | |
31029 #if !CYTHON_ASSUME_SAFE_MACROS | |
31030 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 909, __pyx_L1_error) | |
31031 #endif | |
31032 if (__pyx_t_4 >= __pyx_temp) break; | |
31033 } | |
31034 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
31035 __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 909, __pyx_L1_error) | |
31036 #else | |
31037 __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 909, __pyx_L1_error) | |
31038 __Pyx_GOTREF(__pyx_t_8); | |
31039 #endif | |
31040 } | |
31041 } else { | |
31042 __pyx_t_8 = __pyx_t_5(__pyx_t_11); | |
31043 if (unlikely(!__pyx_t_8)) { | |
31044 PyObject* exc_type = PyErr_Occurred(); | |
31045 if (exc_type) { | |
31046 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
31047 else __PYX_ERR(0, 909, __pyx_L1_error) | |
31048 } | |
31049 break; | |
31050 } | |
31051 __Pyx_GOTREF(__pyx_t_8); | |
31052 } | |
31053 __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_8); | |
31054 __pyx_t_8 = 0; | |
31055 | |
31056 /* "pysam/libcvcf.pyx":910 | |
31057 * | |
31058 * for s in self._samples: | |
31059 * output.append(self.format_formatdata( # <<<<<<<<<<<<<< | |
31060 * data[s], self._format, key=False)) | |
31061 * | |
31062 */ | |
31063 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_formatdata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 910, __pyx_L1_error) | |
31064 __Pyx_GOTREF(__pyx_t_8); | |
31065 | |
31066 /* "pysam/libcvcf.pyx":911 | |
31067 * for s in self._samples: | |
31068 * output.append(self.format_formatdata( | |
31069 * data[s], self._format, key=False)) # <<<<<<<<<<<<<< | |
31070 * | |
31071 * stream.write( "\t".join(output) + "\n" ) | |
31072 */ | |
31073 __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_v_s); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 911, __pyx_L1_error) | |
31074 __Pyx_GOTREF(__pyx_t_9); | |
31075 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 911, __pyx_L1_error) | |
31076 __Pyx_GOTREF(__pyx_t_7); | |
31077 | |
31078 /* "pysam/libcvcf.pyx":910 | |
31079 * | |
31080 * for s in self._samples: | |
31081 * output.append(self.format_formatdata( # <<<<<<<<<<<<<< | |
31082 * data[s], self._format, key=False)) | |
31083 * | |
31084 */ | |
31085 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error) | |
31086 __Pyx_GOTREF(__pyx_t_1); | |
31087 __Pyx_GIVEREF(__pyx_t_9); | |
31088 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9)) __PYX_ERR(0, 910, __pyx_L1_error); | |
31089 __Pyx_GIVEREF(__pyx_t_7); | |
31090 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7)) __PYX_ERR(0, 910, __pyx_L1_error); | |
31091 __pyx_t_9 = 0; | |
31092 __pyx_t_7 = 0; | |
31093 | |
31094 /* "pysam/libcvcf.pyx":911 | |
31095 * for s in self._samples: | |
31096 * output.append(self.format_formatdata( | |
31097 * data[s], self._format, key=False)) # <<<<<<<<<<<<<< | |
31098 * | |
31099 * stream.write( "\t".join(output) + "\n" ) | |
31100 */ | |
31101 __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 911, __pyx_L1_error) | |
31102 __Pyx_GOTREF(__pyx_t_7); | |
31103 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_key, Py_False) < 0) __PYX_ERR(0, 911, __pyx_L1_error) | |
31104 | |
31105 /* "pysam/libcvcf.pyx":910 | |
31106 * | |
31107 * for s in self._samples: | |
31108 * output.append(self.format_formatdata( # <<<<<<<<<<<<<< | |
31109 * data[s], self._format, key=False)) | |
31110 * | |
31111 */ | |
31112 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L1_error) | |
31113 __Pyx_GOTREF(__pyx_t_9); | |
31114 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
31115 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
31116 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
31117 __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_output, __pyx_t_9); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 910, __pyx_L1_error) | |
31118 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
31119 | |
31120 /* "pysam/libcvcf.pyx":909 | |
31121 * data['format'], self._format, value=False)] | |
31122 * | |
31123 * for s in self._samples: # <<<<<<<<<<<<<< | |
31124 * output.append(self.format_formatdata( | |
31125 * data[s], self._format, key=False)) | |
31126 */ | |
31127 } | |
31128 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
31129 | |
31130 /* "pysam/libcvcf.pyx":913 | |
31131 * data[s], self._format, key=False)) | |
31132 * | |
31133 * stream.write( "\t".join(output) + "\n" ) # <<<<<<<<<<<<<< | |
31134 * | |
31135 * def _parse_header(self, stream): | |
31136 */ | |
31137 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 913, __pyx_L1_error) | |
31138 __Pyx_GOTREF(__pyx_t_9); | |
31139 __pyx_t_7 = PyUnicode_Join(__pyx_kp_u__25, __pyx_v_output); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 913, __pyx_L1_error) | |
31140 __Pyx_GOTREF(__pyx_t_7); | |
31141 __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_7, __pyx_kp_u__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) | |
31142 __Pyx_GOTREF(__pyx_t_1); | |
31143 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
31144 __pyx_t_7 = NULL; | |
31145 __pyx_t_14 = 0; | |
31146 #if CYTHON_UNPACK_METHODS | |
31147 if (likely(PyMethod_Check(__pyx_t_9))) { | |
31148 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); | |
31149 if (likely(__pyx_t_7)) { | |
31150 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); | |
31151 __Pyx_INCREF(__pyx_t_7); | |
31152 __Pyx_INCREF(function); | |
31153 __Pyx_DECREF_SET(__pyx_t_9, function); | |
31154 __pyx_t_14 = 1; | |
31155 } | |
31156 } | |
31157 #endif | |
31158 { | |
31159 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1}; | |
31160 __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); | |
31161 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
31162 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
31163 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 913, __pyx_L1_error) | |
31164 __Pyx_GOTREF(__pyx_t_11); | |
31165 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
31166 } | |
31167 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; | |
31168 | |
31169 /* "pysam/libcvcf.pyx":883 | |
31170 * | |
31171 * | |
31172 * def write_data(self, stream, data): # <<<<<<<<<<<<<< | |
31173 * required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples | |
31174 * for k in required: | |
31175 */ | |
31176 | |
31177 /* function exit code */ | |
31178 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
31179 goto __pyx_L0; | |
31180 __pyx_L1_error:; | |
31181 __Pyx_XDECREF(__pyx_t_1); | |
31182 __Pyx_XDECREF(__pyx_t_2); | |
31183 __Pyx_XDECREF(__pyx_t_3); | |
31184 __Pyx_XDECREF(__pyx_t_7); | |
31185 __Pyx_XDECREF(__pyx_t_8); | |
31186 __Pyx_XDECREF(__pyx_t_9); | |
31187 __Pyx_XDECREF(__pyx_t_10); | |
31188 __Pyx_XDECREF(__pyx_t_11); | |
31189 __Pyx_XDECREF(__pyx_t_12); | |
31190 __Pyx_AddTraceback("pysam.libcvcf.VCF.write_data", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
31191 __pyx_r = NULL; | |
31192 __pyx_L0:; | |
31193 __Pyx_XDECREF(__pyx_v_required); | |
31194 __Pyx_XDECREF(__pyx_v_k); | |
31195 __Pyx_XDECREF(__pyx_v_alt); | |
31196 __Pyx_XDECREF(__pyx_v_filter); | |
31197 __Pyx_XDECREF(__pyx_v_qual); | |
31198 __Pyx_XDECREF(__pyx_v_output); | |
31199 __Pyx_XDECREF(__pyx_v_s); | |
31200 __Pyx_XGIVEREF(__pyx_r); | |
31201 __Pyx_RefNannyFinishContext(); | |
31202 return __pyx_r; | |
31203 } | |
31204 | |
31205 /* "pysam/libcvcf.pyx":915 | |
31206 * stream.write( "\t".join(output) + "\n" ) | |
31207 * | |
31208 * def _parse_header(self, stream): # <<<<<<<<<<<<<< | |
31209 * self._lineno = 0 | |
31210 * for line in stream: | |
31211 */ | |
31212 | |
31213 /* Python wrapper */ | |
31214 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_37_parse_header(PyObject *__pyx_self, | |
31215 #if CYTHON_METH_FASTCALL | |
31216 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
31217 #else | |
31218 PyObject *__pyx_args, PyObject *__pyx_kwds | |
31219 #endif | |
31220 ); /*proto*/ | |
31221 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_36_parse_header, "VCF._parse_header(self, stream)"); | |
31222 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_37_parse_header = {"_parse_header", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_37_parse_header, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_36_parse_header}; | |
31223 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_37_parse_header(PyObject *__pyx_self, | |
31224 #if CYTHON_METH_FASTCALL | |
31225 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
31226 #else | |
31227 PyObject *__pyx_args, PyObject *__pyx_kwds | |
31228 #endif | |
31229 ) { | |
31230 PyObject *__pyx_v_self = 0; | |
31231 PyObject *__pyx_v_stream = 0; | |
31232 #if !CYTHON_METH_FASTCALL | |
31233 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
31234 #endif | |
31235 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
31236 PyObject* values[2] = {0,0}; | |
31237 int __pyx_lineno = 0; | |
31238 const char *__pyx_filename = NULL; | |
31239 int __pyx_clineno = 0; | |
31240 PyObject *__pyx_r = 0; | |
31241 __Pyx_RefNannyDeclarations | |
31242 __Pyx_RefNannySetupContext("_parse_header (wrapper)", 0); | |
31243 #if !CYTHON_METH_FASTCALL | |
31244 #if CYTHON_ASSUME_SAFE_MACROS | |
31245 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
31246 #else | |
31247 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
31248 #endif | |
31249 #endif | |
31250 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
31251 { | |
31252 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0}; | |
31253 if (__pyx_kwds) { | |
31254 Py_ssize_t kw_args; | |
31255 switch (__pyx_nargs) { | |
31256 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
31257 CYTHON_FALLTHROUGH; | |
31258 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
31259 CYTHON_FALLTHROUGH; | |
31260 case 0: break; | |
31261 default: goto __pyx_L5_argtuple_error; | |
31262 } | |
31263 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
31264 switch (__pyx_nargs) { | |
31265 case 0: | |
31266 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
31267 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
31268 kw_args--; | |
31269 } | |
31270 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 915, __pyx_L3_error) | |
31271 else goto __pyx_L5_argtuple_error; | |
31272 CYTHON_FALLTHROUGH; | |
31273 case 1: | |
31274 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream)) != 0)) { | |
31275 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
31276 kw_args--; | |
31277 } | |
31278 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 915, __pyx_L3_error) | |
31279 else { | |
31280 __Pyx_RaiseArgtupleInvalid("_parse_header", 1, 2, 2, 1); __PYX_ERR(0, 915, __pyx_L3_error) | |
31281 } | |
31282 } | |
31283 if (unlikely(kw_args > 0)) { | |
31284 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
31285 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_header") < 0)) __PYX_ERR(0, 915, __pyx_L3_error) | |
31286 } | |
31287 } else if (unlikely(__pyx_nargs != 2)) { | |
31288 goto __pyx_L5_argtuple_error; | |
31289 } else { | |
31290 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
31291 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
31292 } | |
31293 __pyx_v_self = values[0]; | |
31294 __pyx_v_stream = values[1]; | |
31295 } | |
31296 goto __pyx_L6_skip; | |
31297 __pyx_L5_argtuple_error:; | |
31298 __Pyx_RaiseArgtupleInvalid("_parse_header", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 915, __pyx_L3_error) | |
31299 __pyx_L6_skip:; | |
31300 goto __pyx_L4_argument_unpacking_done; | |
31301 __pyx_L3_error:; | |
31302 { | |
31303 Py_ssize_t __pyx_temp; | |
31304 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
31305 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
31306 } | |
31307 } | |
31308 __Pyx_AddTraceback("pysam.libcvcf.VCF._parse_header", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
31309 __Pyx_RefNannyFinishContext(); | |
31310 return NULL; | |
31311 __pyx_L4_argument_unpacking_done:; | |
31312 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_36_parse_header(__pyx_self, __pyx_v_self, __pyx_v_stream); | |
31313 | |
31314 /* function exit code */ | |
31315 { | |
31316 Py_ssize_t __pyx_temp; | |
31317 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
31318 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
31319 } | |
31320 } | |
31321 __Pyx_RefNannyFinishContext(); | |
31322 return __pyx_r; | |
31323 } | |
31324 | |
31325 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_36_parse_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) { | |
31326 PyObject *__pyx_v_line = NULL; | |
31327 PyObject *__pyx_r = NULL; | |
31328 __Pyx_RefNannyDeclarations | |
31329 PyObject *__pyx_t_1 = NULL; | |
31330 Py_ssize_t __pyx_t_2; | |
31331 PyObject *(*__pyx_t_3)(PyObject *); | |
31332 PyObject *__pyx_t_4 = NULL; | |
31333 PyObject *__pyx_t_5 = NULL; | |
31334 struct __pyx_opt_args_5pysam_9libcutils_force_str __pyx_t_6; | |
31335 PyObject *__pyx_t_7 = NULL; | |
31336 unsigned int __pyx_t_8; | |
31337 int __pyx_t_9; | |
31338 PyObject *__pyx_t_10 = NULL; | |
31339 PyObject *__pyx_t_11 = NULL; | |
31340 int __pyx_lineno = 0; | |
31341 const char *__pyx_filename = NULL; | |
31342 int __pyx_clineno = 0; | |
31343 __Pyx_RefNannySetupContext("_parse_header", 1); | |
31344 | |
31345 /* "pysam/libcvcf.pyx":916 | |
31346 * | |
31347 * def _parse_header(self, stream): | |
31348 * self._lineno = 0 # <<<<<<<<<<<<<< | |
31349 * for line in stream: | |
31350 * line = force_str(line, self.encoding) | |
31351 */ | |
31352 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lineno, __pyx_int_0) < 0) __PYX_ERR(0, 916, __pyx_L1_error) | |
31353 | |
31354 /* "pysam/libcvcf.pyx":917 | |
31355 * def _parse_header(self, stream): | |
31356 * self._lineno = 0 | |
31357 * for line in stream: # <<<<<<<<<<<<<< | |
31358 * line = force_str(line, self.encoding) | |
31359 * self._lineno += 1 | |
31360 */ | |
31361 if (likely(PyList_CheckExact(__pyx_v_stream)) || PyTuple_CheckExact(__pyx_v_stream)) { | |
31362 __pyx_t_1 = __pyx_v_stream; __Pyx_INCREF(__pyx_t_1); | |
31363 __pyx_t_2 = 0; | |
31364 __pyx_t_3 = NULL; | |
31365 } else { | |
31366 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_stream); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error) | |
31367 __Pyx_GOTREF(__pyx_t_1); | |
31368 __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error) | |
31369 } | |
31370 for (;;) { | |
31371 if (likely(!__pyx_t_3)) { | |
31372 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
31373 { | |
31374 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
31375 #if !CYTHON_ASSUME_SAFE_MACROS | |
31376 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 917, __pyx_L1_error) | |
31377 #endif | |
31378 if (__pyx_t_2 >= __pyx_temp) break; | |
31379 } | |
31380 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
31381 __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, 917, __pyx_L1_error) | |
31382 #else | |
31383 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 917, __pyx_L1_error) | |
31384 __Pyx_GOTREF(__pyx_t_4); | |
31385 #endif | |
31386 } else { | |
31387 { | |
31388 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
31389 #if !CYTHON_ASSUME_SAFE_MACROS | |
31390 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 917, __pyx_L1_error) | |
31391 #endif | |
31392 if (__pyx_t_2 >= __pyx_temp) break; | |
31393 } | |
31394 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
31395 __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, 917, __pyx_L1_error) | |
31396 #else | |
31397 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 917, __pyx_L1_error) | |
31398 __Pyx_GOTREF(__pyx_t_4); | |
31399 #endif | |
31400 } | |
31401 } else { | |
31402 __pyx_t_4 = __pyx_t_3(__pyx_t_1); | |
31403 if (unlikely(!__pyx_t_4)) { | |
31404 PyObject* exc_type = PyErr_Occurred(); | |
31405 if (exc_type) { | |
31406 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
31407 else __PYX_ERR(0, 917, __pyx_L1_error) | |
31408 } | |
31409 break; | |
31410 } | |
31411 __Pyx_GOTREF(__pyx_t_4); | |
31412 } | |
31413 __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_4); | |
31414 __pyx_t_4 = 0; | |
31415 | |
31416 /* "pysam/libcvcf.pyx":918 | |
31417 * self._lineno = 0 | |
31418 * for line in stream: | |
31419 * line = force_str(line, self.encoding) # <<<<<<<<<<<<<< | |
31420 * self._lineno += 1 | |
31421 * if line.startswith('##'): | |
31422 */ | |
31423 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error) | |
31424 __Pyx_GOTREF(__pyx_t_4); | |
31425 __pyx_t_6.__pyx_n = 1; | |
31426 __pyx_t_6.encoding = __pyx_t_4; | |
31427 __pyx_t_5 = __pyx_f_5pysam_9libcutils_force_str(__pyx_v_line, &__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 918, __pyx_L1_error) | |
31428 __Pyx_GOTREF(__pyx_t_5); | |
31429 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
31430 __Pyx_DECREF_SET(__pyx_v_line, __pyx_t_5); | |
31431 __pyx_t_5 = 0; | |
31432 | |
31433 /* "pysam/libcvcf.pyx":919 | |
31434 * for line in stream: | |
31435 * line = force_str(line, self.encoding) | |
31436 * self._lineno += 1 # <<<<<<<<<<<<<< | |
31437 * if line.startswith('##'): | |
31438 * self.parse_header(line.strip()) | |
31439 */ | |
31440 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lineno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error) | |
31441 __Pyx_GOTREF(__pyx_t_5); | |
31442 __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error) | |
31443 __Pyx_GOTREF(__pyx_t_4); | |
31444 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
31445 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lineno, __pyx_t_4) < 0) __PYX_ERR(0, 919, __pyx_L1_error) | |
31446 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
31447 | |
31448 /* "pysam/libcvcf.pyx":920 | |
31449 * line = force_str(line, self.encoding) | |
31450 * self._lineno += 1 | |
31451 * if line.startswith('##'): # <<<<<<<<<<<<<< | |
31452 * self.parse_header(line.strip()) | |
31453 * elif line.startswith('#'): | |
31454 */ | |
31455 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error) | |
31456 __Pyx_GOTREF(__pyx_t_5); | |
31457 __pyx_t_7 = NULL; | |
31458 __pyx_t_8 = 0; | |
31459 #if CYTHON_UNPACK_METHODS | |
31460 if (likely(PyMethod_Check(__pyx_t_5))) { | |
31461 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); | |
31462 if (likely(__pyx_t_7)) { | |
31463 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
31464 __Pyx_INCREF(__pyx_t_7); | |
31465 __Pyx_INCREF(function); | |
31466 __Pyx_DECREF_SET(__pyx_t_5, function); | |
31467 __pyx_t_8 = 1; | |
31468 } | |
31469 } | |
31470 #endif | |
31471 { | |
31472 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u__23}; | |
31473 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
31474 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
31475 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error) | |
31476 __Pyx_GOTREF(__pyx_t_4); | |
31477 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
31478 } | |
31479 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 920, __pyx_L1_error) | |
31480 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
31481 if (__pyx_t_9) { | |
31482 | |
31483 /* "pysam/libcvcf.pyx":921 | |
31484 * self._lineno += 1 | |
31485 * if line.startswith('##'): | |
31486 * self.parse_header(line.strip()) # <<<<<<<<<<<<<< | |
31487 * elif line.startswith('#'): | |
31488 * self.parse_heading(line.strip()) | |
31489 */ | |
31490 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_header); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __pyx_L1_error) | |
31491 __Pyx_GOTREF(__pyx_t_5); | |
31492 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 921, __pyx_L1_error) | |
31493 __Pyx_GOTREF(__pyx_t_10); | |
31494 __pyx_t_11 = NULL; | |
31495 __pyx_t_8 = 0; | |
31496 #if CYTHON_UNPACK_METHODS | |
31497 if (likely(PyMethod_Check(__pyx_t_10))) { | |
31498 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); | |
31499 if (likely(__pyx_t_11)) { | |
31500 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); | |
31501 __Pyx_INCREF(__pyx_t_11); | |
31502 __Pyx_INCREF(function); | |
31503 __Pyx_DECREF_SET(__pyx_t_10, function); | |
31504 __pyx_t_8 = 1; | |
31505 } | |
31506 } | |
31507 #endif | |
31508 { | |
31509 PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; | |
31510 __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); | |
31511 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
31512 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 921, __pyx_L1_error) | |
31513 __Pyx_GOTREF(__pyx_t_7); | |
31514 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
31515 } | |
31516 __pyx_t_10 = NULL; | |
31517 __pyx_t_8 = 0; | |
31518 #if CYTHON_UNPACK_METHODS | |
31519 if (likely(PyMethod_Check(__pyx_t_5))) { | |
31520 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); | |
31521 if (likely(__pyx_t_10)) { | |
31522 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
31523 __Pyx_INCREF(__pyx_t_10); | |
31524 __Pyx_INCREF(function); | |
31525 __Pyx_DECREF_SET(__pyx_t_5, function); | |
31526 __pyx_t_8 = 1; | |
31527 } | |
31528 } | |
31529 #endif | |
31530 { | |
31531 PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7}; | |
31532 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
31533 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; | |
31534 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
31535 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L1_error) | |
31536 __Pyx_GOTREF(__pyx_t_4); | |
31537 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
31538 } | |
31539 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
31540 | |
31541 /* "pysam/libcvcf.pyx":920 | |
31542 * line = force_str(line, self.encoding) | |
31543 * self._lineno += 1 | |
31544 * if line.startswith('##'): # <<<<<<<<<<<<<< | |
31545 * self.parse_header(line.strip()) | |
31546 * elif line.startswith('#'): | |
31547 */ | |
31548 goto __pyx_L5; | |
31549 } | |
31550 | |
31551 /* "pysam/libcvcf.pyx":922 | |
31552 * if line.startswith('##'): | |
31553 * self.parse_header(line.strip()) | |
31554 * elif line.startswith('#'): # <<<<<<<<<<<<<< | |
31555 * self.parse_heading(line.strip()) | |
31556 * self.enter_default_format() | |
31557 */ | |
31558 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 922, __pyx_L1_error) | |
31559 __Pyx_GOTREF(__pyx_t_5); | |
31560 __pyx_t_7 = NULL; | |
31561 __pyx_t_8 = 0; | |
31562 #if CYTHON_UNPACK_METHODS | |
31563 if (likely(PyMethod_Check(__pyx_t_5))) { | |
31564 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); | |
31565 if (likely(__pyx_t_7)) { | |
31566 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
31567 __Pyx_INCREF(__pyx_t_7); | |
31568 __Pyx_INCREF(function); | |
31569 __Pyx_DECREF_SET(__pyx_t_5, function); | |
31570 __pyx_t_8 = 1; | |
31571 } | |
31572 } | |
31573 #endif | |
31574 { | |
31575 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u__24}; | |
31576 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
31577 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
31578 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 922, __pyx_L1_error) | |
31579 __Pyx_GOTREF(__pyx_t_4); | |
31580 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
31581 } | |
31582 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 922, __pyx_L1_error) | |
31583 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
31584 if (__pyx_t_9) { | |
31585 | |
31586 /* "pysam/libcvcf.pyx":923 | |
31587 * self.parse_header(line.strip()) | |
31588 * elif line.startswith('#'): | |
31589 * self.parse_heading(line.strip()) # <<<<<<<<<<<<<< | |
31590 * self.enter_default_format() | |
31591 * else: | |
31592 */ | |
31593 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_heading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error) | |
31594 __Pyx_GOTREF(__pyx_t_5); | |
31595 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 923, __pyx_L1_error) | |
31596 __Pyx_GOTREF(__pyx_t_10); | |
31597 __pyx_t_11 = NULL; | |
31598 __pyx_t_8 = 0; | |
31599 #if CYTHON_UNPACK_METHODS | |
31600 if (likely(PyMethod_Check(__pyx_t_10))) { | |
31601 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); | |
31602 if (likely(__pyx_t_11)) { | |
31603 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); | |
31604 __Pyx_INCREF(__pyx_t_11); | |
31605 __Pyx_INCREF(function); | |
31606 __Pyx_DECREF_SET(__pyx_t_10, function); | |
31607 __pyx_t_8 = 1; | |
31608 } | |
31609 } | |
31610 #endif | |
31611 { | |
31612 PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; | |
31613 __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); | |
31614 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
31615 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 923, __pyx_L1_error) | |
31616 __Pyx_GOTREF(__pyx_t_7); | |
31617 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
31618 } | |
31619 __pyx_t_10 = NULL; | |
31620 __pyx_t_8 = 0; | |
31621 #if CYTHON_UNPACK_METHODS | |
31622 if (likely(PyMethod_Check(__pyx_t_5))) { | |
31623 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); | |
31624 if (likely(__pyx_t_10)) { | |
31625 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
31626 __Pyx_INCREF(__pyx_t_10); | |
31627 __Pyx_INCREF(function); | |
31628 __Pyx_DECREF_SET(__pyx_t_5, function); | |
31629 __pyx_t_8 = 1; | |
31630 } | |
31631 } | |
31632 #endif | |
31633 { | |
31634 PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7}; | |
31635 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
31636 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; | |
31637 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
31638 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 923, __pyx_L1_error) | |
31639 __Pyx_GOTREF(__pyx_t_4); | |
31640 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
31641 } | |
31642 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
31643 | |
31644 /* "pysam/libcvcf.pyx":924 | |
31645 * elif line.startswith('#'): | |
31646 * self.parse_heading(line.strip()) | |
31647 * self.enter_default_format() # <<<<<<<<<<<<<< | |
31648 * else: | |
31649 * break | |
31650 */ | |
31651 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enter_default_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 924, __pyx_L1_error) | |
31652 __Pyx_GOTREF(__pyx_t_5); | |
31653 __pyx_t_7 = NULL; | |
31654 __pyx_t_8 = 0; | |
31655 #if CYTHON_UNPACK_METHODS | |
31656 if (likely(PyMethod_Check(__pyx_t_5))) { | |
31657 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); | |
31658 if (likely(__pyx_t_7)) { | |
31659 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
31660 __Pyx_INCREF(__pyx_t_7); | |
31661 __Pyx_INCREF(function); | |
31662 __Pyx_DECREF_SET(__pyx_t_5, function); | |
31663 __pyx_t_8 = 1; | |
31664 } | |
31665 } | |
31666 #endif | |
31667 { | |
31668 PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; | |
31669 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); | |
31670 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
31671 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) | |
31672 __Pyx_GOTREF(__pyx_t_4); | |
31673 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
31674 } | |
31675 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
31676 | |
31677 /* "pysam/libcvcf.pyx":922 | |
31678 * if line.startswith('##'): | |
31679 * self.parse_header(line.strip()) | |
31680 * elif line.startswith('#'): # <<<<<<<<<<<<<< | |
31681 * self.parse_heading(line.strip()) | |
31682 * self.enter_default_format() | |
31683 */ | |
31684 goto __pyx_L5; | |
31685 } | |
31686 | |
31687 /* "pysam/libcvcf.pyx":926 | |
31688 * self.enter_default_format() | |
31689 * else: | |
31690 * break # <<<<<<<<<<<<<< | |
31691 * return line | |
31692 * | |
31693 */ | |
31694 /*else*/ { | |
31695 goto __pyx_L4_break; | |
31696 } | |
31697 __pyx_L5:; | |
31698 | |
31699 /* "pysam/libcvcf.pyx":917 | |
31700 * def _parse_header(self, stream): | |
31701 * self._lineno = 0 | |
31702 * for line in stream: # <<<<<<<<<<<<<< | |
31703 * line = force_str(line, self.encoding) | |
31704 * self._lineno += 1 | |
31705 */ | |
31706 } | |
31707 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
31708 goto __pyx_L6_for_end; | |
31709 __pyx_L4_break:; | |
31710 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
31711 goto __pyx_L6_for_end; | |
31712 __pyx_L6_for_end:; | |
31713 | |
31714 /* "pysam/libcvcf.pyx":927 | |
31715 * else: | |
31716 * break | |
31717 * return line # <<<<<<<<<<<<<< | |
31718 * | |
31719 * def _parse(self, line, stream): | |
31720 */ | |
31721 __Pyx_XDECREF(__pyx_r); | |
31722 if (unlikely(!__pyx_v_line)) { __Pyx_RaiseUnboundLocalError("line"); __PYX_ERR(0, 927, __pyx_L1_error) } | |
31723 __Pyx_INCREF(__pyx_v_line); | |
31724 __pyx_r = __pyx_v_line; | |
31725 goto __pyx_L0; | |
31726 | |
31727 /* "pysam/libcvcf.pyx":915 | |
31728 * stream.write( "\t".join(output) + "\n" ) | |
31729 * | |
31730 * def _parse_header(self, stream): # <<<<<<<<<<<<<< | |
31731 * self._lineno = 0 | |
31732 * for line in stream: | |
31733 */ | |
31734 | |
31735 /* function exit code */ | |
31736 __pyx_L1_error:; | |
31737 __Pyx_XDECREF(__pyx_t_1); | |
31738 __Pyx_XDECREF(__pyx_t_4); | |
31739 __Pyx_XDECREF(__pyx_t_5); | |
31740 __Pyx_XDECREF(__pyx_t_7); | |
31741 __Pyx_XDECREF(__pyx_t_10); | |
31742 __Pyx_XDECREF(__pyx_t_11); | |
31743 __Pyx_AddTraceback("pysam.libcvcf.VCF._parse_header", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
31744 __pyx_r = NULL; | |
31745 __pyx_L0:; | |
31746 __Pyx_XDECREF(__pyx_v_line); | |
31747 __Pyx_XGIVEREF(__pyx_r); | |
31748 __Pyx_RefNannyFinishContext(); | |
31749 return __pyx_r; | |
31750 } | |
31751 static PyObject *__pyx_gb_5pysam_7libcvcf_3VCF_40generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ | |
31752 | |
31753 /* "pysam/libcvcf.pyx":929 | |
31754 * return line | |
31755 * | |
31756 * def _parse(self, line, stream): # <<<<<<<<<<<<<< | |
31757 * # deal with files with header only | |
31758 * if line.startswith("##"): return | |
31759 */ | |
31760 | |
31761 /* Python wrapper */ | |
31762 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_39_parse(PyObject *__pyx_self, | |
31763 #if CYTHON_METH_FASTCALL | |
31764 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
31765 #else | |
31766 PyObject *__pyx_args, PyObject *__pyx_kwds | |
31767 #endif | |
31768 ); /*proto*/ | |
31769 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_38_parse, "VCF._parse(self, line, stream)"); | |
31770 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_39_parse = {"_parse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_39_parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_38_parse}; | |
31771 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_39_parse(PyObject *__pyx_self, | |
31772 #if CYTHON_METH_FASTCALL | |
31773 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
31774 #else | |
31775 PyObject *__pyx_args, PyObject *__pyx_kwds | |
31776 #endif | |
31777 ) { | |
31778 PyObject *__pyx_v_self = 0; | |
31779 PyObject *__pyx_v_line = 0; | |
31780 PyObject *__pyx_v_stream = 0; | |
31781 #if !CYTHON_METH_FASTCALL | |
31782 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
31783 #endif | |
31784 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
31785 PyObject* values[3] = {0,0,0}; | |
31786 int __pyx_lineno = 0; | |
31787 const char *__pyx_filename = NULL; | |
31788 int __pyx_clineno = 0; | |
31789 PyObject *__pyx_r = 0; | |
31790 __Pyx_RefNannyDeclarations | |
31791 __Pyx_RefNannySetupContext("_parse (wrapper)", 0); | |
31792 #if !CYTHON_METH_FASTCALL | |
31793 #if CYTHON_ASSUME_SAFE_MACROS | |
31794 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
31795 #else | |
31796 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
31797 #endif | |
31798 #endif | |
31799 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
31800 { | |
31801 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,&__pyx_n_s_stream,0}; | |
31802 if (__pyx_kwds) { | |
31803 Py_ssize_t kw_args; | |
31804 switch (__pyx_nargs) { | |
31805 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
31806 CYTHON_FALLTHROUGH; | |
31807 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
31808 CYTHON_FALLTHROUGH; | |
31809 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
31810 CYTHON_FALLTHROUGH; | |
31811 case 0: break; | |
31812 default: goto __pyx_L5_argtuple_error; | |
31813 } | |
31814 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
31815 switch (__pyx_nargs) { | |
31816 case 0: | |
31817 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
31818 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
31819 kw_args--; | |
31820 } | |
31821 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L3_error) | |
31822 else goto __pyx_L5_argtuple_error; | |
31823 CYTHON_FALLTHROUGH; | |
31824 case 1: | |
31825 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line)) != 0)) { | |
31826 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
31827 kw_args--; | |
31828 } | |
31829 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L3_error) | |
31830 else { | |
31831 __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, 1); __PYX_ERR(0, 929, __pyx_L3_error) | |
31832 } | |
31833 CYTHON_FALLTHROUGH; | |
31834 case 2: | |
31835 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream)) != 0)) { | |
31836 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
31837 kw_args--; | |
31838 } | |
31839 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L3_error) | |
31840 else { | |
31841 __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, 2); __PYX_ERR(0, 929, __pyx_L3_error) | |
31842 } | |
31843 } | |
31844 if (unlikely(kw_args > 0)) { | |
31845 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
31846 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse") < 0)) __PYX_ERR(0, 929, __pyx_L3_error) | |
31847 } | |
31848 } else if (unlikely(__pyx_nargs != 3)) { | |
31849 goto __pyx_L5_argtuple_error; | |
31850 } else { | |
31851 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
31852 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
31853 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
31854 } | |
31855 __pyx_v_self = values[0]; | |
31856 __pyx_v_line = values[1]; | |
31857 __pyx_v_stream = values[2]; | |
31858 } | |
31859 goto __pyx_L6_skip; | |
31860 __pyx_L5_argtuple_error:; | |
31861 __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 929, __pyx_L3_error) | |
31862 __pyx_L6_skip:; | |
31863 goto __pyx_L4_argument_unpacking_done; | |
31864 __pyx_L3_error:; | |
31865 { | |
31866 Py_ssize_t __pyx_temp; | |
31867 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
31868 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
31869 } | |
31870 } | |
31871 __Pyx_AddTraceback("pysam.libcvcf.VCF._parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
31872 __Pyx_RefNannyFinishContext(); | |
31873 return NULL; | |
31874 __pyx_L4_argument_unpacking_done:; | |
31875 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_38_parse(__pyx_self, __pyx_v_self, __pyx_v_line, __pyx_v_stream); | |
31876 | |
31877 /* function exit code */ | |
31878 { | |
31879 Py_ssize_t __pyx_temp; | |
31880 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
31881 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
31882 } | |
31883 } | |
31884 __Pyx_RefNannyFinishContext(); | |
31885 return __pyx_r; | |
31886 } | |
31887 | |
31888 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_38_parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_stream) { | |
31889 struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *__pyx_cur_scope; | |
31890 PyObject *__pyx_r = NULL; | |
31891 __Pyx_RefNannyDeclarations | |
31892 int __pyx_lineno = 0; | |
31893 const char *__pyx_filename = NULL; | |
31894 int __pyx_clineno = 0; | |
31895 __Pyx_RefNannySetupContext("_parse", 0); | |
31896 __pyx_cur_scope = (struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *)__pyx_tp_new_5pysam_7libcvcf___pyx_scope_struct___parse(__pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse, __pyx_empty_tuple, NULL); | |
31897 if (unlikely(!__pyx_cur_scope)) { | |
31898 __pyx_cur_scope = ((struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *)Py_None); | |
31899 __Pyx_INCREF(Py_None); | |
31900 __PYX_ERR(0, 929, __pyx_L1_error) | |
31901 } else { | |
31902 __Pyx_GOTREF((PyObject *)__pyx_cur_scope); | |
31903 } | |
31904 __pyx_cur_scope->__pyx_v_self = __pyx_v_self; | |
31905 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); | |
31906 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); | |
31907 __pyx_cur_scope->__pyx_v_line = __pyx_v_line; | |
31908 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_line); | |
31909 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_line); | |
31910 __pyx_cur_scope->__pyx_v_stream = __pyx_v_stream; | |
31911 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stream); | |
31912 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stream); | |
31913 { | |
31914 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5pysam_7libcvcf_3VCF_40generator, __pyx_codeobj__29, (PyObject *) __pyx_cur_scope, __pyx_n_s_parse, __pyx_n_s_VCF__parse, __pyx_n_s_pysam_libcvcf); if (unlikely(!gen)) __PYX_ERR(0, 929, __pyx_L1_error) | |
31915 __Pyx_DECREF(__pyx_cur_scope); | |
31916 __Pyx_RefNannyFinishContext(); | |
31917 return (PyObject *) gen; | |
31918 } | |
31919 | |
31920 /* function exit code */ | |
31921 __pyx_L1_error:; | |
31922 __Pyx_AddTraceback("pysam.libcvcf.VCF._parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
31923 __pyx_r = NULL; | |
31924 __Pyx_DECREF((PyObject *)__pyx_cur_scope); | |
31925 __Pyx_XGIVEREF(__pyx_r); | |
31926 __Pyx_RefNannyFinishContext(); | |
31927 return __pyx_r; | |
31928 } | |
31929 | |
31930 static PyObject *__pyx_gb_5pysam_7libcvcf_3VCF_40generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ | |
31931 { | |
31932 struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *__pyx_cur_scope = ((struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *)__pyx_generator->closure); | |
31933 PyObject *__pyx_r = NULL; | |
31934 PyObject *__pyx_t_1 = NULL; | |
31935 PyObject *__pyx_t_2 = NULL; | |
31936 PyObject *__pyx_t_3 = NULL; | |
31937 unsigned int __pyx_t_4; | |
31938 int __pyx_t_5; | |
31939 Py_ssize_t __pyx_t_6; | |
31940 PyObject *__pyx_t_7 = NULL; | |
31941 PyObject *__pyx_t_8 = NULL; | |
31942 PyObject *(*__pyx_t_9)(PyObject *); | |
31943 int __pyx_t_10; | |
31944 PyObject *__pyx_t_11 = NULL; | |
31945 int __pyx_lineno = 0; | |
31946 const char *__pyx_filename = NULL; | |
31947 int __pyx_clineno = 0; | |
31948 __Pyx_RefNannyDeclarations | |
31949 __Pyx_RefNannySetupContext("_parse", 0); | |
31950 switch (__pyx_generator->resume_label) { | |
31951 case 0: goto __pyx_L3_first_run; | |
31952 case 1: goto __pyx_L7_resume_from_yield; | |
31953 case 2: goto __pyx_L14_resume_from_yield; | |
31954 default: /* CPython raises the right error here */ | |
31955 __Pyx_RefNannyFinishContext(); | |
31956 return NULL; | |
31957 } | |
31958 __pyx_L3_first_run:; | |
31959 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 929, __pyx_L1_error) | |
31960 | |
31961 /* "pysam/libcvcf.pyx":931 | |
31962 * def _parse(self, line, stream): | |
31963 * # deal with files with header only | |
31964 * if line.startswith("##"): return # <<<<<<<<<<<<<< | |
31965 * if len(line.strip()) > 0: | |
31966 * d = self.parse_data( line.strip() ) | |
31967 */ | |
31968 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error) | |
31969 __Pyx_GOTREF(__pyx_t_2); | |
31970 __pyx_t_3 = NULL; | |
31971 __pyx_t_4 = 0; | |
31972 #if CYTHON_UNPACK_METHODS | |
31973 if (likely(PyMethod_Check(__pyx_t_2))) { | |
31974 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
31975 if (likely(__pyx_t_3)) { | |
31976 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
31977 __Pyx_INCREF(__pyx_t_3); | |
31978 __Pyx_INCREF(function); | |
31979 __Pyx_DECREF_SET(__pyx_t_2, function); | |
31980 __pyx_t_4 = 1; | |
31981 } | |
31982 } | |
31983 #endif | |
31984 { | |
31985 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u__23}; | |
31986 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
31987 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
31988 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error) | |
31989 __Pyx_GOTREF(__pyx_t_1); | |
31990 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
31991 } | |
31992 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 931, __pyx_L1_error) | |
31993 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
31994 if (__pyx_t_5) { | |
31995 __Pyx_XDECREF(__pyx_r); | |
31996 __pyx_r = NULL; | |
31997 goto __pyx_L0; | |
31998 } | |
31999 | |
32000 /* "pysam/libcvcf.pyx":932 | |
32001 * # deal with files with header only | |
32002 * if line.startswith("##"): return | |
32003 * if len(line.strip()) > 0: # <<<<<<<<<<<<<< | |
32004 * d = self.parse_data( line.strip() ) | |
32005 * if d: yield d | |
32006 */ | |
32007 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error) | |
32008 __Pyx_GOTREF(__pyx_t_2); | |
32009 __pyx_t_3 = NULL; | |
32010 __pyx_t_4 = 0; | |
32011 #if CYTHON_UNPACK_METHODS | |
32012 if (likely(PyMethod_Check(__pyx_t_2))) { | |
32013 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
32014 if (likely(__pyx_t_3)) { | |
32015 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
32016 __Pyx_INCREF(__pyx_t_3); | |
32017 __Pyx_INCREF(function); | |
32018 __Pyx_DECREF_SET(__pyx_t_2, function); | |
32019 __pyx_t_4 = 1; | |
32020 } | |
32021 } | |
32022 #endif | |
32023 { | |
32024 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
32025 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
32026 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
32027 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) | |
32028 __Pyx_GOTREF(__pyx_t_1); | |
32029 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
32030 } | |
32031 __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 932, __pyx_L1_error) | |
32032 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
32033 __pyx_t_5 = (__pyx_t_6 > 0); | |
32034 if (__pyx_t_5) { | |
32035 | |
32036 /* "pysam/libcvcf.pyx":933 | |
32037 * if line.startswith("##"): return | |
32038 * if len(line.strip()) > 0: | |
32039 * d = self.parse_data( line.strip() ) # <<<<<<<<<<<<<< | |
32040 * if d: yield d | |
32041 * for line in stream: | |
32042 */ | |
32043 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_parse_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error) | |
32044 __Pyx_GOTREF(__pyx_t_2); | |
32045 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 933, __pyx_L1_error) | |
32046 __Pyx_GOTREF(__pyx_t_7); | |
32047 __pyx_t_8 = NULL; | |
32048 __pyx_t_4 = 0; | |
32049 #if CYTHON_UNPACK_METHODS | |
32050 if (likely(PyMethod_Check(__pyx_t_7))) { | |
32051 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); | |
32052 if (likely(__pyx_t_8)) { | |
32053 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); | |
32054 __Pyx_INCREF(__pyx_t_8); | |
32055 __Pyx_INCREF(function); | |
32056 __Pyx_DECREF_SET(__pyx_t_7, function); | |
32057 __pyx_t_4 = 1; | |
32058 } | |
32059 } | |
32060 #endif | |
32061 { | |
32062 PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; | |
32063 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
32064 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
32065 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error) | |
32066 __Pyx_GOTREF(__pyx_t_3); | |
32067 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
32068 } | |
32069 __pyx_t_7 = NULL; | |
32070 __pyx_t_4 = 0; | |
32071 #if CYTHON_UNPACK_METHODS | |
32072 if (likely(PyMethod_Check(__pyx_t_2))) { | |
32073 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); | |
32074 if (likely(__pyx_t_7)) { | |
32075 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
32076 __Pyx_INCREF(__pyx_t_7); | |
32077 __Pyx_INCREF(function); | |
32078 __Pyx_DECREF_SET(__pyx_t_2, function); | |
32079 __pyx_t_4 = 1; | |
32080 } | |
32081 } | |
32082 #endif | |
32083 { | |
32084 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; | |
32085 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
32086 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
32087 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
32088 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) | |
32089 __Pyx_GOTREF(__pyx_t_1); | |
32090 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
32091 } | |
32092 __Pyx_GIVEREF(__pyx_t_1); | |
32093 __pyx_cur_scope->__pyx_v_d = __pyx_t_1; | |
32094 __pyx_t_1 = 0; | |
32095 | |
32096 /* "pysam/libcvcf.pyx":934 | |
32097 * if len(line.strip()) > 0: | |
32098 * d = self.parse_data( line.strip() ) | |
32099 * if d: yield d # <<<<<<<<<<<<<< | |
32100 * for line in stream: | |
32101 * self._lineno += 1 | |
32102 */ | |
32103 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_d); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 934, __pyx_L1_error) | |
32104 if (__pyx_t_5) { | |
32105 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_d); | |
32106 __pyx_r = __pyx_cur_scope->__pyx_v_d; | |
32107 __Pyx_XGIVEREF(__pyx_r); | |
32108 __Pyx_RefNannyFinishContext(); | |
32109 __Pyx_Coroutine_ResetAndClearException(__pyx_generator); | |
32110 /* return from generator, yielding value */ | |
32111 __pyx_generator->resume_label = 1; | |
32112 return __pyx_r; | |
32113 __pyx_L7_resume_from_yield:; | |
32114 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 934, __pyx_L1_error) | |
32115 } | |
32116 | |
32117 /* "pysam/libcvcf.pyx":932 | |
32118 * # deal with files with header only | |
32119 * if line.startswith("##"): return | |
32120 * if len(line.strip()) > 0: # <<<<<<<<<<<<<< | |
32121 * d = self.parse_data( line.strip() ) | |
32122 * if d: yield d | |
32123 */ | |
32124 } | |
32125 | |
32126 /* "pysam/libcvcf.pyx":935 | |
32127 * d = self.parse_data( line.strip() ) | |
32128 * if d: yield d | |
32129 * for line in stream: # <<<<<<<<<<<<<< | |
32130 * self._lineno += 1 | |
32131 * if self._lines and self._lineno > self._lines: raise StopIteration | |
32132 */ | |
32133 if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_stream)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_stream)) { | |
32134 __pyx_t_1 = __pyx_cur_scope->__pyx_v_stream; __Pyx_INCREF(__pyx_t_1); | |
32135 __pyx_t_6 = 0; | |
32136 __pyx_t_9 = NULL; | |
32137 } else { | |
32138 __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_stream); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error) | |
32139 __Pyx_GOTREF(__pyx_t_1); | |
32140 __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 935, __pyx_L1_error) | |
32141 } | |
32142 for (;;) { | |
32143 if (likely(!__pyx_t_9)) { | |
32144 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
32145 { | |
32146 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
32147 #if !CYTHON_ASSUME_SAFE_MACROS | |
32148 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 935, __pyx_L1_error) | |
32149 #endif | |
32150 if (__pyx_t_6 >= __pyx_temp) break; | |
32151 } | |
32152 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
32153 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 935, __pyx_L1_error) | |
32154 #else | |
32155 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error) | |
32156 __Pyx_GOTREF(__pyx_t_2); | |
32157 #endif | |
32158 } else { | |
32159 { | |
32160 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
32161 #if !CYTHON_ASSUME_SAFE_MACROS | |
32162 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 935, __pyx_L1_error) | |
32163 #endif | |
32164 if (__pyx_t_6 >= __pyx_temp) break; | |
32165 } | |
32166 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
32167 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 935, __pyx_L1_error) | |
32168 #else | |
32169 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error) | |
32170 __Pyx_GOTREF(__pyx_t_2); | |
32171 #endif | |
32172 } | |
32173 } else { | |
32174 __pyx_t_2 = __pyx_t_9(__pyx_t_1); | |
32175 if (unlikely(!__pyx_t_2)) { | |
32176 PyObject* exc_type = PyErr_Occurred(); | |
32177 if (exc_type) { | |
32178 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
32179 else __PYX_ERR(0, 935, __pyx_L1_error) | |
32180 } | |
32181 break; | |
32182 } | |
32183 __Pyx_GOTREF(__pyx_t_2); | |
32184 } | |
32185 __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_line); | |
32186 __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_2); | |
32187 __Pyx_GIVEREF(__pyx_t_2); | |
32188 __pyx_t_2 = 0; | |
32189 | |
32190 /* "pysam/libcvcf.pyx":936 | |
32191 * if d: yield d | |
32192 * for line in stream: | |
32193 * self._lineno += 1 # <<<<<<<<<<<<<< | |
32194 * if self._lines and self._lineno > self._lines: raise StopIteration | |
32195 * d = self.parse_data( line.strip() ) | |
32196 */ | |
32197 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lineno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error) | |
32198 __Pyx_GOTREF(__pyx_t_2); | |
32199 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error) | |
32200 __Pyx_GOTREF(__pyx_t_3); | |
32201 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
32202 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lineno, __pyx_t_3) < 0) __PYX_ERR(0, 936, __pyx_L1_error) | |
32203 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
32204 | |
32205 /* "pysam/libcvcf.pyx":937 | |
32206 * for line in stream: | |
32207 * self._lineno += 1 | |
32208 * if self._lines and self._lineno > self._lines: raise StopIteration # <<<<<<<<<<<<<< | |
32209 * d = self.parse_data( line.strip() ) | |
32210 * if d: yield d | |
32211 */ | |
32212 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lines_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) | |
32213 __Pyx_GOTREF(__pyx_t_3); | |
32214 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 937, __pyx_L1_error) | |
32215 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
32216 if (__pyx_t_10) { | |
32217 } else { | |
32218 __pyx_t_5 = __pyx_t_10; | |
32219 goto __pyx_L11_bool_binop_done; | |
32220 } | |
32221 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lineno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) | |
32222 __Pyx_GOTREF(__pyx_t_3); | |
32223 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lines_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error) | |
32224 __Pyx_GOTREF(__pyx_t_2); | |
32225 __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 937, __pyx_L1_error) | |
32226 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
32227 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
32228 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 937, __pyx_L1_error) | |
32229 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
32230 __pyx_t_5 = __pyx_t_10; | |
32231 __pyx_L11_bool_binop_done:; | |
32232 if (unlikely(__pyx_t_5)) { | |
32233 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); | |
32234 __PYX_ERR(0, 937, __pyx_L1_error) | |
32235 } | |
32236 | |
32237 /* "pysam/libcvcf.pyx":938 | |
32238 * self._lineno += 1 | |
32239 * if self._lines and self._lineno > self._lines: raise StopIteration | |
32240 * d = self.parse_data( line.strip() ) # <<<<<<<<<<<<<< | |
32241 * if d: yield d | |
32242 * | |
32243 */ | |
32244 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_parse_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error) | |
32245 __Pyx_GOTREF(__pyx_t_2); | |
32246 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 938, __pyx_L1_error) | |
32247 __Pyx_GOTREF(__pyx_t_8); | |
32248 __pyx_t_11 = NULL; | |
32249 __pyx_t_4 = 0; | |
32250 #if CYTHON_UNPACK_METHODS | |
32251 if (likely(PyMethod_Check(__pyx_t_8))) { | |
32252 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); | |
32253 if (likely(__pyx_t_11)) { | |
32254 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); | |
32255 __Pyx_INCREF(__pyx_t_11); | |
32256 __Pyx_INCREF(function); | |
32257 __Pyx_DECREF_SET(__pyx_t_8, function); | |
32258 __pyx_t_4 = 1; | |
32259 } | |
32260 } | |
32261 #endif | |
32262 { | |
32263 PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; | |
32264 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
32265 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
32266 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error) | |
32267 __Pyx_GOTREF(__pyx_t_3); | |
32268 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
32269 } | |
32270 __pyx_t_8 = NULL; | |
32271 __pyx_t_4 = 0; | |
32272 #if CYTHON_UNPACK_METHODS | |
32273 if (likely(PyMethod_Check(__pyx_t_2))) { | |
32274 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); | |
32275 if (likely(__pyx_t_8)) { | |
32276 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
32277 __Pyx_INCREF(__pyx_t_8); | |
32278 __Pyx_INCREF(function); | |
32279 __Pyx_DECREF_SET(__pyx_t_2, function); | |
32280 __pyx_t_4 = 1; | |
32281 } | |
32282 } | |
32283 #endif | |
32284 { | |
32285 PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; | |
32286 __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
32287 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
32288 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
32289 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error) | |
32290 __Pyx_GOTREF(__pyx_t_7); | |
32291 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
32292 } | |
32293 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_d); | |
32294 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_7); | |
32295 __Pyx_GIVEREF(__pyx_t_7); | |
32296 __pyx_t_7 = 0; | |
32297 | |
32298 /* "pysam/libcvcf.pyx":939 | |
32299 * if self._lines and self._lineno > self._lines: raise StopIteration | |
32300 * d = self.parse_data( line.strip() ) | |
32301 * if d: yield d # <<<<<<<<<<<<<< | |
32302 * | |
32303 * ###################################################################################################### | |
32304 */ | |
32305 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_d); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 939, __pyx_L1_error) | |
32306 if (__pyx_t_5) { | |
32307 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_d); | |
32308 __pyx_r = __pyx_cur_scope->__pyx_v_d; | |
32309 __Pyx_XGIVEREF(__pyx_t_1); | |
32310 __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; | |
32311 __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; | |
32312 __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; | |
32313 __Pyx_XGIVEREF(__pyx_r); | |
32314 __Pyx_RefNannyFinishContext(); | |
32315 __Pyx_Coroutine_ResetAndClearException(__pyx_generator); | |
32316 /* return from generator, yielding value */ | |
32317 __pyx_generator->resume_label = 2; | |
32318 return __pyx_r; | |
32319 __pyx_L14_resume_from_yield:; | |
32320 __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; | |
32321 __pyx_cur_scope->__pyx_t_0 = 0; | |
32322 __Pyx_XGOTREF(__pyx_t_1); | |
32323 __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; | |
32324 __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; | |
32325 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 939, __pyx_L1_error) | |
32326 } | |
32327 | |
32328 /* "pysam/libcvcf.pyx":935 | |
32329 * d = self.parse_data( line.strip() ) | |
32330 * if d: yield d | |
32331 * for line in stream: # <<<<<<<<<<<<<< | |
32332 * self._lineno += 1 | |
32333 * if self._lines and self._lineno > self._lines: raise StopIteration | |
32334 */ | |
32335 } | |
32336 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
32337 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); | |
32338 | |
32339 /* "pysam/libcvcf.pyx":929 | |
32340 * return line | |
32341 * | |
32342 * def _parse(self, line, stream): # <<<<<<<<<<<<<< | |
32343 * # deal with files with header only | |
32344 * if line.startswith("##"): return | |
32345 */ | |
32346 | |
32347 /* function exit code */ | |
32348 PyErr_SetNone(PyExc_StopIteration); | |
32349 goto __pyx_L0; | |
32350 __pyx_L1_error:; | |
32351 __Pyx_Generator_Replace_StopIteration(0); | |
32352 __Pyx_XDECREF(__pyx_t_1); | |
32353 __Pyx_XDECREF(__pyx_t_2); | |
32354 __Pyx_XDECREF(__pyx_t_3); | |
32355 __Pyx_XDECREF(__pyx_t_7); | |
32356 __Pyx_XDECREF(__pyx_t_8); | |
32357 __Pyx_XDECREF(__pyx_t_11); | |
32358 __Pyx_AddTraceback("_parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
32359 __pyx_L0:; | |
32360 __Pyx_XDECREF(__pyx_r); __pyx_r = 0; | |
32361 #if !CYTHON_USE_EXC_INFO_STACK | |
32362 __Pyx_Coroutine_ResetAndClearException(__pyx_generator); | |
32363 #endif | |
32364 __pyx_generator->resume_label = -1; | |
32365 __Pyx_Coroutine_clear((PyObject*)__pyx_generator); | |
32366 __Pyx_RefNannyFinishContext(); | |
32367 return __pyx_r; | |
32368 } | |
32369 | |
32370 /* "pysam/libcvcf.pyx":947 | |
32371 * ###################################################################################################### | |
32372 * | |
32373 * def getsamples(self): # <<<<<<<<<<<<<< | |
32374 * """ List of samples in VCF file """ | |
32375 * return self._samples | |
32376 */ | |
32377 | |
32378 /* Python wrapper */ | |
32379 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_42getsamples(PyObject *__pyx_self, | |
32380 #if CYTHON_METH_FASTCALL | |
32381 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32382 #else | |
32383 PyObject *__pyx_args, PyObject *__pyx_kwds | |
32384 #endif | |
32385 ); /*proto*/ | |
32386 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_41getsamples, "VCF.getsamples(self)\n List of samples in VCF file "); | |
32387 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_42getsamples = {"getsamples", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_42getsamples, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_41getsamples}; | |
32388 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_42getsamples(PyObject *__pyx_self, | |
32389 #if CYTHON_METH_FASTCALL | |
32390 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32391 #else | |
32392 PyObject *__pyx_args, PyObject *__pyx_kwds | |
32393 #endif | |
32394 ) { | |
32395 PyObject *__pyx_v_self = 0; | |
32396 #if !CYTHON_METH_FASTCALL | |
32397 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
32398 #endif | |
32399 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
32400 PyObject* values[1] = {0}; | |
32401 int __pyx_lineno = 0; | |
32402 const char *__pyx_filename = NULL; | |
32403 int __pyx_clineno = 0; | |
32404 PyObject *__pyx_r = 0; | |
32405 __Pyx_RefNannyDeclarations | |
32406 __Pyx_RefNannySetupContext("getsamples (wrapper)", 0); | |
32407 #if !CYTHON_METH_FASTCALL | |
32408 #if CYTHON_ASSUME_SAFE_MACROS | |
32409 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
32410 #else | |
32411 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
32412 #endif | |
32413 #endif | |
32414 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
32415 { | |
32416 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
32417 if (__pyx_kwds) { | |
32418 Py_ssize_t kw_args; | |
32419 switch (__pyx_nargs) { | |
32420 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
32421 CYTHON_FALLTHROUGH; | |
32422 case 0: break; | |
32423 default: goto __pyx_L5_argtuple_error; | |
32424 } | |
32425 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
32426 switch (__pyx_nargs) { | |
32427 case 0: | |
32428 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
32429 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
32430 kw_args--; | |
32431 } | |
32432 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 947, __pyx_L3_error) | |
32433 else goto __pyx_L5_argtuple_error; | |
32434 } | |
32435 if (unlikely(kw_args > 0)) { | |
32436 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
32437 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getsamples") < 0)) __PYX_ERR(0, 947, __pyx_L3_error) | |
32438 } | |
32439 } else if (unlikely(__pyx_nargs != 1)) { | |
32440 goto __pyx_L5_argtuple_error; | |
32441 } else { | |
32442 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
32443 } | |
32444 __pyx_v_self = values[0]; | |
32445 } | |
32446 goto __pyx_L6_skip; | |
32447 __pyx_L5_argtuple_error:; | |
32448 __Pyx_RaiseArgtupleInvalid("getsamples", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 947, __pyx_L3_error) | |
32449 __pyx_L6_skip:; | |
32450 goto __pyx_L4_argument_unpacking_done; | |
32451 __pyx_L3_error:; | |
32452 { | |
32453 Py_ssize_t __pyx_temp; | |
32454 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
32455 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
32456 } | |
32457 } | |
32458 __Pyx_AddTraceback("pysam.libcvcf.VCF.getsamples", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
32459 __Pyx_RefNannyFinishContext(); | |
32460 return NULL; | |
32461 __pyx_L4_argument_unpacking_done:; | |
32462 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_41getsamples(__pyx_self, __pyx_v_self); | |
32463 | |
32464 /* function exit code */ | |
32465 { | |
32466 Py_ssize_t __pyx_temp; | |
32467 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
32468 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
32469 } | |
32470 } | |
32471 __Pyx_RefNannyFinishContext(); | |
32472 return __pyx_r; | |
32473 } | |
32474 | |
32475 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_41getsamples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
32476 PyObject *__pyx_r = NULL; | |
32477 __Pyx_RefNannyDeclarations | |
32478 PyObject *__pyx_t_1 = NULL; | |
32479 int __pyx_lineno = 0; | |
32480 const char *__pyx_filename = NULL; | |
32481 int __pyx_clineno = 0; | |
32482 __Pyx_RefNannySetupContext("getsamples", 1); | |
32483 | |
32484 /* "pysam/libcvcf.pyx":949 | |
32485 * def getsamples(self): | |
32486 * """ List of samples in VCF file """ | |
32487 * return self._samples # <<<<<<<<<<<<<< | |
32488 * | |
32489 * def setsamples(self,samples): | |
32490 */ | |
32491 __Pyx_XDECREF(__pyx_r); | |
32492 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error) | |
32493 __Pyx_GOTREF(__pyx_t_1); | |
32494 __pyx_r = __pyx_t_1; | |
32495 __pyx_t_1 = 0; | |
32496 goto __pyx_L0; | |
32497 | |
32498 /* "pysam/libcvcf.pyx":947 | |
32499 * ###################################################################################################### | |
32500 * | |
32501 * def getsamples(self): # <<<<<<<<<<<<<< | |
32502 * """ List of samples in VCF file """ | |
32503 * return self._samples | |
32504 */ | |
32505 | |
32506 /* function exit code */ | |
32507 __pyx_L1_error:; | |
32508 __Pyx_XDECREF(__pyx_t_1); | |
32509 __Pyx_AddTraceback("pysam.libcvcf.VCF.getsamples", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
32510 __pyx_r = NULL; | |
32511 __pyx_L0:; | |
32512 __Pyx_XGIVEREF(__pyx_r); | |
32513 __Pyx_RefNannyFinishContext(); | |
32514 return __pyx_r; | |
32515 } | |
32516 | |
32517 /* "pysam/libcvcf.pyx":951 | |
32518 * return self._samples | |
32519 * | |
32520 * def setsamples(self,samples): # <<<<<<<<<<<<<< | |
32521 * """ List of samples in VCF file """ | |
32522 * self._samples = samples | |
32523 */ | |
32524 | |
32525 /* Python wrapper */ | |
32526 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_44setsamples(PyObject *__pyx_self, | |
32527 #if CYTHON_METH_FASTCALL | |
32528 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32529 #else | |
32530 PyObject *__pyx_args, PyObject *__pyx_kwds | |
32531 #endif | |
32532 ); /*proto*/ | |
32533 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_43setsamples, "VCF.setsamples(self, samples)\n List of samples in VCF file "); | |
32534 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_44setsamples = {"setsamples", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_44setsamples, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_43setsamples}; | |
32535 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_44setsamples(PyObject *__pyx_self, | |
32536 #if CYTHON_METH_FASTCALL | |
32537 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32538 #else | |
32539 PyObject *__pyx_args, PyObject *__pyx_kwds | |
32540 #endif | |
32541 ) { | |
32542 PyObject *__pyx_v_self = 0; | |
32543 PyObject *__pyx_v_samples = 0; | |
32544 #if !CYTHON_METH_FASTCALL | |
32545 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
32546 #endif | |
32547 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
32548 PyObject* values[2] = {0,0}; | |
32549 int __pyx_lineno = 0; | |
32550 const char *__pyx_filename = NULL; | |
32551 int __pyx_clineno = 0; | |
32552 PyObject *__pyx_r = 0; | |
32553 __Pyx_RefNannyDeclarations | |
32554 __Pyx_RefNannySetupContext("setsamples (wrapper)", 0); | |
32555 #if !CYTHON_METH_FASTCALL | |
32556 #if CYTHON_ASSUME_SAFE_MACROS | |
32557 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
32558 #else | |
32559 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
32560 #endif | |
32561 #endif | |
32562 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
32563 { | |
32564 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_samples_3,0}; | |
32565 if (__pyx_kwds) { | |
32566 Py_ssize_t kw_args; | |
32567 switch (__pyx_nargs) { | |
32568 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
32569 CYTHON_FALLTHROUGH; | |
32570 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
32571 CYTHON_FALLTHROUGH; | |
32572 case 0: break; | |
32573 default: goto __pyx_L5_argtuple_error; | |
32574 } | |
32575 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
32576 switch (__pyx_nargs) { | |
32577 case 0: | |
32578 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
32579 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
32580 kw_args--; | |
32581 } | |
32582 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 951, __pyx_L3_error) | |
32583 else goto __pyx_L5_argtuple_error; | |
32584 CYTHON_FALLTHROUGH; | |
32585 case 1: | |
32586 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_samples_3)) != 0)) { | |
32587 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
32588 kw_args--; | |
32589 } | |
32590 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 951, __pyx_L3_error) | |
32591 else { | |
32592 __Pyx_RaiseArgtupleInvalid("setsamples", 1, 2, 2, 1); __PYX_ERR(0, 951, __pyx_L3_error) | |
32593 } | |
32594 } | |
32595 if (unlikely(kw_args > 0)) { | |
32596 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
32597 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setsamples") < 0)) __PYX_ERR(0, 951, __pyx_L3_error) | |
32598 } | |
32599 } else if (unlikely(__pyx_nargs != 2)) { | |
32600 goto __pyx_L5_argtuple_error; | |
32601 } else { | |
32602 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
32603 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
32604 } | |
32605 __pyx_v_self = values[0]; | |
32606 __pyx_v_samples = values[1]; | |
32607 } | |
32608 goto __pyx_L6_skip; | |
32609 __pyx_L5_argtuple_error:; | |
32610 __Pyx_RaiseArgtupleInvalid("setsamples", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 951, __pyx_L3_error) | |
32611 __pyx_L6_skip:; | |
32612 goto __pyx_L4_argument_unpacking_done; | |
32613 __pyx_L3_error:; | |
32614 { | |
32615 Py_ssize_t __pyx_temp; | |
32616 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
32617 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
32618 } | |
32619 } | |
32620 __Pyx_AddTraceback("pysam.libcvcf.VCF.setsamples", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
32621 __Pyx_RefNannyFinishContext(); | |
32622 return NULL; | |
32623 __pyx_L4_argument_unpacking_done:; | |
32624 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_43setsamples(__pyx_self, __pyx_v_self, __pyx_v_samples); | |
32625 | |
32626 /* function exit code */ | |
32627 { | |
32628 Py_ssize_t __pyx_temp; | |
32629 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
32630 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
32631 } | |
32632 } | |
32633 __Pyx_RefNannyFinishContext(); | |
32634 return __pyx_r; | |
32635 } | |
32636 | |
32637 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_43setsamples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_samples) { | |
32638 PyObject *__pyx_r = NULL; | |
32639 __Pyx_RefNannyDeclarations | |
32640 int __pyx_lineno = 0; | |
32641 const char *__pyx_filename = NULL; | |
32642 int __pyx_clineno = 0; | |
32643 __Pyx_RefNannySetupContext("setsamples", 1); | |
32644 | |
32645 /* "pysam/libcvcf.pyx":953 | |
32646 * def setsamples(self,samples): | |
32647 * """ List of samples in VCF file """ | |
32648 * self._samples = samples # <<<<<<<<<<<<<< | |
32649 * | |
32650 * def getheader(self): | |
32651 */ | |
32652 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_samples, __pyx_v_samples) < 0) __PYX_ERR(0, 953, __pyx_L1_error) | |
32653 | |
32654 /* "pysam/libcvcf.pyx":951 | |
32655 * return self._samples | |
32656 * | |
32657 * def setsamples(self,samples): # <<<<<<<<<<<<<< | |
32658 * """ List of samples in VCF file """ | |
32659 * self._samples = samples | |
32660 */ | |
32661 | |
32662 /* function exit code */ | |
32663 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
32664 goto __pyx_L0; | |
32665 __pyx_L1_error:; | |
32666 __Pyx_AddTraceback("pysam.libcvcf.VCF.setsamples", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
32667 __pyx_r = NULL; | |
32668 __pyx_L0:; | |
32669 __Pyx_XGIVEREF(__pyx_r); | |
32670 __Pyx_RefNannyFinishContext(); | |
32671 return __pyx_r; | |
32672 } | |
32673 | |
32674 /* "pysam/libcvcf.pyx":955 | |
32675 * self._samples = samples | |
32676 * | |
32677 * def getheader(self): # <<<<<<<<<<<<<< | |
32678 * """ List of header key-value pairs (strings) """ | |
32679 * return self._header | |
32680 */ | |
32681 | |
32682 /* Python wrapper */ | |
32683 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_46getheader(PyObject *__pyx_self, | |
32684 #if CYTHON_METH_FASTCALL | |
32685 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32686 #else | |
32687 PyObject *__pyx_args, PyObject *__pyx_kwds | |
32688 #endif | |
32689 ); /*proto*/ | |
32690 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_45getheader, "VCF.getheader(self)\n List of header key-value pairs (strings) "); | |
32691 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_46getheader = {"getheader", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_46getheader, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_45getheader}; | |
32692 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_46getheader(PyObject *__pyx_self, | |
32693 #if CYTHON_METH_FASTCALL | |
32694 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32695 #else | |
32696 PyObject *__pyx_args, PyObject *__pyx_kwds | |
32697 #endif | |
32698 ) { | |
32699 PyObject *__pyx_v_self = 0; | |
32700 #if !CYTHON_METH_FASTCALL | |
32701 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
32702 #endif | |
32703 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
32704 PyObject* values[1] = {0}; | |
32705 int __pyx_lineno = 0; | |
32706 const char *__pyx_filename = NULL; | |
32707 int __pyx_clineno = 0; | |
32708 PyObject *__pyx_r = 0; | |
32709 __Pyx_RefNannyDeclarations | |
32710 __Pyx_RefNannySetupContext("getheader (wrapper)", 0); | |
32711 #if !CYTHON_METH_FASTCALL | |
32712 #if CYTHON_ASSUME_SAFE_MACROS | |
32713 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
32714 #else | |
32715 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
32716 #endif | |
32717 #endif | |
32718 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
32719 { | |
32720 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
32721 if (__pyx_kwds) { | |
32722 Py_ssize_t kw_args; | |
32723 switch (__pyx_nargs) { | |
32724 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
32725 CYTHON_FALLTHROUGH; | |
32726 case 0: break; | |
32727 default: goto __pyx_L5_argtuple_error; | |
32728 } | |
32729 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
32730 switch (__pyx_nargs) { | |
32731 case 0: | |
32732 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
32733 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
32734 kw_args--; | |
32735 } | |
32736 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L3_error) | |
32737 else goto __pyx_L5_argtuple_error; | |
32738 } | |
32739 if (unlikely(kw_args > 0)) { | |
32740 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
32741 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getheader") < 0)) __PYX_ERR(0, 955, __pyx_L3_error) | |
32742 } | |
32743 } else if (unlikely(__pyx_nargs != 1)) { | |
32744 goto __pyx_L5_argtuple_error; | |
32745 } else { | |
32746 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
32747 } | |
32748 __pyx_v_self = values[0]; | |
32749 } | |
32750 goto __pyx_L6_skip; | |
32751 __pyx_L5_argtuple_error:; | |
32752 __Pyx_RaiseArgtupleInvalid("getheader", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 955, __pyx_L3_error) | |
32753 __pyx_L6_skip:; | |
32754 goto __pyx_L4_argument_unpacking_done; | |
32755 __pyx_L3_error:; | |
32756 { | |
32757 Py_ssize_t __pyx_temp; | |
32758 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
32759 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
32760 } | |
32761 } | |
32762 __Pyx_AddTraceback("pysam.libcvcf.VCF.getheader", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
32763 __Pyx_RefNannyFinishContext(); | |
32764 return NULL; | |
32765 __pyx_L4_argument_unpacking_done:; | |
32766 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_45getheader(__pyx_self, __pyx_v_self); | |
32767 | |
32768 /* function exit code */ | |
32769 { | |
32770 Py_ssize_t __pyx_temp; | |
32771 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
32772 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
32773 } | |
32774 } | |
32775 __Pyx_RefNannyFinishContext(); | |
32776 return __pyx_r; | |
32777 } | |
32778 | |
32779 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_45getheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
32780 PyObject *__pyx_r = NULL; | |
32781 __Pyx_RefNannyDeclarations | |
32782 PyObject *__pyx_t_1 = NULL; | |
32783 int __pyx_lineno = 0; | |
32784 const char *__pyx_filename = NULL; | |
32785 int __pyx_clineno = 0; | |
32786 __Pyx_RefNannySetupContext("getheader", 1); | |
32787 | |
32788 /* "pysam/libcvcf.pyx":957 | |
32789 * def getheader(self): | |
32790 * """ List of header key-value pairs (strings) """ | |
32791 * return self._header # <<<<<<<<<<<<<< | |
32792 * | |
32793 * def setheader(self,header): | |
32794 */ | |
32795 __Pyx_XDECREF(__pyx_r); | |
32796 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error) | |
32797 __Pyx_GOTREF(__pyx_t_1); | |
32798 __pyx_r = __pyx_t_1; | |
32799 __pyx_t_1 = 0; | |
32800 goto __pyx_L0; | |
32801 | |
32802 /* "pysam/libcvcf.pyx":955 | |
32803 * self._samples = samples | |
32804 * | |
32805 * def getheader(self): # <<<<<<<<<<<<<< | |
32806 * """ List of header key-value pairs (strings) """ | |
32807 * return self._header | |
32808 */ | |
32809 | |
32810 /* function exit code */ | |
32811 __pyx_L1_error:; | |
32812 __Pyx_XDECREF(__pyx_t_1); | |
32813 __Pyx_AddTraceback("pysam.libcvcf.VCF.getheader", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
32814 __pyx_r = NULL; | |
32815 __pyx_L0:; | |
32816 __Pyx_XGIVEREF(__pyx_r); | |
32817 __Pyx_RefNannyFinishContext(); | |
32818 return __pyx_r; | |
32819 } | |
32820 | |
32821 /* "pysam/libcvcf.pyx":959 | |
32822 * return self._header | |
32823 * | |
32824 * def setheader(self,header): # <<<<<<<<<<<<<< | |
32825 * """ List of header key-value pairs (strings) """ | |
32826 * self._header = header | |
32827 */ | |
32828 | |
32829 /* Python wrapper */ | |
32830 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_48setheader(PyObject *__pyx_self, | |
32831 #if CYTHON_METH_FASTCALL | |
32832 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32833 #else | |
32834 PyObject *__pyx_args, PyObject *__pyx_kwds | |
32835 #endif | |
32836 ); /*proto*/ | |
32837 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_47setheader, "VCF.setheader(self, header)\n List of header key-value pairs (strings) "); | |
32838 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_48setheader = {"setheader", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_48setheader, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_47setheader}; | |
32839 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_48setheader(PyObject *__pyx_self, | |
32840 #if CYTHON_METH_FASTCALL | |
32841 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32842 #else | |
32843 PyObject *__pyx_args, PyObject *__pyx_kwds | |
32844 #endif | |
32845 ) { | |
32846 PyObject *__pyx_v_self = 0; | |
32847 PyObject *__pyx_v_header = 0; | |
32848 #if !CYTHON_METH_FASTCALL | |
32849 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
32850 #endif | |
32851 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
32852 PyObject* values[2] = {0,0}; | |
32853 int __pyx_lineno = 0; | |
32854 const char *__pyx_filename = NULL; | |
32855 int __pyx_clineno = 0; | |
32856 PyObject *__pyx_r = 0; | |
32857 __Pyx_RefNannyDeclarations | |
32858 __Pyx_RefNannySetupContext("setheader (wrapper)", 0); | |
32859 #if !CYTHON_METH_FASTCALL | |
32860 #if CYTHON_ASSUME_SAFE_MACROS | |
32861 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
32862 #else | |
32863 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
32864 #endif | |
32865 #endif | |
32866 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
32867 { | |
32868 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_header_2,0}; | |
32869 if (__pyx_kwds) { | |
32870 Py_ssize_t kw_args; | |
32871 switch (__pyx_nargs) { | |
32872 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
32873 CYTHON_FALLTHROUGH; | |
32874 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
32875 CYTHON_FALLTHROUGH; | |
32876 case 0: break; | |
32877 default: goto __pyx_L5_argtuple_error; | |
32878 } | |
32879 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
32880 switch (__pyx_nargs) { | |
32881 case 0: | |
32882 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
32883 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
32884 kw_args--; | |
32885 } | |
32886 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L3_error) | |
32887 else goto __pyx_L5_argtuple_error; | |
32888 CYTHON_FALLTHROUGH; | |
32889 case 1: | |
32890 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_2)) != 0)) { | |
32891 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
32892 kw_args--; | |
32893 } | |
32894 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L3_error) | |
32895 else { | |
32896 __Pyx_RaiseArgtupleInvalid("setheader", 1, 2, 2, 1); __PYX_ERR(0, 959, __pyx_L3_error) | |
32897 } | |
32898 } | |
32899 if (unlikely(kw_args > 0)) { | |
32900 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
32901 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setheader") < 0)) __PYX_ERR(0, 959, __pyx_L3_error) | |
32902 } | |
32903 } else if (unlikely(__pyx_nargs != 2)) { | |
32904 goto __pyx_L5_argtuple_error; | |
32905 } else { | |
32906 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
32907 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
32908 } | |
32909 __pyx_v_self = values[0]; | |
32910 __pyx_v_header = values[1]; | |
32911 } | |
32912 goto __pyx_L6_skip; | |
32913 __pyx_L5_argtuple_error:; | |
32914 __Pyx_RaiseArgtupleInvalid("setheader", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 959, __pyx_L3_error) | |
32915 __pyx_L6_skip:; | |
32916 goto __pyx_L4_argument_unpacking_done; | |
32917 __pyx_L3_error:; | |
32918 { | |
32919 Py_ssize_t __pyx_temp; | |
32920 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
32921 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
32922 } | |
32923 } | |
32924 __Pyx_AddTraceback("pysam.libcvcf.VCF.setheader", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
32925 __Pyx_RefNannyFinishContext(); | |
32926 return NULL; | |
32927 __pyx_L4_argument_unpacking_done:; | |
32928 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_47setheader(__pyx_self, __pyx_v_self, __pyx_v_header); | |
32929 | |
32930 /* function exit code */ | |
32931 { | |
32932 Py_ssize_t __pyx_temp; | |
32933 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
32934 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
32935 } | |
32936 } | |
32937 __Pyx_RefNannyFinishContext(); | |
32938 return __pyx_r; | |
32939 } | |
32940 | |
32941 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_47setheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_header) { | |
32942 PyObject *__pyx_r = NULL; | |
32943 __Pyx_RefNannyDeclarations | |
32944 int __pyx_lineno = 0; | |
32945 const char *__pyx_filename = NULL; | |
32946 int __pyx_clineno = 0; | |
32947 __Pyx_RefNannySetupContext("setheader", 1); | |
32948 | |
32949 /* "pysam/libcvcf.pyx":961 | |
32950 * def setheader(self,header): | |
32951 * """ List of header key-value pairs (strings) """ | |
32952 * self._header = header # <<<<<<<<<<<<<< | |
32953 * | |
32954 * def getinfo(self): | |
32955 */ | |
32956 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header, __pyx_v_header) < 0) __PYX_ERR(0, 961, __pyx_L1_error) | |
32957 | |
32958 /* "pysam/libcvcf.pyx":959 | |
32959 * return self._header | |
32960 * | |
32961 * def setheader(self,header): # <<<<<<<<<<<<<< | |
32962 * """ List of header key-value pairs (strings) """ | |
32963 * self._header = header | |
32964 */ | |
32965 | |
32966 /* function exit code */ | |
32967 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
32968 goto __pyx_L0; | |
32969 __pyx_L1_error:; | |
32970 __Pyx_AddTraceback("pysam.libcvcf.VCF.setheader", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
32971 __pyx_r = NULL; | |
32972 __pyx_L0:; | |
32973 __Pyx_XGIVEREF(__pyx_r); | |
32974 __Pyx_RefNannyFinishContext(); | |
32975 return __pyx_r; | |
32976 } | |
32977 | |
32978 /* "pysam/libcvcf.pyx":963 | |
32979 * self._header = header | |
32980 * | |
32981 * def getinfo(self): # <<<<<<<<<<<<<< | |
32982 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
32983 * return self._info | |
32984 */ | |
32985 | |
32986 /* Python wrapper */ | |
32987 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_50getinfo(PyObject *__pyx_self, | |
32988 #if CYTHON_METH_FASTCALL | |
32989 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32990 #else | |
32991 PyObject *__pyx_args, PyObject *__pyx_kwds | |
32992 #endif | |
32993 ); /*proto*/ | |
32994 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_49getinfo, "VCF.getinfo(self)\n Dictionary of ##INFO tags, as VCF.FORMAT values "); | |
32995 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_50getinfo = {"getinfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_50getinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_49getinfo}; | |
32996 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_50getinfo(PyObject *__pyx_self, | |
32997 #if CYTHON_METH_FASTCALL | |
32998 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
32999 #else | |
33000 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33001 #endif | |
33002 ) { | |
33003 PyObject *__pyx_v_self = 0; | |
33004 #if !CYTHON_METH_FASTCALL | |
33005 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
33006 #endif | |
33007 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
33008 PyObject* values[1] = {0}; | |
33009 int __pyx_lineno = 0; | |
33010 const char *__pyx_filename = NULL; | |
33011 int __pyx_clineno = 0; | |
33012 PyObject *__pyx_r = 0; | |
33013 __Pyx_RefNannyDeclarations | |
33014 __Pyx_RefNannySetupContext("getinfo (wrapper)", 0); | |
33015 #if !CYTHON_METH_FASTCALL | |
33016 #if CYTHON_ASSUME_SAFE_MACROS | |
33017 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
33018 #else | |
33019 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
33020 #endif | |
33021 #endif | |
33022 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
33023 { | |
33024 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
33025 if (__pyx_kwds) { | |
33026 Py_ssize_t kw_args; | |
33027 switch (__pyx_nargs) { | |
33028 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33029 CYTHON_FALLTHROUGH; | |
33030 case 0: break; | |
33031 default: goto __pyx_L5_argtuple_error; | |
33032 } | |
33033 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
33034 switch (__pyx_nargs) { | |
33035 case 0: | |
33036 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
33037 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
33038 kw_args--; | |
33039 } | |
33040 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L3_error) | |
33041 else goto __pyx_L5_argtuple_error; | |
33042 } | |
33043 if (unlikely(kw_args > 0)) { | |
33044 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
33045 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getinfo") < 0)) __PYX_ERR(0, 963, __pyx_L3_error) | |
33046 } | |
33047 } else if (unlikely(__pyx_nargs != 1)) { | |
33048 goto __pyx_L5_argtuple_error; | |
33049 } else { | |
33050 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33051 } | |
33052 __pyx_v_self = values[0]; | |
33053 } | |
33054 goto __pyx_L6_skip; | |
33055 __pyx_L5_argtuple_error:; | |
33056 __Pyx_RaiseArgtupleInvalid("getinfo", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 963, __pyx_L3_error) | |
33057 __pyx_L6_skip:; | |
33058 goto __pyx_L4_argument_unpacking_done; | |
33059 __pyx_L3_error:; | |
33060 { | |
33061 Py_ssize_t __pyx_temp; | |
33062 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33063 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33064 } | |
33065 } | |
33066 __Pyx_AddTraceback("pysam.libcvcf.VCF.getinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33067 __Pyx_RefNannyFinishContext(); | |
33068 return NULL; | |
33069 __pyx_L4_argument_unpacking_done:; | |
33070 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_49getinfo(__pyx_self, __pyx_v_self); | |
33071 | |
33072 /* function exit code */ | |
33073 { | |
33074 Py_ssize_t __pyx_temp; | |
33075 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33076 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33077 } | |
33078 } | |
33079 __Pyx_RefNannyFinishContext(); | |
33080 return __pyx_r; | |
33081 } | |
33082 | |
33083 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_49getinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
33084 PyObject *__pyx_r = NULL; | |
33085 __Pyx_RefNannyDeclarations | |
33086 PyObject *__pyx_t_1 = NULL; | |
33087 int __pyx_lineno = 0; | |
33088 const char *__pyx_filename = NULL; | |
33089 int __pyx_clineno = 0; | |
33090 __Pyx_RefNannySetupContext("getinfo", 1); | |
33091 | |
33092 /* "pysam/libcvcf.pyx":965 | |
33093 * def getinfo(self): | |
33094 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
33095 * return self._info # <<<<<<<<<<<<<< | |
33096 * | |
33097 * def setinfo(self,info): | |
33098 */ | |
33099 __Pyx_XDECREF(__pyx_r); | |
33100 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error) | |
33101 __Pyx_GOTREF(__pyx_t_1); | |
33102 __pyx_r = __pyx_t_1; | |
33103 __pyx_t_1 = 0; | |
33104 goto __pyx_L0; | |
33105 | |
33106 /* "pysam/libcvcf.pyx":963 | |
33107 * self._header = header | |
33108 * | |
33109 * def getinfo(self): # <<<<<<<<<<<<<< | |
33110 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
33111 * return self._info | |
33112 */ | |
33113 | |
33114 /* function exit code */ | |
33115 __pyx_L1_error:; | |
33116 __Pyx_XDECREF(__pyx_t_1); | |
33117 __Pyx_AddTraceback("pysam.libcvcf.VCF.getinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33118 __pyx_r = NULL; | |
33119 __pyx_L0:; | |
33120 __Pyx_XGIVEREF(__pyx_r); | |
33121 __Pyx_RefNannyFinishContext(); | |
33122 return __pyx_r; | |
33123 } | |
33124 | |
33125 /* "pysam/libcvcf.pyx":967 | |
33126 * return self._info | |
33127 * | |
33128 * def setinfo(self,info): # <<<<<<<<<<<<<< | |
33129 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
33130 * self._info = info | |
33131 */ | |
33132 | |
33133 /* Python wrapper */ | |
33134 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_52setinfo(PyObject *__pyx_self, | |
33135 #if CYTHON_METH_FASTCALL | |
33136 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33137 #else | |
33138 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33139 #endif | |
33140 ); /*proto*/ | |
33141 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_51setinfo, "VCF.setinfo(self, info)\n Dictionary of ##INFO tags, as VCF.FORMAT values "); | |
33142 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_52setinfo = {"setinfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_52setinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_51setinfo}; | |
33143 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_52setinfo(PyObject *__pyx_self, | |
33144 #if CYTHON_METH_FASTCALL | |
33145 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33146 #else | |
33147 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33148 #endif | |
33149 ) { | |
33150 PyObject *__pyx_v_self = 0; | |
33151 PyObject *__pyx_v_info = 0; | |
33152 #if !CYTHON_METH_FASTCALL | |
33153 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
33154 #endif | |
33155 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
33156 PyObject* values[2] = {0,0}; | |
33157 int __pyx_lineno = 0; | |
33158 const char *__pyx_filename = NULL; | |
33159 int __pyx_clineno = 0; | |
33160 PyObject *__pyx_r = 0; | |
33161 __Pyx_RefNannyDeclarations | |
33162 __Pyx_RefNannySetupContext("setinfo (wrapper)", 0); | |
33163 #if !CYTHON_METH_FASTCALL | |
33164 #if CYTHON_ASSUME_SAFE_MACROS | |
33165 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
33166 #else | |
33167 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
33168 #endif | |
33169 #endif | |
33170 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
33171 { | |
33172 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_info_2,0}; | |
33173 if (__pyx_kwds) { | |
33174 Py_ssize_t kw_args; | |
33175 switch (__pyx_nargs) { | |
33176 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
33177 CYTHON_FALLTHROUGH; | |
33178 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33179 CYTHON_FALLTHROUGH; | |
33180 case 0: break; | |
33181 default: goto __pyx_L5_argtuple_error; | |
33182 } | |
33183 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
33184 switch (__pyx_nargs) { | |
33185 case 0: | |
33186 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
33187 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
33188 kw_args--; | |
33189 } | |
33190 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 967, __pyx_L3_error) | |
33191 else goto __pyx_L5_argtuple_error; | |
33192 CYTHON_FALLTHROUGH; | |
33193 case 1: | |
33194 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_info_2)) != 0)) { | |
33195 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
33196 kw_args--; | |
33197 } | |
33198 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 967, __pyx_L3_error) | |
33199 else { | |
33200 __Pyx_RaiseArgtupleInvalid("setinfo", 1, 2, 2, 1); __PYX_ERR(0, 967, __pyx_L3_error) | |
33201 } | |
33202 } | |
33203 if (unlikely(kw_args > 0)) { | |
33204 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
33205 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setinfo") < 0)) __PYX_ERR(0, 967, __pyx_L3_error) | |
33206 } | |
33207 } else if (unlikely(__pyx_nargs != 2)) { | |
33208 goto __pyx_L5_argtuple_error; | |
33209 } else { | |
33210 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33211 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
33212 } | |
33213 __pyx_v_self = values[0]; | |
33214 __pyx_v_info = values[1]; | |
33215 } | |
33216 goto __pyx_L6_skip; | |
33217 __pyx_L5_argtuple_error:; | |
33218 __Pyx_RaiseArgtupleInvalid("setinfo", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 967, __pyx_L3_error) | |
33219 __pyx_L6_skip:; | |
33220 goto __pyx_L4_argument_unpacking_done; | |
33221 __pyx_L3_error:; | |
33222 { | |
33223 Py_ssize_t __pyx_temp; | |
33224 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33225 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33226 } | |
33227 } | |
33228 __Pyx_AddTraceback("pysam.libcvcf.VCF.setinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33229 __Pyx_RefNannyFinishContext(); | |
33230 return NULL; | |
33231 __pyx_L4_argument_unpacking_done:; | |
33232 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_51setinfo(__pyx_self, __pyx_v_self, __pyx_v_info); | |
33233 | |
33234 /* function exit code */ | |
33235 { | |
33236 Py_ssize_t __pyx_temp; | |
33237 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33238 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33239 } | |
33240 } | |
33241 __Pyx_RefNannyFinishContext(); | |
33242 return __pyx_r; | |
33243 } | |
33244 | |
33245 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_51setinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_info) { | |
33246 PyObject *__pyx_r = NULL; | |
33247 __Pyx_RefNannyDeclarations | |
33248 int __pyx_lineno = 0; | |
33249 const char *__pyx_filename = NULL; | |
33250 int __pyx_clineno = 0; | |
33251 __Pyx_RefNannySetupContext("setinfo", 1); | |
33252 | |
33253 /* "pysam/libcvcf.pyx":969 | |
33254 * def setinfo(self,info): | |
33255 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
33256 * self._info = info # <<<<<<<<<<<<<< | |
33257 * | |
33258 * def getformat(self): | |
33259 */ | |
33260 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_info, __pyx_v_info) < 0) __PYX_ERR(0, 969, __pyx_L1_error) | |
33261 | |
33262 /* "pysam/libcvcf.pyx":967 | |
33263 * return self._info | |
33264 * | |
33265 * def setinfo(self,info): # <<<<<<<<<<<<<< | |
33266 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
33267 * self._info = info | |
33268 */ | |
33269 | |
33270 /* function exit code */ | |
33271 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
33272 goto __pyx_L0; | |
33273 __pyx_L1_error:; | |
33274 __Pyx_AddTraceback("pysam.libcvcf.VCF.setinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33275 __pyx_r = NULL; | |
33276 __pyx_L0:; | |
33277 __Pyx_XGIVEREF(__pyx_r); | |
33278 __Pyx_RefNannyFinishContext(); | |
33279 return __pyx_r; | |
33280 } | |
33281 | |
33282 /* "pysam/libcvcf.pyx":971 | |
33283 * self._info = info | |
33284 * | |
33285 * def getformat(self): # <<<<<<<<<<<<<< | |
33286 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
33287 * return self._format | |
33288 */ | |
33289 | |
33290 /* Python wrapper */ | |
33291 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_54getformat(PyObject *__pyx_self, | |
33292 #if CYTHON_METH_FASTCALL | |
33293 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33294 #else | |
33295 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33296 #endif | |
33297 ); /*proto*/ | |
33298 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_53getformat, "VCF.getformat(self)\n Dictionary of ##FORMAT tags, as VCF.FORMAT values "); | |
33299 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_54getformat = {"getformat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_54getformat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_53getformat}; | |
33300 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_54getformat(PyObject *__pyx_self, | |
33301 #if CYTHON_METH_FASTCALL | |
33302 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33303 #else | |
33304 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33305 #endif | |
33306 ) { | |
33307 PyObject *__pyx_v_self = 0; | |
33308 #if !CYTHON_METH_FASTCALL | |
33309 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
33310 #endif | |
33311 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
33312 PyObject* values[1] = {0}; | |
33313 int __pyx_lineno = 0; | |
33314 const char *__pyx_filename = NULL; | |
33315 int __pyx_clineno = 0; | |
33316 PyObject *__pyx_r = 0; | |
33317 __Pyx_RefNannyDeclarations | |
33318 __Pyx_RefNannySetupContext("getformat (wrapper)", 0); | |
33319 #if !CYTHON_METH_FASTCALL | |
33320 #if CYTHON_ASSUME_SAFE_MACROS | |
33321 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
33322 #else | |
33323 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
33324 #endif | |
33325 #endif | |
33326 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
33327 { | |
33328 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
33329 if (__pyx_kwds) { | |
33330 Py_ssize_t kw_args; | |
33331 switch (__pyx_nargs) { | |
33332 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33333 CYTHON_FALLTHROUGH; | |
33334 case 0: break; | |
33335 default: goto __pyx_L5_argtuple_error; | |
33336 } | |
33337 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
33338 switch (__pyx_nargs) { | |
33339 case 0: | |
33340 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
33341 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
33342 kw_args--; | |
33343 } | |
33344 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 971, __pyx_L3_error) | |
33345 else goto __pyx_L5_argtuple_error; | |
33346 } | |
33347 if (unlikely(kw_args > 0)) { | |
33348 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
33349 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getformat") < 0)) __PYX_ERR(0, 971, __pyx_L3_error) | |
33350 } | |
33351 } else if (unlikely(__pyx_nargs != 1)) { | |
33352 goto __pyx_L5_argtuple_error; | |
33353 } else { | |
33354 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33355 } | |
33356 __pyx_v_self = values[0]; | |
33357 } | |
33358 goto __pyx_L6_skip; | |
33359 __pyx_L5_argtuple_error:; | |
33360 __Pyx_RaiseArgtupleInvalid("getformat", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 971, __pyx_L3_error) | |
33361 __pyx_L6_skip:; | |
33362 goto __pyx_L4_argument_unpacking_done; | |
33363 __pyx_L3_error:; | |
33364 { | |
33365 Py_ssize_t __pyx_temp; | |
33366 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33367 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33368 } | |
33369 } | |
33370 __Pyx_AddTraceback("pysam.libcvcf.VCF.getformat", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33371 __Pyx_RefNannyFinishContext(); | |
33372 return NULL; | |
33373 __pyx_L4_argument_unpacking_done:; | |
33374 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_53getformat(__pyx_self, __pyx_v_self); | |
33375 | |
33376 /* function exit code */ | |
33377 { | |
33378 Py_ssize_t __pyx_temp; | |
33379 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33380 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33381 } | |
33382 } | |
33383 __Pyx_RefNannyFinishContext(); | |
33384 return __pyx_r; | |
33385 } | |
33386 | |
33387 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_53getformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
33388 PyObject *__pyx_r = NULL; | |
33389 __Pyx_RefNannyDeclarations | |
33390 PyObject *__pyx_t_1 = NULL; | |
33391 int __pyx_lineno = 0; | |
33392 const char *__pyx_filename = NULL; | |
33393 int __pyx_clineno = 0; | |
33394 __Pyx_RefNannySetupContext("getformat", 1); | |
33395 | |
33396 /* "pysam/libcvcf.pyx":973 | |
33397 * def getformat(self): | |
33398 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
33399 * return self._format # <<<<<<<<<<<<<< | |
33400 * | |
33401 * def setformat(self,format): | |
33402 */ | |
33403 __Pyx_XDECREF(__pyx_r); | |
33404 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error) | |
33405 __Pyx_GOTREF(__pyx_t_1); | |
33406 __pyx_r = __pyx_t_1; | |
33407 __pyx_t_1 = 0; | |
33408 goto __pyx_L0; | |
33409 | |
33410 /* "pysam/libcvcf.pyx":971 | |
33411 * self._info = info | |
33412 * | |
33413 * def getformat(self): # <<<<<<<<<<<<<< | |
33414 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
33415 * return self._format | |
33416 */ | |
33417 | |
33418 /* function exit code */ | |
33419 __pyx_L1_error:; | |
33420 __Pyx_XDECREF(__pyx_t_1); | |
33421 __Pyx_AddTraceback("pysam.libcvcf.VCF.getformat", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33422 __pyx_r = NULL; | |
33423 __pyx_L0:; | |
33424 __Pyx_XGIVEREF(__pyx_r); | |
33425 __Pyx_RefNannyFinishContext(); | |
33426 return __pyx_r; | |
33427 } | |
33428 | |
33429 /* "pysam/libcvcf.pyx":975 | |
33430 * return self._format | |
33431 * | |
33432 * def setformat(self,format): # <<<<<<<<<<<<<< | |
33433 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
33434 * self._format = format | |
33435 */ | |
33436 | |
33437 /* Python wrapper */ | |
33438 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_56setformat(PyObject *__pyx_self, | |
33439 #if CYTHON_METH_FASTCALL | |
33440 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33441 #else | |
33442 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33443 #endif | |
33444 ); /*proto*/ | |
33445 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_55setformat, "VCF.setformat(self, format)\n Dictionary of ##FORMAT tags, as VCF.FORMAT values "); | |
33446 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_56setformat = {"setformat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_56setformat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_55setformat}; | |
33447 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_56setformat(PyObject *__pyx_self, | |
33448 #if CYTHON_METH_FASTCALL | |
33449 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33450 #else | |
33451 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33452 #endif | |
33453 ) { | |
33454 PyObject *__pyx_v_self = 0; | |
33455 PyObject *__pyx_v_format = 0; | |
33456 #if !CYTHON_METH_FASTCALL | |
33457 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
33458 #endif | |
33459 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
33460 PyObject* values[2] = {0,0}; | |
33461 int __pyx_lineno = 0; | |
33462 const char *__pyx_filename = NULL; | |
33463 int __pyx_clineno = 0; | |
33464 PyObject *__pyx_r = 0; | |
33465 __Pyx_RefNannyDeclarations | |
33466 __Pyx_RefNannySetupContext("setformat (wrapper)", 0); | |
33467 #if !CYTHON_METH_FASTCALL | |
33468 #if CYTHON_ASSUME_SAFE_MACROS | |
33469 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
33470 #else | |
33471 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
33472 #endif | |
33473 #endif | |
33474 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
33475 { | |
33476 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_format,0}; | |
33477 if (__pyx_kwds) { | |
33478 Py_ssize_t kw_args; | |
33479 switch (__pyx_nargs) { | |
33480 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
33481 CYTHON_FALLTHROUGH; | |
33482 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33483 CYTHON_FALLTHROUGH; | |
33484 case 0: break; | |
33485 default: goto __pyx_L5_argtuple_error; | |
33486 } | |
33487 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
33488 switch (__pyx_nargs) { | |
33489 case 0: | |
33490 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
33491 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
33492 kw_args--; | |
33493 } | |
33494 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L3_error) | |
33495 else goto __pyx_L5_argtuple_error; | |
33496 CYTHON_FALLTHROUGH; | |
33497 case 1: | |
33498 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) { | |
33499 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
33500 kw_args--; | |
33501 } | |
33502 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L3_error) | |
33503 else { | |
33504 __Pyx_RaiseArgtupleInvalid("setformat", 1, 2, 2, 1); __PYX_ERR(0, 975, __pyx_L3_error) | |
33505 } | |
33506 } | |
33507 if (unlikely(kw_args > 0)) { | |
33508 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
33509 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setformat") < 0)) __PYX_ERR(0, 975, __pyx_L3_error) | |
33510 } | |
33511 } else if (unlikely(__pyx_nargs != 2)) { | |
33512 goto __pyx_L5_argtuple_error; | |
33513 } else { | |
33514 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33515 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
33516 } | |
33517 __pyx_v_self = values[0]; | |
33518 __pyx_v_format = values[1]; | |
33519 } | |
33520 goto __pyx_L6_skip; | |
33521 __pyx_L5_argtuple_error:; | |
33522 __Pyx_RaiseArgtupleInvalid("setformat", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 975, __pyx_L3_error) | |
33523 __pyx_L6_skip:; | |
33524 goto __pyx_L4_argument_unpacking_done; | |
33525 __pyx_L3_error:; | |
33526 { | |
33527 Py_ssize_t __pyx_temp; | |
33528 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33529 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33530 } | |
33531 } | |
33532 __Pyx_AddTraceback("pysam.libcvcf.VCF.setformat", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33533 __Pyx_RefNannyFinishContext(); | |
33534 return NULL; | |
33535 __pyx_L4_argument_unpacking_done:; | |
33536 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_55setformat(__pyx_self, __pyx_v_self, __pyx_v_format); | |
33537 | |
33538 /* function exit code */ | |
33539 { | |
33540 Py_ssize_t __pyx_temp; | |
33541 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33542 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33543 } | |
33544 } | |
33545 __Pyx_RefNannyFinishContext(); | |
33546 return __pyx_r; | |
33547 } | |
33548 | |
33549 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_55setformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format) { | |
33550 PyObject *__pyx_r = NULL; | |
33551 __Pyx_RefNannyDeclarations | |
33552 int __pyx_lineno = 0; | |
33553 const char *__pyx_filename = NULL; | |
33554 int __pyx_clineno = 0; | |
33555 __Pyx_RefNannySetupContext("setformat", 1); | |
33556 | |
33557 /* "pysam/libcvcf.pyx":977 | |
33558 * def setformat(self,format): | |
33559 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
33560 * self._format = format # <<<<<<<<<<<<<< | |
33561 * | |
33562 * def getfilter(self): | |
33563 */ | |
33564 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_format_2, __pyx_v_format) < 0) __PYX_ERR(0, 977, __pyx_L1_error) | |
33565 | |
33566 /* "pysam/libcvcf.pyx":975 | |
33567 * return self._format | |
33568 * | |
33569 * def setformat(self,format): # <<<<<<<<<<<<<< | |
33570 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
33571 * self._format = format | |
33572 */ | |
33573 | |
33574 /* function exit code */ | |
33575 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
33576 goto __pyx_L0; | |
33577 __pyx_L1_error:; | |
33578 __Pyx_AddTraceback("pysam.libcvcf.VCF.setformat", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33579 __pyx_r = NULL; | |
33580 __pyx_L0:; | |
33581 __Pyx_XGIVEREF(__pyx_r); | |
33582 __Pyx_RefNannyFinishContext(); | |
33583 return __pyx_r; | |
33584 } | |
33585 | |
33586 /* "pysam/libcvcf.pyx":979 | |
33587 * self._format = format | |
33588 * | |
33589 * def getfilter(self): # <<<<<<<<<<<<<< | |
33590 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
33591 * return self._filter | |
33592 */ | |
33593 | |
33594 /* Python wrapper */ | |
33595 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_58getfilter(PyObject *__pyx_self, | |
33596 #if CYTHON_METH_FASTCALL | |
33597 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33598 #else | |
33599 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33600 #endif | |
33601 ); /*proto*/ | |
33602 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_57getfilter, "VCF.getfilter(self)\n Dictionary of ##FILTER tags, as VCF.FORMAT values "); | |
33603 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_58getfilter = {"getfilter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_58getfilter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_57getfilter}; | |
33604 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_58getfilter(PyObject *__pyx_self, | |
33605 #if CYTHON_METH_FASTCALL | |
33606 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33607 #else | |
33608 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33609 #endif | |
33610 ) { | |
33611 PyObject *__pyx_v_self = 0; | |
33612 #if !CYTHON_METH_FASTCALL | |
33613 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
33614 #endif | |
33615 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
33616 PyObject* values[1] = {0}; | |
33617 int __pyx_lineno = 0; | |
33618 const char *__pyx_filename = NULL; | |
33619 int __pyx_clineno = 0; | |
33620 PyObject *__pyx_r = 0; | |
33621 __Pyx_RefNannyDeclarations | |
33622 __Pyx_RefNannySetupContext("getfilter (wrapper)", 0); | |
33623 #if !CYTHON_METH_FASTCALL | |
33624 #if CYTHON_ASSUME_SAFE_MACROS | |
33625 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
33626 #else | |
33627 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
33628 #endif | |
33629 #endif | |
33630 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
33631 { | |
33632 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
33633 if (__pyx_kwds) { | |
33634 Py_ssize_t kw_args; | |
33635 switch (__pyx_nargs) { | |
33636 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33637 CYTHON_FALLTHROUGH; | |
33638 case 0: break; | |
33639 default: goto __pyx_L5_argtuple_error; | |
33640 } | |
33641 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
33642 switch (__pyx_nargs) { | |
33643 case 0: | |
33644 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
33645 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
33646 kw_args--; | |
33647 } | |
33648 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 979, __pyx_L3_error) | |
33649 else goto __pyx_L5_argtuple_error; | |
33650 } | |
33651 if (unlikely(kw_args > 0)) { | |
33652 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
33653 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getfilter") < 0)) __PYX_ERR(0, 979, __pyx_L3_error) | |
33654 } | |
33655 } else if (unlikely(__pyx_nargs != 1)) { | |
33656 goto __pyx_L5_argtuple_error; | |
33657 } else { | |
33658 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33659 } | |
33660 __pyx_v_self = values[0]; | |
33661 } | |
33662 goto __pyx_L6_skip; | |
33663 __pyx_L5_argtuple_error:; | |
33664 __Pyx_RaiseArgtupleInvalid("getfilter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 979, __pyx_L3_error) | |
33665 __pyx_L6_skip:; | |
33666 goto __pyx_L4_argument_unpacking_done; | |
33667 __pyx_L3_error:; | |
33668 { | |
33669 Py_ssize_t __pyx_temp; | |
33670 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33671 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33672 } | |
33673 } | |
33674 __Pyx_AddTraceback("pysam.libcvcf.VCF.getfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33675 __Pyx_RefNannyFinishContext(); | |
33676 return NULL; | |
33677 __pyx_L4_argument_unpacking_done:; | |
33678 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_57getfilter(__pyx_self, __pyx_v_self); | |
33679 | |
33680 /* function exit code */ | |
33681 { | |
33682 Py_ssize_t __pyx_temp; | |
33683 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33684 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33685 } | |
33686 } | |
33687 __Pyx_RefNannyFinishContext(); | |
33688 return __pyx_r; | |
33689 } | |
33690 | |
33691 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_57getfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
33692 PyObject *__pyx_r = NULL; | |
33693 __Pyx_RefNannyDeclarations | |
33694 PyObject *__pyx_t_1 = NULL; | |
33695 int __pyx_lineno = 0; | |
33696 const char *__pyx_filename = NULL; | |
33697 int __pyx_clineno = 0; | |
33698 __Pyx_RefNannySetupContext("getfilter", 1); | |
33699 | |
33700 /* "pysam/libcvcf.pyx":981 | |
33701 * def getfilter(self): | |
33702 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
33703 * return self._filter # <<<<<<<<<<<<<< | |
33704 * | |
33705 * def setfilter(self,filter): | |
33706 */ | |
33707 __Pyx_XDECREF(__pyx_r); | |
33708 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) | |
33709 __Pyx_GOTREF(__pyx_t_1); | |
33710 __pyx_r = __pyx_t_1; | |
33711 __pyx_t_1 = 0; | |
33712 goto __pyx_L0; | |
33713 | |
33714 /* "pysam/libcvcf.pyx":979 | |
33715 * self._format = format | |
33716 * | |
33717 * def getfilter(self): # <<<<<<<<<<<<<< | |
33718 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
33719 * return self._filter | |
33720 */ | |
33721 | |
33722 /* function exit code */ | |
33723 __pyx_L1_error:; | |
33724 __Pyx_XDECREF(__pyx_t_1); | |
33725 __Pyx_AddTraceback("pysam.libcvcf.VCF.getfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33726 __pyx_r = NULL; | |
33727 __pyx_L0:; | |
33728 __Pyx_XGIVEREF(__pyx_r); | |
33729 __Pyx_RefNannyFinishContext(); | |
33730 return __pyx_r; | |
33731 } | |
33732 | |
33733 /* "pysam/libcvcf.pyx":983 | |
33734 * return self._filter | |
33735 * | |
33736 * def setfilter(self,filter): # <<<<<<<<<<<<<< | |
33737 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
33738 * self._filter = filter | |
33739 */ | |
33740 | |
33741 /* Python wrapper */ | |
33742 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_60setfilter(PyObject *__pyx_self, | |
33743 #if CYTHON_METH_FASTCALL | |
33744 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33745 #else | |
33746 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33747 #endif | |
33748 ); /*proto*/ | |
33749 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_59setfilter, "VCF.setfilter(self, filter)\n Dictionary of ##FILTER tags, as VCF.FORMAT values "); | |
33750 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_60setfilter = {"setfilter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_60setfilter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_59setfilter}; | |
33751 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_60setfilter(PyObject *__pyx_self, | |
33752 #if CYTHON_METH_FASTCALL | |
33753 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33754 #else | |
33755 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33756 #endif | |
33757 ) { | |
33758 PyObject *__pyx_v_self = 0; | |
33759 PyObject *__pyx_v_filter = 0; | |
33760 #if !CYTHON_METH_FASTCALL | |
33761 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
33762 #endif | |
33763 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
33764 PyObject* values[2] = {0,0}; | |
33765 int __pyx_lineno = 0; | |
33766 const char *__pyx_filename = NULL; | |
33767 int __pyx_clineno = 0; | |
33768 PyObject *__pyx_r = 0; | |
33769 __Pyx_RefNannyDeclarations | |
33770 __Pyx_RefNannySetupContext("setfilter (wrapper)", 0); | |
33771 #if !CYTHON_METH_FASTCALL | |
33772 #if CYTHON_ASSUME_SAFE_MACROS | |
33773 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
33774 #else | |
33775 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
33776 #endif | |
33777 #endif | |
33778 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
33779 { | |
33780 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filter_2,0}; | |
33781 if (__pyx_kwds) { | |
33782 Py_ssize_t kw_args; | |
33783 switch (__pyx_nargs) { | |
33784 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
33785 CYTHON_FALLTHROUGH; | |
33786 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33787 CYTHON_FALLTHROUGH; | |
33788 case 0: break; | |
33789 default: goto __pyx_L5_argtuple_error; | |
33790 } | |
33791 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
33792 switch (__pyx_nargs) { | |
33793 case 0: | |
33794 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
33795 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
33796 kw_args--; | |
33797 } | |
33798 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 983, __pyx_L3_error) | |
33799 else goto __pyx_L5_argtuple_error; | |
33800 CYTHON_FALLTHROUGH; | |
33801 case 1: | |
33802 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filter_2)) != 0)) { | |
33803 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
33804 kw_args--; | |
33805 } | |
33806 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 983, __pyx_L3_error) | |
33807 else { | |
33808 __Pyx_RaiseArgtupleInvalid("setfilter", 1, 2, 2, 1); __PYX_ERR(0, 983, __pyx_L3_error) | |
33809 } | |
33810 } | |
33811 if (unlikely(kw_args > 0)) { | |
33812 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
33813 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setfilter") < 0)) __PYX_ERR(0, 983, __pyx_L3_error) | |
33814 } | |
33815 } else if (unlikely(__pyx_nargs != 2)) { | |
33816 goto __pyx_L5_argtuple_error; | |
33817 } else { | |
33818 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33819 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
33820 } | |
33821 __pyx_v_self = values[0]; | |
33822 __pyx_v_filter = values[1]; | |
33823 } | |
33824 goto __pyx_L6_skip; | |
33825 __pyx_L5_argtuple_error:; | |
33826 __Pyx_RaiseArgtupleInvalid("setfilter", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 983, __pyx_L3_error) | |
33827 __pyx_L6_skip:; | |
33828 goto __pyx_L4_argument_unpacking_done; | |
33829 __pyx_L3_error:; | |
33830 { | |
33831 Py_ssize_t __pyx_temp; | |
33832 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33833 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33834 } | |
33835 } | |
33836 __Pyx_AddTraceback("pysam.libcvcf.VCF.setfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33837 __Pyx_RefNannyFinishContext(); | |
33838 return NULL; | |
33839 __pyx_L4_argument_unpacking_done:; | |
33840 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_59setfilter(__pyx_self, __pyx_v_self, __pyx_v_filter); | |
33841 | |
33842 /* function exit code */ | |
33843 { | |
33844 Py_ssize_t __pyx_temp; | |
33845 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33846 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33847 } | |
33848 } | |
33849 __Pyx_RefNannyFinishContext(); | |
33850 return __pyx_r; | |
33851 } | |
33852 | |
33853 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_59setfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filter) { | |
33854 PyObject *__pyx_r = NULL; | |
33855 __Pyx_RefNannyDeclarations | |
33856 int __pyx_lineno = 0; | |
33857 const char *__pyx_filename = NULL; | |
33858 int __pyx_clineno = 0; | |
33859 __Pyx_RefNannySetupContext("setfilter", 1); | |
33860 | |
33861 /* "pysam/libcvcf.pyx":985 | |
33862 * def setfilter(self,filter): | |
33863 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
33864 * self._filter = filter # <<<<<<<<<<<<<< | |
33865 * | |
33866 * def setversion(self, version): | |
33867 */ | |
33868 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_filter, __pyx_v_filter) < 0) __PYX_ERR(0, 985, __pyx_L1_error) | |
33869 | |
33870 /* "pysam/libcvcf.pyx":983 | |
33871 * return self._filter | |
33872 * | |
33873 * def setfilter(self,filter): # <<<<<<<<<<<<<< | |
33874 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
33875 * self._filter = filter | |
33876 */ | |
33877 | |
33878 /* function exit code */ | |
33879 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
33880 goto __pyx_L0; | |
33881 __pyx_L1_error:; | |
33882 __Pyx_AddTraceback("pysam.libcvcf.VCF.setfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33883 __pyx_r = NULL; | |
33884 __pyx_L0:; | |
33885 __Pyx_XGIVEREF(__pyx_r); | |
33886 __Pyx_RefNannyFinishContext(); | |
33887 return __pyx_r; | |
33888 } | |
33889 | |
33890 /* "pysam/libcvcf.pyx":987 | |
33891 * self._filter = filter | |
33892 * | |
33893 * def setversion(self, version): # <<<<<<<<<<<<<< | |
33894 * if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files") | |
33895 * self._version = version | |
33896 */ | |
33897 | |
33898 /* Python wrapper */ | |
33899 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_62setversion(PyObject *__pyx_self, | |
33900 #if CYTHON_METH_FASTCALL | |
33901 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33902 #else | |
33903 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33904 #endif | |
33905 ); /*proto*/ | |
33906 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_61setversion, "VCF.setversion(self, version)"); | |
33907 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_62setversion = {"setversion", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_62setversion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_61setversion}; | |
33908 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_62setversion(PyObject *__pyx_self, | |
33909 #if CYTHON_METH_FASTCALL | |
33910 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
33911 #else | |
33912 PyObject *__pyx_args, PyObject *__pyx_kwds | |
33913 #endif | |
33914 ) { | |
33915 PyObject *__pyx_v_self = 0; | |
33916 PyObject *__pyx_v_version = 0; | |
33917 #if !CYTHON_METH_FASTCALL | |
33918 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
33919 #endif | |
33920 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
33921 PyObject* values[2] = {0,0}; | |
33922 int __pyx_lineno = 0; | |
33923 const char *__pyx_filename = NULL; | |
33924 int __pyx_clineno = 0; | |
33925 PyObject *__pyx_r = 0; | |
33926 __Pyx_RefNannyDeclarations | |
33927 __Pyx_RefNannySetupContext("setversion (wrapper)", 0); | |
33928 #if !CYTHON_METH_FASTCALL | |
33929 #if CYTHON_ASSUME_SAFE_MACROS | |
33930 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
33931 #else | |
33932 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
33933 #endif | |
33934 #endif | |
33935 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
33936 { | |
33937 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_version_2,0}; | |
33938 if (__pyx_kwds) { | |
33939 Py_ssize_t kw_args; | |
33940 switch (__pyx_nargs) { | |
33941 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
33942 CYTHON_FALLTHROUGH; | |
33943 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33944 CYTHON_FALLTHROUGH; | |
33945 case 0: break; | |
33946 default: goto __pyx_L5_argtuple_error; | |
33947 } | |
33948 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
33949 switch (__pyx_nargs) { | |
33950 case 0: | |
33951 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
33952 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
33953 kw_args--; | |
33954 } | |
33955 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 987, __pyx_L3_error) | |
33956 else goto __pyx_L5_argtuple_error; | |
33957 CYTHON_FALLTHROUGH; | |
33958 case 1: | |
33959 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_version_2)) != 0)) { | |
33960 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
33961 kw_args--; | |
33962 } | |
33963 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 987, __pyx_L3_error) | |
33964 else { | |
33965 __Pyx_RaiseArgtupleInvalid("setversion", 1, 2, 2, 1); __PYX_ERR(0, 987, __pyx_L3_error) | |
33966 } | |
33967 } | |
33968 if (unlikely(kw_args > 0)) { | |
33969 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
33970 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setversion") < 0)) __PYX_ERR(0, 987, __pyx_L3_error) | |
33971 } | |
33972 } else if (unlikely(__pyx_nargs != 2)) { | |
33973 goto __pyx_L5_argtuple_error; | |
33974 } else { | |
33975 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
33976 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
33977 } | |
33978 __pyx_v_self = values[0]; | |
33979 __pyx_v_version = values[1]; | |
33980 } | |
33981 goto __pyx_L6_skip; | |
33982 __pyx_L5_argtuple_error:; | |
33983 __Pyx_RaiseArgtupleInvalid("setversion", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 987, __pyx_L3_error) | |
33984 __pyx_L6_skip:; | |
33985 goto __pyx_L4_argument_unpacking_done; | |
33986 __pyx_L3_error:; | |
33987 { | |
33988 Py_ssize_t __pyx_temp; | |
33989 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
33990 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
33991 } | |
33992 } | |
33993 __Pyx_AddTraceback("pysam.libcvcf.VCF.setversion", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
33994 __Pyx_RefNannyFinishContext(); | |
33995 return NULL; | |
33996 __pyx_L4_argument_unpacking_done:; | |
33997 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_61setversion(__pyx_self, __pyx_v_self, __pyx_v_version); | |
33998 | |
33999 /* function exit code */ | |
34000 { | |
34001 Py_ssize_t __pyx_temp; | |
34002 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
34003 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
34004 } | |
34005 } | |
34006 __Pyx_RefNannyFinishContext(); | |
34007 return __pyx_r; | |
34008 } | |
34009 | |
34010 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_61setversion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_version) { | |
34011 PyObject *__pyx_r = NULL; | |
34012 __Pyx_RefNannyDeclarations | |
34013 int __pyx_t_1; | |
34014 int __pyx_t_2; | |
34015 PyObject *__pyx_t_3 = NULL; | |
34016 int __pyx_lineno = 0; | |
34017 const char *__pyx_filename = NULL; | |
34018 int __pyx_clineno = 0; | |
34019 __Pyx_RefNannySetupContext("setversion", 1); | |
34020 | |
34021 /* "pysam/libcvcf.pyx":988 | |
34022 * | |
34023 * def setversion(self, version): | |
34024 * if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files") # <<<<<<<<<<<<<< | |
34025 * self._version = version | |
34026 * | |
34027 */ | |
34028 __pyx_t_2 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_version, __pyx_int_33, 33, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 988, __pyx_L1_error) | |
34029 if (__pyx_t_2) { | |
34030 } else { | |
34031 __pyx_t_1 = __pyx_t_2; | |
34032 goto __pyx_L4_bool_binop_done; | |
34033 } | |
34034 __pyx_t_2 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_version, __pyx_int_40, 40, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 988, __pyx_L1_error) | |
34035 __pyx_t_1 = __pyx_t_2; | |
34036 __pyx_L4_bool_binop_done:; | |
34037 if (unlikely(__pyx_t_1)) { | |
34038 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 988, __pyx_L1_error) | |
34039 __Pyx_GOTREF(__pyx_t_3); | |
34040 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
34041 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
34042 __PYX_ERR(0, 988, __pyx_L1_error) | |
34043 } | |
34044 | |
34045 /* "pysam/libcvcf.pyx":989 | |
34046 * def setversion(self, version): | |
34047 * if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files") | |
34048 * self._version = version # <<<<<<<<<<<<<< | |
34049 * | |
34050 * def setregions(self, regions): | |
34051 */ | |
34052 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_v_version) < 0) __PYX_ERR(0, 989, __pyx_L1_error) | |
34053 | |
34054 /* "pysam/libcvcf.pyx":987 | |
34055 * self._filter = filter | |
34056 * | |
34057 * def setversion(self, version): # <<<<<<<<<<<<<< | |
34058 * if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files") | |
34059 * self._version = version | |
34060 */ | |
34061 | |
34062 /* function exit code */ | |
34063 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
34064 goto __pyx_L0; | |
34065 __pyx_L1_error:; | |
34066 __Pyx_XDECREF(__pyx_t_3); | |
34067 __Pyx_AddTraceback("pysam.libcvcf.VCF.setversion", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34068 __pyx_r = NULL; | |
34069 __pyx_L0:; | |
34070 __Pyx_XGIVEREF(__pyx_r); | |
34071 __Pyx_RefNannyFinishContext(); | |
34072 return __pyx_r; | |
34073 } | |
34074 | |
34075 /* "pysam/libcvcf.pyx":991 | |
34076 * self._version = version | |
34077 * | |
34078 * def setregions(self, regions): # <<<<<<<<<<<<<< | |
34079 * self._regions = regions | |
34080 * | |
34081 */ | |
34082 | |
34083 /* Python wrapper */ | |
34084 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_64setregions(PyObject *__pyx_self, | |
34085 #if CYTHON_METH_FASTCALL | |
34086 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34087 #else | |
34088 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34089 #endif | |
34090 ); /*proto*/ | |
34091 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_63setregions, "VCF.setregions(self, regions)"); | |
34092 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_64setregions = {"setregions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_64setregions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_63setregions}; | |
34093 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_64setregions(PyObject *__pyx_self, | |
34094 #if CYTHON_METH_FASTCALL | |
34095 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34096 #else | |
34097 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34098 #endif | |
34099 ) { | |
34100 PyObject *__pyx_v_self = 0; | |
34101 PyObject *__pyx_v_regions = 0; | |
34102 #if !CYTHON_METH_FASTCALL | |
34103 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
34104 #endif | |
34105 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
34106 PyObject* values[2] = {0,0}; | |
34107 int __pyx_lineno = 0; | |
34108 const char *__pyx_filename = NULL; | |
34109 int __pyx_clineno = 0; | |
34110 PyObject *__pyx_r = 0; | |
34111 __Pyx_RefNannyDeclarations | |
34112 __Pyx_RefNannySetupContext("setregions (wrapper)", 0); | |
34113 #if !CYTHON_METH_FASTCALL | |
34114 #if CYTHON_ASSUME_SAFE_MACROS | |
34115 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
34116 #else | |
34117 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
34118 #endif | |
34119 #endif | |
34120 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
34121 { | |
34122 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_regions,0}; | |
34123 if (__pyx_kwds) { | |
34124 Py_ssize_t kw_args; | |
34125 switch (__pyx_nargs) { | |
34126 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
34127 CYTHON_FALLTHROUGH; | |
34128 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
34129 CYTHON_FALLTHROUGH; | |
34130 case 0: break; | |
34131 default: goto __pyx_L5_argtuple_error; | |
34132 } | |
34133 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
34134 switch (__pyx_nargs) { | |
34135 case 0: | |
34136 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
34137 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
34138 kw_args--; | |
34139 } | |
34140 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error) | |
34141 else goto __pyx_L5_argtuple_error; | |
34142 CYTHON_FALLTHROUGH; | |
34143 case 1: | |
34144 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_regions)) != 0)) { | |
34145 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
34146 kw_args--; | |
34147 } | |
34148 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error) | |
34149 else { | |
34150 __Pyx_RaiseArgtupleInvalid("setregions", 1, 2, 2, 1); __PYX_ERR(0, 991, __pyx_L3_error) | |
34151 } | |
34152 } | |
34153 if (unlikely(kw_args > 0)) { | |
34154 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
34155 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setregions") < 0)) __PYX_ERR(0, 991, __pyx_L3_error) | |
34156 } | |
34157 } else if (unlikely(__pyx_nargs != 2)) { | |
34158 goto __pyx_L5_argtuple_error; | |
34159 } else { | |
34160 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
34161 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
34162 } | |
34163 __pyx_v_self = values[0]; | |
34164 __pyx_v_regions = values[1]; | |
34165 } | |
34166 goto __pyx_L6_skip; | |
34167 __pyx_L5_argtuple_error:; | |
34168 __Pyx_RaiseArgtupleInvalid("setregions", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 991, __pyx_L3_error) | |
34169 __pyx_L6_skip:; | |
34170 goto __pyx_L4_argument_unpacking_done; | |
34171 __pyx_L3_error:; | |
34172 { | |
34173 Py_ssize_t __pyx_temp; | |
34174 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
34175 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
34176 } | |
34177 } | |
34178 __Pyx_AddTraceback("pysam.libcvcf.VCF.setregions", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34179 __Pyx_RefNannyFinishContext(); | |
34180 return NULL; | |
34181 __pyx_L4_argument_unpacking_done:; | |
34182 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_63setregions(__pyx_self, __pyx_v_self, __pyx_v_regions); | |
34183 | |
34184 /* function exit code */ | |
34185 { | |
34186 Py_ssize_t __pyx_temp; | |
34187 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
34188 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
34189 } | |
34190 } | |
34191 __Pyx_RefNannyFinishContext(); | |
34192 return __pyx_r; | |
34193 } | |
34194 | |
34195 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_63setregions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_regions) { | |
34196 PyObject *__pyx_r = NULL; | |
34197 __Pyx_RefNannyDeclarations | |
34198 int __pyx_lineno = 0; | |
34199 const char *__pyx_filename = NULL; | |
34200 int __pyx_clineno = 0; | |
34201 __Pyx_RefNannySetupContext("setregions", 1); | |
34202 | |
34203 /* "pysam/libcvcf.pyx":992 | |
34204 * | |
34205 * def setregions(self, regions): | |
34206 * self._regions = regions # <<<<<<<<<<<<<< | |
34207 * | |
34208 * def setreference(self, ref): | |
34209 */ | |
34210 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_regions_2, __pyx_v_regions) < 0) __PYX_ERR(0, 992, __pyx_L1_error) | |
34211 | |
34212 /* "pysam/libcvcf.pyx":991 | |
34213 * self._version = version | |
34214 * | |
34215 * def setregions(self, regions): # <<<<<<<<<<<<<< | |
34216 * self._regions = regions | |
34217 * | |
34218 */ | |
34219 | |
34220 /* function exit code */ | |
34221 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
34222 goto __pyx_L0; | |
34223 __pyx_L1_error:; | |
34224 __Pyx_AddTraceback("pysam.libcvcf.VCF.setregions", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34225 __pyx_r = NULL; | |
34226 __pyx_L0:; | |
34227 __Pyx_XGIVEREF(__pyx_r); | |
34228 __Pyx_RefNannyFinishContext(); | |
34229 return __pyx_r; | |
34230 } | |
34231 | |
34232 /* "pysam/libcvcf.pyx":994 | |
34233 * self._regions = regions | |
34234 * | |
34235 * def setreference(self, ref): # <<<<<<<<<<<<<< | |
34236 * """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """ | |
34237 * self._reference = ref | |
34238 */ | |
34239 | |
34240 /* Python wrapper */ | |
34241 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_66setreference(PyObject *__pyx_self, | |
34242 #if CYTHON_METH_FASTCALL | |
34243 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34244 #else | |
34245 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34246 #endif | |
34247 ); /*proto*/ | |
34248 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_65setreference, "VCF.setreference(self, ref)\n Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile "); | |
34249 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_66setreference = {"setreference", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_66setreference, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_65setreference}; | |
34250 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_66setreference(PyObject *__pyx_self, | |
34251 #if CYTHON_METH_FASTCALL | |
34252 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34253 #else | |
34254 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34255 #endif | |
34256 ) { | |
34257 PyObject *__pyx_v_self = 0; | |
34258 PyObject *__pyx_v_ref = 0; | |
34259 #if !CYTHON_METH_FASTCALL | |
34260 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
34261 #endif | |
34262 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
34263 PyObject* values[2] = {0,0}; | |
34264 int __pyx_lineno = 0; | |
34265 const char *__pyx_filename = NULL; | |
34266 int __pyx_clineno = 0; | |
34267 PyObject *__pyx_r = 0; | |
34268 __Pyx_RefNannyDeclarations | |
34269 __Pyx_RefNannySetupContext("setreference (wrapper)", 0); | |
34270 #if !CYTHON_METH_FASTCALL | |
34271 #if CYTHON_ASSUME_SAFE_MACROS | |
34272 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
34273 #else | |
34274 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
34275 #endif | |
34276 #endif | |
34277 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
34278 { | |
34279 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ref,0}; | |
34280 if (__pyx_kwds) { | |
34281 Py_ssize_t kw_args; | |
34282 switch (__pyx_nargs) { | |
34283 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
34284 CYTHON_FALLTHROUGH; | |
34285 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
34286 CYTHON_FALLTHROUGH; | |
34287 case 0: break; | |
34288 default: goto __pyx_L5_argtuple_error; | |
34289 } | |
34290 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
34291 switch (__pyx_nargs) { | |
34292 case 0: | |
34293 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
34294 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
34295 kw_args--; | |
34296 } | |
34297 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 994, __pyx_L3_error) | |
34298 else goto __pyx_L5_argtuple_error; | |
34299 CYTHON_FALLTHROUGH; | |
34300 case 1: | |
34301 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref)) != 0)) { | |
34302 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
34303 kw_args--; | |
34304 } | |
34305 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 994, __pyx_L3_error) | |
34306 else { | |
34307 __Pyx_RaiseArgtupleInvalid("setreference", 1, 2, 2, 1); __PYX_ERR(0, 994, __pyx_L3_error) | |
34308 } | |
34309 } | |
34310 if (unlikely(kw_args > 0)) { | |
34311 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
34312 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setreference") < 0)) __PYX_ERR(0, 994, __pyx_L3_error) | |
34313 } | |
34314 } else if (unlikely(__pyx_nargs != 2)) { | |
34315 goto __pyx_L5_argtuple_error; | |
34316 } else { | |
34317 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
34318 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
34319 } | |
34320 __pyx_v_self = values[0]; | |
34321 __pyx_v_ref = values[1]; | |
34322 } | |
34323 goto __pyx_L6_skip; | |
34324 __pyx_L5_argtuple_error:; | |
34325 __Pyx_RaiseArgtupleInvalid("setreference", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 994, __pyx_L3_error) | |
34326 __pyx_L6_skip:; | |
34327 goto __pyx_L4_argument_unpacking_done; | |
34328 __pyx_L3_error:; | |
34329 { | |
34330 Py_ssize_t __pyx_temp; | |
34331 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
34332 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
34333 } | |
34334 } | |
34335 __Pyx_AddTraceback("pysam.libcvcf.VCF.setreference", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34336 __Pyx_RefNannyFinishContext(); | |
34337 return NULL; | |
34338 __pyx_L4_argument_unpacking_done:; | |
34339 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_65setreference(__pyx_self, __pyx_v_self, __pyx_v_ref); | |
34340 | |
34341 /* function exit code */ | |
34342 { | |
34343 Py_ssize_t __pyx_temp; | |
34344 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
34345 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
34346 } | |
34347 } | |
34348 __Pyx_RefNannyFinishContext(); | |
34349 return __pyx_r; | |
34350 } | |
34351 | |
34352 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_65setreference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ref) { | |
34353 PyObject *__pyx_r = NULL; | |
34354 __Pyx_RefNannyDeclarations | |
34355 int __pyx_lineno = 0; | |
34356 const char *__pyx_filename = NULL; | |
34357 int __pyx_clineno = 0; | |
34358 __Pyx_RefNannySetupContext("setreference", 1); | |
34359 | |
34360 /* "pysam/libcvcf.pyx":996 | |
34361 * def setreference(self, ref): | |
34362 * """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """ | |
34363 * self._reference = ref # <<<<<<<<<<<<<< | |
34364 * | |
34365 * def ignoreerror(self, errorstring): | |
34366 */ | |
34367 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reference_2, __pyx_v_ref) < 0) __PYX_ERR(0, 996, __pyx_L1_error) | |
34368 | |
34369 /* "pysam/libcvcf.pyx":994 | |
34370 * self._regions = regions | |
34371 * | |
34372 * def setreference(self, ref): # <<<<<<<<<<<<<< | |
34373 * """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """ | |
34374 * self._reference = ref | |
34375 */ | |
34376 | |
34377 /* function exit code */ | |
34378 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
34379 goto __pyx_L0; | |
34380 __pyx_L1_error:; | |
34381 __Pyx_AddTraceback("pysam.libcvcf.VCF.setreference", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34382 __pyx_r = NULL; | |
34383 __pyx_L0:; | |
34384 __Pyx_XGIVEREF(__pyx_r); | |
34385 __Pyx_RefNannyFinishContext(); | |
34386 return __pyx_r; | |
34387 } | |
34388 | |
34389 /* "pysam/libcvcf.pyx":998 | |
34390 * self._reference = ref | |
34391 * | |
34392 * def ignoreerror(self, errorstring): # <<<<<<<<<<<<<< | |
34393 * try: self._ignored_errors.add(self.__dict__[errorstring]) | |
34394 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34395 */ | |
34396 | |
34397 /* Python wrapper */ | |
34398 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_68ignoreerror(PyObject *__pyx_self, | |
34399 #if CYTHON_METH_FASTCALL | |
34400 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34401 #else | |
34402 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34403 #endif | |
34404 ); /*proto*/ | |
34405 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_67ignoreerror, "VCF.ignoreerror(self, errorstring)"); | |
34406 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_68ignoreerror = {"ignoreerror", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_68ignoreerror, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_67ignoreerror}; | |
34407 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_68ignoreerror(PyObject *__pyx_self, | |
34408 #if CYTHON_METH_FASTCALL | |
34409 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34410 #else | |
34411 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34412 #endif | |
34413 ) { | |
34414 PyObject *__pyx_v_self = 0; | |
34415 PyObject *__pyx_v_errorstring = 0; | |
34416 #if !CYTHON_METH_FASTCALL | |
34417 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
34418 #endif | |
34419 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
34420 PyObject* values[2] = {0,0}; | |
34421 int __pyx_lineno = 0; | |
34422 const char *__pyx_filename = NULL; | |
34423 int __pyx_clineno = 0; | |
34424 PyObject *__pyx_r = 0; | |
34425 __Pyx_RefNannyDeclarations | |
34426 __Pyx_RefNannySetupContext("ignoreerror (wrapper)", 0); | |
34427 #if !CYTHON_METH_FASTCALL | |
34428 #if CYTHON_ASSUME_SAFE_MACROS | |
34429 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
34430 #else | |
34431 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
34432 #endif | |
34433 #endif | |
34434 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
34435 { | |
34436 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_errorstring,0}; | |
34437 if (__pyx_kwds) { | |
34438 Py_ssize_t kw_args; | |
34439 switch (__pyx_nargs) { | |
34440 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
34441 CYTHON_FALLTHROUGH; | |
34442 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
34443 CYTHON_FALLTHROUGH; | |
34444 case 0: break; | |
34445 default: goto __pyx_L5_argtuple_error; | |
34446 } | |
34447 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
34448 switch (__pyx_nargs) { | |
34449 case 0: | |
34450 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
34451 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
34452 kw_args--; | |
34453 } | |
34454 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 998, __pyx_L3_error) | |
34455 else goto __pyx_L5_argtuple_error; | |
34456 CYTHON_FALLTHROUGH; | |
34457 case 1: | |
34458 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_errorstring)) != 0)) { | |
34459 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
34460 kw_args--; | |
34461 } | |
34462 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 998, __pyx_L3_error) | |
34463 else { | |
34464 __Pyx_RaiseArgtupleInvalid("ignoreerror", 1, 2, 2, 1); __PYX_ERR(0, 998, __pyx_L3_error) | |
34465 } | |
34466 } | |
34467 if (unlikely(kw_args > 0)) { | |
34468 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
34469 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ignoreerror") < 0)) __PYX_ERR(0, 998, __pyx_L3_error) | |
34470 } | |
34471 } else if (unlikely(__pyx_nargs != 2)) { | |
34472 goto __pyx_L5_argtuple_error; | |
34473 } else { | |
34474 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
34475 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
34476 } | |
34477 __pyx_v_self = values[0]; | |
34478 __pyx_v_errorstring = values[1]; | |
34479 } | |
34480 goto __pyx_L6_skip; | |
34481 __pyx_L5_argtuple_error:; | |
34482 __Pyx_RaiseArgtupleInvalid("ignoreerror", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 998, __pyx_L3_error) | |
34483 __pyx_L6_skip:; | |
34484 goto __pyx_L4_argument_unpacking_done; | |
34485 __pyx_L3_error:; | |
34486 { | |
34487 Py_ssize_t __pyx_temp; | |
34488 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
34489 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
34490 } | |
34491 } | |
34492 __Pyx_AddTraceback("pysam.libcvcf.VCF.ignoreerror", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34493 __Pyx_RefNannyFinishContext(); | |
34494 return NULL; | |
34495 __pyx_L4_argument_unpacking_done:; | |
34496 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_67ignoreerror(__pyx_self, __pyx_v_self, __pyx_v_errorstring); | |
34497 | |
34498 /* function exit code */ | |
34499 { | |
34500 Py_ssize_t __pyx_temp; | |
34501 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
34502 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
34503 } | |
34504 } | |
34505 __Pyx_RefNannyFinishContext(); | |
34506 return __pyx_r; | |
34507 } | |
34508 | |
34509 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_67ignoreerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errorstring) { | |
34510 PyObject *__pyx_r = NULL; | |
34511 __Pyx_RefNannyDeclarations | |
34512 PyObject *__pyx_t_1 = NULL; | |
34513 PyObject *__pyx_t_2 = NULL; | |
34514 PyObject *__pyx_t_3 = NULL; | |
34515 PyObject *__pyx_t_4 = NULL; | |
34516 PyObject *__pyx_t_5 = NULL; | |
34517 PyObject *__pyx_t_6 = NULL; | |
34518 PyObject *__pyx_t_7 = NULL; | |
34519 unsigned int __pyx_t_8; | |
34520 int __pyx_t_9; | |
34521 PyObject *__pyx_t_10 = NULL; | |
34522 int __pyx_lineno = 0; | |
34523 const char *__pyx_filename = NULL; | |
34524 int __pyx_clineno = 0; | |
34525 __Pyx_RefNannySetupContext("ignoreerror", 1); | |
34526 | |
34527 /* "pysam/libcvcf.pyx":999 | |
34528 * | |
34529 * def ignoreerror(self, errorstring): | |
34530 * try: self._ignored_errors.add(self.__dict__[errorstring]) # <<<<<<<<<<<<<< | |
34531 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34532 * | |
34533 */ | |
34534 { | |
34535 __Pyx_PyThreadState_declare | |
34536 __Pyx_PyThreadState_assign | |
34537 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); | |
34538 __Pyx_XGOTREF(__pyx_t_1); | |
34539 __Pyx_XGOTREF(__pyx_t_2); | |
34540 __Pyx_XGOTREF(__pyx_t_3); | |
34541 /*try:*/ { | |
34542 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ignored_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 999, __pyx_L3_error) | |
34543 __Pyx_GOTREF(__pyx_t_5); | |
34544 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_add); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L3_error) | |
34545 __Pyx_GOTREF(__pyx_t_6); | |
34546 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34547 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 999, __pyx_L3_error) | |
34548 __Pyx_GOTREF(__pyx_t_5); | |
34549 __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_errorstring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 999, __pyx_L3_error) | |
34550 __Pyx_GOTREF(__pyx_t_7); | |
34551 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34552 __pyx_t_5 = NULL; | |
34553 __pyx_t_8 = 0; | |
34554 #if CYTHON_UNPACK_METHODS | |
34555 if (likely(PyMethod_Check(__pyx_t_6))) { | |
34556 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); | |
34557 if (likely(__pyx_t_5)) { | |
34558 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
34559 __Pyx_INCREF(__pyx_t_5); | |
34560 __Pyx_INCREF(function); | |
34561 __Pyx_DECREF_SET(__pyx_t_6, function); | |
34562 __pyx_t_8 = 1; | |
34563 } | |
34564 } | |
34565 #endif | |
34566 { | |
34567 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7}; | |
34568 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
34569 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34570 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
34571 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L3_error) | |
34572 __Pyx_GOTREF(__pyx_t_4); | |
34573 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
34574 } | |
34575 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
34576 } | |
34577 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
34578 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
34579 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
34580 goto __pyx_L8_try_end; | |
34581 __pyx_L3_error:; | |
34582 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
34583 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34584 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
34585 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
34586 | |
34587 /* "pysam/libcvcf.pyx":1000 | |
34588 * def ignoreerror(self, errorstring): | |
34589 * try: self._ignored_errors.add(self.__dict__[errorstring]) | |
34590 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) # <<<<<<<<<<<<<< | |
34591 * | |
34592 * def warnerror(self, errorstring): | |
34593 */ | |
34594 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); | |
34595 if (__pyx_t_9) { | |
34596 __Pyx_AddTraceback("pysam.libcvcf.VCF.ignoreerror", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34597 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1000, __pyx_L5_except_error) | |
34598 __Pyx_XGOTREF(__pyx_t_4); | |
34599 __Pyx_XGOTREF(__pyx_t_6); | |
34600 __Pyx_XGOTREF(__pyx_t_7); | |
34601 __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Invalid_error_string_s, __pyx_v_errorstring); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1000, __pyx_L5_except_error) | |
34602 __Pyx_GOTREF(__pyx_t_5); | |
34603 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1000, __pyx_L5_except_error) | |
34604 __Pyx_GOTREF(__pyx_t_10); | |
34605 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34606 __Pyx_Raise(__pyx_t_10, 0, 0, 0); | |
34607 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
34608 __PYX_ERR(0, 1000, __pyx_L5_except_error) | |
34609 } | |
34610 goto __pyx_L5_except_error; | |
34611 | |
34612 /* "pysam/libcvcf.pyx":999 | |
34613 * | |
34614 * def ignoreerror(self, errorstring): | |
34615 * try: self._ignored_errors.add(self.__dict__[errorstring]) # <<<<<<<<<<<<<< | |
34616 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34617 * | |
34618 */ | |
34619 __pyx_L5_except_error:; | |
34620 __Pyx_XGIVEREF(__pyx_t_1); | |
34621 __Pyx_XGIVEREF(__pyx_t_2); | |
34622 __Pyx_XGIVEREF(__pyx_t_3); | |
34623 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); | |
34624 goto __pyx_L1_error; | |
34625 __pyx_L8_try_end:; | |
34626 } | |
34627 | |
34628 /* "pysam/libcvcf.pyx":998 | |
34629 * self._reference = ref | |
34630 * | |
34631 * def ignoreerror(self, errorstring): # <<<<<<<<<<<<<< | |
34632 * try: self._ignored_errors.add(self.__dict__[errorstring]) | |
34633 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34634 */ | |
34635 | |
34636 /* function exit code */ | |
34637 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
34638 goto __pyx_L0; | |
34639 __pyx_L1_error:; | |
34640 __Pyx_XDECREF(__pyx_t_4); | |
34641 __Pyx_XDECREF(__pyx_t_5); | |
34642 __Pyx_XDECREF(__pyx_t_6); | |
34643 __Pyx_XDECREF(__pyx_t_7); | |
34644 __Pyx_XDECREF(__pyx_t_10); | |
34645 __Pyx_AddTraceback("pysam.libcvcf.VCF.ignoreerror", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34646 __pyx_r = NULL; | |
34647 __pyx_L0:; | |
34648 __Pyx_XGIVEREF(__pyx_r); | |
34649 __Pyx_RefNannyFinishContext(); | |
34650 return __pyx_r; | |
34651 } | |
34652 | |
34653 /* "pysam/libcvcf.pyx":1002 | |
34654 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34655 * | |
34656 * def warnerror(self, errorstring): # <<<<<<<<<<<<<< | |
34657 * try: self._warn_errors.add(self.__dict__[errorstring]) | |
34658 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34659 */ | |
34660 | |
34661 /* Python wrapper */ | |
34662 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_70warnerror(PyObject *__pyx_self, | |
34663 #if CYTHON_METH_FASTCALL | |
34664 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34665 #else | |
34666 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34667 #endif | |
34668 ); /*proto*/ | |
34669 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_69warnerror, "VCF.warnerror(self, errorstring)"); | |
34670 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_70warnerror = {"warnerror", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_70warnerror, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_69warnerror}; | |
34671 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_70warnerror(PyObject *__pyx_self, | |
34672 #if CYTHON_METH_FASTCALL | |
34673 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34674 #else | |
34675 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34676 #endif | |
34677 ) { | |
34678 PyObject *__pyx_v_self = 0; | |
34679 PyObject *__pyx_v_errorstring = 0; | |
34680 #if !CYTHON_METH_FASTCALL | |
34681 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
34682 #endif | |
34683 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
34684 PyObject* values[2] = {0,0}; | |
34685 int __pyx_lineno = 0; | |
34686 const char *__pyx_filename = NULL; | |
34687 int __pyx_clineno = 0; | |
34688 PyObject *__pyx_r = 0; | |
34689 __Pyx_RefNannyDeclarations | |
34690 __Pyx_RefNannySetupContext("warnerror (wrapper)", 0); | |
34691 #if !CYTHON_METH_FASTCALL | |
34692 #if CYTHON_ASSUME_SAFE_MACROS | |
34693 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
34694 #else | |
34695 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
34696 #endif | |
34697 #endif | |
34698 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
34699 { | |
34700 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_errorstring,0}; | |
34701 if (__pyx_kwds) { | |
34702 Py_ssize_t kw_args; | |
34703 switch (__pyx_nargs) { | |
34704 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
34705 CYTHON_FALLTHROUGH; | |
34706 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
34707 CYTHON_FALLTHROUGH; | |
34708 case 0: break; | |
34709 default: goto __pyx_L5_argtuple_error; | |
34710 } | |
34711 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
34712 switch (__pyx_nargs) { | |
34713 case 0: | |
34714 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
34715 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
34716 kw_args--; | |
34717 } | |
34718 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L3_error) | |
34719 else goto __pyx_L5_argtuple_error; | |
34720 CYTHON_FALLTHROUGH; | |
34721 case 1: | |
34722 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_errorstring)) != 0)) { | |
34723 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
34724 kw_args--; | |
34725 } | |
34726 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L3_error) | |
34727 else { | |
34728 __Pyx_RaiseArgtupleInvalid("warnerror", 1, 2, 2, 1); __PYX_ERR(0, 1002, __pyx_L3_error) | |
34729 } | |
34730 } | |
34731 if (unlikely(kw_args > 0)) { | |
34732 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
34733 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "warnerror") < 0)) __PYX_ERR(0, 1002, __pyx_L3_error) | |
34734 } | |
34735 } else if (unlikely(__pyx_nargs != 2)) { | |
34736 goto __pyx_L5_argtuple_error; | |
34737 } else { | |
34738 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
34739 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
34740 } | |
34741 __pyx_v_self = values[0]; | |
34742 __pyx_v_errorstring = values[1]; | |
34743 } | |
34744 goto __pyx_L6_skip; | |
34745 __pyx_L5_argtuple_error:; | |
34746 __Pyx_RaiseArgtupleInvalid("warnerror", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1002, __pyx_L3_error) | |
34747 __pyx_L6_skip:; | |
34748 goto __pyx_L4_argument_unpacking_done; | |
34749 __pyx_L3_error:; | |
34750 { | |
34751 Py_ssize_t __pyx_temp; | |
34752 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
34753 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
34754 } | |
34755 } | |
34756 __Pyx_AddTraceback("pysam.libcvcf.VCF.warnerror", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34757 __Pyx_RefNannyFinishContext(); | |
34758 return NULL; | |
34759 __pyx_L4_argument_unpacking_done:; | |
34760 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_69warnerror(__pyx_self, __pyx_v_self, __pyx_v_errorstring); | |
34761 | |
34762 /* function exit code */ | |
34763 { | |
34764 Py_ssize_t __pyx_temp; | |
34765 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
34766 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
34767 } | |
34768 } | |
34769 __Pyx_RefNannyFinishContext(); | |
34770 return __pyx_r; | |
34771 } | |
34772 | |
34773 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_69warnerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errorstring) { | |
34774 PyObject *__pyx_r = NULL; | |
34775 __Pyx_RefNannyDeclarations | |
34776 PyObject *__pyx_t_1 = NULL; | |
34777 PyObject *__pyx_t_2 = NULL; | |
34778 PyObject *__pyx_t_3 = NULL; | |
34779 PyObject *__pyx_t_4 = NULL; | |
34780 PyObject *__pyx_t_5 = NULL; | |
34781 PyObject *__pyx_t_6 = NULL; | |
34782 PyObject *__pyx_t_7 = NULL; | |
34783 unsigned int __pyx_t_8; | |
34784 int __pyx_t_9; | |
34785 PyObject *__pyx_t_10 = NULL; | |
34786 int __pyx_lineno = 0; | |
34787 const char *__pyx_filename = NULL; | |
34788 int __pyx_clineno = 0; | |
34789 __Pyx_RefNannySetupContext("warnerror", 1); | |
34790 | |
34791 /* "pysam/libcvcf.pyx":1003 | |
34792 * | |
34793 * def warnerror(self, errorstring): | |
34794 * try: self._warn_errors.add(self.__dict__[errorstring]) # <<<<<<<<<<<<<< | |
34795 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34796 * | |
34797 */ | |
34798 { | |
34799 __Pyx_PyThreadState_declare | |
34800 __Pyx_PyThreadState_assign | |
34801 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); | |
34802 __Pyx_XGOTREF(__pyx_t_1); | |
34803 __Pyx_XGOTREF(__pyx_t_2); | |
34804 __Pyx_XGOTREF(__pyx_t_3); | |
34805 /*try:*/ { | |
34806 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_warn_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1003, __pyx_L3_error) | |
34807 __Pyx_GOTREF(__pyx_t_5); | |
34808 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_add); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L3_error) | |
34809 __Pyx_GOTREF(__pyx_t_6); | |
34810 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34811 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1003, __pyx_L3_error) | |
34812 __Pyx_GOTREF(__pyx_t_5); | |
34813 __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_errorstring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L3_error) | |
34814 __Pyx_GOTREF(__pyx_t_7); | |
34815 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34816 __pyx_t_5 = NULL; | |
34817 __pyx_t_8 = 0; | |
34818 #if CYTHON_UNPACK_METHODS | |
34819 if (likely(PyMethod_Check(__pyx_t_6))) { | |
34820 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); | |
34821 if (likely(__pyx_t_5)) { | |
34822 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
34823 __Pyx_INCREF(__pyx_t_5); | |
34824 __Pyx_INCREF(function); | |
34825 __Pyx_DECREF_SET(__pyx_t_6, function); | |
34826 __pyx_t_8 = 1; | |
34827 } | |
34828 } | |
34829 #endif | |
34830 { | |
34831 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7}; | |
34832 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
34833 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34834 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
34835 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L3_error) | |
34836 __Pyx_GOTREF(__pyx_t_4); | |
34837 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
34838 } | |
34839 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
34840 } | |
34841 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
34842 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
34843 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
34844 goto __pyx_L8_try_end; | |
34845 __pyx_L3_error:; | |
34846 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
34847 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34848 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
34849 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
34850 | |
34851 /* "pysam/libcvcf.pyx":1004 | |
34852 * def warnerror(self, errorstring): | |
34853 * try: self._warn_errors.add(self.__dict__[errorstring]) | |
34854 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) # <<<<<<<<<<<<<< | |
34855 * | |
34856 * def parse(self, stream): | |
34857 */ | |
34858 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); | |
34859 if (__pyx_t_9) { | |
34860 __Pyx_AddTraceback("pysam.libcvcf.VCF.warnerror", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34861 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1004, __pyx_L5_except_error) | |
34862 __Pyx_XGOTREF(__pyx_t_4); | |
34863 __Pyx_XGOTREF(__pyx_t_6); | |
34864 __Pyx_XGOTREF(__pyx_t_7); | |
34865 __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Invalid_error_string_s, __pyx_v_errorstring); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1004, __pyx_L5_except_error) | |
34866 __Pyx_GOTREF(__pyx_t_5); | |
34867 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1004, __pyx_L5_except_error) | |
34868 __Pyx_GOTREF(__pyx_t_10); | |
34869 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
34870 __Pyx_Raise(__pyx_t_10, 0, 0, 0); | |
34871 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
34872 __PYX_ERR(0, 1004, __pyx_L5_except_error) | |
34873 } | |
34874 goto __pyx_L5_except_error; | |
34875 | |
34876 /* "pysam/libcvcf.pyx":1003 | |
34877 * | |
34878 * def warnerror(self, errorstring): | |
34879 * try: self._warn_errors.add(self.__dict__[errorstring]) # <<<<<<<<<<<<<< | |
34880 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34881 * | |
34882 */ | |
34883 __pyx_L5_except_error:; | |
34884 __Pyx_XGIVEREF(__pyx_t_1); | |
34885 __Pyx_XGIVEREF(__pyx_t_2); | |
34886 __Pyx_XGIVEREF(__pyx_t_3); | |
34887 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); | |
34888 goto __pyx_L1_error; | |
34889 __pyx_L8_try_end:; | |
34890 } | |
34891 | |
34892 /* "pysam/libcvcf.pyx":1002 | |
34893 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34894 * | |
34895 * def warnerror(self, errorstring): # <<<<<<<<<<<<<< | |
34896 * try: self._warn_errors.add(self.__dict__[errorstring]) | |
34897 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34898 */ | |
34899 | |
34900 /* function exit code */ | |
34901 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
34902 goto __pyx_L0; | |
34903 __pyx_L1_error:; | |
34904 __Pyx_XDECREF(__pyx_t_4); | |
34905 __Pyx_XDECREF(__pyx_t_5); | |
34906 __Pyx_XDECREF(__pyx_t_6); | |
34907 __Pyx_XDECREF(__pyx_t_7); | |
34908 __Pyx_XDECREF(__pyx_t_10); | |
34909 __Pyx_AddTraceback("pysam.libcvcf.VCF.warnerror", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
34910 __pyx_r = NULL; | |
34911 __pyx_L0:; | |
34912 __Pyx_XGIVEREF(__pyx_r); | |
34913 __Pyx_RefNannyFinishContext(); | |
34914 return __pyx_r; | |
34915 } | |
34916 | |
34917 /* "pysam/libcvcf.pyx":1006 | |
34918 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
34919 * | |
34920 * def parse(self, stream): # <<<<<<<<<<<<<< | |
34921 * """ Parse a stream of VCF-formatted lines. Initializes class instance and return generator """ | |
34922 * last_line = self._parse_header(stream) | |
34923 */ | |
34924 | |
34925 /* Python wrapper */ | |
34926 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_72parse(PyObject *__pyx_self, | |
34927 #if CYTHON_METH_FASTCALL | |
34928 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34929 #else | |
34930 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34931 #endif | |
34932 ); /*proto*/ | |
34933 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_71parse, "VCF.parse(self, stream)\n Parse a stream of VCF-formatted lines. Initializes class instance and return generator "); | |
34934 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_72parse = {"parse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_72parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_71parse}; | |
34935 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_72parse(PyObject *__pyx_self, | |
34936 #if CYTHON_METH_FASTCALL | |
34937 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
34938 #else | |
34939 PyObject *__pyx_args, PyObject *__pyx_kwds | |
34940 #endif | |
34941 ) { | |
34942 PyObject *__pyx_v_self = 0; | |
34943 PyObject *__pyx_v_stream = 0; | |
34944 #if !CYTHON_METH_FASTCALL | |
34945 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
34946 #endif | |
34947 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
34948 PyObject* values[2] = {0,0}; | |
34949 int __pyx_lineno = 0; | |
34950 const char *__pyx_filename = NULL; | |
34951 int __pyx_clineno = 0; | |
34952 PyObject *__pyx_r = 0; | |
34953 __Pyx_RefNannyDeclarations | |
34954 __Pyx_RefNannySetupContext("parse (wrapper)", 0); | |
34955 #if !CYTHON_METH_FASTCALL | |
34956 #if CYTHON_ASSUME_SAFE_MACROS | |
34957 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
34958 #else | |
34959 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
34960 #endif | |
34961 #endif | |
34962 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
34963 { | |
34964 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0}; | |
34965 if (__pyx_kwds) { | |
34966 Py_ssize_t kw_args; | |
34967 switch (__pyx_nargs) { | |
34968 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
34969 CYTHON_FALLTHROUGH; | |
34970 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
34971 CYTHON_FALLTHROUGH; | |
34972 case 0: break; | |
34973 default: goto __pyx_L5_argtuple_error; | |
34974 } | |
34975 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
34976 switch (__pyx_nargs) { | |
34977 case 0: | |
34978 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
34979 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
34980 kw_args--; | |
34981 } | |
34982 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1006, __pyx_L3_error) | |
34983 else goto __pyx_L5_argtuple_error; | |
34984 CYTHON_FALLTHROUGH; | |
34985 case 1: | |
34986 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream)) != 0)) { | |
34987 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
34988 kw_args--; | |
34989 } | |
34990 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1006, __pyx_L3_error) | |
34991 else { | |
34992 __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, 1); __PYX_ERR(0, 1006, __pyx_L3_error) | |
34993 } | |
34994 } | |
34995 if (unlikely(kw_args > 0)) { | |
34996 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
34997 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse") < 0)) __PYX_ERR(0, 1006, __pyx_L3_error) | |
34998 } | |
34999 } else if (unlikely(__pyx_nargs != 2)) { | |
35000 goto __pyx_L5_argtuple_error; | |
35001 } else { | |
35002 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
35003 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
35004 } | |
35005 __pyx_v_self = values[0]; | |
35006 __pyx_v_stream = values[1]; | |
35007 } | |
35008 goto __pyx_L6_skip; | |
35009 __pyx_L5_argtuple_error:; | |
35010 __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1006, __pyx_L3_error) | |
35011 __pyx_L6_skip:; | |
35012 goto __pyx_L4_argument_unpacking_done; | |
35013 __pyx_L3_error:; | |
35014 { | |
35015 Py_ssize_t __pyx_temp; | |
35016 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
35017 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
35018 } | |
35019 } | |
35020 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
35021 __Pyx_RefNannyFinishContext(); | |
35022 return NULL; | |
35023 __pyx_L4_argument_unpacking_done:; | |
35024 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_71parse(__pyx_self, __pyx_v_self, __pyx_v_stream); | |
35025 | |
35026 /* function exit code */ | |
35027 { | |
35028 Py_ssize_t __pyx_temp; | |
35029 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
35030 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
35031 } | |
35032 } | |
35033 __Pyx_RefNannyFinishContext(); | |
35034 return __pyx_r; | |
35035 } | |
35036 | |
35037 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_71parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) { | |
35038 PyObject *__pyx_v_last_line = NULL; | |
35039 PyObject *__pyx_r = NULL; | |
35040 __Pyx_RefNannyDeclarations | |
35041 PyObject *__pyx_t_1 = NULL; | |
35042 PyObject *__pyx_t_2 = NULL; | |
35043 PyObject *__pyx_t_3 = NULL; | |
35044 unsigned int __pyx_t_4; | |
35045 int __pyx_lineno = 0; | |
35046 const char *__pyx_filename = NULL; | |
35047 int __pyx_clineno = 0; | |
35048 __Pyx_RefNannySetupContext("parse", 1); | |
35049 | |
35050 /* "pysam/libcvcf.pyx":1008 | |
35051 * def parse(self, stream): | |
35052 * """ Parse a stream of VCF-formatted lines. Initializes class instance and return generator """ | |
35053 * last_line = self._parse_header(stream) # <<<<<<<<<<<<<< | |
35054 * # now return a generator that does the actual work. In this way the pre-processing is done | |
35055 * # before the first piece of data is yielded | |
35056 */ | |
35057 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_header_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error) | |
35058 __Pyx_GOTREF(__pyx_t_2); | |
35059 __pyx_t_3 = NULL; | |
35060 __pyx_t_4 = 0; | |
35061 #if CYTHON_UNPACK_METHODS | |
35062 if (likely(PyMethod_Check(__pyx_t_2))) { | |
35063 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
35064 if (likely(__pyx_t_3)) { | |
35065 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
35066 __Pyx_INCREF(__pyx_t_3); | |
35067 __Pyx_INCREF(function); | |
35068 __Pyx_DECREF_SET(__pyx_t_2, function); | |
35069 __pyx_t_4 = 1; | |
35070 } | |
35071 } | |
35072 #endif | |
35073 { | |
35074 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_stream}; | |
35075 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
35076 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
35077 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) | |
35078 __Pyx_GOTREF(__pyx_t_1); | |
35079 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
35080 } | |
35081 __pyx_v_last_line = __pyx_t_1; | |
35082 __pyx_t_1 = 0; | |
35083 | |
35084 /* "pysam/libcvcf.pyx":1011 | |
35085 * # now return a generator that does the actual work. In this way the pre-processing is done | |
35086 * # before the first piece of data is yielded | |
35087 * return self._parse(last_line, stream) # <<<<<<<<<<<<<< | |
35088 * | |
35089 * def write(self, stream, datagenerator): | |
35090 */ | |
35091 __Pyx_XDECREF(__pyx_r); | |
35092 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error) | |
35093 __Pyx_GOTREF(__pyx_t_2); | |
35094 __pyx_t_3 = NULL; | |
35095 __pyx_t_4 = 0; | |
35096 #if CYTHON_UNPACK_METHODS | |
35097 if (likely(PyMethod_Check(__pyx_t_2))) { | |
35098 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
35099 if (likely(__pyx_t_3)) { | |
35100 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
35101 __Pyx_INCREF(__pyx_t_3); | |
35102 __Pyx_INCREF(function); | |
35103 __Pyx_DECREF_SET(__pyx_t_2, function); | |
35104 __pyx_t_4 = 1; | |
35105 } | |
35106 } | |
35107 #endif | |
35108 { | |
35109 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_last_line, __pyx_v_stream}; | |
35110 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
35111 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
35112 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error) | |
35113 __Pyx_GOTREF(__pyx_t_1); | |
35114 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
35115 } | |
35116 __pyx_r = __pyx_t_1; | |
35117 __pyx_t_1 = 0; | |
35118 goto __pyx_L0; | |
35119 | |
35120 /* "pysam/libcvcf.pyx":1006 | |
35121 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
35122 * | |
35123 * def parse(self, stream): # <<<<<<<<<<<<<< | |
35124 * """ Parse a stream of VCF-formatted lines. Initializes class instance and return generator """ | |
35125 * last_line = self._parse_header(stream) | |
35126 */ | |
35127 | |
35128 /* function exit code */ | |
35129 __pyx_L1_error:; | |
35130 __Pyx_XDECREF(__pyx_t_1); | |
35131 __Pyx_XDECREF(__pyx_t_2); | |
35132 __Pyx_XDECREF(__pyx_t_3); | |
35133 __Pyx_AddTraceback("pysam.libcvcf.VCF.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
35134 __pyx_r = NULL; | |
35135 __pyx_L0:; | |
35136 __Pyx_XDECREF(__pyx_v_last_line); | |
35137 __Pyx_XGIVEREF(__pyx_r); | |
35138 __Pyx_RefNannyFinishContext(); | |
35139 return __pyx_r; | |
35140 } | |
35141 | |
35142 /* "pysam/libcvcf.pyx":1013 | |
35143 * return self._parse(last_line, stream) | |
35144 * | |
35145 * def write(self, stream, datagenerator): # <<<<<<<<<<<<<< | |
35146 * """ Writes a VCF file to a stream, using a data generator (or list) """ | |
35147 * self.write_header(stream) | |
35148 */ | |
35149 | |
35150 /* Python wrapper */ | |
35151 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_74write(PyObject *__pyx_self, | |
35152 #if CYTHON_METH_FASTCALL | |
35153 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
35154 #else | |
35155 PyObject *__pyx_args, PyObject *__pyx_kwds | |
35156 #endif | |
35157 ); /*proto*/ | |
35158 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_73write, "VCF.write(self, stream, datagenerator)\n Writes a VCF file to a stream, using a data generator (or list) "); | |
35159 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_74write = {"write", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_74write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_73write}; | |
35160 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_74write(PyObject *__pyx_self, | |
35161 #if CYTHON_METH_FASTCALL | |
35162 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
35163 #else | |
35164 PyObject *__pyx_args, PyObject *__pyx_kwds | |
35165 #endif | |
35166 ) { | |
35167 PyObject *__pyx_v_self = 0; | |
35168 PyObject *__pyx_v_stream = 0; | |
35169 PyObject *__pyx_v_datagenerator = 0; | |
35170 #if !CYTHON_METH_FASTCALL | |
35171 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
35172 #endif | |
35173 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
35174 PyObject* values[3] = {0,0,0}; | |
35175 int __pyx_lineno = 0; | |
35176 const char *__pyx_filename = NULL; | |
35177 int __pyx_clineno = 0; | |
35178 PyObject *__pyx_r = 0; | |
35179 __Pyx_RefNannyDeclarations | |
35180 __Pyx_RefNannySetupContext("write (wrapper)", 0); | |
35181 #if !CYTHON_METH_FASTCALL | |
35182 #if CYTHON_ASSUME_SAFE_MACROS | |
35183 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
35184 #else | |
35185 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
35186 #endif | |
35187 #endif | |
35188 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
35189 { | |
35190 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,&__pyx_n_s_datagenerator,0}; | |
35191 if (__pyx_kwds) { | |
35192 Py_ssize_t kw_args; | |
35193 switch (__pyx_nargs) { | |
35194 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
35195 CYTHON_FALLTHROUGH; | |
35196 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
35197 CYTHON_FALLTHROUGH; | |
35198 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
35199 CYTHON_FALLTHROUGH; | |
35200 case 0: break; | |
35201 default: goto __pyx_L5_argtuple_error; | |
35202 } | |
35203 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
35204 switch (__pyx_nargs) { | |
35205 case 0: | |
35206 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
35207 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
35208 kw_args--; | |
35209 } | |
35210 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1013, __pyx_L3_error) | |
35211 else goto __pyx_L5_argtuple_error; | |
35212 CYTHON_FALLTHROUGH; | |
35213 case 1: | |
35214 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream)) != 0)) { | |
35215 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
35216 kw_args--; | |
35217 } | |
35218 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1013, __pyx_L3_error) | |
35219 else { | |
35220 __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, 1); __PYX_ERR(0, 1013, __pyx_L3_error) | |
35221 } | |
35222 CYTHON_FALLTHROUGH; | |
35223 case 2: | |
35224 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_datagenerator)) != 0)) { | |
35225 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
35226 kw_args--; | |
35227 } | |
35228 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1013, __pyx_L3_error) | |
35229 else { | |
35230 __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, 2); __PYX_ERR(0, 1013, __pyx_L3_error) | |
35231 } | |
35232 } | |
35233 if (unlikely(kw_args > 0)) { | |
35234 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
35235 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "write") < 0)) __PYX_ERR(0, 1013, __pyx_L3_error) | |
35236 } | |
35237 } else if (unlikely(__pyx_nargs != 3)) { | |
35238 goto __pyx_L5_argtuple_error; | |
35239 } else { | |
35240 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
35241 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
35242 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
35243 } | |
35244 __pyx_v_self = values[0]; | |
35245 __pyx_v_stream = values[1]; | |
35246 __pyx_v_datagenerator = values[2]; | |
35247 } | |
35248 goto __pyx_L6_skip; | |
35249 __pyx_L5_argtuple_error:; | |
35250 __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1013, __pyx_L3_error) | |
35251 __pyx_L6_skip:; | |
35252 goto __pyx_L4_argument_unpacking_done; | |
35253 __pyx_L3_error:; | |
35254 { | |
35255 Py_ssize_t __pyx_temp; | |
35256 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
35257 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
35258 } | |
35259 } | |
35260 __Pyx_AddTraceback("pysam.libcvcf.VCF.write", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
35261 __Pyx_RefNannyFinishContext(); | |
35262 return NULL; | |
35263 __pyx_L4_argument_unpacking_done:; | |
35264 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_73write(__pyx_self, __pyx_v_self, __pyx_v_stream, __pyx_v_datagenerator); | |
35265 | |
35266 /* function exit code */ | |
35267 { | |
35268 Py_ssize_t __pyx_temp; | |
35269 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
35270 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
35271 } | |
35272 } | |
35273 __Pyx_RefNannyFinishContext(); | |
35274 return __pyx_r; | |
35275 } | |
35276 | |
35277 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_73write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_datagenerator) { | |
35278 PyObject *__pyx_v_data = NULL; | |
35279 PyObject *__pyx_r = NULL; | |
35280 __Pyx_RefNannyDeclarations | |
35281 PyObject *__pyx_t_1 = NULL; | |
35282 PyObject *__pyx_t_2 = NULL; | |
35283 PyObject *__pyx_t_3 = NULL; | |
35284 unsigned int __pyx_t_4; | |
35285 Py_ssize_t __pyx_t_5; | |
35286 PyObject *(*__pyx_t_6)(PyObject *); | |
35287 PyObject *__pyx_t_7 = NULL; | |
35288 int __pyx_lineno = 0; | |
35289 const char *__pyx_filename = NULL; | |
35290 int __pyx_clineno = 0; | |
35291 __Pyx_RefNannySetupContext("write", 1); | |
35292 | |
35293 /* "pysam/libcvcf.pyx":1015 | |
35294 * def write(self, stream, datagenerator): | |
35295 * """ Writes a VCF file to a stream, using a data generator (or list) """ | |
35296 * self.write_header(stream) # <<<<<<<<<<<<<< | |
35297 * self.write_heading(stream) | |
35298 * for data in datagenerator: self.write_data(stream,data) | |
35299 */ | |
35300 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_header); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error) | |
35301 __Pyx_GOTREF(__pyx_t_2); | |
35302 __pyx_t_3 = NULL; | |
35303 __pyx_t_4 = 0; | |
35304 #if CYTHON_UNPACK_METHODS | |
35305 if (likely(PyMethod_Check(__pyx_t_2))) { | |
35306 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
35307 if (likely(__pyx_t_3)) { | |
35308 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
35309 __Pyx_INCREF(__pyx_t_3); | |
35310 __Pyx_INCREF(function); | |
35311 __Pyx_DECREF_SET(__pyx_t_2, function); | |
35312 __pyx_t_4 = 1; | |
35313 } | |
35314 } | |
35315 #endif | |
35316 { | |
35317 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_stream}; | |
35318 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
35319 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
35320 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) | |
35321 __Pyx_GOTREF(__pyx_t_1); | |
35322 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
35323 } | |
35324 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
35325 | |
35326 /* "pysam/libcvcf.pyx":1016 | |
35327 * """ Writes a VCF file to a stream, using a data generator (or list) """ | |
35328 * self.write_header(stream) | |
35329 * self.write_heading(stream) # <<<<<<<<<<<<<< | |
35330 * for data in datagenerator: self.write_data(stream,data) | |
35331 * | |
35332 */ | |
35333 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_heading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) | |
35334 __Pyx_GOTREF(__pyx_t_2); | |
35335 __pyx_t_3 = NULL; | |
35336 __pyx_t_4 = 0; | |
35337 #if CYTHON_UNPACK_METHODS | |
35338 if (likely(PyMethod_Check(__pyx_t_2))) { | |
35339 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
35340 if (likely(__pyx_t_3)) { | |
35341 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
35342 __Pyx_INCREF(__pyx_t_3); | |
35343 __Pyx_INCREF(function); | |
35344 __Pyx_DECREF_SET(__pyx_t_2, function); | |
35345 __pyx_t_4 = 1; | |
35346 } | |
35347 } | |
35348 #endif | |
35349 { | |
35350 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_stream}; | |
35351 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
35352 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
35353 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) | |
35354 __Pyx_GOTREF(__pyx_t_1); | |
35355 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
35356 } | |
35357 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
35358 | |
35359 /* "pysam/libcvcf.pyx":1017 | |
35360 * self.write_header(stream) | |
35361 * self.write_heading(stream) | |
35362 * for data in datagenerator: self.write_data(stream,data) # <<<<<<<<<<<<<< | |
35363 * | |
35364 * def writeheader(self, stream): | |
35365 */ | |
35366 if (likely(PyList_CheckExact(__pyx_v_datagenerator)) || PyTuple_CheckExact(__pyx_v_datagenerator)) { | |
35367 __pyx_t_1 = __pyx_v_datagenerator; __Pyx_INCREF(__pyx_t_1); | |
35368 __pyx_t_5 = 0; | |
35369 __pyx_t_6 = NULL; | |
35370 } else { | |
35371 __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_datagenerator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35372 __Pyx_GOTREF(__pyx_t_1); | |
35373 __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35374 } | |
35375 for (;;) { | |
35376 if (likely(!__pyx_t_6)) { | |
35377 if (likely(PyList_CheckExact(__pyx_t_1))) { | |
35378 { | |
35379 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); | |
35380 #if !CYTHON_ASSUME_SAFE_MACROS | |
35381 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35382 #endif | |
35383 if (__pyx_t_5 >= __pyx_temp) break; | |
35384 } | |
35385 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
35386 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35387 #else | |
35388 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35389 __Pyx_GOTREF(__pyx_t_2); | |
35390 #endif | |
35391 } else { | |
35392 { | |
35393 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); | |
35394 #if !CYTHON_ASSUME_SAFE_MACROS | |
35395 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35396 #endif | |
35397 if (__pyx_t_5 >= __pyx_temp) break; | |
35398 } | |
35399 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
35400 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35401 #else | |
35402 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35403 __Pyx_GOTREF(__pyx_t_2); | |
35404 #endif | |
35405 } | |
35406 } else { | |
35407 __pyx_t_2 = __pyx_t_6(__pyx_t_1); | |
35408 if (unlikely(!__pyx_t_2)) { | |
35409 PyObject* exc_type = PyErr_Occurred(); | |
35410 if (exc_type) { | |
35411 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); | |
35412 else __PYX_ERR(0, 1017, __pyx_L1_error) | |
35413 } | |
35414 break; | |
35415 } | |
35416 __Pyx_GOTREF(__pyx_t_2); | |
35417 } | |
35418 __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_2); | |
35419 __pyx_t_2 = 0; | |
35420 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35421 __Pyx_GOTREF(__pyx_t_3); | |
35422 __pyx_t_7 = NULL; | |
35423 __pyx_t_4 = 0; | |
35424 #if CYTHON_UNPACK_METHODS | |
35425 if (likely(PyMethod_Check(__pyx_t_3))) { | |
35426 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); | |
35427 if (likely(__pyx_t_7)) { | |
35428 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
35429 __Pyx_INCREF(__pyx_t_7); | |
35430 __Pyx_INCREF(function); | |
35431 __Pyx_DECREF_SET(__pyx_t_3, function); | |
35432 __pyx_t_4 = 1; | |
35433 } | |
35434 } | |
35435 #endif | |
35436 { | |
35437 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_stream, __pyx_v_data}; | |
35438 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
35439 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
35440 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error) | |
35441 __Pyx_GOTREF(__pyx_t_2); | |
35442 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
35443 } | |
35444 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
35445 } | |
35446 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
35447 | |
35448 /* "pysam/libcvcf.pyx":1013 | |
35449 * return self._parse(last_line, stream) | |
35450 * | |
35451 * def write(self, stream, datagenerator): # <<<<<<<<<<<<<< | |
35452 * """ Writes a VCF file to a stream, using a data generator (or list) """ | |
35453 * self.write_header(stream) | |
35454 */ | |
35455 | |
35456 /* function exit code */ | |
35457 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
35458 goto __pyx_L0; | |
35459 __pyx_L1_error:; | |
35460 __Pyx_XDECREF(__pyx_t_1); | |
35461 __Pyx_XDECREF(__pyx_t_2); | |
35462 __Pyx_XDECREF(__pyx_t_3); | |
35463 __Pyx_XDECREF(__pyx_t_7); | |
35464 __Pyx_AddTraceback("pysam.libcvcf.VCF.write", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
35465 __pyx_r = NULL; | |
35466 __pyx_L0:; | |
35467 __Pyx_XDECREF(__pyx_v_data); | |
35468 __Pyx_XGIVEREF(__pyx_r); | |
35469 __Pyx_RefNannyFinishContext(); | |
35470 return __pyx_r; | |
35471 } | |
35472 | |
35473 /* "pysam/libcvcf.pyx":1019 | |
35474 * for data in datagenerator: self.write_data(stream,data) | |
35475 * | |
35476 * def writeheader(self, stream): # <<<<<<<<<<<<<< | |
35477 * """ Writes a VCF header """ | |
35478 * self.write_header(stream) | |
35479 */ | |
35480 | |
35481 /* Python wrapper */ | |
35482 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_76writeheader(PyObject *__pyx_self, | |
35483 #if CYTHON_METH_FASTCALL | |
35484 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
35485 #else | |
35486 PyObject *__pyx_args, PyObject *__pyx_kwds | |
35487 #endif | |
35488 ); /*proto*/ | |
35489 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_75writeheader, "VCF.writeheader(self, stream)\n Writes a VCF header "); | |
35490 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_76writeheader = {"writeheader", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_76writeheader, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_75writeheader}; | |
35491 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_76writeheader(PyObject *__pyx_self, | |
35492 #if CYTHON_METH_FASTCALL | |
35493 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
35494 #else | |
35495 PyObject *__pyx_args, PyObject *__pyx_kwds | |
35496 #endif | |
35497 ) { | |
35498 PyObject *__pyx_v_self = 0; | |
35499 PyObject *__pyx_v_stream = 0; | |
35500 #if !CYTHON_METH_FASTCALL | |
35501 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
35502 #endif | |
35503 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
35504 PyObject* values[2] = {0,0}; | |
35505 int __pyx_lineno = 0; | |
35506 const char *__pyx_filename = NULL; | |
35507 int __pyx_clineno = 0; | |
35508 PyObject *__pyx_r = 0; | |
35509 __Pyx_RefNannyDeclarations | |
35510 __Pyx_RefNannySetupContext("writeheader (wrapper)", 0); | |
35511 #if !CYTHON_METH_FASTCALL | |
35512 #if CYTHON_ASSUME_SAFE_MACROS | |
35513 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
35514 #else | |
35515 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
35516 #endif | |
35517 #endif | |
35518 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
35519 { | |
35520 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0}; | |
35521 if (__pyx_kwds) { | |
35522 Py_ssize_t kw_args; | |
35523 switch (__pyx_nargs) { | |
35524 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
35525 CYTHON_FALLTHROUGH; | |
35526 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
35527 CYTHON_FALLTHROUGH; | |
35528 case 0: break; | |
35529 default: goto __pyx_L5_argtuple_error; | |
35530 } | |
35531 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
35532 switch (__pyx_nargs) { | |
35533 case 0: | |
35534 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
35535 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
35536 kw_args--; | |
35537 } | |
35538 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L3_error) | |
35539 else goto __pyx_L5_argtuple_error; | |
35540 CYTHON_FALLTHROUGH; | |
35541 case 1: | |
35542 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stream)) != 0)) { | |
35543 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
35544 kw_args--; | |
35545 } | |
35546 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L3_error) | |
35547 else { | |
35548 __Pyx_RaiseArgtupleInvalid("writeheader", 1, 2, 2, 1); __PYX_ERR(0, 1019, __pyx_L3_error) | |
35549 } | |
35550 } | |
35551 if (unlikely(kw_args > 0)) { | |
35552 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
35553 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "writeheader") < 0)) __PYX_ERR(0, 1019, __pyx_L3_error) | |
35554 } | |
35555 } else if (unlikely(__pyx_nargs != 2)) { | |
35556 goto __pyx_L5_argtuple_error; | |
35557 } else { | |
35558 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
35559 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
35560 } | |
35561 __pyx_v_self = values[0]; | |
35562 __pyx_v_stream = values[1]; | |
35563 } | |
35564 goto __pyx_L6_skip; | |
35565 __pyx_L5_argtuple_error:; | |
35566 __Pyx_RaiseArgtupleInvalid("writeheader", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1019, __pyx_L3_error) | |
35567 __pyx_L6_skip:; | |
35568 goto __pyx_L4_argument_unpacking_done; | |
35569 __pyx_L3_error:; | |
35570 { | |
35571 Py_ssize_t __pyx_temp; | |
35572 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
35573 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
35574 } | |
35575 } | |
35576 __Pyx_AddTraceback("pysam.libcvcf.VCF.writeheader", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
35577 __Pyx_RefNannyFinishContext(); | |
35578 return NULL; | |
35579 __pyx_L4_argument_unpacking_done:; | |
35580 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_75writeheader(__pyx_self, __pyx_v_self, __pyx_v_stream); | |
35581 | |
35582 /* function exit code */ | |
35583 { | |
35584 Py_ssize_t __pyx_temp; | |
35585 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
35586 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
35587 } | |
35588 } | |
35589 __Pyx_RefNannyFinishContext(); | |
35590 return __pyx_r; | |
35591 } | |
35592 | |
35593 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_75writeheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) { | |
35594 PyObject *__pyx_r = NULL; | |
35595 __Pyx_RefNannyDeclarations | |
35596 PyObject *__pyx_t_1 = NULL; | |
35597 PyObject *__pyx_t_2 = NULL; | |
35598 PyObject *__pyx_t_3 = NULL; | |
35599 unsigned int __pyx_t_4; | |
35600 int __pyx_lineno = 0; | |
35601 const char *__pyx_filename = NULL; | |
35602 int __pyx_clineno = 0; | |
35603 __Pyx_RefNannySetupContext("writeheader", 1); | |
35604 | |
35605 /* "pysam/libcvcf.pyx":1021 | |
35606 * def writeheader(self, stream): | |
35607 * """ Writes a VCF header """ | |
35608 * self.write_header(stream) # <<<<<<<<<<<<<< | |
35609 * self.write_heading(stream) | |
35610 * | |
35611 */ | |
35612 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_header); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error) | |
35613 __Pyx_GOTREF(__pyx_t_2); | |
35614 __pyx_t_3 = NULL; | |
35615 __pyx_t_4 = 0; | |
35616 #if CYTHON_UNPACK_METHODS | |
35617 if (likely(PyMethod_Check(__pyx_t_2))) { | |
35618 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
35619 if (likely(__pyx_t_3)) { | |
35620 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
35621 __Pyx_INCREF(__pyx_t_3); | |
35622 __Pyx_INCREF(function); | |
35623 __Pyx_DECREF_SET(__pyx_t_2, function); | |
35624 __pyx_t_4 = 1; | |
35625 } | |
35626 } | |
35627 #endif | |
35628 { | |
35629 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_stream}; | |
35630 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
35631 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
35632 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L1_error) | |
35633 __Pyx_GOTREF(__pyx_t_1); | |
35634 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
35635 } | |
35636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
35637 | |
35638 /* "pysam/libcvcf.pyx":1022 | |
35639 * """ Writes a VCF header """ | |
35640 * self.write_header(stream) | |
35641 * self.write_heading(stream) # <<<<<<<<<<<<<< | |
35642 * | |
35643 * def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2): | |
35644 */ | |
35645 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_heading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error) | |
35646 __Pyx_GOTREF(__pyx_t_2); | |
35647 __pyx_t_3 = NULL; | |
35648 __pyx_t_4 = 0; | |
35649 #if CYTHON_UNPACK_METHODS | |
35650 if (likely(PyMethod_Check(__pyx_t_2))) { | |
35651 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
35652 if (likely(__pyx_t_3)) { | |
35653 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
35654 __Pyx_INCREF(__pyx_t_3); | |
35655 __Pyx_INCREF(function); | |
35656 __Pyx_DECREF_SET(__pyx_t_2, function); | |
35657 __pyx_t_4 = 1; | |
35658 } | |
35659 } | |
35660 #endif | |
35661 { | |
35662 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_stream}; | |
35663 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
35664 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
35665 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error) | |
35666 __Pyx_GOTREF(__pyx_t_1); | |
35667 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
35668 } | |
35669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
35670 | |
35671 /* "pysam/libcvcf.pyx":1019 | |
35672 * for data in datagenerator: self.write_data(stream,data) | |
35673 * | |
35674 * def writeheader(self, stream): # <<<<<<<<<<<<<< | |
35675 * """ Writes a VCF header """ | |
35676 * self.write_header(stream) | |
35677 */ | |
35678 | |
35679 /* function exit code */ | |
35680 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
35681 goto __pyx_L0; | |
35682 __pyx_L1_error:; | |
35683 __Pyx_XDECREF(__pyx_t_1); | |
35684 __Pyx_XDECREF(__pyx_t_2); | |
35685 __Pyx_XDECREF(__pyx_t_3); | |
35686 __Pyx_AddTraceback("pysam.libcvcf.VCF.writeheader", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
35687 __pyx_r = NULL; | |
35688 __pyx_L0:; | |
35689 __Pyx_XGIVEREF(__pyx_r); | |
35690 __Pyx_RefNannyFinishContext(); | |
35691 return __pyx_r; | |
35692 } | |
35693 | |
35694 /* "pysam/libcvcf.pyx":1024 | |
35695 * self.write_heading(stream) | |
35696 * | |
35697 * def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2): # <<<<<<<<<<<<<< | |
35698 * """ Utility function: compares two calls for equality """ | |
35699 * # a variant should always be assigned to a unique position, one base before | |
35700 */ | |
35701 | |
35702 /* Python wrapper */ | |
35703 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_78compare_calls(PyObject *__pyx_self, | |
35704 #if CYTHON_METH_FASTCALL | |
35705 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
35706 #else | |
35707 PyObject *__pyx_args, PyObject *__pyx_kwds | |
35708 #endif | |
35709 ); /*proto*/ | |
35710 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_77compare_calls, "VCF.compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2)\n Utility function: compares two calls for equality "); | |
35711 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_78compare_calls = {"compare_calls", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_78compare_calls, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_77compare_calls}; | |
35712 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_78compare_calls(PyObject *__pyx_self, | |
35713 #if CYTHON_METH_FASTCALL | |
35714 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
35715 #else | |
35716 PyObject *__pyx_args, PyObject *__pyx_kwds | |
35717 #endif | |
35718 ) { | |
35719 CYTHON_UNUSED PyObject *__pyx_v_self = 0; | |
35720 PyObject *__pyx_v_pos1 = 0; | |
35721 PyObject *__pyx_v_ref1 = 0; | |
35722 PyObject *__pyx_v_alt1 = 0; | |
35723 PyObject *__pyx_v_pos2 = 0; | |
35724 PyObject *__pyx_v_ref2 = 0; | |
35725 PyObject *__pyx_v_alt2 = 0; | |
35726 #if !CYTHON_METH_FASTCALL | |
35727 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
35728 #endif | |
35729 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
35730 PyObject* values[7] = {0,0,0,0,0,0,0}; | |
35731 int __pyx_lineno = 0; | |
35732 const char *__pyx_filename = NULL; | |
35733 int __pyx_clineno = 0; | |
35734 PyObject *__pyx_r = 0; | |
35735 __Pyx_RefNannyDeclarations | |
35736 __Pyx_RefNannySetupContext("compare_calls (wrapper)", 0); | |
35737 #if !CYTHON_METH_FASTCALL | |
35738 #if CYTHON_ASSUME_SAFE_MACROS | |
35739 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
35740 #else | |
35741 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
35742 #endif | |
35743 #endif | |
35744 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
35745 { | |
35746 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_pos1,&__pyx_n_s_ref1,&__pyx_n_s_alt1,&__pyx_n_s_pos2,&__pyx_n_s_ref2,&__pyx_n_s_alt2,0}; | |
35747 if (__pyx_kwds) { | |
35748 Py_ssize_t kw_args; | |
35749 switch (__pyx_nargs) { | |
35750 case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); | |
35751 CYTHON_FALLTHROUGH; | |
35752 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
35753 CYTHON_FALLTHROUGH; | |
35754 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
35755 CYTHON_FALLTHROUGH; | |
35756 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
35757 CYTHON_FALLTHROUGH; | |
35758 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
35759 CYTHON_FALLTHROUGH; | |
35760 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
35761 CYTHON_FALLTHROUGH; | |
35762 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
35763 CYTHON_FALLTHROUGH; | |
35764 case 0: break; | |
35765 default: goto __pyx_L5_argtuple_error; | |
35766 } | |
35767 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
35768 switch (__pyx_nargs) { | |
35769 case 0: | |
35770 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
35771 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
35772 kw_args--; | |
35773 } | |
35774 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L3_error) | |
35775 else goto __pyx_L5_argtuple_error; | |
35776 CYTHON_FALLTHROUGH; | |
35777 case 1: | |
35778 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos1)) != 0)) { | |
35779 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
35780 kw_args--; | |
35781 } | |
35782 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L3_error) | |
35783 else { | |
35784 __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 1); __PYX_ERR(0, 1024, __pyx_L3_error) | |
35785 } | |
35786 CYTHON_FALLTHROUGH; | |
35787 case 2: | |
35788 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref1)) != 0)) { | |
35789 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
35790 kw_args--; | |
35791 } | |
35792 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L3_error) | |
35793 else { | |
35794 __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 2); __PYX_ERR(0, 1024, __pyx_L3_error) | |
35795 } | |
35796 CYTHON_FALLTHROUGH; | |
35797 case 3: | |
35798 if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alt1)) != 0)) { | |
35799 (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); | |
35800 kw_args--; | |
35801 } | |
35802 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L3_error) | |
35803 else { | |
35804 __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 3); __PYX_ERR(0, 1024, __pyx_L3_error) | |
35805 } | |
35806 CYTHON_FALLTHROUGH; | |
35807 case 4: | |
35808 if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pos2)) != 0)) { | |
35809 (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); | |
35810 kw_args--; | |
35811 } | |
35812 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L3_error) | |
35813 else { | |
35814 __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 4); __PYX_ERR(0, 1024, __pyx_L3_error) | |
35815 } | |
35816 CYTHON_FALLTHROUGH; | |
35817 case 5: | |
35818 if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref2)) != 0)) { | |
35819 (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); | |
35820 kw_args--; | |
35821 } | |
35822 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L3_error) | |
35823 else { | |
35824 __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 5); __PYX_ERR(0, 1024, __pyx_L3_error) | |
35825 } | |
35826 CYTHON_FALLTHROUGH; | |
35827 case 6: | |
35828 if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alt2)) != 0)) { | |
35829 (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); | |
35830 kw_args--; | |
35831 } | |
35832 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L3_error) | |
35833 else { | |
35834 __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 6); __PYX_ERR(0, 1024, __pyx_L3_error) | |
35835 } | |
35836 } | |
35837 if (unlikely(kw_args > 0)) { | |
35838 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
35839 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compare_calls") < 0)) __PYX_ERR(0, 1024, __pyx_L3_error) | |
35840 } | |
35841 } else if (unlikely(__pyx_nargs != 7)) { | |
35842 goto __pyx_L5_argtuple_error; | |
35843 } else { | |
35844 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
35845 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
35846 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
35847 values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
35848 values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
35849 values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
35850 values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); | |
35851 } | |
35852 __pyx_v_self = values[0]; | |
35853 __pyx_v_pos1 = values[1]; | |
35854 __pyx_v_ref1 = values[2]; | |
35855 __pyx_v_alt1 = values[3]; | |
35856 __pyx_v_pos2 = values[4]; | |
35857 __pyx_v_ref2 = values[5]; | |
35858 __pyx_v_alt2 = values[6]; | |
35859 } | |
35860 goto __pyx_L6_skip; | |
35861 __pyx_L5_argtuple_error:; | |
35862 __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 1024, __pyx_L3_error) | |
35863 __pyx_L6_skip:; | |
35864 goto __pyx_L4_argument_unpacking_done; | |
35865 __pyx_L3_error:; | |
35866 { | |
35867 Py_ssize_t __pyx_temp; | |
35868 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
35869 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
35870 } | |
35871 } | |
35872 __Pyx_AddTraceback("pysam.libcvcf.VCF.compare_calls", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
35873 __Pyx_RefNannyFinishContext(); | |
35874 return NULL; | |
35875 __pyx_L4_argument_unpacking_done:; | |
35876 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_77compare_calls(__pyx_self, __pyx_v_self, __pyx_v_pos1, __pyx_v_ref1, __pyx_v_alt1, __pyx_v_pos2, __pyx_v_ref2, __pyx_v_alt2); | |
35877 | |
35878 /* function exit code */ | |
35879 { | |
35880 Py_ssize_t __pyx_temp; | |
35881 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
35882 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
35883 } | |
35884 } | |
35885 __Pyx_RefNannyFinishContext(); | |
35886 return __pyx_r; | |
35887 } | |
35888 | |
35889 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_77compare_calls(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_pos1, PyObject *__pyx_v_ref1, PyObject *__pyx_v_alt1, PyObject *__pyx_v_pos2, PyObject *__pyx_v_ref2, PyObject *__pyx_v_alt2) { | |
35890 PyObject *__pyx_r = NULL; | |
35891 __Pyx_RefNannyDeclarations | |
35892 PyObject *__pyx_t_1 = NULL; | |
35893 int __pyx_t_2; | |
35894 Py_ssize_t __pyx_t_3; | |
35895 int __pyx_t_4; | |
35896 PyObject *__pyx_t_5 = NULL; | |
35897 PyObject *__pyx_t_6 = NULL; | |
35898 int __pyx_lineno = 0; | |
35899 const char *__pyx_filename = NULL; | |
35900 int __pyx_clineno = 0; | |
35901 __Pyx_RefNannySetupContext("compare_calls", 0); | |
35902 __Pyx_INCREF(__pyx_v_ref1); | |
35903 __Pyx_INCREF(__pyx_v_alt1); | |
35904 __Pyx_INCREF(__pyx_v_ref2); | |
35905 __Pyx_INCREF(__pyx_v_alt2); | |
35906 | |
35907 /* "pysam/libcvcf.pyx":1029 | |
35908 * # the leftmost position of the alignment gap. If this rule is implemented | |
35909 * # correctly, the two positions must be equal for the calls to be identical. | |
35910 * if pos1 != pos2: return False # <<<<<<<<<<<<<< | |
35911 * # from both calls, trim rightmost bases when identical. Do this safely, i.e. | |
35912 * # only when the reference bases are not Ns | |
35913 */ | |
35914 __pyx_t_1 = PyObject_RichCompare(__pyx_v_pos1, __pyx_v_pos2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) | |
35915 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) | |
35916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
35917 if (__pyx_t_2) { | |
35918 __Pyx_XDECREF(__pyx_r); | |
35919 __Pyx_INCREF(Py_False); | |
35920 __pyx_r = Py_False; | |
35921 goto __pyx_L0; | |
35922 } | |
35923 | |
35924 /* "pysam/libcvcf.pyx":1032 | |
35925 * # from both calls, trim rightmost bases when identical. Do this safely, i.e. | |
35926 * # only when the reference bases are not Ns | |
35927 * while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]: # <<<<<<<<<<<<<< | |
35928 * ref1 = ref1[:-1] | |
35929 * alt1 = alt1[:-1] | |
35930 */ | |
35931 while (1) { | |
35932 __pyx_t_3 = PyObject_Length(__pyx_v_ref1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1032, __pyx_L1_error) | |
35933 __pyx_t_4 = (__pyx_t_3 > 0); | |
35934 if (__pyx_t_4) { | |
35935 } else { | |
35936 __pyx_t_2 = __pyx_t_4; | |
35937 goto __pyx_L6_bool_binop_done; | |
35938 } | |
35939 __pyx_t_3 = PyObject_Length(__pyx_v_alt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1032, __pyx_L1_error) | |
35940 __pyx_t_4 = (__pyx_t_3 > 0); | |
35941 if (__pyx_t_4) { | |
35942 } else { | |
35943 __pyx_t_2 = __pyx_t_4; | |
35944 goto __pyx_L6_bool_binop_done; | |
35945 } | |
35946 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ref1, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) | |
35947 __Pyx_GOTREF(__pyx_t_1); | |
35948 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alt1, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error) | |
35949 __Pyx_GOTREF(__pyx_t_5); | |
35950 __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error) | |
35951 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
35952 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
35953 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1032, __pyx_L1_error) | |
35954 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
35955 __pyx_t_2 = __pyx_t_4; | |
35956 __pyx_L6_bool_binop_done:; | |
35957 if (!__pyx_t_2) break; | |
35958 | |
35959 /* "pysam/libcvcf.pyx":1033 | |
35960 * # only when the reference bases are not Ns | |
35961 * while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]: | |
35962 * ref1 = ref1[:-1] # <<<<<<<<<<<<<< | |
35963 * alt1 = alt1[:-1] | |
35964 * while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]: | |
35965 */ | |
35966 __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_ref1, 0, -1L, NULL, NULL, &__pyx_slice__28, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1033, __pyx_L1_error) | |
35967 __Pyx_GOTREF(__pyx_t_6); | |
35968 __Pyx_DECREF_SET(__pyx_v_ref1, __pyx_t_6); | |
35969 __pyx_t_6 = 0; | |
35970 | |
35971 /* "pysam/libcvcf.pyx":1034 | |
35972 * while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]: | |
35973 * ref1 = ref1[:-1] | |
35974 * alt1 = alt1[:-1] # <<<<<<<<<<<<<< | |
35975 * while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]: | |
35976 * ref2 = ref2[:-1] | |
35977 */ | |
35978 __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_alt1, 0, -1L, NULL, NULL, &__pyx_slice__28, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error) | |
35979 __Pyx_GOTREF(__pyx_t_6); | |
35980 __Pyx_DECREF_SET(__pyx_v_alt1, __pyx_t_6); | |
35981 __pyx_t_6 = 0; | |
35982 } | |
35983 | |
35984 /* "pysam/libcvcf.pyx":1035 | |
35985 * ref1 = ref1[:-1] | |
35986 * alt1 = alt1[:-1] | |
35987 * while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]: # <<<<<<<<<<<<<< | |
35988 * ref2 = ref2[:-1] | |
35989 * alt2 = alt2[:-1] | |
35990 */ | |
35991 while (1) { | |
35992 __pyx_t_3 = PyObject_Length(__pyx_v_ref2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1035, __pyx_L1_error) | |
35993 __pyx_t_4 = (__pyx_t_3 > 0); | |
35994 if (__pyx_t_4) { | |
35995 } else { | |
35996 __pyx_t_2 = __pyx_t_4; | |
35997 goto __pyx_L11_bool_binop_done; | |
35998 } | |
35999 __pyx_t_3 = PyObject_Length(__pyx_v_alt2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1035, __pyx_L1_error) | |
36000 __pyx_t_4 = (__pyx_t_3 > 0); | |
36001 if (__pyx_t_4) { | |
36002 } else { | |
36003 __pyx_t_2 = __pyx_t_4; | |
36004 goto __pyx_L11_bool_binop_done; | |
36005 } | |
36006 __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_ref2, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1035, __pyx_L1_error) | |
36007 __Pyx_GOTREF(__pyx_t_6); | |
36008 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alt2, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1035, __pyx_L1_error) | |
36009 __Pyx_GOTREF(__pyx_t_5); | |
36010 __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) | |
36011 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
36012 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
36013 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error) | |
36014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36015 __pyx_t_2 = __pyx_t_4; | |
36016 __pyx_L11_bool_binop_done:; | |
36017 if (!__pyx_t_2) break; | |
36018 | |
36019 /* "pysam/libcvcf.pyx":1036 | |
36020 * alt1 = alt1[:-1] | |
36021 * while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]: | |
36022 * ref2 = ref2[:-1] # <<<<<<<<<<<<<< | |
36023 * alt2 = alt2[:-1] | |
36024 * # now, the alternative alleles must be identical | |
36025 */ | |
36026 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_ref2, 0, -1L, NULL, NULL, &__pyx_slice__28, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error) | |
36027 __Pyx_GOTREF(__pyx_t_1); | |
36028 __Pyx_DECREF_SET(__pyx_v_ref2, __pyx_t_1); | |
36029 __pyx_t_1 = 0; | |
36030 | |
36031 /* "pysam/libcvcf.pyx":1037 | |
36032 * while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]: | |
36033 * ref2 = ref2[:-1] | |
36034 * alt2 = alt2[:-1] # <<<<<<<<<<<<<< | |
36035 * # now, the alternative alleles must be identical | |
36036 * return alt1 == alt2 | |
36037 */ | |
36038 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_alt2, 0, -1L, NULL, NULL, &__pyx_slice__28, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error) | |
36039 __Pyx_GOTREF(__pyx_t_1); | |
36040 __Pyx_DECREF_SET(__pyx_v_alt2, __pyx_t_1); | |
36041 __pyx_t_1 = 0; | |
36042 } | |
36043 | |
36044 /* "pysam/libcvcf.pyx":1039 | |
36045 * alt2 = alt2[:-1] | |
36046 * # now, the alternative alleles must be identical | |
36047 * return alt1 == alt2 # <<<<<<<<<<<<<< | |
36048 * | |
36049 * ########################################################################################################### | |
36050 */ | |
36051 __Pyx_XDECREF(__pyx_r); | |
36052 __pyx_t_1 = PyObject_RichCompare(__pyx_v_alt1, __pyx_v_alt2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) | |
36053 __pyx_r = __pyx_t_1; | |
36054 __pyx_t_1 = 0; | |
36055 goto __pyx_L0; | |
36056 | |
36057 /* "pysam/libcvcf.pyx":1024 | |
36058 * self.write_heading(stream) | |
36059 * | |
36060 * def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2): # <<<<<<<<<<<<<< | |
36061 * """ Utility function: compares two calls for equality """ | |
36062 * # a variant should always be assigned to a unique position, one base before | |
36063 */ | |
36064 | |
36065 /* function exit code */ | |
36066 __pyx_L1_error:; | |
36067 __Pyx_XDECREF(__pyx_t_1); | |
36068 __Pyx_XDECREF(__pyx_t_5); | |
36069 __Pyx_XDECREF(__pyx_t_6); | |
36070 __Pyx_AddTraceback("pysam.libcvcf.VCF.compare_calls", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
36071 __pyx_r = NULL; | |
36072 __pyx_L0:; | |
36073 __Pyx_XDECREF(__pyx_v_ref1); | |
36074 __Pyx_XDECREF(__pyx_v_alt1); | |
36075 __Pyx_XDECREF(__pyx_v_ref2); | |
36076 __Pyx_XDECREF(__pyx_v_alt2); | |
36077 __Pyx_XGIVEREF(__pyx_r); | |
36078 __Pyx_RefNannyFinishContext(); | |
36079 return __pyx_r; | |
36080 } | |
36081 | |
36082 /* "pysam/libcvcf.pyx":1046 | |
36083 * ########################################################################################################### | |
36084 * | |
36085 * def connect(self, filename, encoding="ascii"): # <<<<<<<<<<<<<< | |
36086 * '''connect to tabix file.''' | |
36087 * self.encoding=encoding | |
36088 */ | |
36089 | |
36090 /* Python wrapper */ | |
36091 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_80connect(PyObject *__pyx_self, | |
36092 #if CYTHON_METH_FASTCALL | |
36093 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
36094 #else | |
36095 PyObject *__pyx_args, PyObject *__pyx_kwds | |
36096 #endif | |
36097 ); /*proto*/ | |
36098 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_79connect, "VCF.connect(self, filename, encoding=u'ascii')\nconnect to tabix file."); | |
36099 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_80connect = {"connect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_80connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_79connect}; | |
36100 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_80connect(PyObject *__pyx_self, | |
36101 #if CYTHON_METH_FASTCALL | |
36102 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
36103 #else | |
36104 PyObject *__pyx_args, PyObject *__pyx_kwds | |
36105 #endif | |
36106 ) { | |
36107 PyObject *__pyx_v_self = 0; | |
36108 PyObject *__pyx_v_filename = 0; | |
36109 PyObject *__pyx_v_encoding = 0; | |
36110 #if !CYTHON_METH_FASTCALL | |
36111 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
36112 #endif | |
36113 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
36114 PyObject* values[3] = {0,0,0}; | |
36115 int __pyx_lineno = 0; | |
36116 const char *__pyx_filename = NULL; | |
36117 int __pyx_clineno = 0; | |
36118 PyObject *__pyx_r = 0; | |
36119 __Pyx_RefNannyDeclarations | |
36120 __Pyx_RefNannySetupContext("connect (wrapper)", 0); | |
36121 #if !CYTHON_METH_FASTCALL | |
36122 #if CYTHON_ASSUME_SAFE_MACROS | |
36123 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
36124 #else | |
36125 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
36126 #endif | |
36127 #endif | |
36128 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
36129 { | |
36130 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,&__pyx_n_s_encoding,0}; | |
36131 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_ascii))); | |
36132 if (__pyx_kwds) { | |
36133 Py_ssize_t kw_args; | |
36134 switch (__pyx_nargs) { | |
36135 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
36136 CYTHON_FALLTHROUGH; | |
36137 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
36138 CYTHON_FALLTHROUGH; | |
36139 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
36140 CYTHON_FALLTHROUGH; | |
36141 case 0: break; | |
36142 default: goto __pyx_L5_argtuple_error; | |
36143 } | |
36144 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
36145 switch (__pyx_nargs) { | |
36146 case 0: | |
36147 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
36148 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
36149 kw_args--; | |
36150 } | |
36151 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1046, __pyx_L3_error) | |
36152 else goto __pyx_L5_argtuple_error; | |
36153 CYTHON_FALLTHROUGH; | |
36154 case 1: | |
36155 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { | |
36156 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
36157 kw_args--; | |
36158 } | |
36159 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1046, __pyx_L3_error) | |
36160 else { | |
36161 __Pyx_RaiseArgtupleInvalid("connect", 0, 2, 3, 1); __PYX_ERR(0, 1046, __pyx_L3_error) | |
36162 } | |
36163 CYTHON_FALLTHROUGH; | |
36164 case 2: | |
36165 if (kw_args > 0) { | |
36166 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding); | |
36167 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
36168 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1046, __pyx_L3_error) | |
36169 } | |
36170 } | |
36171 if (unlikely(kw_args > 0)) { | |
36172 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
36173 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "connect") < 0)) __PYX_ERR(0, 1046, __pyx_L3_error) | |
36174 } | |
36175 } else { | |
36176 switch (__pyx_nargs) { | |
36177 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
36178 CYTHON_FALLTHROUGH; | |
36179 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
36180 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
36181 break; | |
36182 default: goto __pyx_L5_argtuple_error; | |
36183 } | |
36184 } | |
36185 __pyx_v_self = values[0]; | |
36186 __pyx_v_filename = values[1]; | |
36187 __pyx_v_encoding = values[2]; | |
36188 } | |
36189 goto __pyx_L6_skip; | |
36190 __pyx_L5_argtuple_error:; | |
36191 __Pyx_RaiseArgtupleInvalid("connect", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1046, __pyx_L3_error) | |
36192 __pyx_L6_skip:; | |
36193 goto __pyx_L4_argument_unpacking_done; | |
36194 __pyx_L3_error:; | |
36195 { | |
36196 Py_ssize_t __pyx_temp; | |
36197 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
36198 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
36199 } | |
36200 } | |
36201 __Pyx_AddTraceback("pysam.libcvcf.VCF.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
36202 __Pyx_RefNannyFinishContext(); | |
36203 return NULL; | |
36204 __pyx_L4_argument_unpacking_done:; | |
36205 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_79connect(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_encoding); | |
36206 | |
36207 /* function exit code */ | |
36208 { | |
36209 Py_ssize_t __pyx_temp; | |
36210 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
36211 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
36212 } | |
36213 } | |
36214 __Pyx_RefNannyFinishContext(); | |
36215 return __pyx_r; | |
36216 } | |
36217 | |
36218 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_79connect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_encoding) { | |
36219 PyObject *__pyx_r = NULL; | |
36220 __Pyx_RefNannyDeclarations | |
36221 PyObject *__pyx_t_1 = NULL; | |
36222 PyObject *__pyx_t_2 = NULL; | |
36223 PyObject *__pyx_t_3 = NULL; | |
36224 PyObject *__pyx_t_4 = NULL; | |
36225 unsigned int __pyx_t_5; | |
36226 int __pyx_lineno = 0; | |
36227 const char *__pyx_filename = NULL; | |
36228 int __pyx_clineno = 0; | |
36229 __Pyx_RefNannySetupContext("connect", 1); | |
36230 | |
36231 /* "pysam/libcvcf.pyx":1048 | |
36232 * def connect(self, filename, encoding="ascii"): | |
36233 * '''connect to tabix file.''' | |
36234 * self.encoding=encoding # <<<<<<<<<<<<<< | |
36235 * self.tabixfile = pysam.Tabixfile(filename, encoding=encoding) | |
36236 * self._parse_header(self.tabixfile.header) | |
36237 */ | |
36238 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1048, __pyx_L1_error) | |
36239 | |
36240 /* "pysam/libcvcf.pyx":1049 | |
36241 * '''connect to tabix file.''' | |
36242 * self.encoding=encoding | |
36243 * self.tabixfile = pysam.Tabixfile(filename, encoding=encoding) # <<<<<<<<<<<<<< | |
36244 * self._parse_header(self.tabixfile.header) | |
36245 * | |
36246 */ | |
36247 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pysam); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) | |
36248 __Pyx_GOTREF(__pyx_t_1); | |
36249 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Tabixfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error) | |
36250 __Pyx_GOTREF(__pyx_t_2); | |
36251 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36252 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) | |
36253 __Pyx_GOTREF(__pyx_t_1); | |
36254 __Pyx_INCREF(__pyx_v_filename); | |
36255 __Pyx_GIVEREF(__pyx_v_filename); | |
36256 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename)) __PYX_ERR(0, 1049, __pyx_L1_error); | |
36257 __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error) | |
36258 __Pyx_GOTREF(__pyx_t_3); | |
36259 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 1049, __pyx_L1_error) | |
36260 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error) | |
36261 __Pyx_GOTREF(__pyx_t_4); | |
36262 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
36263 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36264 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
36265 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile, __pyx_t_4) < 0) __PYX_ERR(0, 1049, __pyx_L1_error) | |
36266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
36267 | |
36268 /* "pysam/libcvcf.pyx":1050 | |
36269 * self.encoding=encoding | |
36270 * self.tabixfile = pysam.Tabixfile(filename, encoding=encoding) | |
36271 * self._parse_header(self.tabixfile.header) # <<<<<<<<<<<<<< | |
36272 * | |
36273 * def __del__(self): | |
36274 */ | |
36275 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_header_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error) | |
36276 __Pyx_GOTREF(__pyx_t_3); | |
36277 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) | |
36278 __Pyx_GOTREF(__pyx_t_1); | |
36279 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_header_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error) | |
36280 __Pyx_GOTREF(__pyx_t_2); | |
36281 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36282 __pyx_t_1 = NULL; | |
36283 __pyx_t_5 = 0; | |
36284 #if CYTHON_UNPACK_METHODS | |
36285 if (likely(PyMethod_Check(__pyx_t_3))) { | |
36286 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); | |
36287 if (likely(__pyx_t_1)) { | |
36288 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
36289 __Pyx_INCREF(__pyx_t_1); | |
36290 __Pyx_INCREF(function); | |
36291 __Pyx_DECREF_SET(__pyx_t_3, function); | |
36292 __pyx_t_5 = 1; | |
36293 } | |
36294 } | |
36295 #endif | |
36296 { | |
36297 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2}; | |
36298 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
36299 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36300 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
36301 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1050, __pyx_L1_error) | |
36302 __Pyx_GOTREF(__pyx_t_4); | |
36303 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
36304 } | |
36305 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
36306 | |
36307 /* "pysam/libcvcf.pyx":1046 | |
36308 * ########################################################################################################### | |
36309 * | |
36310 * def connect(self, filename, encoding="ascii"): # <<<<<<<<<<<<<< | |
36311 * '''connect to tabix file.''' | |
36312 * self.encoding=encoding | |
36313 */ | |
36314 | |
36315 /* function exit code */ | |
36316 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
36317 goto __pyx_L0; | |
36318 __pyx_L1_error:; | |
36319 __Pyx_XDECREF(__pyx_t_1); | |
36320 __Pyx_XDECREF(__pyx_t_2); | |
36321 __Pyx_XDECREF(__pyx_t_3); | |
36322 __Pyx_XDECREF(__pyx_t_4); | |
36323 __Pyx_AddTraceback("pysam.libcvcf.VCF.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
36324 __pyx_r = NULL; | |
36325 __pyx_L0:; | |
36326 __Pyx_XGIVEREF(__pyx_r); | |
36327 __Pyx_RefNannyFinishContext(); | |
36328 return __pyx_r; | |
36329 } | |
36330 | |
36331 /* "pysam/libcvcf.pyx":1052 | |
36332 * self._parse_header(self.tabixfile.header) | |
36333 * | |
36334 * def __del__(self): # <<<<<<<<<<<<<< | |
36335 * self.close() | |
36336 * self.tabixfile = None | |
36337 */ | |
36338 | |
36339 /* Python wrapper */ | |
36340 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_82__del__(PyObject *__pyx_self, | |
36341 #if CYTHON_METH_FASTCALL | |
36342 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
36343 #else | |
36344 PyObject *__pyx_args, PyObject *__pyx_kwds | |
36345 #endif | |
36346 ); /*proto*/ | |
36347 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_81__del__, "VCF.__del__(self)"); | |
36348 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_82__del__ = {"__del__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_82__del__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_81__del__}; | |
36349 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_82__del__(PyObject *__pyx_self, | |
36350 #if CYTHON_METH_FASTCALL | |
36351 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
36352 #else | |
36353 PyObject *__pyx_args, PyObject *__pyx_kwds | |
36354 #endif | |
36355 ) { | |
36356 PyObject *__pyx_v_self = 0; | |
36357 #if !CYTHON_METH_FASTCALL | |
36358 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
36359 #endif | |
36360 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
36361 PyObject* values[1] = {0}; | |
36362 int __pyx_lineno = 0; | |
36363 const char *__pyx_filename = NULL; | |
36364 int __pyx_clineno = 0; | |
36365 PyObject *__pyx_r = 0; | |
36366 __Pyx_RefNannyDeclarations | |
36367 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); | |
36368 #if !CYTHON_METH_FASTCALL | |
36369 #if CYTHON_ASSUME_SAFE_MACROS | |
36370 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
36371 #else | |
36372 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
36373 #endif | |
36374 #endif | |
36375 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
36376 { | |
36377 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
36378 if (__pyx_kwds) { | |
36379 Py_ssize_t kw_args; | |
36380 switch (__pyx_nargs) { | |
36381 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
36382 CYTHON_FALLTHROUGH; | |
36383 case 0: break; | |
36384 default: goto __pyx_L5_argtuple_error; | |
36385 } | |
36386 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
36387 switch (__pyx_nargs) { | |
36388 case 0: | |
36389 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
36390 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
36391 kw_args--; | |
36392 } | |
36393 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L3_error) | |
36394 else goto __pyx_L5_argtuple_error; | |
36395 } | |
36396 if (unlikely(kw_args > 0)) { | |
36397 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
36398 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__del__") < 0)) __PYX_ERR(0, 1052, __pyx_L3_error) | |
36399 } | |
36400 } else if (unlikely(__pyx_nargs != 1)) { | |
36401 goto __pyx_L5_argtuple_error; | |
36402 } else { | |
36403 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
36404 } | |
36405 __pyx_v_self = values[0]; | |
36406 } | |
36407 goto __pyx_L6_skip; | |
36408 __pyx_L5_argtuple_error:; | |
36409 __Pyx_RaiseArgtupleInvalid("__del__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1052, __pyx_L3_error) | |
36410 __pyx_L6_skip:; | |
36411 goto __pyx_L4_argument_unpacking_done; | |
36412 __pyx_L3_error:; | |
36413 { | |
36414 Py_ssize_t __pyx_temp; | |
36415 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
36416 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
36417 } | |
36418 } | |
36419 __Pyx_AddTraceback("pysam.libcvcf.VCF.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
36420 __Pyx_RefNannyFinishContext(); | |
36421 return NULL; | |
36422 __pyx_L4_argument_unpacking_done:; | |
36423 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_81__del__(__pyx_self, __pyx_v_self); | |
36424 | |
36425 /* function exit code */ | |
36426 { | |
36427 Py_ssize_t __pyx_temp; | |
36428 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
36429 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
36430 } | |
36431 } | |
36432 __Pyx_RefNannyFinishContext(); | |
36433 return __pyx_r; | |
36434 } | |
36435 | |
36436 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_81__del__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
36437 PyObject *__pyx_r = NULL; | |
36438 __Pyx_RefNannyDeclarations | |
36439 PyObject *__pyx_t_1 = NULL; | |
36440 PyObject *__pyx_t_2 = NULL; | |
36441 PyObject *__pyx_t_3 = NULL; | |
36442 unsigned int __pyx_t_4; | |
36443 int __pyx_lineno = 0; | |
36444 const char *__pyx_filename = NULL; | |
36445 int __pyx_clineno = 0; | |
36446 __Pyx_RefNannySetupContext("__del__", 1); | |
36447 | |
36448 /* "pysam/libcvcf.pyx":1053 | |
36449 * | |
36450 * def __del__(self): | |
36451 * self.close() # <<<<<<<<<<<<<< | |
36452 * self.tabixfile = None | |
36453 * | |
36454 */ | |
36455 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error) | |
36456 __Pyx_GOTREF(__pyx_t_2); | |
36457 __pyx_t_3 = NULL; | |
36458 __pyx_t_4 = 0; | |
36459 #if CYTHON_UNPACK_METHODS | |
36460 if (likely(PyMethod_Check(__pyx_t_2))) { | |
36461 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
36462 if (likely(__pyx_t_3)) { | |
36463 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
36464 __Pyx_INCREF(__pyx_t_3); | |
36465 __Pyx_INCREF(function); | |
36466 __Pyx_DECREF_SET(__pyx_t_2, function); | |
36467 __pyx_t_4 = 1; | |
36468 } | |
36469 } | |
36470 #endif | |
36471 { | |
36472 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
36473 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
36474 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
36475 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) | |
36476 __Pyx_GOTREF(__pyx_t_1); | |
36477 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
36478 } | |
36479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36480 | |
36481 /* "pysam/libcvcf.pyx":1054 | |
36482 * def __del__(self): | |
36483 * self.close() | |
36484 * self.tabixfile = None # <<<<<<<<<<<<<< | |
36485 * | |
36486 * def close(self): | |
36487 */ | |
36488 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile, Py_None) < 0) __PYX_ERR(0, 1054, __pyx_L1_error) | |
36489 | |
36490 /* "pysam/libcvcf.pyx":1052 | |
36491 * self._parse_header(self.tabixfile.header) | |
36492 * | |
36493 * def __del__(self): # <<<<<<<<<<<<<< | |
36494 * self.close() | |
36495 * self.tabixfile = None | |
36496 */ | |
36497 | |
36498 /* function exit code */ | |
36499 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
36500 goto __pyx_L0; | |
36501 __pyx_L1_error:; | |
36502 __Pyx_XDECREF(__pyx_t_1); | |
36503 __Pyx_XDECREF(__pyx_t_2); | |
36504 __Pyx_XDECREF(__pyx_t_3); | |
36505 __Pyx_AddTraceback("pysam.libcvcf.VCF.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
36506 __pyx_r = NULL; | |
36507 __pyx_L0:; | |
36508 __Pyx_XGIVEREF(__pyx_r); | |
36509 __Pyx_RefNannyFinishContext(); | |
36510 return __pyx_r; | |
36511 } | |
36512 | |
36513 /* "pysam/libcvcf.pyx":1056 | |
36514 * self.tabixfile = None | |
36515 * | |
36516 * def close(self): # <<<<<<<<<<<<<< | |
36517 * if self.tabixfile: | |
36518 * self.tabixfile.close() | |
36519 */ | |
36520 | |
36521 /* Python wrapper */ | |
36522 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_84close(PyObject *__pyx_self, | |
36523 #if CYTHON_METH_FASTCALL | |
36524 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
36525 #else | |
36526 PyObject *__pyx_args, PyObject *__pyx_kwds | |
36527 #endif | |
36528 ); /*proto*/ | |
36529 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_83close, "VCF.close(self)"); | |
36530 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_84close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_84close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_83close}; | |
36531 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_84close(PyObject *__pyx_self, | |
36532 #if CYTHON_METH_FASTCALL | |
36533 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
36534 #else | |
36535 PyObject *__pyx_args, PyObject *__pyx_kwds | |
36536 #endif | |
36537 ) { | |
36538 PyObject *__pyx_v_self = 0; | |
36539 #if !CYTHON_METH_FASTCALL | |
36540 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
36541 #endif | |
36542 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
36543 PyObject* values[1] = {0}; | |
36544 int __pyx_lineno = 0; | |
36545 const char *__pyx_filename = NULL; | |
36546 int __pyx_clineno = 0; | |
36547 PyObject *__pyx_r = 0; | |
36548 __Pyx_RefNannyDeclarations | |
36549 __Pyx_RefNannySetupContext("close (wrapper)", 0); | |
36550 #if !CYTHON_METH_FASTCALL | |
36551 #if CYTHON_ASSUME_SAFE_MACROS | |
36552 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
36553 #else | |
36554 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
36555 #endif | |
36556 #endif | |
36557 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
36558 { | |
36559 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
36560 if (__pyx_kwds) { | |
36561 Py_ssize_t kw_args; | |
36562 switch (__pyx_nargs) { | |
36563 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
36564 CYTHON_FALLTHROUGH; | |
36565 case 0: break; | |
36566 default: goto __pyx_L5_argtuple_error; | |
36567 } | |
36568 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
36569 switch (__pyx_nargs) { | |
36570 case 0: | |
36571 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
36572 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
36573 kw_args--; | |
36574 } | |
36575 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error) | |
36576 else goto __pyx_L5_argtuple_error; | |
36577 } | |
36578 if (unlikely(kw_args > 0)) { | |
36579 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
36580 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "close") < 0)) __PYX_ERR(0, 1056, __pyx_L3_error) | |
36581 } | |
36582 } else if (unlikely(__pyx_nargs != 1)) { | |
36583 goto __pyx_L5_argtuple_error; | |
36584 } else { | |
36585 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
36586 } | |
36587 __pyx_v_self = values[0]; | |
36588 } | |
36589 goto __pyx_L6_skip; | |
36590 __pyx_L5_argtuple_error:; | |
36591 __Pyx_RaiseArgtupleInvalid("close", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1056, __pyx_L3_error) | |
36592 __pyx_L6_skip:; | |
36593 goto __pyx_L4_argument_unpacking_done; | |
36594 __pyx_L3_error:; | |
36595 { | |
36596 Py_ssize_t __pyx_temp; | |
36597 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
36598 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
36599 } | |
36600 } | |
36601 __Pyx_AddTraceback("pysam.libcvcf.VCF.close", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
36602 __Pyx_RefNannyFinishContext(); | |
36603 return NULL; | |
36604 __pyx_L4_argument_unpacking_done:; | |
36605 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_83close(__pyx_self, __pyx_v_self); | |
36606 | |
36607 /* function exit code */ | |
36608 { | |
36609 Py_ssize_t __pyx_temp; | |
36610 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
36611 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
36612 } | |
36613 } | |
36614 __Pyx_RefNannyFinishContext(); | |
36615 return __pyx_r; | |
36616 } | |
36617 | |
36618 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_83close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
36619 PyObject *__pyx_r = NULL; | |
36620 __Pyx_RefNannyDeclarations | |
36621 PyObject *__pyx_t_1 = NULL; | |
36622 int __pyx_t_2; | |
36623 PyObject *__pyx_t_3 = NULL; | |
36624 PyObject *__pyx_t_4 = NULL; | |
36625 unsigned int __pyx_t_5; | |
36626 int __pyx_lineno = 0; | |
36627 const char *__pyx_filename = NULL; | |
36628 int __pyx_clineno = 0; | |
36629 __Pyx_RefNannySetupContext("close", 1); | |
36630 | |
36631 /* "pysam/libcvcf.pyx":1057 | |
36632 * | |
36633 * def close(self): | |
36634 * if self.tabixfile: # <<<<<<<<<<<<<< | |
36635 * self.tabixfile.close() | |
36636 * self.tabixfile = None | |
36637 */ | |
36638 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) | |
36639 __Pyx_GOTREF(__pyx_t_1); | |
36640 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1057, __pyx_L1_error) | |
36641 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36642 if (__pyx_t_2) { | |
36643 | |
36644 /* "pysam/libcvcf.pyx":1058 | |
36645 * def close(self): | |
36646 * if self.tabixfile: | |
36647 * self.tabixfile.close() # <<<<<<<<<<<<<< | |
36648 * self.tabixfile = None | |
36649 * | |
36650 */ | |
36651 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L1_error) | |
36652 __Pyx_GOTREF(__pyx_t_3); | |
36653 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1058, __pyx_L1_error) | |
36654 __Pyx_GOTREF(__pyx_t_4); | |
36655 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
36656 __pyx_t_3 = NULL; | |
36657 __pyx_t_5 = 0; | |
36658 #if CYTHON_UNPACK_METHODS | |
36659 if (likely(PyMethod_Check(__pyx_t_4))) { | |
36660 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); | |
36661 if (likely(__pyx_t_3)) { | |
36662 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
36663 __Pyx_INCREF(__pyx_t_3); | |
36664 __Pyx_INCREF(function); | |
36665 __Pyx_DECREF_SET(__pyx_t_4, function); | |
36666 __pyx_t_5 = 1; | |
36667 } | |
36668 } | |
36669 #endif | |
36670 { | |
36671 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
36672 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); | |
36673 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
36674 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error) | |
36675 __Pyx_GOTREF(__pyx_t_1); | |
36676 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
36677 } | |
36678 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36679 | |
36680 /* "pysam/libcvcf.pyx":1059 | |
36681 * if self.tabixfile: | |
36682 * self.tabixfile.close() | |
36683 * self.tabixfile = None # <<<<<<<<<<<<<< | |
36684 * | |
36685 * def fetch(self, | |
36686 */ | |
36687 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile, Py_None) < 0) __PYX_ERR(0, 1059, __pyx_L1_error) | |
36688 | |
36689 /* "pysam/libcvcf.pyx":1057 | |
36690 * | |
36691 * def close(self): | |
36692 * if self.tabixfile: # <<<<<<<<<<<<<< | |
36693 * self.tabixfile.close() | |
36694 * self.tabixfile = None | |
36695 */ | |
36696 } | |
36697 | |
36698 /* "pysam/libcvcf.pyx":1056 | |
36699 * self.tabixfile = None | |
36700 * | |
36701 * def close(self): # <<<<<<<<<<<<<< | |
36702 * if self.tabixfile: | |
36703 * self.tabixfile.close() | |
36704 */ | |
36705 | |
36706 /* function exit code */ | |
36707 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
36708 goto __pyx_L0; | |
36709 __pyx_L1_error:; | |
36710 __Pyx_XDECREF(__pyx_t_1); | |
36711 __Pyx_XDECREF(__pyx_t_3); | |
36712 __Pyx_XDECREF(__pyx_t_4); | |
36713 __Pyx_AddTraceback("pysam.libcvcf.VCF.close", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
36714 __pyx_r = NULL; | |
36715 __pyx_L0:; | |
36716 __Pyx_XGIVEREF(__pyx_r); | |
36717 __Pyx_RefNannyFinishContext(); | |
36718 return __pyx_r; | |
36719 } | |
36720 | |
36721 /* "pysam/libcvcf.pyx":1061 | |
36722 * self.tabixfile = None | |
36723 * | |
36724 * def fetch(self, # <<<<<<<<<<<<<< | |
36725 * reference=None, | |
36726 * start=None, | |
36727 */ | |
36728 | |
36729 /* Python wrapper */ | |
36730 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_86fetch(PyObject *__pyx_self, | |
36731 #if CYTHON_METH_FASTCALL | |
36732 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
36733 #else | |
36734 PyObject *__pyx_args, PyObject *__pyx_kwds | |
36735 #endif | |
36736 ); /*proto*/ | |
36737 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_85fetch, "VCF.fetch(self, reference=None, start=None, end=None, region=None)\n Parse a stream of VCF-formatted lines.\n Initializes class instance and return generator "); | |
36738 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_86fetch = {"fetch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_86fetch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_85fetch}; | |
36739 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_86fetch(PyObject *__pyx_self, | |
36740 #if CYTHON_METH_FASTCALL | |
36741 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
36742 #else | |
36743 PyObject *__pyx_args, PyObject *__pyx_kwds | |
36744 #endif | |
36745 ) { | |
36746 PyObject *__pyx_v_self = 0; | |
36747 PyObject *__pyx_v_reference = 0; | |
36748 PyObject *__pyx_v_start = 0; | |
36749 PyObject *__pyx_v_end = 0; | |
36750 PyObject *__pyx_v_region = 0; | |
36751 #if !CYTHON_METH_FASTCALL | |
36752 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
36753 #endif | |
36754 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
36755 PyObject* values[5] = {0,0,0,0,0}; | |
36756 int __pyx_lineno = 0; | |
36757 const char *__pyx_filename = NULL; | |
36758 int __pyx_clineno = 0; | |
36759 PyObject *__pyx_r = 0; | |
36760 __Pyx_RefNannyDeclarations | |
36761 __Pyx_RefNannySetupContext("fetch (wrapper)", 0); | |
36762 #if !CYTHON_METH_FASTCALL | |
36763 #if CYTHON_ASSUME_SAFE_MACROS | |
36764 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
36765 #else | |
36766 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
36767 #endif | |
36768 #endif | |
36769 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
36770 { | |
36771 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,0}; | |
36772 | |
36773 /* "pysam/libcvcf.pyx":1062 | |
36774 * | |
36775 * def fetch(self, | |
36776 * reference=None, # <<<<<<<<<<<<<< | |
36777 * start=None, | |
36778 * end=None, | |
36779 */ | |
36780 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
36781 | |
36782 /* "pysam/libcvcf.pyx":1063 | |
36783 * def fetch(self, | |
36784 * reference=None, | |
36785 * start=None, # <<<<<<<<<<<<<< | |
36786 * end=None, | |
36787 * region=None ): | |
36788 */ | |
36789 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
36790 | |
36791 /* "pysam/libcvcf.pyx":1064 | |
36792 * reference=None, | |
36793 * start=None, | |
36794 * end=None, # <<<<<<<<<<<<<< | |
36795 * region=None ): | |
36796 * """ Parse a stream of VCF-formatted lines. | |
36797 */ | |
36798 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
36799 | |
36800 /* "pysam/libcvcf.pyx":1065 | |
36801 * start=None, | |
36802 * end=None, | |
36803 * region=None ): # <<<<<<<<<<<<<< | |
36804 * """ Parse a stream of VCF-formatted lines. | |
36805 * Initializes class instance and return generator """ | |
36806 */ | |
36807 values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
36808 if (__pyx_kwds) { | |
36809 Py_ssize_t kw_args; | |
36810 switch (__pyx_nargs) { | |
36811 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
36812 CYTHON_FALLTHROUGH; | |
36813 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
36814 CYTHON_FALLTHROUGH; | |
36815 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
36816 CYTHON_FALLTHROUGH; | |
36817 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
36818 CYTHON_FALLTHROUGH; | |
36819 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
36820 CYTHON_FALLTHROUGH; | |
36821 case 0: break; | |
36822 default: goto __pyx_L5_argtuple_error; | |
36823 } | |
36824 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
36825 switch (__pyx_nargs) { | |
36826 case 0: | |
36827 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
36828 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
36829 kw_args--; | |
36830 } | |
36831 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1061, __pyx_L3_error) | |
36832 else goto __pyx_L5_argtuple_error; | |
36833 CYTHON_FALLTHROUGH; | |
36834 case 1: | |
36835 if (kw_args > 0) { | |
36836 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reference); | |
36837 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
36838 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1061, __pyx_L3_error) | |
36839 } | |
36840 CYTHON_FALLTHROUGH; | |
36841 case 2: | |
36842 if (kw_args > 0) { | |
36843 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start); | |
36844 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
36845 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1061, __pyx_L3_error) | |
36846 } | |
36847 CYTHON_FALLTHROUGH; | |
36848 case 3: | |
36849 if (kw_args > 0) { | |
36850 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end); | |
36851 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
36852 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1061, __pyx_L3_error) | |
36853 } | |
36854 CYTHON_FALLTHROUGH; | |
36855 case 4: | |
36856 if (kw_args > 0) { | |
36857 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_region); | |
36858 if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
36859 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1061, __pyx_L3_error) | |
36860 } | |
36861 } | |
36862 if (unlikely(kw_args > 0)) { | |
36863 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
36864 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetch") < 0)) __PYX_ERR(0, 1061, __pyx_L3_error) | |
36865 } | |
36866 } else { | |
36867 switch (__pyx_nargs) { | |
36868 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
36869 CYTHON_FALLTHROUGH; | |
36870 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
36871 CYTHON_FALLTHROUGH; | |
36872 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
36873 CYTHON_FALLTHROUGH; | |
36874 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
36875 CYTHON_FALLTHROUGH; | |
36876 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
36877 break; | |
36878 default: goto __pyx_L5_argtuple_error; | |
36879 } | |
36880 } | |
36881 __pyx_v_self = values[0]; | |
36882 __pyx_v_reference = values[1]; | |
36883 __pyx_v_start = values[2]; | |
36884 __pyx_v_end = values[3]; | |
36885 __pyx_v_region = values[4]; | |
36886 } | |
36887 goto __pyx_L6_skip; | |
36888 __pyx_L5_argtuple_error:; | |
36889 __Pyx_RaiseArgtupleInvalid("fetch", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 1061, __pyx_L3_error) | |
36890 __pyx_L6_skip:; | |
36891 goto __pyx_L4_argument_unpacking_done; | |
36892 __pyx_L3_error:; | |
36893 { | |
36894 Py_ssize_t __pyx_temp; | |
36895 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
36896 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
36897 } | |
36898 } | |
36899 __Pyx_AddTraceback("pysam.libcvcf.VCF.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
36900 __Pyx_RefNannyFinishContext(); | |
36901 return NULL; | |
36902 __pyx_L4_argument_unpacking_done:; | |
36903 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_85fetch(__pyx_self, __pyx_v_self, __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region); | |
36904 | |
36905 /* "pysam/libcvcf.pyx":1061 | |
36906 * self.tabixfile = None | |
36907 * | |
36908 * def fetch(self, # <<<<<<<<<<<<<< | |
36909 * reference=None, | |
36910 * start=None, | |
36911 */ | |
36912 | |
36913 /* function exit code */ | |
36914 { | |
36915 Py_ssize_t __pyx_temp; | |
36916 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
36917 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
36918 } | |
36919 } | |
36920 __Pyx_RefNannyFinishContext(); | |
36921 return __pyx_r; | |
36922 } | |
36923 | |
36924 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_85fetch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region) { | |
36925 PyObject *__pyx_r = NULL; | |
36926 __Pyx_RefNannyDeclarations | |
36927 PyObject *__pyx_t_1 = NULL; | |
36928 PyObject *__pyx_t_2 = NULL; | |
36929 PyObject *__pyx_t_3 = NULL; | |
36930 PyObject *__pyx_t_4 = NULL; | |
36931 int __pyx_lineno = 0; | |
36932 const char *__pyx_filename = NULL; | |
36933 int __pyx_clineno = 0; | |
36934 __Pyx_RefNannySetupContext("fetch", 1); | |
36935 | |
36936 /* "pysam/libcvcf.pyx":1068 | |
36937 * """ Parse a stream of VCF-formatted lines. | |
36938 * Initializes class instance and return generator """ | |
36939 * return self.tabixfile.fetch( # <<<<<<<<<<<<<< | |
36940 * reference, | |
36941 * start, | |
36942 */ | |
36943 __Pyx_XDECREF(__pyx_r); | |
36944 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) | |
36945 __Pyx_GOTREF(__pyx_t_1); | |
36946 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fetch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) | |
36947 __Pyx_GOTREF(__pyx_t_2); | |
36948 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36949 | |
36950 /* "pysam/libcvcf.pyx":1072 | |
36951 * start, | |
36952 * end, | |
36953 * region, # <<<<<<<<<<<<<< | |
36954 * parser = asVCFRecord(self)) | |
36955 * | |
36956 */ | |
36957 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) | |
36958 __Pyx_GOTREF(__pyx_t_1); | |
36959 __Pyx_INCREF(__pyx_v_reference); | |
36960 __Pyx_GIVEREF(__pyx_v_reference); | |
36961 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_reference)) __PYX_ERR(0, 1068, __pyx_L1_error); | |
36962 __Pyx_INCREF(__pyx_v_start); | |
36963 __Pyx_GIVEREF(__pyx_v_start); | |
36964 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start)) __PYX_ERR(0, 1068, __pyx_L1_error); | |
36965 __Pyx_INCREF(__pyx_v_end); | |
36966 __Pyx_GIVEREF(__pyx_v_end); | |
36967 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end)) __PYX_ERR(0, 1068, __pyx_L1_error); | |
36968 __Pyx_INCREF(__pyx_v_region); | |
36969 __Pyx_GIVEREF(__pyx_v_region); | |
36970 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_region)) __PYX_ERR(0, 1068, __pyx_L1_error); | |
36971 | |
36972 /* "pysam/libcvcf.pyx":1073 | |
36973 * end, | |
36974 * region, | |
36975 * parser = asVCFRecord(self)) # <<<<<<<<<<<<<< | |
36976 * | |
36977 * def validate(self, record): | |
36978 */ | |
36979 __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1073, __pyx_L1_error) | |
36980 __Pyx_GOTREF(__pyx_t_3); | |
36981 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5pysam_7libcvcf_asVCFRecord), __pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error) | |
36982 __Pyx_GOTREF(__pyx_t_4); | |
36983 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_parser, __pyx_t_4) < 0) __PYX_ERR(0, 1073, __pyx_L1_error) | |
36984 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
36985 | |
36986 /* "pysam/libcvcf.pyx":1068 | |
36987 * """ Parse a stream of VCF-formatted lines. | |
36988 * Initializes class instance and return generator """ | |
36989 * return self.tabixfile.fetch( # <<<<<<<<<<<<<< | |
36990 * reference, | |
36991 * start, | |
36992 */ | |
36993 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error) | |
36994 __Pyx_GOTREF(__pyx_t_4); | |
36995 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
36996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
36997 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
36998 __pyx_r = __pyx_t_4; | |
36999 __pyx_t_4 = 0; | |
37000 goto __pyx_L0; | |
37001 | |
37002 /* "pysam/libcvcf.pyx":1061 | |
37003 * self.tabixfile = None | |
37004 * | |
37005 * def fetch(self, # <<<<<<<<<<<<<< | |
37006 * reference=None, | |
37007 * start=None, | |
37008 */ | |
37009 | |
37010 /* function exit code */ | |
37011 __pyx_L1_error:; | |
37012 __Pyx_XDECREF(__pyx_t_1); | |
37013 __Pyx_XDECREF(__pyx_t_2); | |
37014 __Pyx_XDECREF(__pyx_t_3); | |
37015 __Pyx_XDECREF(__pyx_t_4); | |
37016 __Pyx_AddTraceback("pysam.libcvcf.VCF.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
37017 __pyx_r = NULL; | |
37018 __pyx_L0:; | |
37019 __Pyx_XGIVEREF(__pyx_r); | |
37020 __Pyx_RefNannyFinishContext(); | |
37021 return __pyx_r; | |
37022 } | |
37023 | |
37024 /* "pysam/libcvcf.pyx":1075 | |
37025 * parser = asVCFRecord(self)) | |
37026 * | |
37027 * def validate(self, record): # <<<<<<<<<<<<<< | |
37028 * '''validate vcf record. | |
37029 * | |
37030 */ | |
37031 | |
37032 /* Python wrapper */ | |
37033 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_88validate(PyObject *__pyx_self, | |
37034 #if CYTHON_METH_FASTCALL | |
37035 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
37036 #else | |
37037 PyObject *__pyx_args, PyObject *__pyx_kwds | |
37038 #endif | |
37039 ); /*proto*/ | |
37040 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_3VCF_87validate, "VCF.validate(self, record)\nvalidate vcf record.\n\n returns a validated record.\n "); | |
37041 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_3VCF_88validate = {"validate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_3VCF_88validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_3VCF_87validate}; | |
37042 static PyObject *__pyx_pw_5pysam_7libcvcf_3VCF_88validate(PyObject *__pyx_self, | |
37043 #if CYTHON_METH_FASTCALL | |
37044 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
37045 #else | |
37046 PyObject *__pyx_args, PyObject *__pyx_kwds | |
37047 #endif | |
37048 ) { | |
37049 CYTHON_UNUSED PyObject *__pyx_v_self = 0; | |
37050 CYTHON_UNUSED PyObject *__pyx_v_record = 0; | |
37051 #if !CYTHON_METH_FASTCALL | |
37052 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
37053 #endif | |
37054 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
37055 PyObject* values[2] = {0,0}; | |
37056 int __pyx_lineno = 0; | |
37057 const char *__pyx_filename = NULL; | |
37058 int __pyx_clineno = 0; | |
37059 PyObject *__pyx_r = 0; | |
37060 __Pyx_RefNannyDeclarations | |
37061 __Pyx_RefNannySetupContext("validate (wrapper)", 0); | |
37062 #if !CYTHON_METH_FASTCALL | |
37063 #if CYTHON_ASSUME_SAFE_MACROS | |
37064 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
37065 #else | |
37066 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
37067 #endif | |
37068 #endif | |
37069 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
37070 { | |
37071 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_record,0}; | |
37072 if (__pyx_kwds) { | |
37073 Py_ssize_t kw_args; | |
37074 switch (__pyx_nargs) { | |
37075 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
37076 CYTHON_FALLTHROUGH; | |
37077 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
37078 CYTHON_FALLTHROUGH; | |
37079 case 0: break; | |
37080 default: goto __pyx_L5_argtuple_error; | |
37081 } | |
37082 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
37083 switch (__pyx_nargs) { | |
37084 case 0: | |
37085 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
37086 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
37087 kw_args--; | |
37088 } | |
37089 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1075, __pyx_L3_error) | |
37090 else goto __pyx_L5_argtuple_error; | |
37091 CYTHON_FALLTHROUGH; | |
37092 case 1: | |
37093 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_record)) != 0)) { | |
37094 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
37095 kw_args--; | |
37096 } | |
37097 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1075, __pyx_L3_error) | |
37098 else { | |
37099 __Pyx_RaiseArgtupleInvalid("validate", 1, 2, 2, 1); __PYX_ERR(0, 1075, __pyx_L3_error) | |
37100 } | |
37101 } | |
37102 if (unlikely(kw_args > 0)) { | |
37103 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
37104 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "validate") < 0)) __PYX_ERR(0, 1075, __pyx_L3_error) | |
37105 } | |
37106 } else if (unlikely(__pyx_nargs != 2)) { | |
37107 goto __pyx_L5_argtuple_error; | |
37108 } else { | |
37109 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
37110 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
37111 } | |
37112 __pyx_v_self = values[0]; | |
37113 __pyx_v_record = values[1]; | |
37114 } | |
37115 goto __pyx_L6_skip; | |
37116 __pyx_L5_argtuple_error:; | |
37117 __Pyx_RaiseArgtupleInvalid("validate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1075, __pyx_L3_error) | |
37118 __pyx_L6_skip:; | |
37119 goto __pyx_L4_argument_unpacking_done; | |
37120 __pyx_L3_error:; | |
37121 { | |
37122 Py_ssize_t __pyx_temp; | |
37123 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
37124 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
37125 } | |
37126 } | |
37127 __Pyx_AddTraceback("pysam.libcvcf.VCF.validate", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
37128 __Pyx_RefNannyFinishContext(); | |
37129 return NULL; | |
37130 __pyx_L4_argument_unpacking_done:; | |
37131 __pyx_r = __pyx_pf_5pysam_7libcvcf_3VCF_87validate(__pyx_self, __pyx_v_self, __pyx_v_record); | |
37132 | |
37133 /* function exit code */ | |
37134 { | |
37135 Py_ssize_t __pyx_temp; | |
37136 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
37137 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
37138 } | |
37139 } | |
37140 __Pyx_RefNannyFinishContext(); | |
37141 return __pyx_r; | |
37142 } | |
37143 | |
37144 static PyObject *__pyx_pf_5pysam_7libcvcf_3VCF_87validate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_record) { | |
37145 PyObject *__pyx_r = NULL; | |
37146 __Pyx_RefNannyDeclarations | |
37147 PyObject *__pyx_t_1 = NULL; | |
37148 int __pyx_lineno = 0; | |
37149 const char *__pyx_filename = NULL; | |
37150 int __pyx_clineno = 0; | |
37151 __Pyx_RefNannySetupContext("validate", 1); | |
37152 | |
37153 /* "pysam/libcvcf.pyx":1081 | |
37154 * ''' | |
37155 * | |
37156 * raise NotImplementedError("needs to be checked") # <<<<<<<<<<<<<< | |
37157 * | |
37158 * chrom, pos = record.chrom, record.pos | |
37159 */ | |
37160 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error) | |
37161 __Pyx_GOTREF(__pyx_t_1); | |
37162 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
37163 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
37164 __PYX_ERR(0, 1081, __pyx_L1_error) | |
37165 | |
37166 /* "pysam/libcvcf.pyx":1075 | |
37167 * parser = asVCFRecord(self)) | |
37168 * | |
37169 * def validate(self, record): # <<<<<<<<<<<<<< | |
37170 * '''validate vcf record. | |
37171 * | |
37172 */ | |
37173 | |
37174 /* function exit code */ | |
37175 __pyx_L1_error:; | |
37176 __Pyx_XDECREF(__pyx_t_1); | |
37177 __Pyx_AddTraceback("pysam.libcvcf.VCF.validate", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
37178 __pyx_r = NULL; | |
37179 __Pyx_XGIVEREF(__pyx_r); | |
37180 __Pyx_RefNannyFinishContext(); | |
37181 return __pyx_r; | |
37182 } | |
37183 | |
37184 /* "(tree fragment)":1 | |
37185 * def __pyx_unpickle_asVCFRecord(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
37186 * cdef object __pyx_PickleError | |
37187 * cdef object __pyx_result | |
37188 */ | |
37189 | |
37190 /* Python wrapper */ | |
37191 static PyObject *__pyx_pw_5pysam_7libcvcf_5__pyx_unpickle_asVCFRecord(PyObject *__pyx_self, | |
37192 #if CYTHON_METH_FASTCALL | |
37193 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
37194 #else | |
37195 PyObject *__pyx_args, PyObject *__pyx_kwds | |
37196 #endif | |
37197 ); /*proto*/ | |
37198 PyDoc_STRVAR(__pyx_doc_5pysam_7libcvcf_4__pyx_unpickle_asVCFRecord, "__pyx_unpickle_asVCFRecord(__pyx_type, long __pyx_checksum, __pyx_state)"); | |
37199 static PyMethodDef __pyx_mdef_5pysam_7libcvcf_5__pyx_unpickle_asVCFRecord = {"__pyx_unpickle_asVCFRecord", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_5__pyx_unpickle_asVCFRecord, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_4__pyx_unpickle_asVCFRecord}; | |
37200 static PyObject *__pyx_pw_5pysam_7libcvcf_5__pyx_unpickle_asVCFRecord(PyObject *__pyx_self, | |
37201 #if CYTHON_METH_FASTCALL | |
37202 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
37203 #else | |
37204 PyObject *__pyx_args, PyObject *__pyx_kwds | |
37205 #endif | |
37206 ) { | |
37207 PyObject *__pyx_v___pyx_type = 0; | |
37208 long __pyx_v___pyx_checksum; | |
37209 PyObject *__pyx_v___pyx_state = 0; | |
37210 #if !CYTHON_METH_FASTCALL | |
37211 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
37212 #endif | |
37213 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
37214 PyObject* values[3] = {0,0,0}; | |
37215 int __pyx_lineno = 0; | |
37216 const char *__pyx_filename = NULL; | |
37217 int __pyx_clineno = 0; | |
37218 PyObject *__pyx_r = 0; | |
37219 __Pyx_RefNannyDeclarations | |
37220 __Pyx_RefNannySetupContext("__pyx_unpickle_asVCFRecord (wrapper)", 0); | |
37221 #if !CYTHON_METH_FASTCALL | |
37222 #if CYTHON_ASSUME_SAFE_MACROS | |
37223 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
37224 #else | |
37225 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
37226 #endif | |
37227 #endif | |
37228 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
37229 { | |
37230 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; | |
37231 if (__pyx_kwds) { | |
37232 Py_ssize_t kw_args; | |
37233 switch (__pyx_nargs) { | |
37234 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
37235 CYTHON_FALLTHROUGH; | |
37236 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
37237 CYTHON_FALLTHROUGH; | |
37238 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
37239 CYTHON_FALLTHROUGH; | |
37240 case 0: break; | |
37241 default: goto __pyx_L5_argtuple_error; | |
37242 } | |
37243 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
37244 switch (__pyx_nargs) { | |
37245 case 0: | |
37246 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { | |
37247 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
37248 kw_args--; | |
37249 } | |
37250 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
37251 else goto __pyx_L5_argtuple_error; | |
37252 CYTHON_FALLTHROUGH; | |
37253 case 1: | |
37254 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { | |
37255 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
37256 kw_args--; | |
37257 } | |
37258 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
37259 else { | |
37260 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asVCFRecord", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) | |
37261 } | |
37262 CYTHON_FALLTHROUGH; | |
37263 case 2: | |
37264 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
37265 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
37266 kw_args--; | |
37267 } | |
37268 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
37269 else { | |
37270 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asVCFRecord", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) | |
37271 } | |
37272 } | |
37273 if (unlikely(kw_args > 0)) { | |
37274 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
37275 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_asVCFRecord") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) | |
37276 } | |
37277 } else if (unlikely(__pyx_nargs != 3)) { | |
37278 goto __pyx_L5_argtuple_error; | |
37279 } else { | |
37280 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
37281 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
37282 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
37283 } | |
37284 __pyx_v___pyx_type = values[0]; | |
37285 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
37286 __pyx_v___pyx_state = values[2]; | |
37287 } | |
37288 goto __pyx_L6_skip; | |
37289 __pyx_L5_argtuple_error:; | |
37290 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asVCFRecord", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) | |
37291 __pyx_L6_skip:; | |
37292 goto __pyx_L4_argument_unpacking_done; | |
37293 __pyx_L3_error:; | |
37294 { | |
37295 Py_ssize_t __pyx_temp; | |
37296 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
37297 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
37298 } | |
37299 } | |
37300 __Pyx_AddTraceback("pysam.libcvcf.__pyx_unpickle_asVCFRecord", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
37301 __Pyx_RefNannyFinishContext(); | |
37302 return NULL; | |
37303 __pyx_L4_argument_unpacking_done:; | |
37304 __pyx_r = __pyx_pf_5pysam_7libcvcf_4__pyx_unpickle_asVCFRecord(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); | |
37305 | |
37306 /* function exit code */ | |
37307 { | |
37308 Py_ssize_t __pyx_temp; | |
37309 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
37310 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
37311 } | |
37312 } | |
37313 __Pyx_RefNannyFinishContext(); | |
37314 return __pyx_r; | |
37315 } | |
37316 | |
37317 static PyObject *__pyx_pf_5pysam_7libcvcf_4__pyx_unpickle_asVCFRecord(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { | |
37318 PyObject *__pyx_v___pyx_PickleError = 0; | |
37319 PyObject *__pyx_v___pyx_result = 0; | |
37320 PyObject *__pyx_r = NULL; | |
37321 __Pyx_RefNannyDeclarations | |
37322 PyObject *__pyx_t_1 = NULL; | |
37323 int __pyx_t_2; | |
37324 PyObject *__pyx_t_3 = NULL; | |
37325 PyObject *__pyx_t_4 = NULL; | |
37326 unsigned int __pyx_t_5; | |
37327 int __pyx_lineno = 0; | |
37328 const char *__pyx_filename = NULL; | |
37329 int __pyx_clineno = 0; | |
37330 __Pyx_RefNannySetupContext("__pyx_unpickle_asVCFRecord", 1); | |
37331 | |
37332 /* "(tree fragment)":4 | |
37333 * cdef object __pyx_PickleError | |
37334 * cdef object __pyx_result | |
37335 * if __pyx_checksum not in (0xe48d6d5, 0xcc3d7cd, 0x1c28f48): # <<<<<<<<<<<<<< | |
37336 * from pickle import PickleError as __pyx_PickleError | |
37337 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe48d6d5, 0xcc3d7cd, 0x1c28f48) = (encoding, vcffile))" % __pyx_checksum | |
37338 */ | |
37339 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) | |
37340 __Pyx_GOTREF(__pyx_t_1); | |
37341 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__32, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) | |
37342 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
37343 if (__pyx_t_2) { | |
37344 | |
37345 /* "(tree fragment)":5 | |
37346 * cdef object __pyx_result | |
37347 * if __pyx_checksum not in (0xe48d6d5, 0xcc3d7cd, 0x1c28f48): | |
37348 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< | |
37349 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe48d6d5, 0xcc3d7cd, 0x1c28f48) = (encoding, vcffile))" % __pyx_checksum | |
37350 * __pyx_result = asVCFRecord.__new__(__pyx_type) | |
37351 */ | |
37352 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
37353 __Pyx_GOTREF(__pyx_t_1); | |
37354 __Pyx_INCREF(__pyx_n_s_PickleError); | |
37355 __Pyx_GIVEREF(__pyx_n_s_PickleError); | |
37356 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); | |
37357 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) | |
37358 __Pyx_GOTREF(__pyx_t_3); | |
37359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
37360 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
37361 __Pyx_GOTREF(__pyx_t_1); | |
37362 __Pyx_INCREF(__pyx_t_1); | |
37363 __pyx_v___pyx_PickleError = __pyx_t_1; | |
37364 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
37365 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
37366 | |
37367 /* "(tree fragment)":6 | |
37368 * if __pyx_checksum not in (0xe48d6d5, 0xcc3d7cd, 0x1c28f48): | |
37369 * from pickle import PickleError as __pyx_PickleError | |
37370 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe48d6d5, 0xcc3d7cd, 0x1c28f48) = (encoding, vcffile))" % __pyx_checksum # <<<<<<<<<<<<<< | |
37371 * __pyx_result = asVCFRecord.__new__(__pyx_type) | |
37372 * if __pyx_state is not None: | |
37373 */ | |
37374 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) | |
37375 __Pyx_GOTREF(__pyx_t_3); | |
37376 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
37377 __Pyx_GOTREF(__pyx_t_1); | |
37378 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
37379 __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); | |
37380 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
37381 __PYX_ERR(1, 6, __pyx_L1_error) | |
37382 | |
37383 /* "(tree fragment)":4 | |
37384 * cdef object __pyx_PickleError | |
37385 * cdef object __pyx_result | |
37386 * if __pyx_checksum not in (0xe48d6d5, 0xcc3d7cd, 0x1c28f48): # <<<<<<<<<<<<<< | |
37387 * from pickle import PickleError as __pyx_PickleError | |
37388 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe48d6d5, 0xcc3d7cd, 0x1c28f48) = (encoding, vcffile))" % __pyx_checksum | |
37389 */ | |
37390 } | |
37391 | |
37392 /* "(tree fragment)":7 | |
37393 * from pickle import PickleError as __pyx_PickleError | |
37394 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe48d6d5, 0xcc3d7cd, 0x1c28f48) = (encoding, vcffile))" % __pyx_checksum | |
37395 * __pyx_result = asVCFRecord.__new__(__pyx_type) # <<<<<<<<<<<<<< | |
37396 * if __pyx_state is not None: | |
37397 * __pyx_unpickle_asVCFRecord__set_state(<asVCFRecord> __pyx_result, __pyx_state) | |
37398 */ | |
37399 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5pysam_7libcvcf_asVCFRecord), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) | |
37400 __Pyx_GOTREF(__pyx_t_3); | |
37401 __pyx_t_4 = NULL; | |
37402 __pyx_t_5 = 0; | |
37403 #if CYTHON_UNPACK_METHODS | |
37404 if (likely(PyMethod_Check(__pyx_t_3))) { | |
37405 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
37406 if (likely(__pyx_t_4)) { | |
37407 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
37408 __Pyx_INCREF(__pyx_t_4); | |
37409 __Pyx_INCREF(function); | |
37410 __Pyx_DECREF_SET(__pyx_t_3, function); | |
37411 __pyx_t_5 = 1; | |
37412 } | |
37413 } | |
37414 #endif | |
37415 { | |
37416 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; | |
37417 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
37418 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
37419 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) | |
37420 __Pyx_GOTREF(__pyx_t_1); | |
37421 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
37422 } | |
37423 __pyx_v___pyx_result = __pyx_t_1; | |
37424 __pyx_t_1 = 0; | |
37425 | |
37426 /* "(tree fragment)":8 | |
37427 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe48d6d5, 0xcc3d7cd, 0x1c28f48) = (encoding, vcffile))" % __pyx_checksum | |
37428 * __pyx_result = asVCFRecord.__new__(__pyx_type) | |
37429 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
37430 * __pyx_unpickle_asVCFRecord__set_state(<asVCFRecord> __pyx_result, __pyx_state) | |
37431 * return __pyx_result | |
37432 */ | |
37433 __pyx_t_2 = (__pyx_v___pyx_state != Py_None); | |
37434 if (__pyx_t_2) { | |
37435 | |
37436 /* "(tree fragment)":9 | |
37437 * __pyx_result = asVCFRecord.__new__(__pyx_type) | |
37438 * if __pyx_state is not None: | |
37439 * __pyx_unpickle_asVCFRecord__set_state(<asVCFRecord> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< | |
37440 * return __pyx_result | |
37441 * cdef __pyx_unpickle_asVCFRecord__set_state(asVCFRecord __pyx_result, tuple __pyx_state): | |
37442 */ | |
37443 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) | |
37444 __pyx_t_1 = __pyx_f_5pysam_7libcvcf___pyx_unpickle_asVCFRecord__set_state(((struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) | |
37445 __Pyx_GOTREF(__pyx_t_1); | |
37446 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
37447 | |
37448 /* "(tree fragment)":8 | |
37449 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe48d6d5, 0xcc3d7cd, 0x1c28f48) = (encoding, vcffile))" % __pyx_checksum | |
37450 * __pyx_result = asVCFRecord.__new__(__pyx_type) | |
37451 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
37452 * __pyx_unpickle_asVCFRecord__set_state(<asVCFRecord> __pyx_result, __pyx_state) | |
37453 * return __pyx_result | |
37454 */ | |
37455 } | |
37456 | |
37457 /* "(tree fragment)":10 | |
37458 * if __pyx_state is not None: | |
37459 * __pyx_unpickle_asVCFRecord__set_state(<asVCFRecord> __pyx_result, __pyx_state) | |
37460 * return __pyx_result # <<<<<<<<<<<<<< | |
37461 * cdef __pyx_unpickle_asVCFRecord__set_state(asVCFRecord __pyx_result, tuple __pyx_state): | |
37462 * __pyx_result.encoding = __pyx_state[0]; __pyx_result.vcffile = __pyx_state[1] | |
37463 */ | |
37464 __Pyx_XDECREF(__pyx_r); | |
37465 __Pyx_INCREF(__pyx_v___pyx_result); | |
37466 __pyx_r = __pyx_v___pyx_result; | |
37467 goto __pyx_L0; | |
37468 | |
37469 /* "(tree fragment)":1 | |
37470 * def __pyx_unpickle_asVCFRecord(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
37471 * cdef object __pyx_PickleError | |
37472 * cdef object __pyx_result | |
37473 */ | |
37474 | |
37475 /* function exit code */ | |
37476 __pyx_L1_error:; | |
37477 __Pyx_XDECREF(__pyx_t_1); | |
37478 __Pyx_XDECREF(__pyx_t_3); | |
37479 __Pyx_XDECREF(__pyx_t_4); | |
37480 __Pyx_AddTraceback("pysam.libcvcf.__pyx_unpickle_asVCFRecord", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
37481 __pyx_r = NULL; | |
37482 __pyx_L0:; | |
37483 __Pyx_XDECREF(__pyx_v___pyx_PickleError); | |
37484 __Pyx_XDECREF(__pyx_v___pyx_result); | |
37485 __Pyx_XGIVEREF(__pyx_r); | |
37486 __Pyx_RefNannyFinishContext(); | |
37487 return __pyx_r; | |
37488 } | |
37489 | |
37490 /* "(tree fragment)":11 | |
37491 * __pyx_unpickle_asVCFRecord__set_state(<asVCFRecord> __pyx_result, __pyx_state) | |
37492 * return __pyx_result | |
37493 * cdef __pyx_unpickle_asVCFRecord__set_state(asVCFRecord __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
37494 * __pyx_result.encoding = __pyx_state[0]; __pyx_result.vcffile = __pyx_state[1] | |
37495 * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): | |
37496 */ | |
37497 | |
37498 static PyObject *__pyx_f_5pysam_7libcvcf___pyx_unpickle_asVCFRecord__set_state(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { | |
37499 PyObject *__pyx_r = NULL; | |
37500 __Pyx_RefNannyDeclarations | |
37501 PyObject *__pyx_t_1 = NULL; | |
37502 int __pyx_t_2; | |
37503 Py_ssize_t __pyx_t_3; | |
37504 int __pyx_t_4; | |
37505 PyObject *__pyx_t_5 = NULL; | |
37506 PyObject *__pyx_t_6 = NULL; | |
37507 PyObject *__pyx_t_7 = NULL; | |
37508 unsigned int __pyx_t_8; | |
37509 int __pyx_lineno = 0; | |
37510 const char *__pyx_filename = NULL; | |
37511 int __pyx_clineno = 0; | |
37512 __Pyx_RefNannySetupContext("__pyx_unpickle_asVCFRecord__set_state", 1); | |
37513 | |
37514 /* "(tree fragment)":12 | |
37515 * return __pyx_result | |
37516 * cdef __pyx_unpickle_asVCFRecord__set_state(asVCFRecord __pyx_result, tuple __pyx_state): | |
37517 * __pyx_result.encoding = __pyx_state[0]; __pyx_result.vcffile = __pyx_state[1] # <<<<<<<<<<<<<< | |
37518 * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): | |
37519 * __pyx_result.__dict__.update(__pyx_state[2]) | |
37520 */ | |
37521 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
37522 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
37523 __PYX_ERR(1, 12, __pyx_L1_error) | |
37524 } | |
37525 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
37526 __Pyx_GOTREF(__pyx_t_1); | |
37527 __Pyx_GIVEREF(__pyx_t_1); | |
37528 __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
37529 __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
37530 __pyx_v___pyx_result->__pyx_base.encoding = __pyx_t_1; | |
37531 __pyx_t_1 = 0; | |
37532 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
37533 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
37534 __PYX_ERR(1, 12, __pyx_L1_error) | |
37535 } | |
37536 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
37537 __Pyx_GOTREF(__pyx_t_1); | |
37538 __Pyx_GIVEREF(__pyx_t_1); | |
37539 __Pyx_GOTREF(__pyx_v___pyx_result->vcffile); | |
37540 __Pyx_DECREF(__pyx_v___pyx_result->vcffile); | |
37541 __pyx_v___pyx_result->vcffile = __pyx_t_1; | |
37542 __pyx_t_1 = 0; | |
37543 | |
37544 /* "(tree fragment)":13 | |
37545 * cdef __pyx_unpickle_asVCFRecord__set_state(asVCFRecord __pyx_result, tuple __pyx_state): | |
37546 * __pyx_result.encoding = __pyx_state[0]; __pyx_result.vcffile = __pyx_state[1] | |
37547 * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
37548 * __pyx_result.__dict__.update(__pyx_state[2]) | |
37549 */ | |
37550 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
37551 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
37552 __PYX_ERR(1, 13, __pyx_L1_error) | |
37553 } | |
37554 __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
37555 __pyx_t_4 = (__pyx_t_3 > 2); | |
37556 if (__pyx_t_4) { | |
37557 } else { | |
37558 __pyx_t_2 = __pyx_t_4; | |
37559 goto __pyx_L4_bool_binop_done; | |
37560 } | |
37561 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
37562 __pyx_t_2 = __pyx_t_4; | |
37563 __pyx_L4_bool_binop_done:; | |
37564 if (__pyx_t_2) { | |
37565 | |
37566 /* "(tree fragment)":14 | |
37567 * __pyx_result.encoding = __pyx_state[0]; __pyx_result.vcffile = __pyx_state[1] | |
37568 * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): | |
37569 * __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< | |
37570 */ | |
37571 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
37572 __Pyx_GOTREF(__pyx_t_5); | |
37573 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) | |
37574 __Pyx_GOTREF(__pyx_t_6); | |
37575 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
37576 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
37577 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
37578 __PYX_ERR(1, 14, __pyx_L1_error) | |
37579 } | |
37580 __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
37581 __Pyx_GOTREF(__pyx_t_5); | |
37582 __pyx_t_7 = NULL; | |
37583 __pyx_t_8 = 0; | |
37584 #if CYTHON_UNPACK_METHODS | |
37585 if (likely(PyMethod_Check(__pyx_t_6))) { | |
37586 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); | |
37587 if (likely(__pyx_t_7)) { | |
37588 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
37589 __Pyx_INCREF(__pyx_t_7); | |
37590 __Pyx_INCREF(function); | |
37591 __Pyx_DECREF_SET(__pyx_t_6, function); | |
37592 __pyx_t_8 = 1; | |
37593 } | |
37594 } | |
37595 #endif | |
37596 { | |
37597 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; | |
37598 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
37599 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
37600 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
37601 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) | |
37602 __Pyx_GOTREF(__pyx_t_1); | |
37603 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
37604 } | |
37605 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
37606 | |
37607 /* "(tree fragment)":13 | |
37608 * cdef __pyx_unpickle_asVCFRecord__set_state(asVCFRecord __pyx_result, tuple __pyx_state): | |
37609 * __pyx_result.encoding = __pyx_state[0]; __pyx_result.vcffile = __pyx_state[1] | |
37610 * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
37611 * __pyx_result.__dict__.update(__pyx_state[2]) | |
37612 */ | |
37613 } | |
37614 | |
37615 /* "(tree fragment)":11 | |
37616 * __pyx_unpickle_asVCFRecord__set_state(<asVCFRecord> __pyx_result, __pyx_state) | |
37617 * return __pyx_result | |
37618 * cdef __pyx_unpickle_asVCFRecord__set_state(asVCFRecord __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
37619 * __pyx_result.encoding = __pyx_state[0]; __pyx_result.vcffile = __pyx_state[1] | |
37620 * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): | |
37621 */ | |
37622 | |
37623 /* function exit code */ | |
37624 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
37625 goto __pyx_L0; | |
37626 __pyx_L1_error:; | |
37627 __Pyx_XDECREF(__pyx_t_1); | |
37628 __Pyx_XDECREF(__pyx_t_5); | |
37629 __Pyx_XDECREF(__pyx_t_6); | |
37630 __Pyx_XDECREF(__pyx_t_7); | |
37631 __Pyx_AddTraceback("pysam.libcvcf.__pyx_unpickle_asVCFRecord__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
37632 __pyx_r = 0; | |
37633 __pyx_L0:; | |
37634 __Pyx_XGIVEREF(__pyx_r); | |
37635 __Pyx_RefNannyFinishContext(); | |
37636 return __pyx_r; | |
37637 } | |
37638 static struct __pyx_vtabstruct_5pysam_7libcvcf_VCFRecord __pyx_vtable_5pysam_7libcvcf_VCFRecord; | |
37639 | |
37640 static PyObject *__pyx_tp_new_5pysam_7libcvcf_VCFRecord(PyTypeObject *t, PyObject *a, PyObject *k) { | |
37641 struct __pyx_obj_5pysam_7libcvcf_VCFRecord *p; | |
37642 PyObject *o = __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy, tp_new, newfunc)(t, a, k); | |
37643 if (unlikely(!o)) return 0; | |
37644 p = ((struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)o); | |
37645 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy*)__pyx_vtabptr_5pysam_7libcvcf_VCFRecord; | |
37646 p->vcf = Py_None; Py_INCREF(Py_None); | |
37647 if (unlikely(__pyx_pw_5pysam_7libcvcf_9VCFRecord_3__cinit__(o, a, k) < 0)) goto bad; | |
37648 return o; | |
37649 bad: | |
37650 Py_DECREF(o); o = 0; | |
37651 return NULL; | |
37652 } | |
37653 | |
37654 static void __pyx_tp_dealloc_5pysam_7libcvcf_VCFRecord(PyObject *o) { | |
37655 struct __pyx_obj_5pysam_7libcvcf_VCFRecord *p = (struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)o; | |
37656 #if CYTHON_USE_TP_FINALIZE | |
37657 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
37658 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_7libcvcf_VCFRecord) { | |
37659 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
37660 } | |
37661 } | |
37662 #endif | |
37663 PyObject_GC_UnTrack(o); | |
37664 Py_CLEAR(p->vcf); | |
37665 #if PY_MAJOR_VERSION < 3 | |
37666 if (!(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy) || PyType_IS_GC(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy)) PyObject_GC_Track(o); | |
37667 #else | |
37668 if (PyType_IS_GC(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy)) PyObject_GC_Track(o); | |
37669 #endif | |
37670 if (likely(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy)) __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy, tp_dealloc, destructor)(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5pysam_7libcvcf_VCFRecord); | |
37671 } | |
37672 | |
37673 static int __pyx_tp_traverse_5pysam_7libcvcf_VCFRecord(PyObject *o, visitproc v, void *a) { | |
37674 int e; | |
37675 struct __pyx_obj_5pysam_7libcvcf_VCFRecord *p = (struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)o; | |
37676 e = ((likely(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy)) ? ((__pyx_ptype_5pysam_16libctabixproxies_TupleProxy->tp_traverse) ? __pyx_ptype_5pysam_16libctabixproxies_TupleProxy->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_7libcvcf_VCFRecord)); if (e) return e; | |
37677 if (p->vcf) { | |
37678 e = (*v)(p->vcf, a); if (e) return e; | |
37679 } | |
37680 return 0; | |
37681 } | |
37682 | |
37683 static int __pyx_tp_clear_5pysam_7libcvcf_VCFRecord(PyObject *o) { | |
37684 PyObject* tmp; | |
37685 struct __pyx_obj_5pysam_7libcvcf_VCFRecord *p = (struct __pyx_obj_5pysam_7libcvcf_VCFRecord *)o; | |
37686 if (likely(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy)) { if (__pyx_ptype_5pysam_16libctabixproxies_TupleProxy->tp_clear) __pyx_ptype_5pysam_16libctabixproxies_TupleProxy->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_7libcvcf_VCFRecord); | |
37687 tmp = ((PyObject*)p->vcf); | |
37688 p->vcf = Py_None; Py_INCREF(Py_None); | |
37689 Py_XDECREF(tmp); | |
37690 return 0; | |
37691 } | |
37692 static PyObject *__pyx_sq_item_5pysam_7libcvcf_VCFRecord(PyObject *o, Py_ssize_t i) { | |
37693 PyObject *r; | |
37694 PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; | |
37695 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); | |
37696 Py_DECREF(x); | |
37697 return r; | |
37698 } | |
37699 | |
37700 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_contig(PyObject *o, CYTHON_UNUSED void *x) { | |
37701 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_6contig_1__get__(o); | |
37702 } | |
37703 | |
37704 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_pos(PyObject *o, CYTHON_UNUSED void *x) { | |
37705 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_3pos_1__get__(o); | |
37706 } | |
37707 | |
37708 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_id(PyObject *o, CYTHON_UNUSED void *x) { | |
37709 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_2id_1__get__(o); | |
37710 } | |
37711 | |
37712 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_ref(PyObject *o, CYTHON_UNUSED void *x) { | |
37713 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_3ref_1__get__(o); | |
37714 } | |
37715 | |
37716 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_alt(PyObject *o, CYTHON_UNUSED void *x) { | |
37717 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_3alt_1__get__(o); | |
37718 } | |
37719 | |
37720 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_qual(PyObject *o, CYTHON_UNUSED void *x) { | |
37721 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_4qual_1__get__(o); | |
37722 } | |
37723 | |
37724 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_filter(PyObject *o, CYTHON_UNUSED void *x) { | |
37725 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_6filter_1__get__(o); | |
37726 } | |
37727 | |
37728 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_info(PyObject *o, CYTHON_UNUSED void *x) { | |
37729 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_4info_1__get__(o); | |
37730 } | |
37731 | |
37732 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_format(PyObject *o, CYTHON_UNUSED void *x) { | |
37733 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_6format_1__get__(o); | |
37734 } | |
37735 | |
37736 static PyObject *__pyx_getprop_5pysam_7libcvcf_9VCFRecord_samples(PyObject *o, CYTHON_UNUSED void *x) { | |
37737 return __pyx_pw_5pysam_7libcvcf_9VCFRecord_7samples_1__get__(o); | |
37738 } | |
37739 | |
37740 static PyMethodDef __pyx_methods_5pysam_7libcvcf_VCFRecord[] = { | |
37741 {"error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_9VCFRecord_5error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_9VCFRecord_4error}, | |
37742 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_9VCFRecord_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_9VCFRecord_10__reduce_cython__}, | |
37743 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_9VCFRecord_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_9VCFRecord_12__setstate_cython__}, | |
37744 {0, 0, 0, 0} | |
37745 }; | |
37746 | |
37747 static struct PyGetSetDef __pyx_getsets_5pysam_7libcvcf_VCFRecord[] = { | |
37748 {(char *)"contig", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_contig, 0, (char *)0, 0}, | |
37749 {(char *)"pos", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_pos, 0, (char *)0, 0}, | |
37750 {(char *)"id", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_id, 0, (char *)0, 0}, | |
37751 {(char *)"ref", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_ref, 0, (char *)0, 0}, | |
37752 {(char *)"alt", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_alt, 0, (char *)0, 0}, | |
37753 {(char *)"qual", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_qual, 0, (char *)0, 0}, | |
37754 {(char *)"filter", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_filter, 0, (char *)0, 0}, | |
37755 {(char *)"info", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_info, 0, (char *)0, 0}, | |
37756 {(char *)"format", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_format, 0, (char *)0, 0}, | |
37757 {(char *)"samples", __pyx_getprop_5pysam_7libcvcf_9VCFRecord_samples, 0, (char *)0, 0}, | |
37758 {0, 0, 0, 0, 0} | |
37759 }; | |
37760 #if CYTHON_USE_TYPE_SPECS | |
37761 static PyType_Slot __pyx_type_5pysam_7libcvcf_VCFRecord_slots[] = { | |
37762 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_7libcvcf_VCFRecord}, | |
37763 {Py_sq_length, (void *)__pyx_pw_5pysam_7libcvcf_9VCFRecord_7__len__}, | |
37764 {Py_sq_item, (void *)__pyx_sq_item_5pysam_7libcvcf_VCFRecord}, | |
37765 {Py_mp_length, (void *)__pyx_pw_5pysam_7libcvcf_9VCFRecord_7__len__}, | |
37766 {Py_mp_subscript, (void *)__pyx_pw_5pysam_7libcvcf_9VCFRecord_9__getitem__}, | |
37767 {Py_tp_doc, (void *)PyDoc_STR("VCFRecord(vcf)\nvcf record.\n\n initialized from data and vcf meta\n ")}, | |
37768 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_7libcvcf_VCFRecord}, | |
37769 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_7libcvcf_VCFRecord}, | |
37770 {Py_tp_methods, (void *)__pyx_methods_5pysam_7libcvcf_VCFRecord}, | |
37771 {Py_tp_getset, (void *)__pyx_getsets_5pysam_7libcvcf_VCFRecord}, | |
37772 {Py_tp_init, (void *)__pyx_pw_5pysam_7libcvcf_9VCFRecord_1__init__}, | |
37773 {Py_tp_new, (void *)__pyx_tp_new_5pysam_7libcvcf_VCFRecord}, | |
37774 {0, 0}, | |
37775 }; | |
37776 static PyType_Spec __pyx_type_5pysam_7libcvcf_VCFRecord_spec = { | |
37777 "pysam.libcvcf.VCFRecord", | |
37778 sizeof(struct __pyx_obj_5pysam_7libcvcf_VCFRecord), | |
37779 0, | |
37780 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, | |
37781 __pyx_type_5pysam_7libcvcf_VCFRecord_slots, | |
37782 }; | |
37783 #else | |
37784 | |
37785 static PySequenceMethods __pyx_tp_as_sequence_VCFRecord = { | |
37786 __pyx_pw_5pysam_7libcvcf_9VCFRecord_7__len__, /*sq_length*/ | |
37787 0, /*sq_concat*/ | |
37788 0, /*sq_repeat*/ | |
37789 __pyx_sq_item_5pysam_7libcvcf_VCFRecord, /*sq_item*/ | |
37790 0, /*sq_slice*/ | |
37791 0, /*sq_ass_item*/ | |
37792 0, /*sq_ass_slice*/ | |
37793 0, /*sq_contains*/ | |
37794 0, /*sq_inplace_concat*/ | |
37795 0, /*sq_inplace_repeat*/ | |
37796 }; | |
37797 | |
37798 static PyMappingMethods __pyx_tp_as_mapping_VCFRecord = { | |
37799 __pyx_pw_5pysam_7libcvcf_9VCFRecord_7__len__, /*mp_length*/ | |
37800 __pyx_pw_5pysam_7libcvcf_9VCFRecord_9__getitem__, /*mp_subscript*/ | |
37801 0, /*mp_ass_subscript*/ | |
37802 }; | |
37803 | |
37804 static PyTypeObject __pyx_type_5pysam_7libcvcf_VCFRecord = { | |
37805 PyVarObject_HEAD_INIT(0, 0) | |
37806 "pysam.libcvcf.""VCFRecord", /*tp_name*/ | |
37807 sizeof(struct __pyx_obj_5pysam_7libcvcf_VCFRecord), /*tp_basicsize*/ | |
37808 0, /*tp_itemsize*/ | |
37809 __pyx_tp_dealloc_5pysam_7libcvcf_VCFRecord, /*tp_dealloc*/ | |
37810 #if PY_VERSION_HEX < 0x030800b4 | |
37811 0, /*tp_print*/ | |
37812 #endif | |
37813 #if PY_VERSION_HEX >= 0x030800b4 | |
37814 0, /*tp_vectorcall_offset*/ | |
37815 #endif | |
37816 0, /*tp_getattr*/ | |
37817 0, /*tp_setattr*/ | |
37818 #if PY_MAJOR_VERSION < 3 | |
37819 0, /*tp_compare*/ | |
37820 #endif | |
37821 #if PY_MAJOR_VERSION >= 3 | |
37822 0, /*tp_as_async*/ | |
37823 #endif | |
37824 0, /*tp_repr*/ | |
37825 0, /*tp_as_number*/ | |
37826 &__pyx_tp_as_sequence_VCFRecord, /*tp_as_sequence*/ | |
37827 &__pyx_tp_as_mapping_VCFRecord, /*tp_as_mapping*/ | |
37828 0, /*tp_hash*/ | |
37829 0, /*tp_call*/ | |
37830 0, /*tp_str*/ | |
37831 0, /*tp_getattro*/ | |
37832 0, /*tp_setattro*/ | |
37833 0, /*tp_as_buffer*/ | |
37834 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ | |
37835 PyDoc_STR("VCFRecord(vcf)\nvcf record.\n\n initialized from data and vcf meta\n "), /*tp_doc*/ | |
37836 __pyx_tp_traverse_5pysam_7libcvcf_VCFRecord, /*tp_traverse*/ | |
37837 __pyx_tp_clear_5pysam_7libcvcf_VCFRecord, /*tp_clear*/ | |
37838 0, /*tp_richcompare*/ | |
37839 0, /*tp_weaklistoffset*/ | |
37840 0, /*tp_iter*/ | |
37841 0, /*tp_iternext*/ | |
37842 __pyx_methods_5pysam_7libcvcf_VCFRecord, /*tp_methods*/ | |
37843 0, /*tp_members*/ | |
37844 __pyx_getsets_5pysam_7libcvcf_VCFRecord, /*tp_getset*/ | |
37845 0, /*tp_base*/ | |
37846 0, /*tp_dict*/ | |
37847 0, /*tp_descr_get*/ | |
37848 0, /*tp_descr_set*/ | |
37849 #if !CYTHON_USE_TYPE_SPECS | |
37850 0, /*tp_dictoffset*/ | |
37851 #endif | |
37852 __pyx_pw_5pysam_7libcvcf_9VCFRecord_1__init__, /*tp_init*/ | |
37853 0, /*tp_alloc*/ | |
37854 __pyx_tp_new_5pysam_7libcvcf_VCFRecord, /*tp_new*/ | |
37855 0, /*tp_free*/ | |
37856 0, /*tp_is_gc*/ | |
37857 0, /*tp_bases*/ | |
37858 0, /*tp_mro*/ | |
37859 0, /*tp_cache*/ | |
37860 0, /*tp_subclasses*/ | |
37861 0, /*tp_weaklist*/ | |
37862 0, /*tp_del*/ | |
37863 0, /*tp_version_tag*/ | |
37864 #if PY_VERSION_HEX >= 0x030400a1 | |
37865 #if CYTHON_USE_TP_FINALIZE | |
37866 0, /*tp_finalize*/ | |
37867 #else | |
37868 NULL, /*tp_finalize*/ | |
37869 #endif | |
37870 #endif | |
37871 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
37872 0, /*tp_vectorcall*/ | |
37873 #endif | |
37874 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
37875 0, /*tp_print*/ | |
37876 #endif | |
37877 #if PY_VERSION_HEX >= 0x030C0000 | |
37878 0, /*tp_watched*/ | |
37879 #endif | |
37880 #if PY_VERSION_HEX >= 0x030d00A4 | |
37881 0, /*tp_versions_used*/ | |
37882 #endif | |
37883 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
37884 0, /*tp_pypy_flags*/ | |
37885 #endif | |
37886 }; | |
37887 #endif | |
37888 static struct __pyx_vtabstruct_5pysam_7libcvcf_asVCFRecord __pyx_vtable_5pysam_7libcvcf_asVCFRecord; | |
37889 | |
37890 static PyObject *__pyx_tp_new_5pysam_7libcvcf_asVCFRecord(PyTypeObject *t, PyObject *a, PyObject *k) { | |
37891 struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *p; | |
37892 PyObject *o = __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_9libctabix_Parser, tp_new, newfunc)(t, a, k); | |
37893 if (unlikely(!o)) return 0; | |
37894 p = ((struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *)o); | |
37895 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libctabix_Parser*)__pyx_vtabptr_5pysam_7libcvcf_asVCFRecord; | |
37896 p->vcffile = Py_None; Py_INCREF(Py_None); | |
37897 return o; | |
37898 } | |
37899 | |
37900 static void __pyx_tp_dealloc_5pysam_7libcvcf_asVCFRecord(PyObject *o) { | |
37901 struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *p = (struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *)o; | |
37902 #if CYTHON_USE_TP_FINALIZE | |
37903 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
37904 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_7libcvcf_asVCFRecord) { | |
37905 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
37906 } | |
37907 } | |
37908 #endif | |
37909 PyObject_GC_UnTrack(o); | |
37910 Py_CLEAR(p->vcffile); | |
37911 #if PY_MAJOR_VERSION < 3 | |
37912 if (!(__pyx_ptype_5pysam_9libctabix_Parser) || PyType_IS_GC(__pyx_ptype_5pysam_9libctabix_Parser)) PyObject_GC_Track(o); | |
37913 #else | |
37914 if (PyType_IS_GC(__pyx_ptype_5pysam_9libctabix_Parser)) PyObject_GC_Track(o); | |
37915 #endif | |
37916 if (likely(__pyx_ptype_5pysam_9libctabix_Parser)) __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_9libctabix_Parser, tp_dealloc, destructor)(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5pysam_7libcvcf_asVCFRecord); | |
37917 } | |
37918 | |
37919 static int __pyx_tp_traverse_5pysam_7libcvcf_asVCFRecord(PyObject *o, visitproc v, void *a) { | |
37920 int e; | |
37921 struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *p = (struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *)o; | |
37922 e = ((likely(__pyx_ptype_5pysam_9libctabix_Parser)) ? ((__pyx_ptype_5pysam_9libctabix_Parser->tp_traverse) ? __pyx_ptype_5pysam_9libctabix_Parser->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_7libcvcf_asVCFRecord)); if (e) return e; | |
37923 if (p->vcffile) { | |
37924 e = (*v)(p->vcffile, a); if (e) return e; | |
37925 } | |
37926 return 0; | |
37927 } | |
37928 | |
37929 static int __pyx_tp_clear_5pysam_7libcvcf_asVCFRecord(PyObject *o) { | |
37930 PyObject* tmp; | |
37931 struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *p = (struct __pyx_obj_5pysam_7libcvcf_asVCFRecord *)o; | |
37932 if (likely(__pyx_ptype_5pysam_9libctabix_Parser)) { if (__pyx_ptype_5pysam_9libctabix_Parser->tp_clear) __pyx_ptype_5pysam_9libctabix_Parser->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_7libcvcf_asVCFRecord); | |
37933 tmp = ((PyObject*)p->vcffile); | |
37934 p->vcffile = Py_None; Py_INCREF(Py_None); | |
37935 Py_XDECREF(tmp); | |
37936 return 0; | |
37937 } | |
37938 | |
37939 static PyMethodDef __pyx_methods_5pysam_7libcvcf_asVCFRecord[] = { | |
37940 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_11asVCFRecord_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_11asVCFRecord_2__reduce_cython__}, | |
37941 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_7libcvcf_11asVCFRecord_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_7libcvcf_11asVCFRecord_4__setstate_cython__}, | |
37942 {0, 0, 0, 0} | |
37943 }; | |
37944 #if CYTHON_USE_TYPE_SPECS | |
37945 static PyType_Slot __pyx_type_5pysam_7libcvcf_asVCFRecord_slots[] = { | |
37946 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_7libcvcf_asVCFRecord}, | |
37947 {Py_tp_doc, (void *)PyDoc_STR("asVCFRecord(vcffile)\nconverts a :term:`tabix row` into a VCF record.")}, | |
37948 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_7libcvcf_asVCFRecord}, | |
37949 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_7libcvcf_asVCFRecord}, | |
37950 {Py_tp_methods, (void *)__pyx_methods_5pysam_7libcvcf_asVCFRecord}, | |
37951 {Py_tp_init, (void *)__pyx_pw_5pysam_7libcvcf_11asVCFRecord_1__init__}, | |
37952 {Py_tp_new, (void *)__pyx_tp_new_5pysam_7libcvcf_asVCFRecord}, | |
37953 {0, 0}, | |
37954 }; | |
37955 static PyType_Spec __pyx_type_5pysam_7libcvcf_asVCFRecord_spec = { | |
37956 "pysam.libcvcf.asVCFRecord", | |
37957 sizeof(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord), | |
37958 0, | |
37959 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, | |
37960 __pyx_type_5pysam_7libcvcf_asVCFRecord_slots, | |
37961 }; | |
37962 #else | |
37963 | |
37964 static PyTypeObject __pyx_type_5pysam_7libcvcf_asVCFRecord = { | |
37965 PyVarObject_HEAD_INIT(0, 0) | |
37966 "pysam.libcvcf.""asVCFRecord", /*tp_name*/ | |
37967 sizeof(struct __pyx_obj_5pysam_7libcvcf_asVCFRecord), /*tp_basicsize*/ | |
37968 0, /*tp_itemsize*/ | |
37969 __pyx_tp_dealloc_5pysam_7libcvcf_asVCFRecord, /*tp_dealloc*/ | |
37970 #if PY_VERSION_HEX < 0x030800b4 | |
37971 0, /*tp_print*/ | |
37972 #endif | |
37973 #if PY_VERSION_HEX >= 0x030800b4 | |
37974 0, /*tp_vectorcall_offset*/ | |
37975 #endif | |
37976 0, /*tp_getattr*/ | |
37977 0, /*tp_setattr*/ | |
37978 #if PY_MAJOR_VERSION < 3 | |
37979 0, /*tp_compare*/ | |
37980 #endif | |
37981 #if PY_MAJOR_VERSION >= 3 | |
37982 0, /*tp_as_async*/ | |
37983 #endif | |
37984 0, /*tp_repr*/ | |
37985 0, /*tp_as_number*/ | |
37986 0, /*tp_as_sequence*/ | |
37987 0, /*tp_as_mapping*/ | |
37988 0, /*tp_hash*/ | |
37989 0, /*tp_call*/ | |
37990 0, /*tp_str*/ | |
37991 0, /*tp_getattro*/ | |
37992 0, /*tp_setattro*/ | |
37993 0, /*tp_as_buffer*/ | |
37994 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ | |
37995 PyDoc_STR("asVCFRecord(vcffile)\nconverts a :term:`tabix row` into a VCF record."), /*tp_doc*/ | |
37996 __pyx_tp_traverse_5pysam_7libcvcf_asVCFRecord, /*tp_traverse*/ | |
37997 __pyx_tp_clear_5pysam_7libcvcf_asVCFRecord, /*tp_clear*/ | |
37998 0, /*tp_richcompare*/ | |
37999 0, /*tp_weaklistoffset*/ | |
38000 0, /*tp_iter*/ | |
38001 0, /*tp_iternext*/ | |
38002 __pyx_methods_5pysam_7libcvcf_asVCFRecord, /*tp_methods*/ | |
38003 0, /*tp_members*/ | |
38004 0, /*tp_getset*/ | |
38005 0, /*tp_base*/ | |
38006 0, /*tp_dict*/ | |
38007 0, /*tp_descr_get*/ | |
38008 0, /*tp_descr_set*/ | |
38009 #if !CYTHON_USE_TYPE_SPECS | |
38010 0, /*tp_dictoffset*/ | |
38011 #endif | |
38012 __pyx_pw_5pysam_7libcvcf_11asVCFRecord_1__init__, /*tp_init*/ | |
38013 0, /*tp_alloc*/ | |
38014 __pyx_tp_new_5pysam_7libcvcf_asVCFRecord, /*tp_new*/ | |
38015 0, /*tp_free*/ | |
38016 0, /*tp_is_gc*/ | |
38017 0, /*tp_bases*/ | |
38018 0, /*tp_mro*/ | |
38019 0, /*tp_cache*/ | |
38020 0, /*tp_subclasses*/ | |
38021 0, /*tp_weaklist*/ | |
38022 0, /*tp_del*/ | |
38023 0, /*tp_version_tag*/ | |
38024 #if PY_VERSION_HEX >= 0x030400a1 | |
38025 #if CYTHON_USE_TP_FINALIZE | |
38026 0, /*tp_finalize*/ | |
38027 #else | |
38028 NULL, /*tp_finalize*/ | |
38029 #endif | |
38030 #endif | |
38031 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
38032 0, /*tp_vectorcall*/ | |
38033 #endif | |
38034 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
38035 0, /*tp_print*/ | |
38036 #endif | |
38037 #if PY_VERSION_HEX >= 0x030C0000 | |
38038 0, /*tp_watched*/ | |
38039 #endif | |
38040 #if PY_VERSION_HEX >= 0x030d00A4 | |
38041 0, /*tp_versions_used*/ | |
38042 #endif | |
38043 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
38044 0, /*tp_pypy_flags*/ | |
38045 #endif | |
38046 }; | |
38047 #endif | |
38048 | |
38049 #if CYTHON_USE_FREELISTS | |
38050 static struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *__pyx_freelist_5pysam_7libcvcf___pyx_scope_struct___parse[8]; | |
38051 static int __pyx_freecount_5pysam_7libcvcf___pyx_scope_struct___parse = 0; | |
38052 #endif | |
38053 | |
38054 static PyObject *__pyx_tp_new_5pysam_7libcvcf___pyx_scope_struct___parse(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { | |
38055 PyObject *o; | |
38056 #if CYTHON_COMPILING_IN_LIMITED_API | |
38057 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); | |
38058 o = alloc_func(t, 0); | |
38059 #else | |
38060 #if CYTHON_USE_FREELISTS | |
38061 if (likely((int)(__pyx_freecount_5pysam_7libcvcf___pyx_scope_struct___parse > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse)))) { | |
38062 o = (PyObject*)__pyx_freelist_5pysam_7libcvcf___pyx_scope_struct___parse[--__pyx_freecount_5pysam_7libcvcf___pyx_scope_struct___parse]; | |
38063 memset(o, 0, sizeof(struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse)); | |
38064 (void) PyObject_INIT(o, t); | |
38065 PyObject_GC_Track(o); | |
38066 } else | |
38067 #endif | |
38068 { | |
38069 o = (*t->tp_alloc)(t, 0); | |
38070 if (unlikely(!o)) return 0; | |
38071 } | |
38072 #endif | |
38073 return o; | |
38074 } | |
38075 | |
38076 static void __pyx_tp_dealloc_5pysam_7libcvcf___pyx_scope_struct___parse(PyObject *o) { | |
38077 struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *p = (struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *)o; | |
38078 #if CYTHON_USE_TP_FINALIZE | |
38079 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
38080 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_7libcvcf___pyx_scope_struct___parse) { | |
38081 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
38082 } | |
38083 } | |
38084 #endif | |
38085 PyObject_GC_UnTrack(o); | |
38086 Py_CLEAR(p->__pyx_v_d); | |
38087 Py_CLEAR(p->__pyx_v_line); | |
38088 Py_CLEAR(p->__pyx_v_self); | |
38089 Py_CLEAR(p->__pyx_v_stream); | |
38090 Py_CLEAR(p->__pyx_t_0); | |
38091 #if CYTHON_USE_FREELISTS | |
38092 if (((int)(__pyx_freecount_5pysam_7libcvcf___pyx_scope_struct___parse < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse)))) { | |
38093 __pyx_freelist_5pysam_7libcvcf___pyx_scope_struct___parse[__pyx_freecount_5pysam_7libcvcf___pyx_scope_struct___parse++] = ((struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *)o); | |
38094 } else | |
38095 #endif | |
38096 { | |
38097 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
38098 (*Py_TYPE(o)->tp_free)(o); | |
38099 #else | |
38100 { | |
38101 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); | |
38102 if (tp_free) tp_free(o); | |
38103 } | |
38104 #endif | |
38105 } | |
38106 } | |
38107 | |
38108 static int __pyx_tp_traverse_5pysam_7libcvcf___pyx_scope_struct___parse(PyObject *o, visitproc v, void *a) { | |
38109 int e; | |
38110 struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *p = (struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse *)o; | |
38111 if (p->__pyx_v_d) { | |
38112 e = (*v)(p->__pyx_v_d, a); if (e) return e; | |
38113 } | |
38114 if (p->__pyx_v_line) { | |
38115 e = (*v)(p->__pyx_v_line, a); if (e) return e; | |
38116 } | |
38117 if (p->__pyx_v_self) { | |
38118 e = (*v)(p->__pyx_v_self, a); if (e) return e; | |
38119 } | |
38120 if (p->__pyx_v_stream) { | |
38121 e = (*v)(p->__pyx_v_stream, a); if (e) return e; | |
38122 } | |
38123 if (p->__pyx_t_0) { | |
38124 e = (*v)(p->__pyx_t_0, a); if (e) return e; | |
38125 } | |
38126 return 0; | |
38127 } | |
38128 #if CYTHON_USE_TYPE_SPECS | |
38129 static PyType_Slot __pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse_slots[] = { | |
38130 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_7libcvcf___pyx_scope_struct___parse}, | |
38131 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_7libcvcf___pyx_scope_struct___parse}, | |
38132 {Py_tp_new, (void *)__pyx_tp_new_5pysam_7libcvcf___pyx_scope_struct___parse}, | |
38133 {0, 0}, | |
38134 }; | |
38135 static PyType_Spec __pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse_spec = { | |
38136 "pysam.libcvcf.__pyx_scope_struct___parse", | |
38137 sizeof(struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse), | |
38138 0, | |
38139 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, | |
38140 __pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse_slots, | |
38141 }; | |
38142 #else | |
38143 | |
38144 static PyTypeObject __pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse = { | |
38145 PyVarObject_HEAD_INIT(0, 0) | |
38146 "pysam.libcvcf.""__pyx_scope_struct___parse", /*tp_name*/ | |
38147 sizeof(struct __pyx_obj_5pysam_7libcvcf___pyx_scope_struct___parse), /*tp_basicsize*/ | |
38148 0, /*tp_itemsize*/ | |
38149 __pyx_tp_dealloc_5pysam_7libcvcf___pyx_scope_struct___parse, /*tp_dealloc*/ | |
38150 #if PY_VERSION_HEX < 0x030800b4 | |
38151 0, /*tp_print*/ | |
38152 #endif | |
38153 #if PY_VERSION_HEX >= 0x030800b4 | |
38154 0, /*tp_vectorcall_offset*/ | |
38155 #endif | |
38156 0, /*tp_getattr*/ | |
38157 0, /*tp_setattr*/ | |
38158 #if PY_MAJOR_VERSION < 3 | |
38159 0, /*tp_compare*/ | |
38160 #endif | |
38161 #if PY_MAJOR_VERSION >= 3 | |
38162 0, /*tp_as_async*/ | |
38163 #endif | |
38164 0, /*tp_repr*/ | |
38165 0, /*tp_as_number*/ | |
38166 0, /*tp_as_sequence*/ | |
38167 0, /*tp_as_mapping*/ | |
38168 0, /*tp_hash*/ | |
38169 0, /*tp_call*/ | |
38170 0, /*tp_str*/ | |
38171 0, /*tp_getattro*/ | |
38172 0, /*tp_setattro*/ | |
38173 0, /*tp_as_buffer*/ | |
38174 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ | |
38175 0, /*tp_doc*/ | |
38176 __pyx_tp_traverse_5pysam_7libcvcf___pyx_scope_struct___parse, /*tp_traverse*/ | |
38177 0, /*tp_clear*/ | |
38178 0, /*tp_richcompare*/ | |
38179 0, /*tp_weaklistoffset*/ | |
38180 0, /*tp_iter*/ | |
38181 0, /*tp_iternext*/ | |
38182 0, /*tp_methods*/ | |
38183 0, /*tp_members*/ | |
38184 0, /*tp_getset*/ | |
38185 0, /*tp_base*/ | |
38186 0, /*tp_dict*/ | |
38187 0, /*tp_descr_get*/ | |
38188 0, /*tp_descr_set*/ | |
38189 #if !CYTHON_USE_TYPE_SPECS | |
38190 0, /*tp_dictoffset*/ | |
38191 #endif | |
38192 0, /*tp_init*/ | |
38193 0, /*tp_alloc*/ | |
38194 __pyx_tp_new_5pysam_7libcvcf___pyx_scope_struct___parse, /*tp_new*/ | |
38195 0, /*tp_free*/ | |
38196 0, /*tp_is_gc*/ | |
38197 0, /*tp_bases*/ | |
38198 0, /*tp_mro*/ | |
38199 0, /*tp_cache*/ | |
38200 0, /*tp_subclasses*/ | |
38201 0, /*tp_weaklist*/ | |
38202 0, /*tp_del*/ | |
38203 0, /*tp_version_tag*/ | |
38204 #if PY_VERSION_HEX >= 0x030400a1 | |
38205 #if CYTHON_USE_TP_FINALIZE | |
38206 0, /*tp_finalize*/ | |
38207 #else | |
38208 NULL, /*tp_finalize*/ | |
38209 #endif | |
38210 #endif | |
38211 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
38212 0, /*tp_vectorcall*/ | |
38213 #endif | |
38214 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
38215 0, /*tp_print*/ | |
38216 #endif | |
38217 #if PY_VERSION_HEX >= 0x030C0000 | |
38218 0, /*tp_watched*/ | |
38219 #endif | |
38220 #if PY_VERSION_HEX >= 0x030d00A4 | |
38221 0, /*tp_versions_used*/ | |
38222 #endif | |
38223 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
38224 0, /*tp_pypy_flags*/ | |
38225 #endif | |
38226 }; | |
38227 #endif | |
38228 | |
38229 static PyMethodDef __pyx_methods[] = { | |
38230 {0, 0, 0, 0} | |
38231 }; | |
38232 #ifndef CYTHON_SMALL_CODE | |
38233 #if defined(__clang__) | |
38234 #define CYTHON_SMALL_CODE | |
38235 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) | |
38236 #define CYTHON_SMALL_CODE __attribute__((cold)) | |
38237 #else | |
38238 #define CYTHON_SMALL_CODE | |
38239 #endif | |
38240 #endif | |
38241 /* #### Code section: pystring_table ### */ | |
38242 | |
38243 static int __Pyx_CreateStringTabAndInitStrings(void) { | |
38244 __Pyx_StringTabEntry __pyx_string_tab[] = { | |
38245 {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, | |
38246 {&__pyx_kp_b_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 0, 0}, | |
38247 {&__pyx_kp_u_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 1, 0, 0}, | |
38248 {&__pyx_n_u_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 1, 0, 1}, | |
38249 {&__pyx_n_u_ACGTN, __pyx_k_ACGTN, sizeof(__pyx_k_ACGTN), 0, 1, 0, 1}, | |
38250 {&__pyx_kp_u_ACGTN_2, __pyx_k_ACGTN_2, sizeof(__pyx_k_ACGTN_2), 0, 1, 0, 0}, | |
38251 {&__pyx_n_u_ALT, __pyx_k_ALT, sizeof(__pyx_k_ALT), 0, 1, 0, 1}, | |
38252 {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, | |
38253 {&__pyx_n_s_BADLY_FORMATTED_FORMAT_STRING, __pyx_k_BADLY_FORMATTED_FORMAT_STRING, sizeof(__pyx_k_BADLY_FORMATTED_FORMAT_STRING), 0, 0, 1, 1}, | |
38254 {&__pyx_kp_u_BADLY_FORMATTED_FORMAT_STRING_Fo, __pyx_k_BADLY_FORMATTED_FORMAT_STRING_Fo, sizeof(__pyx_k_BADLY_FORMATTED_FORMAT_STRING_Fo), 0, 1, 0, 0}, | |
38255 {&__pyx_n_s_BADLY_FORMATTED_HEADING, __pyx_k_BADLY_FORMATTED_HEADING, sizeof(__pyx_k_BADLY_FORMATTED_HEADING), 0, 0, 1, 1}, | |
38256 {&__pyx_kp_u_BADLY_FORMATTED_HEADING_Did_not, __pyx_k_BADLY_FORMATTED_HEADING_Did_not, sizeof(__pyx_k_BADLY_FORMATTED_HEADING_Did_not), 0, 1, 0, 0}, | |
38257 {&__pyx_kp_u_BAD_CHR_TAG_Error_calculating_ch, __pyx_k_BAD_CHR_TAG_Error_calculating_ch, sizeof(__pyx_k_BAD_CHR_TAG_Error_calculating_ch), 0, 1, 0, 0}, | |
38258 {&__pyx_n_s_BAD_GENOTYPE, __pyx_k_BAD_GENOTYPE, sizeof(__pyx_k_BAD_GENOTYPE), 0, 0, 1, 1}, | |
38259 {&__pyx_kp_u_BAD_GENOTYPE_Cannot_parse_genoty, __pyx_k_BAD_GENOTYPE_Cannot_parse_genoty, sizeof(__pyx_k_BAD_GENOTYPE_Cannot_parse_genoty), 0, 1, 0, 0}, | |
38260 {&__pyx_n_s_BAD_NUMBER_OF_COLUMNS, __pyx_k_BAD_NUMBER_OF_COLUMNS, sizeof(__pyx_k_BAD_NUMBER_OF_COLUMNS), 0, 0, 1, 1}, | |
38261 {&__pyx_kp_u_BAD_NUMBER_OF_COLUMNS_Wrong_numb, __pyx_k_BAD_NUMBER_OF_COLUMNS_Wrong_numb, sizeof(__pyx_k_BAD_NUMBER_OF_COLUMNS_Wrong_numb), 0, 1, 0, 0}, | |
38262 {&__pyx_n_s_BAD_NUMBER_OF_PARAMETERS, __pyx_k_BAD_NUMBER_OF_PARAMETERS, sizeof(__pyx_k_BAD_NUMBER_OF_PARAMETERS), 0, 0, 1, 1}, | |
38263 {&__pyx_kp_u_BAD_NUMBER_OF_PARAMETERS_Found_u, __pyx_k_BAD_NUMBER_OF_PARAMETERS_Found_u, sizeof(__pyx_k_BAD_NUMBER_OF_PARAMETERS_Found_u), 0, 1, 0, 0}, | |
38264 {&__pyx_n_s_BAD_NUMBER_OF_VALUES, __pyx_k_BAD_NUMBER_OF_VALUES, sizeof(__pyx_k_BAD_NUMBER_OF_VALUES), 0, 0, 1, 1}, | |
38265 {&__pyx_kp_u_BAD_NUMBER_OF_VALUES_Found_too_m, __pyx_k_BAD_NUMBER_OF_VALUES_Found_too_m, sizeof(__pyx_k_BAD_NUMBER_OF_VALUES_Found_too_m), 0, 1, 0, 0}, | |
38266 {&__pyx_n_u_CHROM, __pyx_k_CHROM, sizeof(__pyx_k_CHROM), 0, 1, 0, 1}, | |
38267 {&__pyx_kp_u_Can_only_handle_v3_3_and_v4_0_VC, __pyx_k_Can_only_handle_v3_3_and_v4_0_VC, sizeof(__pyx_k_Can_only_handle_v3_3_and_v4_0_VC), 0, 1, 0, 0}, | |
38268 {&__pyx_n_u_Character, __pyx_k_Character, sizeof(__pyx_k_Character), 0, 1, 0, 1}, | |
38269 {&__pyx_kp_u_Conditional_genotype_quality, __pyx_k_Conditional_genotype_quality, sizeof(__pyx_k_Conditional_genotype_quality), 0, 1, 0, 0}, | |
38270 {&__pyx_n_u_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 1, 0, 1}, | |
38271 {&__pyx_n_u_DP, __pyx_k_DP, sizeof(__pyx_k_DP), 0, 1, 0, 1}, | |
38272 {&__pyx_kp_u_Description, __pyx_k_Description, sizeof(__pyx_k_Description), 0, 1, 0, 0}, | |
38273 {&__pyx_n_u_Description_2, __pyx_k_Description_2, sizeof(__pyx_k_Description_2), 0, 1, 0, 1}, | |
38274 {&__pyx_kp_u_Don_t_understand_region_string_s, __pyx_k_Don_t_understand_region_string_s, sizeof(__pyx_k_Don_t_understand_region_string_s), 0, 1, 0, 0}, | |
38275 {&__pyx_n_u_EC, __pyx_k_EC, sizeof(__pyx_k_EC), 0, 1, 0, 1}, | |
38276 {&__pyx_n_s_ERROR_FLAG_HAS_VALUE, __pyx_k_ERROR_FLAG_HAS_VALUE, sizeof(__pyx_k_ERROR_FLAG_HAS_VALUE), 0, 0, 1, 1}, | |
38277 {&__pyx_kp_u_ERROR_FLAG_HAS_VALUE_Flag_fields, __pyx_k_ERROR_FLAG_HAS_VALUE_Flag_fields, sizeof(__pyx_k_ERROR_FLAG_HAS_VALUE_Flag_fields), 0, 1, 0, 0}, | |
38278 {&__pyx_n_s_ERROR_FORMAT_NOT_CHAR, __pyx_k_ERROR_FORMAT_NOT_CHAR, sizeof(__pyx_k_ERROR_FORMAT_NOT_CHAR), 0, 0, 1, 1}, | |
38279 {&__pyx_kp_u_ERROR_FORMAT_NOT_CHAR_Eexpected, __pyx_k_ERROR_FORMAT_NOT_CHAR_Eexpected, sizeof(__pyx_k_ERROR_FORMAT_NOT_CHAR_Eexpected), 0, 1, 0, 0}, | |
38280 {&__pyx_n_s_ERROR_FORMAT_NOT_INTEGER, __pyx_k_ERROR_FORMAT_NOT_INTEGER, sizeof(__pyx_k_ERROR_FORMAT_NOT_INTEGER), 0, 0, 1, 1}, | |
38281 {&__pyx_kp_u_ERROR_FORMAT_NOT_INTEGER_Expecte, __pyx_k_ERROR_FORMAT_NOT_INTEGER_Expecte, sizeof(__pyx_k_ERROR_FORMAT_NOT_INTEGER_Expecte), 0, 1, 0, 0}, | |
38282 {&__pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL, __pyx_k_ERROR_FORMAT_NOT_NUMERICAL, sizeof(__pyx_k_ERROR_FORMAT_NOT_NUMERICAL), 0, 0, 1, 1}, | |
38283 {&__pyx_kp_u_ERROR_FORMAT_NOT_NUMERICAL_Expec, __pyx_k_ERROR_FORMAT_NOT_NUMERICAL_Expec, sizeof(__pyx_k_ERROR_FORMAT_NOT_NUMERICAL_Expec), 0, 1, 0, 0}, | |
38284 {&__pyx_n_s_ERROR_INFO_STRING, __pyx_k_ERROR_INFO_STRING, sizeof(__pyx_k_ERROR_INFO_STRING), 0, 0, 1, 1}, | |
38285 {&__pyx_kp_u_ERROR_INFO_STRING_Error_while_pa, __pyx_k_ERROR_INFO_STRING_Error_while_pa, sizeof(__pyx_k_ERROR_INFO_STRING_Error_while_pa), 0, 1, 0, 0}, | |
38286 {&__pyx_n_s_ERROR_TRAILING_DATA, __pyx_k_ERROR_TRAILING_DATA, sizeof(__pyx_k_ERROR_TRAILING_DATA), 0, 0, 1, 1}, | |
38287 {&__pyx_kp_u_ERROR_TRAILING_DATA_Numerical_fi, __pyx_k_ERROR_TRAILING_DATA_Numerical_fi, sizeof(__pyx_k_ERROR_TRAILING_DATA_Numerical_fi), 0, 1, 0, 0}, | |
38288 {&__pyx_n_s_ERROR_UNKNOWN_KEY, __pyx_k_ERROR_UNKNOWN_KEY, sizeof(__pyx_k_ERROR_UNKNOWN_KEY), 0, 0, 1, 1}, | |
38289 {&__pyx_kp_u_ERROR_UNKNOWN_KEY_Unknown_key_s, __pyx_k_ERROR_UNKNOWN_KEY_Unknown_key_s, sizeof(__pyx_k_ERROR_UNKNOWN_KEY_Unknown_key_s), 0, 1, 0, 0}, | |
38290 {&__pyx_n_u_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 1, 0, 1}, | |
38291 {&__pyx_kp_u_Expected_alternate_allel_counts, __pyx_k_Expected_alternate_allel_counts, sizeof(__pyx_k_Expected_alternate_allel_counts), 0, 1, 0, 0}, | |
38292 {&__pyx_n_u_FILTER, __pyx_k_FILTER, sizeof(__pyx_k_FILTER), 0, 1, 0, 1}, | |
38293 {&__pyx_n_s_FILTER_NOT_DEFINED, __pyx_k_FILTER_NOT_DEFINED, sizeof(__pyx_k_FILTER_NOT_DEFINED), 0, 0, 1, 1}, | |
38294 {&__pyx_kp_u_FILTER_NOT_DEFINED_Identifier_s, __pyx_k_FILTER_NOT_DEFINED_Identifier_s, sizeof(__pyx_k_FILTER_NOT_DEFINED_Identifier_s), 0, 1, 0, 0}, | |
38295 {&__pyx_n_s_FORMAT, __pyx_k_FORMAT, sizeof(__pyx_k_FORMAT), 0, 0, 1, 1}, | |
38296 {&__pyx_n_u_FORMAT, __pyx_k_FORMAT, sizeof(__pyx_k_FORMAT), 0, 1, 0, 1}, | |
38297 {&__pyx_n_s_FORMAT_MISSING_QUOTES, __pyx_k_FORMAT_MISSING_QUOTES, sizeof(__pyx_k_FORMAT_MISSING_QUOTES), 0, 0, 1, 1}, | |
38298 {&__pyx_kp_u_FORMAT_MISSING_QUOTES_Descriptio, __pyx_k_FORMAT_MISSING_QUOTES_Descriptio, sizeof(__pyx_k_FORMAT_MISSING_QUOTES_Descriptio), 0, 1, 0, 0}, | |
38299 {&__pyx_n_s_FORMAT_NOT_DEFINED, __pyx_k_FORMAT_NOT_DEFINED, sizeof(__pyx_k_FORMAT_NOT_DEFINED), 0, 0, 1, 1}, | |
38300 {&__pyx_kp_u_FORMAT_NOT_DEFINED_Identifier_s, __pyx_k_FORMAT_NOT_DEFINED_Identifier_s, sizeof(__pyx_k_FORMAT_NOT_DEFINED_Identifier_s), 0, 1, 0, 0}, | |
38301 {&__pyx_n_u_FT, __pyx_k_FT, sizeof(__pyx_k_FT), 0, 1, 0, 1}, | |
38302 {&__pyx_n_u_Flag, __pyx_k_Flag, sizeof(__pyx_k_Flag), 0, 1, 0, 1}, | |
38303 {&__pyx_n_u_Float, __pyx_k_Float, sizeof(__pyx_k_Float), 0, 1, 0, 1}, | |
38304 {&__pyx_n_u_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 1, 0, 1}, | |
38305 {&__pyx_n_u_GL, __pyx_k_GL, sizeof(__pyx_k_GL), 0, 1, 0, 1}, | |
38306 {&__pyx_n_u_GLE, __pyx_k_GLE, sizeof(__pyx_k_GLE), 0, 1, 0, 1}, | |
38307 {&__pyx_n_u_GP, __pyx_k_GP, sizeof(__pyx_k_GP), 0, 1, 0, 1}, | |
38308 {&__pyx_n_u_GQ, __pyx_k_GQ, sizeof(__pyx_k_GQ), 0, 1, 0, 1}, | |
38309 {&__pyx_n_u_GT, __pyx_k_GT, sizeof(__pyx_k_GT), 0, 1, 0, 1}, | |
38310 {&__pyx_n_s_GTdata, __pyx_k_GTdata, sizeof(__pyx_k_GTdata), 0, 0, 1, 1}, | |
38311 {&__pyx_n_s_GTstring, __pyx_k_GTstring, sizeof(__pyx_k_GTstring), 0, 0, 1, 1}, | |
38312 {&__pyx_n_u_Genotype, __pyx_k_Genotype, sizeof(__pyx_k_Genotype), 0, 1, 0, 1}, | |
38313 {&__pyx_kp_u_Genotype_Quality, __pyx_k_Genotype_Quality, sizeof(__pyx_k_Genotype_Quality), 0, 1, 0, 0}, | |
38314 {&__pyx_kp_u_Genotype_likelihoods, __pyx_k_Genotype_likelihoods, sizeof(__pyx_k_Genotype_likelihoods), 0, 1, 0, 0}, | |
38315 {&__pyx_kp_u_Genotype_posterior_probabilities, __pyx_k_Genotype_posterior_probabilities, sizeof(__pyx_k_Genotype_posterior_probabilities), 0, 1, 0, 0}, | |
38316 {&__pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS, __pyx_k_HEADING_NOT_SEPARATED_BY_TABS, sizeof(__pyx_k_HEADING_NOT_SEPARATED_BY_TABS), 0, 0, 1, 1}, | |
38317 {&__pyx_kp_u_HEADING_NOT_SEPARATED_BY_TABS_He, __pyx_k_HEADING_NOT_SEPARATED_BY_TABS_He, sizeof(__pyx_k_HEADING_NOT_SEPARATED_BY_TABS_He), 0, 1, 0, 0}, | |
38318 {&__pyx_n_u_HQ, __pyx_k_HQ, sizeof(__pyx_k_HQ), 0, 1, 0, 1}, | |
38319 {&__pyx_kp_u_Haplotype_Quality, __pyx_k_Haplotype_Quality, sizeof(__pyx_k_Haplotype_Quality), 0, 1, 0, 0}, | |
38320 {&__pyx_n_u_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 1, 0, 1}, | |
38321 {&__pyx_kp_u_ID, __pyx_k_ID, sizeof(__pyx_k_ID), 0, 1, 0, 0}, | |
38322 {&__pyx_n_u_ID_2, __pyx_k_ID_2, sizeof(__pyx_k_ID_2), 0, 1, 0, 1}, | |
38323 {&__pyx_n_u_INFO, __pyx_k_INFO, sizeof(__pyx_k_INFO), 0, 1, 0, 1}, | |
38324 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, | |
38325 {&__pyx_n_u_Integer, __pyx_k_Integer, sizeof(__pyx_k_Integer), 0, 1, 0, 1}, | |
38326 {&__pyx_kp_u_Invalid_error_string_s, __pyx_k_Invalid_error_string_s, sizeof(__pyx_k_Invalid_error_string_s), 0, 1, 0, 0}, | |
38327 {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, | |
38328 {&__pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE, __pyx_k_MISSING_INDEL_ALLELE_REF_BASE, sizeof(__pyx_k_MISSING_INDEL_ALLELE_REF_BASE), 0, 0, 1, 1}, | |
38329 {&__pyx_kp_u_MISSING_INDEL_ALLELE_REF_BASE_In, __pyx_k_MISSING_INDEL_ALLELE_REF_BASE_In, sizeof(__pyx_k_MISSING_INDEL_ALLELE_REF_BASE_In), 0, 1, 0, 0}, | |
38330 {&__pyx_n_s_MISSING_REF, __pyx_k_MISSING_REF, sizeof(__pyx_k_MISSING_REF), 0, 0, 1, 1}, | |
38331 {&__pyx_kp_u_MISSING_REF_Reference_allele_mis, __pyx_k_MISSING_REF_Reference_allele_mis, sizeof(__pyx_k_MISSING_REF_Reference_allele_mis), 0, 1, 0, 0}, | |
38332 {&__pyx_n_u_MQ, __pyx_k_MQ, sizeof(__pyx_k_MQ), 0, 1, 0, 1}, | |
38333 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, | |
38334 {&__pyx_n_u_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 1, 0, 1}, | |
38335 {&__pyx_n_s_NT_ALLELES, __pyx_k_NT_ALLELES, sizeof(__pyx_k_NT_ALLELES), 0, 0, 1, 1}, | |
38336 {&__pyx_n_s_NT_GENOTYPES, __pyx_k_NT_GENOTYPES, sizeof(__pyx_k_NT_GENOTYPES), 0, 0, 1, 1}, | |
38337 {&__pyx_n_s_NT_NR_ALLELES, __pyx_k_NT_NR_ALLELES, sizeof(__pyx_k_NT_NR_ALLELES), 0, 0, 1, 1}, | |
38338 {&__pyx_n_s_NT_NUMBER, __pyx_k_NT_NUMBER, sizeof(__pyx_k_NT_NUMBER), 0, 0, 1, 1}, | |
38339 {&__pyx_n_s_NT_PHASED_GENOTYPES, __pyx_k_NT_PHASED_GENOTYPES, sizeof(__pyx_k_NT_PHASED_GENOTYPES), 0, 0, 1, 1}, | |
38340 {&__pyx_n_s_NT_UNKNOWN, __pyx_k_NT_UNKNOWN, sizeof(__pyx_k_NT_UNKNOWN), 0, 0, 1, 1}, | |
38341 {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, | |
38342 {&__pyx_kp_u_Number, __pyx_k_Number, sizeof(__pyx_k_Number), 0, 1, 0, 0}, | |
38343 {&__pyx_n_u_Number_2, __pyx_k_Number_2, sizeof(__pyx_k_Number_2), 0, 1, 0, 1}, | |
38344 {&__pyx_n_b_PASS, __pyx_k_PASS, sizeof(__pyx_k_PASS), 0, 0, 0, 1}, | |
38345 {&__pyx_n_u_PASS, __pyx_k_PASS, sizeof(__pyx_k_PASS), 0, 1, 0, 1}, | |
38346 {&__pyx_n_u_PL, __pyx_k_PL, sizeof(__pyx_k_PL), 0, 1, 0, 1}, | |
38347 {&__pyx_n_u_POS, __pyx_k_POS, sizeof(__pyx_k_POS), 0, 1, 0, 1}, | |
38348 {&__pyx_n_s_POS_NOT_NUMERICAL, __pyx_k_POS_NOT_NUMERICAL, sizeof(__pyx_k_POS_NOT_NUMERICAL), 0, 0, 1, 1}, | |
38349 {&__pyx_kp_u_POS_NOT_NUMERICAL_Position_colum, __pyx_k_POS_NOT_NUMERICAL_Position_colum, sizeof(__pyx_k_POS_NOT_NUMERICAL_Position_colum), 0, 1, 0, 0}, | |
38350 {&__pyx_n_s_POS_NOT_POSITIVE, __pyx_k_POS_NOT_POSITIVE, sizeof(__pyx_k_POS_NOT_POSITIVE), 0, 0, 1, 1}, | |
38351 {&__pyx_kp_u_POS_NOT_POSITIVE_Position_field, __pyx_k_POS_NOT_POSITIVE_Position_field, sizeof(__pyx_k_POS_NOT_POSITIVE_Position_field), 0, 1, 0, 0}, | |
38352 {&__pyx_n_u_PQ, __pyx_k_PQ, sizeof(__pyx_k_PQ), 0, 1, 0, 1}, | |
38353 {&__pyx_n_u_PS, __pyx_k_PS, sizeof(__pyx_k_PS), 0, 1, 0, 1}, | |
38354 {&__pyx_kp_u_Phase_set, __pyx_k_Phase_set, sizeof(__pyx_k_Phase_set), 0, 1, 0, 0}, | |
38355 {&__pyx_kp_u_Phasing_quality, __pyx_k_Phasing_quality, sizeof(__pyx_k_Phasing_quality), 0, 1, 0, 0}, | |
38356 {&__pyx_kp_u_Phred_scaled_genotype_likelihood, __pyx_k_Phred_scaled_genotype_likelihood, sizeof(__pyx_k_Phred_scaled_genotype_likelihood), 0, 1, 0, 0}, | |
38357 {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, | |
38358 {&__pyx_n_u_QUAL, __pyx_k_QUAL, sizeof(__pyx_k_QUAL), 0, 1, 0, 1}, | |
38359 {&__pyx_n_s_QUAL_NOT_NUMERICAL, __pyx_k_QUAL_NOT_NUMERICAL, sizeof(__pyx_k_QUAL_NOT_NUMERICAL), 0, 0, 1, 1}, | |
38360 {&__pyx_kp_u_QUAL_NOT_NUMERICAL_Quality_field, __pyx_k_QUAL_NOT_NUMERICAL_Quality_field, sizeof(__pyx_k_QUAL_NOT_NUMERICAL_Quality_field), 0, 1, 0, 0}, | |
38361 {&__pyx_n_u_REF, __pyx_k_REF, sizeof(__pyx_k_REF), 0, 1, 0, 1}, | |
38362 {&__pyx_kp_u_RMS_mapping_quality, __pyx_k_RMS_mapping_quality, sizeof(__pyx_k_RMS_mapping_quality), 0, 1, 0, 0}, | |
38363 {&__pyx_kp_u_Read_depth_at_this_position_for, __pyx_k_Read_depth_at_this_position_for, sizeof(__pyx_k_Read_depth_at_this_position_for), 0, 1, 0, 0}, | |
38364 {&__pyx_kp_u_Required_key_s_not_found_in_data, __pyx_k_Required_key_s_not_found_in_data, sizeof(__pyx_k_Required_key_s_not_found_in_data), 0, 1, 0, 0}, | |
38365 {&__pyx_kp_u_Sample_Genotype_Filter, __pyx_k_Sample_Genotype_Filter, sizeof(__pyx_k_Sample_Genotype_Filter), 0, 1, 0, 0}, | |
38366 {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, | |
38367 {&__pyx_n_u_String, __pyx_k_String, sizeof(__pyx_k_String), 0, 1, 0, 1}, | |
38368 {&__pyx_n_s_Tabixfile, __pyx_k_Tabixfile, sizeof(__pyx_k_Tabixfile), 0, 0, 1, 1}, | |
38369 {&__pyx_kp_u_Type, __pyx_k_Type, sizeof(__pyx_k_Type), 0, 1, 0, 0}, | |
38370 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, | |
38371 {&__pyx_n_u_Type_2, __pyx_k_Type_2, sizeof(__pyx_k_Type_2), 0, 1, 0, 1}, | |
38372 {&__pyx_n_s_UNKNOWN_CHAR_IN_REF, __pyx_k_UNKNOWN_CHAR_IN_REF, sizeof(__pyx_k_UNKNOWN_CHAR_IN_REF), 0, 0, 1, 1}, | |
38373 {&__pyx_kp_u_UNKNOWN_CHAR_IN_REF_Unknown_char, __pyx_k_UNKNOWN_CHAR_IN_REF_Unknown_char, sizeof(__pyx_k_UNKNOWN_CHAR_IN_REF_Unknown_char), 0, 1, 0, 0}, | |
38374 {&__pyx_n_s_UNKNOWN_FORMAT_STRING, __pyx_k_UNKNOWN_FORMAT_STRING, sizeof(__pyx_k_UNKNOWN_FORMAT_STRING), 0, 0, 1, 1}, | |
38375 {&__pyx_kp_u_UNKNOWN_FORMAT_STRING_Unknown_fi, __pyx_k_UNKNOWN_FORMAT_STRING_Unknown_fi, sizeof(__pyx_k_UNKNOWN_FORMAT_STRING_Unknown_fi), 0, 1, 0, 0}, | |
38376 {&__pyx_kp_u_Undefined_tag, __pyx_k_Undefined_tag, sizeof(__pyx_k_Undefined_tag), 0, 1, 0, 0}, | |
38377 {&__pyx_kp_u_Unknown_number_type_encountered, __pyx_k_Unknown_number_type_encountered, sizeof(__pyx_k_Unknown_number_type_encountered), 0, 1, 0, 0}, | |
38378 {&__pyx_n_s_V33_BAD_ALLELE, __pyx_k_V33_BAD_ALLELE, sizeof(__pyx_k_V33_BAD_ALLELE), 0, 0, 1, 1}, | |
38379 {&__pyx_kp_u_V33_BAD_ALLELE_Cannot_interpret, __pyx_k_V33_BAD_ALLELE_Cannot_interpret, sizeof(__pyx_k_V33_BAD_ALLELE_Cannot_interpret), 0, 1, 0, 0}, | |
38380 {&__pyx_n_s_V33_BAD_REF, __pyx_k_V33_BAD_REF, sizeof(__pyx_k_V33_BAD_REF), 0, 0, 1, 1}, | |
38381 {&__pyx_kp_u_V33_BAD_REF_Reference_should_be, __pyx_k_V33_BAD_REF_Reference_should_be, sizeof(__pyx_k_V33_BAD_REF_Reference_should_be), 0, 1, 0, 0}, | |
38382 {&__pyx_n_s_V33_UNMATCHED_DELETION, __pyx_k_V33_UNMATCHED_DELETION, sizeof(__pyx_k_V33_UNMATCHED_DELETION), 0, 0, 1, 1}, | |
38383 {&__pyx_kp_u_V33_UNMATCHED_DELETION_Deleted_s, __pyx_k_V33_UNMATCHED_DELETION_Deleted_s, sizeof(__pyx_k_V33_UNMATCHED_DELETION_Deleted_s), 0, 1, 0, 0}, | |
38384 {&__pyx_n_s_V40_BAD_ALLELE, __pyx_k_V40_BAD_ALLELE, sizeof(__pyx_k_V40_BAD_ALLELE), 0, 0, 1, 1}, | |
38385 {&__pyx_kp_u_V40_BAD_ALLELE_Bad_allele_found, __pyx_k_V40_BAD_ALLELE_Bad_allele_found, sizeof(__pyx_k_V40_BAD_ALLELE_Bad_allele_found), 0, 1, 0, 0}, | |
38386 {&__pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD, __pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD, sizeof(__pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD), 0, 0, 1, 1}, | |
38387 {&__pyx_kp_u_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2, __pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2, sizeof(__pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2), 0, 1, 0, 0}, | |
38388 {&__pyx_n_s_V40_MISSING_ANGLE_BRACKETS, __pyx_k_V40_MISSING_ANGLE_BRACKETS, sizeof(__pyx_k_V40_MISSING_ANGLE_BRACKETS), 0, 0, 1, 1}, | |
38389 {&__pyx_kp_u_V40_MISSING_ANGLE_BRACKETS_Forma, __pyx_k_V40_MISSING_ANGLE_BRACKETS_Forma, sizeof(__pyx_k_V40_MISSING_ANGLE_BRACKETS_Forma), 0, 1, 0, 0}, | |
38390 {&__pyx_n_s_VCF, __pyx_k_VCF, sizeof(__pyx_k_VCF), 0, 0, 1, 1}, | |
38391 {&__pyx_n_u_VCF, __pyx_k_VCF, sizeof(__pyx_k_VCF), 0, 1, 0, 1}, | |
38392 {&__pyx_n_s_VCFRecord, __pyx_k_VCFRecord, sizeof(__pyx_k_VCFRecord), 0, 0, 1, 1}, | |
38393 {&__pyx_n_u_VCFRecord, __pyx_k_VCFRecord, sizeof(__pyx_k_VCFRecord), 0, 1, 0, 1}, | |
38394 {&__pyx_n_s_VCFRecord___reduce_cython, __pyx_k_VCFRecord___reduce_cython, sizeof(__pyx_k_VCFRecord___reduce_cython), 0, 0, 1, 1}, | |
38395 {&__pyx_n_s_VCFRecord___setstate_cython, __pyx_k_VCFRecord___setstate_cython, sizeof(__pyx_k_VCFRecord___setstate_cython), 0, 0, 1, 1}, | |
38396 {&__pyx_n_s_VCFRecord_error, __pyx_k_VCFRecord_error, sizeof(__pyx_k_VCFRecord_error), 0, 0, 1, 1}, | |
38397 {&__pyx_n_s_VCF___del, __pyx_k_VCF___del, sizeof(__pyx_k_VCF___del), 0, 0, 1, 1}, | |
38398 {&__pyx_n_s_VCF___init, __pyx_k_VCF___init, sizeof(__pyx_k_VCF___init), 0, 0, 1, 1}, | |
38399 {&__pyx_n_s_VCF__add_definition, __pyx_k_VCF__add_definition, sizeof(__pyx_k_VCF__add_definition), 0, 0, 1, 1}, | |
38400 {&__pyx_n_s_VCF__parse, __pyx_k_VCF__parse, sizeof(__pyx_k_VCF__parse), 0, 0, 1, 1}, | |
38401 {&__pyx_n_s_VCF__parse_header, __pyx_k_VCF__parse_header, sizeof(__pyx_k_VCF__parse_header), 0, 0, 1, 1}, | |
38402 {&__pyx_n_s_VCF_close, __pyx_k_VCF_close, sizeof(__pyx_k_VCF_close), 0, 0, 1, 1}, | |
38403 {&__pyx_n_s_VCF_compare_calls, __pyx_k_VCF_compare_calls, sizeof(__pyx_k_VCF_compare_calls), 0, 0, 1, 1}, | |
38404 {&__pyx_n_s_VCF_connect, __pyx_k_VCF_connect, sizeof(__pyx_k_VCF_connect), 0, 0, 1, 1}, | |
38405 {&__pyx_n_s_VCF_convertGT, __pyx_k_VCF_convertGT, sizeof(__pyx_k_VCF_convertGT), 0, 0, 1, 1}, | |
38406 {&__pyx_n_s_VCF_convertGTback, __pyx_k_VCF_convertGTback, sizeof(__pyx_k_VCF_convertGTback), 0, 0, 1, 1}, | |
38407 {&__pyx_n_s_VCF_enter_default_format, __pyx_k_VCF_enter_default_format, sizeof(__pyx_k_VCF_enter_default_format), 0, 0, 1, 1}, | |
38408 {&__pyx_n_s_VCF_error, __pyx_k_VCF_error, sizeof(__pyx_k_VCF_error), 0, 0, 1, 1}, | |
38409 {&__pyx_n_s_VCF_fetch, __pyx_k_VCF_fetch, sizeof(__pyx_k_VCF_fetch), 0, 0, 1, 1}, | |
38410 {&__pyx_n_s_VCF_format_format, __pyx_k_VCF_format_format, sizeof(__pyx_k_VCF_format_format), 0, 0, 1, 1}, | |
38411 {&__pyx_n_s_VCF_format_formatdata, __pyx_k_VCF_format_formatdata, sizeof(__pyx_k_VCF_format_formatdata), 0, 0, 1, 1}, | |
38412 {&__pyx_n_s_VCF_get_expected, __pyx_k_VCF_get_expected, sizeof(__pyx_k_VCF_get_expected), 0, 0, 1, 1}, | |
38413 {&__pyx_n_s_VCF_getfilter, __pyx_k_VCF_getfilter, sizeof(__pyx_k_VCF_getfilter), 0, 0, 1, 1}, | |
38414 {&__pyx_n_s_VCF_getformat, __pyx_k_VCF_getformat, sizeof(__pyx_k_VCF_getformat), 0, 0, 1, 1}, | |
38415 {&__pyx_n_s_VCF_getheader, __pyx_k_VCF_getheader, sizeof(__pyx_k_VCF_getheader), 0, 0, 1, 1}, | |
38416 {&__pyx_n_s_VCF_getinfo, __pyx_k_VCF_getinfo, sizeof(__pyx_k_VCF_getinfo), 0, 0, 1, 1}, | |
38417 {&__pyx_n_s_VCF_getsamples, __pyx_k_VCF_getsamples, sizeof(__pyx_k_VCF_getsamples), 0, 0, 1, 1}, | |
38418 {&__pyx_n_s_VCF_ignoreerror, __pyx_k_VCF_ignoreerror, sizeof(__pyx_k_VCF_ignoreerror), 0, 0, 1, 1}, | |
38419 {&__pyx_n_s_VCF_inregion, __pyx_k_VCF_inregion, sizeof(__pyx_k_VCF_inregion), 0, 0, 1, 1}, | |
38420 {&__pyx_n_s_VCF_parse, __pyx_k_VCF_parse, sizeof(__pyx_k_VCF_parse), 0, 0, 1, 1}, | |
38421 {&__pyx_n_s_VCF_parse_data, __pyx_k_VCF_parse_data, sizeof(__pyx_k_VCF_parse_data), 0, 0, 1, 1}, | |
38422 {&__pyx_n_s_VCF_parse_format, __pyx_k_VCF_parse_format, sizeof(__pyx_k_VCF_parse_format), 0, 0, 1, 1}, | |
38423 {&__pyx_n_s_VCF_parse_formatdata, __pyx_k_VCF_parse_formatdata, sizeof(__pyx_k_VCF_parse_formatdata), 0, 0, 1, 1}, | |
38424 {&__pyx_n_s_VCF_parse_header, __pyx_k_VCF_parse_header, sizeof(__pyx_k_VCF_parse_header), 0, 0, 1, 1}, | |
38425 {&__pyx_n_s_VCF_parse_heading, __pyx_k_VCF_parse_heading, sizeof(__pyx_k_VCF_parse_heading), 0, 0, 1, 1}, | |
38426 {&__pyx_kp_u_VCF_says, __pyx_k_VCF_says, sizeof(__pyx_k_VCF_says), 0, 1, 0, 0}, | |
38427 {&__pyx_n_s_VCF_setfilter, __pyx_k_VCF_setfilter, sizeof(__pyx_k_VCF_setfilter), 0, 0, 1, 1}, | |
38428 {&__pyx_n_s_VCF_setformat, __pyx_k_VCF_setformat, sizeof(__pyx_k_VCF_setformat), 0, 0, 1, 1}, | |
38429 {&__pyx_n_s_VCF_setheader, __pyx_k_VCF_setheader, sizeof(__pyx_k_VCF_setheader), 0, 0, 1, 1}, | |
38430 {&__pyx_n_s_VCF_setinfo, __pyx_k_VCF_setinfo, sizeof(__pyx_k_VCF_setinfo), 0, 0, 1, 1}, | |
38431 {&__pyx_n_s_VCF_setreference, __pyx_k_VCF_setreference, sizeof(__pyx_k_VCF_setreference), 0, 0, 1, 1}, | |
38432 {&__pyx_n_s_VCF_setregions, __pyx_k_VCF_setregions, sizeof(__pyx_k_VCF_setregions), 0, 0, 1, 1}, | |
38433 {&__pyx_n_s_VCF_setsamples, __pyx_k_VCF_setsamples, sizeof(__pyx_k_VCF_setsamples), 0, 0, 1, 1}, | |
38434 {&__pyx_n_s_VCF_setversion, __pyx_k_VCF_setversion, sizeof(__pyx_k_VCF_setversion), 0, 0, 1, 1}, | |
38435 {&__pyx_n_s_VCF_validate, __pyx_k_VCF_validate, sizeof(__pyx_k_VCF_validate), 0, 0, 1, 1}, | |
38436 {&__pyx_n_s_VCF_warnerror, __pyx_k_VCF_warnerror, sizeof(__pyx_k_VCF_warnerror), 0, 0, 1, 1}, | |
38437 {&__pyx_n_s_VCF_write, __pyx_k_VCF_write, sizeof(__pyx_k_VCF_write), 0, 0, 1, 1}, | |
38438 {&__pyx_n_s_VCF_write_data, __pyx_k_VCF_write_data, sizeof(__pyx_k_VCF_write_data), 0, 0, 1, 1}, | |
38439 {&__pyx_n_s_VCF_write_header, __pyx_k_VCF_write_header, sizeof(__pyx_k_VCF_write_header), 0, 0, 1, 1}, | |
38440 {&__pyx_n_s_VCF_write_heading, __pyx_k_VCF_write_heading, sizeof(__pyx_k_VCF_write_heading), 0, 0, 1, 1}, | |
38441 {&__pyx_n_s_VCF_writeheader, __pyx_k_VCF_writeheader, sizeof(__pyx_k_VCF_writeheader), 0, 0, 1, 1}, | |
38442 {&__pyx_kp_u_VCFv3_3, __pyx_k_VCFv3_3, sizeof(__pyx_k_VCFv3_3), 0, 1, 0, 0}, | |
38443 {&__pyx_kp_u_VCFv4_0, __pyx_k_VCFv4_0, sizeof(__pyx_k_VCFv4_0), 0, 1, 0, 0}, | |
38444 {&__pyx_kp_u_VCFv4_1, __pyx_k_VCFv4_1, sizeof(__pyx_k_VCFv4_1), 0, 1, 0, 0}, | |
38445 {&__pyx_kp_u_VCFv4_2, __pyx_k_VCFv4_2, sizeof(__pyx_k_VCFv4_2), 0, 1, 0, 0}, | |
38446 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, | |
38447 {&__pyx_n_s_WRONG_REF, __pyx_k_WRONG_REF, sizeof(__pyx_k_WRONG_REF), 0, 0, 1, 1}, | |
38448 {&__pyx_kp_u_WRONG_REF_Wrong_reference_s, __pyx_k_WRONG_REF_Wrong_reference_s, sizeof(__pyx_k_WRONG_REF_Wrong_reference_s), 0, 1, 0, 0}, | |
38449 {&__pyx_n_u_Warning, __pyx_k_Warning, sizeof(__pyx_k_Warning), 0, 1, 0, 1}, | |
38450 {&__pyx_n_s_ZERO_FOR_NON_FLAG_FIELD, __pyx_k_ZERO_FOR_NON_FLAG_FIELD, sizeof(__pyx_k_ZERO_FOR_NON_FLAG_FIELD), 0, 0, 1, 1}, | |
38451 {&__pyx_kp_u_ZERO_FOR_NON_FLAG_FIELD_number_s, __pyx_k_ZERO_FOR_NON_FLAG_FIELD_number_s, sizeof(__pyx_k_ZERO_FOR_NON_FLAG_FIELD_number_s), 0, 1, 0, 0}, | |
38452 {&__pyx_n_s_ZERO_LENGTH_ALLELE, __pyx_k_ZERO_LENGTH_ALLELE, sizeof(__pyx_k_ZERO_LENGTH_ALLELE), 0, 0, 1, 1}, | |
38453 {&__pyx_kp_u_ZERO_LENGTH_ALLELE_Found_zero_le, __pyx_k_ZERO_LENGTH_ALLELE_Found_zero_le, sizeof(__pyx_k_ZERO_LENGTH_ALLELE_Found_zero_le), 0, 1, 0, 0}, | |
38454 {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, | |
38455 {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, | |
38456 {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, | |
38457 {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, | |
38458 {&__pyx_n_s__139, __pyx_k__139, sizeof(__pyx_k__139), 0, 0, 1, 1}, | |
38459 {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, | |
38460 {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0}, | |
38461 {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, | |
38462 {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, | |
38463 {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, | |
38464 {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0}, | |
38465 {&__pyx_kp_u__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0, 0}, | |
38466 {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0}, | |
38467 {&__pyx_kp_u__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0, 0}, | |
38468 {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, | |
38469 {&__pyx_n_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 1}, | |
38470 {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0}, | |
38471 {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, | |
38472 {&__pyx_kp_b__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 0, 0}, | |
38473 {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, | |
38474 {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, | |
38475 {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, | |
38476 {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, | |
38477 {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, | |
38478 {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, | |
38479 {&__pyx_n_s_add_definition, __pyx_k_add_definition, sizeof(__pyx_k_add_definition), 0, 0, 1, 1}, | |
38480 {&__pyx_n_s_addn, __pyx_k_addn, sizeof(__pyx_k_addn), 0, 0, 1, 1}, | |
38481 {&__pyx_n_s_addns, __pyx_k_addns, sizeof(__pyx_k_addns), 0, 0, 1, 1}, | |
38482 {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, | |
38483 {&__pyx_n_s_allele, __pyx_k_allele, sizeof(__pyx_k_allele), 0, 0, 1, 1}, | |
38484 {&__pyx_n_s_alleleRegEx, __pyx_k_alleleRegEx, sizeof(__pyx_k_alleleRegEx), 0, 0, 1, 1}, | |
38485 {&__pyx_kp_u_alleles, __pyx_k_alleles, sizeof(__pyx_k_alleles), 0, 1, 0, 0}, | |
38486 {&__pyx_n_s_alt, __pyx_k_alt, sizeof(__pyx_k_alt), 0, 0, 1, 1}, | |
38487 {&__pyx_n_u_alt, __pyx_k_alt, sizeof(__pyx_k_alt), 0, 1, 0, 1}, | |
38488 {&__pyx_n_s_alt1, __pyx_k_alt1, sizeof(__pyx_k_alt1), 0, 0, 1, 1}, | |
38489 {&__pyx_n_s_alt2, __pyx_k_alt2, sizeof(__pyx_k_alt2), 0, 0, 1, 1}, | |
38490 {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, | |
38491 {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, | |
38492 {&__pyx_n_s_asVCFRecord, __pyx_k_asVCFRecord, sizeof(__pyx_k_asVCFRecord), 0, 0, 1, 1}, | |
38493 {&__pyx_n_s_asVCFRecord___reduce_cython, __pyx_k_asVCFRecord___reduce_cython, sizeof(__pyx_k_asVCFRecord___reduce_cython), 0, 0, 1, 1}, | |
38494 {&__pyx_n_s_asVCFRecord___setstate_cython, __pyx_k_asVCFRecord___setstate_cython, sizeof(__pyx_k_asVCFRecord___setstate_cython), 0, 0, 1, 1}, | |
38495 {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, | |
38496 {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, | |
38497 {&__pyx_n_s_bisect, __pyx_k_bisect, sizeof(__pyx_k_bisect), 0, 0, 1, 1}, | |
38498 {&__pyx_n_s_blurp, __pyx_k_blurp, sizeof(__pyx_k_blurp), 0, 0, 1, 1}, | |
38499 {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, | |
38500 {&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 0, 1, 1}, | |
38501 {&__pyx_n_u_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 1, 0, 1}, | |
38502 {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, | |
38503 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, | |
38504 {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, | |
38505 {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, | |
38506 {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1}, | |
38507 {&__pyx_n_s_compare_calls, __pyx_k_compare_calls, sizeof(__pyx_k_compare_calls), 0, 0, 1, 1}, | |
38508 {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, | |
38509 {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1}, | |
38510 {&__pyx_n_s_convertGT, __pyx_k_convertGT, sizeof(__pyx_k_convertGT), 0, 0, 1, 1}, | |
38511 {&__pyx_n_s_convertGTback, __pyx_k_convertGTback, sizeof(__pyx_k_convertGTback), 0, 0, 1, 1}, | |
38512 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, | |
38513 {&__pyx_n_s_copy_2, __pyx_k_copy_2, sizeof(__pyx_k_copy_2), 0, 0, 1, 1}, | |
38514 {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, | |
38515 {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, | |
38516 {&__pyx_n_s_datagenerator, __pyx_k_datagenerator, sizeof(__pyx_k_datagenerator), 0, 0, 1, 1}, | |
38517 {&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1}, | |
38518 {&__pyx_n_s_defaultdict, __pyx_k_defaultdict, sizeof(__pyx_k_defaultdict), 0, 0, 1, 1}, | |
38519 {&__pyx_n_s_del, __pyx_k_del, sizeof(__pyx_k_del), 0, 0, 1, 1}, | |
38520 {&__pyx_kp_u_deletion_is, __pyx_k_deletion_is, sizeof(__pyx_k_deletion_is), 0, 1, 0, 0}, | |
38521 {&__pyx_n_u_descr, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 1, 0, 1}, | |
38522 {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1}, | |
38523 {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, | |
38524 {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, | |
38525 {&__pyx_n_s_dict_3, __pyx_k_dict_3, sizeof(__pyx_k_dict_3), 0, 0, 1, 1}, | |
38526 {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, | |
38527 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, | |
38528 {&__pyx_n_s_elts, __pyx_k_elts, sizeof(__pyx_k_elts), 0, 0, 1, 1}, | |
38529 {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, | |
38530 {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, | |
38531 {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, | |
38532 {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1}, | |
38533 {&__pyx_n_s_enter_default_format, __pyx_k_enter_default_format, sizeof(__pyx_k_enter_default_format), 0, 0, 1, 1}, | |
38534 {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, | |
38535 {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, | |
38536 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, | |
38537 {&__pyx_n_s_errorlabel, __pyx_k_errorlabel, sizeof(__pyx_k_errorlabel), 0, 0, 1, 1}, | |
38538 {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1}, | |
38539 {&__pyx_n_s_errorstring, __pyx_k_errorstring, sizeof(__pyx_k_errorstring), 0, 0, 1, 1}, | |
38540 {&__pyx_n_s_errwarn, __pyx_k_errwarn, sizeof(__pyx_k_errwarn), 0, 0, 1, 1}, | |
38541 {&__pyx_kp_u_expected, __pyx_k_expected, sizeof(__pyx_k_expected), 0, 1, 0, 0}, | |
38542 {&__pyx_kp_u_expected_2, __pyx_k_expected_2, sizeof(__pyx_k_expected_2), 0, 1, 0, 0}, | |
38543 {&__pyx_kp_u_expected_3, __pyx_k_expected_3, sizeof(__pyx_k_expected_3), 0, 1, 0, 0}, | |
38544 {&__pyx_n_s_expected_4, __pyx_k_expected_4, sizeof(__pyx_k_expected_4), 0, 0, 1, 1}, | |
38545 {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, | |
38546 {&__pyx_n_s_fa, __pyx_k_fa, sizeof(__pyx_k_fa), 0, 0, 1, 1}, | |
38547 {&__pyx_n_s_faref, __pyx_k_faref, sizeof(__pyx_k_faref), 0, 0, 1, 1}, | |
38548 {&__pyx_n_s_faref_leftflank, __pyx_k_faref_leftflank, sizeof(__pyx_k_faref_leftflank), 0, 0, 1, 1}, | |
38549 {&__pyx_n_s_fetch, __pyx_k_fetch, sizeof(__pyx_k_fetch), 0, 0, 1, 1}, | |
38550 {&__pyx_n_u_fileformat, __pyx_k_fileformat, sizeof(__pyx_k_fileformat), 0, 1, 0, 1}, | |
38551 {&__pyx_kp_u_fileformat_VCFv, __pyx_k_fileformat_VCFv, sizeof(__pyx_k_fileformat_VCFv), 0, 1, 0, 0}, | |
38552 {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, | |
38553 {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1}, | |
38554 {&__pyx_n_s_filter_2, __pyx_k_filter_2, sizeof(__pyx_k_filter_2), 0, 0, 1, 1}, | |
38555 {&__pyx_n_u_filter_2, __pyx_k_filter_2, sizeof(__pyx_k_filter_2), 0, 1, 0, 1}, | |
38556 {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1}, | |
38557 {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, | |
38558 {&__pyx_n_s_fmt, __pyx_k_fmt, sizeof(__pyx_k_fmt), 0, 0, 1, 1}, | |
38559 {&__pyx_kp_u_for, __pyx_k_for, sizeof(__pyx_k_for), 0, 1, 0, 0}, | |
38560 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, | |
38561 {&__pyx_n_u_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 1, 0, 1}, | |
38562 {&__pyx_n_s_format_2, __pyx_k_format_2, sizeof(__pyx_k_format_2), 0, 0, 1, 1}, | |
38563 {&__pyx_n_s_format_format, __pyx_k_format_format, sizeof(__pyx_k_format_format), 0, 0, 1, 1}, | |
38564 {&__pyx_n_s_format_formatdata, __pyx_k_format_formatdata, sizeof(__pyx_k_format_formatdata), 0, 0, 1, 1}, | |
38565 {&__pyx_n_s_formatdict, __pyx_k_formatdict, sizeof(__pyx_k_formatdict), 0, 0, 1, 1}, | |
38566 {&__pyx_kp_u_found, __pyx_k_found, sizeof(__pyx_k_found), 0, 1, 0, 0}, | |
38567 {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, | |
38568 {&__pyx_kp_u_genotypes, __pyx_k_genotypes, sizeof(__pyx_k_genotypes), 0, 1, 0, 0}, | |
38569 {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, | |
38570 {&__pyx_n_s_get_expected, __pyx_k_get_expected, sizeof(__pyx_k_get_expected), 0, 0, 1, 1}, | |
38571 {&__pyx_n_s_get_sequence, __pyx_k_get_sequence, sizeof(__pyx_k_get_sequence), 0, 0, 1, 1}, | |
38572 {&__pyx_n_s_getfilter, __pyx_k_getfilter, sizeof(__pyx_k_getfilter), 0, 0, 1, 1}, | |
38573 {&__pyx_n_s_getformat, __pyx_k_getformat, sizeof(__pyx_k_getformat), 0, 0, 1, 1}, | |
38574 {&__pyx_n_s_getheader, __pyx_k_getheader, sizeof(__pyx_k_getheader), 0, 0, 1, 1}, | |
38575 {&__pyx_n_s_getinfo, __pyx_k_getinfo, sizeof(__pyx_k_getinfo), 0, 0, 1, 1}, | |
38576 {&__pyx_n_s_getsamples, __pyx_k_getsamples, sizeof(__pyx_k_getsamples), 0, 0, 1, 1}, | |
38577 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, | |
38578 {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0}, | |
38579 {&__pyx_n_s_gts, __pyx_k_gts, sizeof(__pyx_k_gts), 0, 0, 1, 1}, | |
38580 {&__pyx_n_s_gtsRegEx, __pyx_k_gtsRegEx, sizeof(__pyx_k_gtsRegEx), 0, 0, 1, 1}, | |
38581 {&__pyx_n_s_have_deletions, __pyx_k_have_deletions, sizeof(__pyx_k_have_deletions), 0, 0, 1, 1}, | |
38582 {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1}, | |
38583 {&__pyx_n_s_header_2, __pyx_k_header_2, sizeof(__pyx_k_header_2), 0, 0, 1, 1}, | |
38584 {&__pyx_n_s_headings, __pyx_k_headings, sizeof(__pyx_k_headings), 0, 0, 1, 1}, | |
38585 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, | |
38586 {&__pyx_kp_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 0}, | |
38587 {&__pyx_n_s_id_2, __pyx_k_id_2, sizeof(__pyx_k_id_2), 0, 0, 1, 1}, | |
38588 {&__pyx_n_u_id_2, __pyx_k_id_2, sizeof(__pyx_k_id_2), 0, 1, 0, 1}, | |
38589 {&__pyx_kp_u_id_numbertype_number_type_descri, __pyx_k_id_numbertype_number_type_descri, sizeof(__pyx_k_id_numbertype_number_type_descri), 0, 1, 0, 0}, | |
38590 {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, | |
38591 {&__pyx_n_s_ielts, __pyx_k_ielts, sizeof(__pyx_k_ielts), 0, 0, 1, 1}, | |
38592 {&__pyx_n_s_ignored_errors, __pyx_k_ignored_errors, sizeof(__pyx_k_ignored_errors), 0, 0, 1, 1}, | |
38593 {&__pyx_n_s_ignoreerror, __pyx_k_ignoreerror, sizeof(__pyx_k_ignoreerror), 0, 0, 1, 1}, | |
38594 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, | |
38595 {&__pyx_kp_u_in_line, __pyx_k_in_line, sizeof(__pyx_k_in_line), 0, 1, 0, 0}, | |
38596 {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, | |
38597 {&__pyx_n_s_info_2, __pyx_k_info_2, sizeof(__pyx_k_info_2), 0, 0, 1, 1}, | |
38598 {&__pyx_n_u_info_2, __pyx_k_info_2, sizeof(__pyx_k_info_2), 0, 1, 0, 1}, | |
38599 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, | |
38600 {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, | |
38601 {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, | |
38602 {&__pyx_n_s_inregion, __pyx_k_inregion, sizeof(__pyx_k_inregion), 0, 0, 1, 1}, | |
38603 {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, | |
38604 {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, | |
38605 {&__pyx_n_s_itemgetter, __pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 0, 1, 1}, | |
38606 {&__pyx_n_s_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 0, 0, 1, 1}, | |
38607 {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, | |
38608 {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, | |
38609 {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, | |
38610 {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, | |
38611 {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, | |
38612 {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, | |
38613 {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, | |
38614 {&__pyx_n_s_last_line, __pyx_k_last_line, sizeof(__pyx_k_last_line), 0, 0, 1, 1}, | |
38615 {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, | |
38616 {&__pyx_n_s_leftalign, __pyx_k_leftalign, sizeof(__pyx_k_leftalign), 0, 0, 1, 1}, | |
38617 {&__pyx_n_s_leftalign_2, __pyx_k_leftalign_2, sizeof(__pyx_k_leftalign_2), 0, 0, 1, 1}, | |
38618 {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, | |
38619 {&__pyx_n_s_line_2, __pyx_k_line_2, sizeof(__pyx_k_line_2), 0, 0, 1, 1}, | |
38620 {&__pyx_n_s_lineno, __pyx_k_lineno, sizeof(__pyx_k_lineno), 0, 0, 1, 1}, | |
38621 {&__pyx_n_s_lineparse, __pyx_k_lineparse, sizeof(__pyx_k_lineparse), 0, 0, 1, 1}, | |
38622 {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1}, | |
38623 {&__pyx_n_s_lines_2, __pyx_k_lines_2, sizeof(__pyx_k_lines_2), 0, 0, 1, 1}, | |
38624 {&__pyx_n_s_longest, __pyx_k_longest, sizeof(__pyx_k_longest), 0, 0, 1, 1}, | |
38625 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, | |
38626 {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, | |
38627 {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1}, | |
38628 {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, | |
38629 {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, | |
38630 {&__pyx_n_u_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 1, 0, 1}, | |
38631 {&__pyx_n_s_missingvalue, __pyx_k_missingvalue, sizeof(__pyx_k_missingvalue), 0, 0, 1, 1}, | |
38632 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, | |
38633 {&__pyx_n_s_movable, __pyx_k_movable, sizeof(__pyx_k_movable), 0, 0, 1, 1}, | |
38634 {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, | |
38635 {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, | |
38636 {&__pyx_n_s_na, __pyx_k_na, sizeof(__pyx_k_na), 0, 0, 1, 1}, | |
38637 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, | |
38638 {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, | |
38639 {&__pyx_kp_u_needs_to_be_checked, __pyx_k_needs_to_be_checked, sizeof(__pyx_k_needs_to_be_checked), 0, 1, 0, 0}, | |
38640 {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, | |
38641 {&__pyx_n_s_newalts, __pyx_k_newalts, sizeof(__pyx_k_newalts), 0, 0, 1, 1}, | |
38642 {&__pyx_n_s_nmb, __pyx_k_nmb, sizeof(__pyx_k_nmb), 0, 0, 1, 1}, | |
38643 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, | |
38644 {&__pyx_kp_u_nonref_alleles, __pyx_k_nonref_alleles, sizeof(__pyx_k_nonref_alleles), 0, 1, 0, 0}, | |
38645 {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1}, | |
38646 {&__pyx_n_u_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 1, 0, 1}, | |
38647 {&__pyx_n_s_numbertype, __pyx_k_numbertype, sizeof(__pyx_k_numbertype), 0, 0, 1, 1}, | |
38648 {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, | |
38649 {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, | |
38650 {&__pyx_n_s_opt, __pyx_k_opt, sizeof(__pyx_k_opt), 0, 0, 1, 1}, | |
38651 {&__pyx_kp_u_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 1, 0, 0}, | |
38652 {&__pyx_n_s_output_2, __pyx_k_output_2, sizeof(__pyx_k_output_2), 0, 0, 1, 1}, | |
38653 {&__pyx_kp_u_parameters_got, __pyx_k_parameters_got, sizeof(__pyx_k_parameters_got), 0, 1, 0, 0}, | |
38654 {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1}, | |
38655 {&__pyx_n_s_parse_2, __pyx_k_parse_2, sizeof(__pyx_k_parse_2), 0, 0, 1, 1}, | |
38656 {&__pyx_n_s_parse_data, __pyx_k_parse_data, sizeof(__pyx_k_parse_data), 0, 0, 1, 1}, | |
38657 {&__pyx_n_s_parse_format, __pyx_k_parse_format, sizeof(__pyx_k_parse_format), 0, 0, 1, 1}, | |
38658 {&__pyx_n_s_parse_formatdata, __pyx_k_parse_formatdata, sizeof(__pyx_k_parse_formatdata), 0, 0, 1, 1}, | |
38659 {&__pyx_n_s_parse_header, __pyx_k_parse_header, sizeof(__pyx_k_parse_header), 0, 0, 1, 1}, | |
38660 {&__pyx_n_s_parse_header_2, __pyx_k_parse_header_2, sizeof(__pyx_k_parse_header_2), 0, 0, 1, 1}, | |
38661 {&__pyx_n_s_parse_heading, __pyx_k_parse_heading, sizeof(__pyx_k_parse_heading), 0, 0, 1, 1}, | |
38662 {&__pyx_n_s_parse_regions, __pyx_k_parse_regions, sizeof(__pyx_k_parse_regions), 0, 0, 1, 1}, | |
38663 {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1}, | |
38664 {&__pyx_kp_u_phased_genotypes, __pyx_k_phased_genotypes, sizeof(__pyx_k_phased_genotypes), 0, 1, 0, 0}, | |
38665 {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, | |
38666 {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, | |
38667 {&__pyx_n_u_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 1, 0, 1}, | |
38668 {&__pyx_n_s_pos1, __pyx_k_pos1, sizeof(__pyx_k_pos1), 0, 0, 1, 1}, | |
38669 {&__pyx_n_s_pos2, __pyx_k_pos2, sizeof(__pyx_k_pos2), 0, 0, 1, 1}, | |
38670 {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, | |
38671 {&__pyx_n_s_pysam, __pyx_k_pysam, sizeof(__pyx_k_pysam), 0, 0, 1, 1}, | |
38672 {&__pyx_n_s_pysam_libcvcf, __pyx_k_pysam_libcvcf, sizeof(__pyx_k_pysam_libcvcf), 0, 0, 1, 1}, | |
38673 {&__pyx_kp_s_pysam_libcvcf_pyx, __pyx_k_pysam_libcvcf_pyx, sizeof(__pyx_k_pysam_libcvcf_pyx), 0, 0, 1, 0}, | |
38674 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, | |
38675 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, | |
38676 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, | |
38677 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, | |
38678 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, | |
38679 {&__pyx_n_s_pyx_unpickle_asVCFRecord, __pyx_k_pyx_unpickle_asVCFRecord, sizeof(__pyx_k_pyx_unpickle_asVCFRecord), 0, 0, 1, 1}, | |
38680 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, | |
38681 {&__pyx_n_s_qual, __pyx_k_qual, sizeof(__pyx_k_qual), 0, 0, 1, 1}, | |
38682 {&__pyx_n_u_qual, __pyx_k_qual, sizeof(__pyx_k_qual), 0, 1, 0, 1}, | |
38683 {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, | |
38684 {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, | |
38685 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, | |
38686 {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, | |
38687 {&__pyx_n_s_record, __pyx_k_record, sizeof(__pyx_k_record), 0, 0, 1, 1}, | |
38688 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, | |
38689 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, | |
38690 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, | |
38691 {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, | |
38692 {&__pyx_n_u_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 1, 0, 1}, | |
38693 {&__pyx_n_s_ref1, __pyx_k_ref1, sizeof(__pyx_k_ref1), 0, 0, 1, 1}, | |
38694 {&__pyx_n_s_ref2, __pyx_k_ref2, sizeof(__pyx_k_ref2), 0, 0, 1, 1}, | |
38695 {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1}, | |
38696 {&__pyx_n_s_reference_2, __pyx_k_reference_2, sizeof(__pyx_k_reference_2), 0, 0, 1, 1}, | |
38697 {&__pyx_kp_u_reference_is, __pyx_k_reference_is, sizeof(__pyx_k_reference_is), 0, 1, 0, 0}, | |
38698 {&__pyx_kp_u_reference_is_2, __pyx_k_reference_is_2, sizeof(__pyx_k_reference_is_2), 0, 1, 0, 0}, | |
38699 {&__pyx_n_s_region, __pyx_k_region, sizeof(__pyx_k_region), 0, 0, 1, 1}, | |
38700 {&__pyx_n_s_regions, __pyx_k_regions, sizeof(__pyx_k_regions), 0, 0, 1, 1}, | |
38701 {&__pyx_n_s_regions_2, __pyx_k_regions_2, sizeof(__pyx_k_regions_2), 0, 0, 1, 1}, | |
38702 {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, | |
38703 {&__pyx_n_s_required, __pyx_k_required, sizeof(__pyx_k_required), 0, 0, 1, 1}, | |
38704 {&__pyx_n_s_required_2, __pyx_k_required_2, sizeof(__pyx_k_required_2), 0, 0, 1, 1}, | |
38705 {&__pyx_n_s_rest, __pyx_k_rest, sizeof(__pyx_k_rest), 0, 0, 1, 1}, | |
38706 {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, | |
38707 {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, | |
38708 {&__pyx_n_s_sample, __pyx_k_sample, sizeof(__pyx_k_sample), 0, 0, 1, 1}, | |
38709 {&__pyx_n_s_sample2column, __pyx_k_sample2column, sizeof(__pyx_k_sample2column), 0, 0, 1, 1}, | |
38710 {&__pyx_n_s_samples, __pyx_k_samples, sizeof(__pyx_k_samples), 0, 0, 1, 1}, | |
38711 {&__pyx_kp_u_samples_2, __pyx_k_samples_2, sizeof(__pyx_k_samples_2), 0, 1, 0, 0}, | |
38712 {&__pyx_n_s_samples_3, __pyx_k_samples_3, sizeof(__pyx_k_samples_3), 0, 0, 1, 1}, | |
38713 {&__pyx_n_s_sdata, __pyx_k_sdata, sizeof(__pyx_k_sdata), 0, 0, 1, 1}, | |
38714 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, | |
38715 {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, | |
38716 {&__pyx_n_s_separator, __pyx_k_separator, sizeof(__pyx_k_separator), 0, 0, 1, 1}, | |
38717 {&__pyx_n_s_sequence, __pyx_k_sequence, sizeof(__pyx_k_sequence), 0, 0, 1, 1}, | |
38718 {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, | |
38719 {&__pyx_n_s_setfilter, __pyx_k_setfilter, sizeof(__pyx_k_setfilter), 0, 0, 1, 1}, | |
38720 {&__pyx_n_s_setformat, __pyx_k_setformat, sizeof(__pyx_k_setformat), 0, 0, 1, 1}, | |
38721 {&__pyx_n_s_setheader, __pyx_k_setheader, sizeof(__pyx_k_setheader), 0, 0, 1, 1}, | |
38722 {&__pyx_n_s_setinfo, __pyx_k_setinfo, sizeof(__pyx_k_setinfo), 0, 0, 1, 1}, | |
38723 {&__pyx_n_s_setreference, __pyx_k_setreference, sizeof(__pyx_k_setreference), 0, 0, 1, 1}, | |
38724 {&__pyx_n_s_setregions, __pyx_k_setregions, sizeof(__pyx_k_setregions), 0, 0, 1, 1}, | |
38725 {&__pyx_n_s_setsamples, __pyx_k_setsamples, sizeof(__pyx_k_setsamples), 0, 0, 1, 1}, | |
38726 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, | |
38727 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, | |
38728 {&__pyx_n_s_setversion, __pyx_k_setversion, sizeof(__pyx_k_setversion), 0, 0, 1, 1}, | |
38729 {&__pyx_n_s_shortest, __pyx_k_shortest, sizeof(__pyx_k_shortest), 0, 0, 1, 1}, | |
38730 {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, | |
38731 {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, | |
38732 {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, | |
38733 {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, | |
38734 {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, | |
38735 {&__pyx_kp_u_sth_entry_not_found, __pyx_k_sth_entry_not_found, sizeof(__pyx_k_sth_entry_not_found), 0, 1, 0, 0}, | |
38736 {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1}, | |
38737 {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1}, | |
38738 {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, | |
38739 {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, | |
38740 {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, | |
38741 {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, | |
38742 {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, | |
38743 {&__pyx_n_s_tabixfile, __pyx_k_tabixfile, sizeof(__pyx_k_tabixfile), 0, 0, 1, 1}, | |
38744 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, | |
38745 {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, | |
38746 {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, | |
38747 {&__pyx_n_u_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 1, 0, 1}, | |
38748 {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, | |
38749 {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, | |
38750 {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, | |
38751 {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, | |
38752 {&__pyx_n_s_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 0, 0, 1, 1}, | |
38753 {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, | |
38754 {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, | |
38755 {&__pyx_kp_u_values_in_element, __pyx_k_values_in_element, sizeof(__pyx_k_values_in_element), 0, 1, 0, 0}, | |
38756 {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1}, | |
38757 {&__pyx_n_s_vcf, __pyx_k_vcf, sizeof(__pyx_k_vcf), 0, 0, 1, 1}, | |
38758 {&__pyx_n_s_vcffile, __pyx_k_vcffile, sizeof(__pyx_k_vcffile), 0, 0, 1, 1}, | |
38759 {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, | |
38760 {&__pyx_n_s_version_2, __pyx_k_version_2, sizeof(__pyx_k_version_2), 0, 0, 1, 1}, | |
38761 {&__pyx_n_s_warn_errors, __pyx_k_warn_errors, sizeof(__pyx_k_warn_errors), 0, 0, 1, 1}, | |
38762 {&__pyx_n_s_warnerror, __pyx_k_warnerror, sizeof(__pyx_k_warnerror), 0, 0, 1, 1}, | |
38763 {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, | |
38764 {&__pyx_n_s_write_data, __pyx_k_write_data, sizeof(__pyx_k_write_data), 0, 0, 1, 1}, | |
38765 {&__pyx_n_s_write_header, __pyx_k_write_header, sizeof(__pyx_k_write_header), 0, 0, 1, 1}, | |
38766 {&__pyx_n_s_write_heading, __pyx_k_write_heading, sizeof(__pyx_k_write_heading), 0, 0, 1, 1}, | |
38767 {&__pyx_n_s_writeheader, __pyx_k_writeheader, sizeof(__pyx_k_writeheader), 0, 0, 1, 1}, | |
38768 {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, | |
38769 {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, | |
38770 {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, | |
38771 {0, 0, 0, 0, 0, 0, 0} | |
38772 }; | |
38773 return __Pyx_InitStrings(__pyx_string_tab); | |
38774 } | |
38775 /* #### Code section: cached_builtins ### */ | |
38776 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { | |
38777 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 253, __pyx_L1_error) | |
38778 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 87, __pyx_L1_error) | |
38779 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 224, __pyx_L1_error) | |
38780 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) | |
38781 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 493, __pyx_L1_error) | |
38782 __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 500, __pyx_L1_error) | |
38783 __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 539, __pyx_L1_error) | |
38784 __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 837, __pyx_L1_error) | |
38785 __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 877, __pyx_L1_error) | |
38786 __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 937, __pyx_L1_error) | |
38787 __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 1000, __pyx_L1_error) | |
38788 __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 1081, __pyx_L1_error) | |
38789 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 120, __pyx_L1_error) | |
38790 return 0; | |
38791 __pyx_L1_error:; | |
38792 return -1; | |
38793 } | |
38794 /* #### Code section: cached_constants ### */ | |
38795 | |
38796 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { | |
38797 __Pyx_RefNannyDeclarations | |
38798 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); | |
38799 | |
38800 /* "pysam/libcvcf.pyx":337 | |
38801 * if _copy != None: | |
38802 * self._leftalign = _copy._leftalign | |
38803 * self._header = _copy._header[:] # <<<<<<<<<<<<<< | |
38804 * self._version = _copy._version | |
38805 * self._info = copy.deepcopy(_copy._info) | |
38806 */ | |
38807 __pyx_slice__9 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 337, __pyx_L1_error) | |
38808 __Pyx_GOTREF(__pyx_slice__9); | |
38809 __Pyx_GIVEREF(__pyx_slice__9); | |
38810 | |
38811 /* "pysam/libcvcf.pyx":372 | |
38812 * self.error(line,self.V40_MISSING_ANGLE_BRACKETS) | |
38813 * format += ">" | |
38814 * format = format[1:-1] # <<<<<<<<<<<<<< | |
38815 * data = {'id':None,'number':None,'type':None,'descr':None} | |
38816 * idx = 0 | |
38817 */ | |
38818 __pyx_slice__17 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 372, __pyx_L1_error) | |
38819 __Pyx_GOTREF(__pyx_slice__17); | |
38820 __Pyx_GIVEREF(__pyx_slice__17); | |
38821 | |
38822 /* "pysam/libcvcf.pyx":377 | |
38823 * while len(format.strip())>0: | |
38824 * elts = format.strip().split(',') | |
38825 * first, rest = elts[0], ','.join(elts[1:]) # <<<<<<<<<<<<<< | |
38826 * if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')): | |
38827 * if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS) | |
38828 */ | |
38829 __pyx_slice__18 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) __PYX_ERR(0, 377, __pyx_L1_error) | |
38830 __Pyx_GOTREF(__pyx_slice__18); | |
38831 __Pyx_GIVEREF(__pyx_slice__18); | |
38832 | |
38833 /* "pysam/libcvcf.pyx":391 | |
38834 * elts = first.split('=') + [rest] | |
38835 * data['descr'] = elts[1] | |
38836 * rest = '"'.join(elts[2:]) # <<<<<<<<<<<<<< | |
38837 * if rest.startswith(','): rest = rest[1:] | |
38838 * else: | |
38839 */ | |
38840 __pyx_slice__20 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 391, __pyx_L1_error) | |
38841 __Pyx_GOTREF(__pyx_slice__20); | |
38842 __Pyx_GIVEREF(__pyx_slice__20); | |
38843 | |
38844 /* "pysam/libcvcf.pyx":512 | |
38845 * # snip off trailing missing data | |
38846 * while len(output) > 1: | |
38847 * last = output[-1].replace(',','').replace('.','') # <<<<<<<<<<<<<< | |
38848 * if len(last)>0: break | |
38849 * output = output[:-1] | |
38850 */ | |
38851 __pyx_tuple__21 = PyTuple_Pack(2, __pyx_kp_u__2, __pyx_kp_u_); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 512, __pyx_L1_error) | |
38852 __Pyx_GOTREF(__pyx_tuple__21); | |
38853 __Pyx_GIVEREF(__pyx_tuple__21); | |
38854 __pyx_tuple__22 = PyTuple_Pack(2, __pyx_kp_u__5, __pyx_kp_u_); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 512, __pyx_L1_error) | |
38855 __Pyx_GOTREF(__pyx_tuple__22); | |
38856 __Pyx_GIVEREF(__pyx_tuple__22); | |
38857 | |
38858 /* "pysam/libcvcf.pyx":602 | |
38859 * self.error(line,self.BADLY_FORMATTED_HEADING,err) | |
38860 * | |
38861 * self._samples = headings[9:] # <<<<<<<<<<<<<< | |
38862 * self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] ) | |
38863 * | |
38864 */ | |
38865 __pyx_slice__26 = PySlice_New(__pyx_int_9, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(0, 602, __pyx_L1_error) | |
38866 __Pyx_GOTREF(__pyx_slice__26); | |
38867 __Pyx_GIVEREF(__pyx_slice__26); | |
38868 | |
38869 /* "pysam/libcvcf.pyx":835 | |
38870 * if not movable: | |
38871 * break | |
38872 * ref = ref[:-1] # <<<<<<<<<<<<<< | |
38873 * alt = [allele[:-1] for allele in alt] | |
38874 * if min([len(allele) for allele in alt]) == 0 or len(ref) == 0: | |
38875 */ | |
38876 __pyx_slice__28 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(0, 835, __pyx_L1_error) | |
38877 __Pyx_GOTREF(__pyx_slice__28); | |
38878 __Pyx_GIVEREF(__pyx_slice__28); | |
38879 | |
38880 /* "pysam/libcvcf.pyx":988 | |
38881 * | |
38882 * def setversion(self, version): | |
38883 * if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files") # <<<<<<<<<<<<<< | |
38884 * self._version = version | |
38885 * | |
38886 */ | |
38887 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_Can_only_handle_v3_3_and_v4_0_VC); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 988, __pyx_L1_error) | |
38888 __Pyx_GOTREF(__pyx_tuple__30); | |
38889 __Pyx_GIVEREF(__pyx_tuple__30); | |
38890 | |
38891 /* "pysam/libcvcf.pyx":1081 | |
38892 * ''' | |
38893 * | |
38894 * raise NotImplementedError("needs to be checked") # <<<<<<<<<<<<<< | |
38895 * | |
38896 * chrom, pos = record.chrom, record.pos | |
38897 */ | |
38898 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_needs_to_be_checked); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1081, __pyx_L1_error) | |
38899 __Pyx_GOTREF(__pyx_tuple__31); | |
38900 __Pyx_GIVEREF(__pyx_tuple__31); | |
38901 | |
38902 /* "(tree fragment)":4 | |
38903 * cdef object __pyx_PickleError | |
38904 * cdef object __pyx_result | |
38905 * if __pyx_checksum not in (0xe48d6d5, 0xcc3d7cd, 0x1c28f48): # <<<<<<<<<<<<<< | |
38906 * from pickle import PickleError as __pyx_PickleError | |
38907 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe48d6d5, 0xcc3d7cd, 0x1c28f48) = (encoding, vcffile))" % __pyx_checksum | |
38908 */ | |
38909 __pyx_tuple__32 = PyTuple_Pack(3, __pyx_int_239654613, __pyx_int_214161357, __pyx_int_29527880); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 4, __pyx_L1_error) | |
38910 __Pyx_GOTREF(__pyx_tuple__32); | |
38911 __Pyx_GIVEREF(__pyx_tuple__32); | |
38912 | |
38913 /* "pysam/libcvcf.pyx":64 | |
38914 * import pysam | |
38915 * | |
38916 * gtsRegEx = re.compile("[|/\\\\]") # <<<<<<<<<<<<<< | |
38917 * alleleRegEx = re.compile('^[ACGTN]+$') | |
38918 * | |
38919 */ | |
38920 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u__34); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 64, __pyx_L1_error) | |
38921 __Pyx_GOTREF(__pyx_tuple__35); | |
38922 __Pyx_GIVEREF(__pyx_tuple__35); | |
38923 | |
38924 /* "pysam/libcvcf.pyx":65 | |
38925 * | |
38926 * gtsRegEx = re.compile("[|/\\\\]") | |
38927 * alleleRegEx = re.compile('^[ACGTN]+$') # <<<<<<<<<<<<<< | |
38928 * | |
38929 * # Utility function. Uses 0-based coordinates | |
38930 */ | |
38931 __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_ACGTN_2); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 65, __pyx_L1_error) | |
38932 __Pyx_GOTREF(__pyx_tuple__36); | |
38933 __Pyx_GIVEREF(__pyx_tuple__36); | |
38934 | |
38935 /* "pysam/libcvcf.pyx":68 | |
38936 * | |
38937 * # Utility function. Uses 0-based coordinates | |
38938 * def get_sequence(chrom, start, end, fa): # <<<<<<<<<<<<<< | |
38939 * # obtain sequence from .fa file, without truncation | |
38940 * if end<=start: return "" | |
38941 */ | |
38942 __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_chrom, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_fa, __pyx_n_s_sequence); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 68, __pyx_L1_error) | |
38943 __Pyx_GOTREF(__pyx_tuple__37); | |
38944 __Pyx_GIVEREF(__pyx_tuple__37); | |
38945 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_get_sequence, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 68, __pyx_L1_error) | |
38946 | |
38947 /* "pysam/libcvcf.pyx":78 | |
38948 * | |
38949 * # Utility function. Parses a region string | |
38950 * def parse_regions( string ): # <<<<<<<<<<<<<< | |
38951 * result = [] | |
38952 * for r in string.split(','): | |
38953 */ | |
38954 __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_string, __pyx_n_s_result, __pyx_n_s_r, __pyx_n_s_elts, __pyx_n_s_chrom, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_ielts); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 78, __pyx_L1_error) | |
38955 __Pyx_GOTREF(__pyx_tuple__39); | |
38956 __Pyx_GIVEREF(__pyx_tuple__39); | |
38957 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_parse_regions, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 78, __pyx_L1_error) | |
38958 | |
38959 /* "pysam/libcvcf.pyx":96 | |
38960 * | |
38961 * | |
38962 * FORMAT = namedtuple('FORMAT','id numbertype number type description missingvalue') # <<<<<<<<<<<<<< | |
38963 * | |
38964 * ########################################################################################################### | |
38965 */ | |
38966 __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_u_FORMAT, __pyx_kp_u_id_numbertype_number_type_descri); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 96, __pyx_L1_error) | |
38967 __Pyx_GOTREF(__pyx_tuple__41); | |
38968 __Pyx_GIVEREF(__pyx_tuple__41); | |
38969 | |
38970 /* "pysam/libcvcf.pyx":134 | |
38971 * self.encoding = vcf.encoding | |
38972 * | |
38973 * def error(self, line, error, opt=None): # <<<<<<<<<<<<<< | |
38974 * '''raise error.''' | |
38975 * # pass to vcf file for error handling | |
38976 */ | |
38977 __pyx_tuple__42 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_error, __pyx_n_s_opt); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 134, __pyx_L1_error) | |
38978 __Pyx_GOTREF(__pyx_tuple__42); | |
38979 __Pyx_GIVEREF(__pyx_tuple__42); | |
38980 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_error, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 134, __pyx_L1_error) | |
38981 __pyx_tuple__44 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 134, __pyx_L1_error) | |
38982 __Pyx_GOTREF(__pyx_tuple__44); | |
38983 __Pyx_GIVEREF(__pyx_tuple__44); | |
38984 | |
38985 /* "(tree fragment)":1 | |
38986 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
38987 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
38988 * def __setstate_cython__(self, __pyx_state): | |
38989 */ | |
38990 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 1, __pyx_L1_error) | |
38991 __Pyx_GOTREF(__pyx_tuple__45); | |
38992 __Pyx_GIVEREF(__pyx_tuple__45); | |
38993 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(1, 1, __pyx_L1_error) | |
38994 | |
38995 /* "(tree fragment)":3 | |
38996 * def __reduce_cython__(self): | |
38997 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
38998 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
38999 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
39000 */ | |
39001 __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 3, __pyx_L1_error) | |
39002 __Pyx_GOTREF(__pyx_tuple__47); | |
39003 __Pyx_GIVEREF(__pyx_tuple__47); | |
39004 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(1, 3, __pyx_L1_error) | |
39005 | |
39006 /* "(tree fragment)":1 | |
39007 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
39008 * cdef tuple state | |
39009 * cdef object _dict | |
39010 */ | |
39011 __pyx_tuple__49 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 1, __pyx_L1_error) | |
39012 __Pyx_GOTREF(__pyx_tuple__49); | |
39013 __Pyx_GIVEREF(__pyx_tuple__49); | |
39014 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(1, 1, __pyx_L1_error) | |
39015 | |
39016 /* "(tree fragment)":16 | |
39017 * else: | |
39018 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, state) | |
39019 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
39020 * __pyx_unpickle_asVCFRecord__set_state(self, __pyx_state) | |
39021 */ | |
39022 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 16, __pyx_L1_error) | |
39023 | |
39024 /* "pysam/libcvcf.pyx":253 | |
39025 * return r | |
39026 * | |
39027 * class VCF(object): # <<<<<<<<<<<<<< | |
39028 * | |
39029 * # types | |
39030 */ | |
39031 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 253, __pyx_L1_error) | |
39032 __Pyx_GOTREF(__pyx_tuple__52); | |
39033 __Pyx_GIVEREF(__pyx_tuple__52); | |
39034 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 253, __pyx_L1_error) | |
39035 __Pyx_GOTREF(__pyx_tuple__53); | |
39036 __Pyx_GIVEREF(__pyx_tuple__53); | |
39037 | |
39038 /* "pysam/libcvcf.pyx":330 | |
39039 * _lines = None | |
39040 * | |
39041 * def __init__(self, _copy=None, reference=None, regions=None, # <<<<<<<<<<<<<< | |
39042 * lines=None, leftalign=False): | |
39043 * # make error identifiers accessible by name | |
39044 */ | |
39045 __pyx_tuple__54 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_copy, __pyx_n_s_reference, __pyx_n_s_regions, __pyx_n_s_lines, __pyx_n_s_leftalign, __pyx_n_s_id_2); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 330, __pyx_L1_error) | |
39046 __Pyx_GOTREF(__pyx_tuple__54); | |
39047 __Pyx_GIVEREF(__pyx_tuple__54); | |
39048 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_init, 330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 330, __pyx_L1_error) | |
39049 __pyx_tuple__56 = PyTuple_Pack(5, Py_None, Py_None, Py_None, Py_None, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 330, __pyx_L1_error) | |
39050 __Pyx_GOTREF(__pyx_tuple__56); | |
39051 __Pyx_GIVEREF(__pyx_tuple__56); | |
39052 | |
39053 /* "pysam/libcvcf.pyx":355 | |
39054 * self.tabixfile = None | |
39055 * | |
39056 * def error(self,line,error,opt=None): # <<<<<<<<<<<<<< | |
39057 * if error in self._ignored_errors: return | |
39058 * errorlabel, errorstring = self._errors[error].split(':') | |
39059 */ | |
39060 __pyx_tuple__57 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_error, __pyx_n_s_opt, __pyx_n_s_errorlabel, __pyx_n_s_errorstring, __pyx_n_s_errwarn); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 355, __pyx_L1_error) | |
39061 __Pyx_GOTREF(__pyx_tuple__57); | |
39062 __Pyx_GIVEREF(__pyx_tuple__57); | |
39063 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_error, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 355, __pyx_L1_error) | |
39064 | |
39065 /* "pysam/libcvcf.pyx":364 | |
39066 * raise ValueError(errorstring) | |
39067 * | |
39068 * def parse_format(self,line,format,filter=False): # <<<<<<<<<<<<<< | |
39069 * if self._version == 40: | |
39070 * if not format.startswith('<'): | |
39071 */ | |
39072 __pyx_tuple__59 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_format, __pyx_n_s_filter_2, __pyx_n_s_data, __pyx_n_s_idx, __pyx_n_s_elts, __pyx_n_s_first, __pyx_n_s_rest, __pyx_n_s_n, __pyx_n_s_t); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 364, __pyx_L1_error) | |
39073 __Pyx_GOTREF(__pyx_tuple__59); | |
39074 __Pyx_GIVEREF(__pyx_tuple__59); | |
39075 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_parse_format, 364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 364, __pyx_L1_error) | |
39076 __pyx_tuple__61 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 364, __pyx_L1_error) | |
39077 __Pyx_GOTREF(__pyx_tuple__61); | |
39078 __Pyx_GIVEREF(__pyx_tuple__61); | |
39079 | |
39080 /* "pysam/libcvcf.pyx":436 | |
39081 * return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing']) | |
39082 * | |
39083 * def format_format( self, fmt, filter=False ): # <<<<<<<<<<<<<< | |
39084 * values = [('ID',fmt.id)] | |
39085 * if fmt.number != None and not filter: | |
39086 */ | |
39087 __pyx_tuple__62 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_fmt, __pyx_n_s_filter_2, __pyx_n_s_values, __pyx_n_s_nmb, __pyx_n_s_format, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 436, __pyx_L1_error) | |
39088 __Pyx_GOTREF(__pyx_tuple__62); | |
39089 __Pyx_GIVEREF(__pyx_tuple__62); | |
39090 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_format_format, 436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 436, __pyx_L1_error) | |
39091 | |
39092 /* "pysam/libcvcf.pyx":456 | |
39093 * return format | |
39094 * | |
39095 * def get_expected(self, format, formatdict, alt): # <<<<<<<<<<<<<< | |
39096 * fmt = formatdict[format] | |
39097 * if fmt.numbertype == self.NT_UNKNOWN: return -1 | |
39098 */ | |
39099 __pyx_tuple__64 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_format, __pyx_n_s_formatdict, __pyx_n_s_alt, __pyx_n_s_fmt); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 456, __pyx_L1_error) | |
39100 __Pyx_GOTREF(__pyx_tuple__64); | |
39101 __Pyx_GIVEREF(__pyx_tuple__64); | |
39102 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_get_expected, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 456, __pyx_L1_error) | |
39103 | |
39104 /* "pysam/libcvcf.pyx":467 | |
39105 * | |
39106 * | |
39107 * def _add_definition(self, formatdict, key, data, line ): # <<<<<<<<<<<<<< | |
39108 * if key in formatdict: return | |
39109 * self.error(line,self.ERROR_UNKNOWN_KEY,key) | |
39110 */ | |
39111 __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_formatdict, __pyx_n_s_key, __pyx_n_s_data, __pyx_n_s_line); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 467, __pyx_L1_error) | |
39112 __Pyx_GOTREF(__pyx_tuple__66); | |
39113 __Pyx_GIVEREF(__pyx_tuple__66); | |
39114 __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_add_definition, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 467, __pyx_L1_error) | |
39115 | |
39116 /* "pysam/libcvcf.pyx":484 | |
39117 * | |
39118 * # todo: trim trailing missing values | |
39119 * def format_formatdata( self, data, format, key=True, value=True, separator=":" ): # <<<<<<<<<<<<<< | |
39120 * output, sdata = [], [] | |
39121 * if type(data) == type([]): # for FORMAT field, make data with dummy values | |
39122 */ | |
39123 __pyx_tuple__68 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_format, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_separator, __pyx_n_s_output_2, __pyx_n_s_sdata, __pyx_n_s_d, __pyx_n_s_k, __pyx_n_s_idx, __pyx_n_s_v, __pyx_n_s_last); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 484, __pyx_L1_error) | |
39124 __Pyx_GOTREF(__pyx_tuple__68); | |
39125 __Pyx_GIVEREF(__pyx_tuple__68); | |
39126 __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_format_formatdata, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 484, __pyx_L1_error) | |
39127 __pyx_tuple__70 = PyTuple_Pack(3, ((PyObject *)Py_True), ((PyObject *)Py_True), ((PyObject*)__pyx_kp_u__3)); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 484, __pyx_L1_error) | |
39128 __Pyx_GOTREF(__pyx_tuple__70); | |
39129 __Pyx_GIVEREF(__pyx_tuple__70); | |
39130 | |
39131 /* "pysam/libcvcf.pyx":518 | |
39132 * | |
39133 * | |
39134 * def enter_default_format(self): # <<<<<<<<<<<<<< | |
39135 * for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'), | |
39136 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), | |
39137 */ | |
39138 __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_f); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 518, __pyx_L1_error) | |
39139 __Pyx_GOTREF(__pyx_tuple__71); | |
39140 __Pyx_GIVEREF(__pyx_tuple__71); | |
39141 __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_enter_default_format, 518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 518, __pyx_L1_error) | |
39142 | |
39143 /* "pysam/libcvcf.pyx":537 | |
39144 * self._format[f.id] = f | |
39145 * | |
39146 * def parse_header(self, line): # <<<<<<<<<<<<<< | |
39147 * | |
39148 * assert line.startswith('##') | |
39149 */ | |
39150 __pyx_tuple__73 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_elts, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_f); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 537, __pyx_L1_error) | |
39151 __Pyx_GOTREF(__pyx_tuple__73); | |
39152 __Pyx_GIVEREF(__pyx_tuple__73); | |
39153 __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_parse_header, 537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 537, __pyx_L1_error) | |
39154 | |
39155 /* "pysam/libcvcf.pyx":570 | |
39156 * | |
39157 * | |
39158 * def write_header( self, stream ): # <<<<<<<<<<<<<< | |
39159 * stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10)) | |
39160 * for key,value in self._header: stream.write("##%s=%s\n" % (key,value)) | |
39161 */ | |
39162 __pyx_tuple__75 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_var, __pyx_n_s_label, __pyx_n_s_f); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 570, __pyx_L1_error) | |
39163 __Pyx_GOTREF(__pyx_tuple__75); | |
39164 __Pyx_GIVEREF(__pyx_tuple__75); | |
39165 __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_write_header, 570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 570, __pyx_L1_error) | |
39166 | |
39167 /* "pysam/libcvcf.pyx":577 | |
39168 * | |
39169 * | |
39170 * def parse_heading( self, line ): # <<<<<<<<<<<<<< | |
39171 * assert line.startswith('#') | |
39172 * assert not line.startswith('##') | |
39173 */ | |
39174 __pyx_tuple__77 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_headings, __pyx_n_s_i, __pyx_n_s_s, __pyx_n_s_err, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 577, __pyx_L1_error) | |
39175 __Pyx_GOTREF(__pyx_tuple__77); | |
39176 __Pyx_GIVEREF(__pyx_tuple__77); | |
39177 __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_parse_heading, 577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 577, __pyx_L1_error) | |
39178 | |
39179 /* "pysam/libcvcf.pyx":605 | |
39180 * self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] ) | |
39181 * | |
39182 * def write_heading( self, stream ): # <<<<<<<<<<<<<< | |
39183 * stream.write("#" + "\t".join(self._required + self._samples) + "\n") | |
39184 * | |
39185 */ | |
39186 __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_stream); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 605, __pyx_L1_error) | |
39187 __Pyx_GOTREF(__pyx_tuple__79); | |
39188 __Pyx_GIVEREF(__pyx_tuple__79); | |
39189 __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_write_heading, 605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 605, __pyx_L1_error) | |
39190 | |
39191 /* "pysam/libcvcf.pyx":608 | |
39192 * stream.write("#" + "\t".join(self._required + self._samples) + "\n") | |
39193 * | |
39194 * def convertGT(self, GTstring): # <<<<<<<<<<<<<< | |
39195 * if GTstring == ".": return ["."] | |
39196 * try: | |
39197 */ | |
39198 __pyx_tuple__81 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_GTstring, __pyx_n_s_gts); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 608, __pyx_L1_error) | |
39199 __Pyx_GOTREF(__pyx_tuple__81); | |
39200 __Pyx_GIVEREF(__pyx_tuple__81); | |
39201 __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_convertGT, 608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 608, __pyx_L1_error) | |
39202 | |
39203 /* "pysam/libcvcf.pyx":620 | |
39204 * return [".","|","."] | |
39205 * | |
39206 * def convertGTback(self, GTdata): # <<<<<<<<<<<<<< | |
39207 * return ''.join(map(str,GTdata)) | |
39208 * | |
39209 */ | |
39210 __pyx_tuple__83 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_GTdata); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 620, __pyx_L1_error) | |
39211 __Pyx_GOTREF(__pyx_tuple__83); | |
39212 __Pyx_GIVEREF(__pyx_tuple__83); | |
39213 __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_convertGTback, 620, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 620, __pyx_L1_error) | |
39214 | |
39215 /* "pysam/libcvcf.pyx":623 | |
39216 * return ''.join(map(str,GTdata)) | |
39217 * | |
39218 * def parse_formatdata( self, key, value, formatdict, line ): # <<<<<<<<<<<<<< | |
39219 * # To do: check that the right number of values is present | |
39220 * f = formatdict.get(key,None) | |
39221 */ | |
39222 __pyx_tuple__85 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_formatdict, __pyx_n_s_line, __pyx_n_s_f, __pyx_n_s_values, __pyx_n_s_idx, __pyx_n_s_v); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 623, __pyx_L1_error) | |
39223 __Pyx_GOTREF(__pyx_tuple__85); | |
39224 __Pyx_GIVEREF(__pyx_tuple__85); | |
39225 __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_parse_formatdata, 623, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 623, __pyx_L1_error) | |
39226 | |
39227 /* "pysam/libcvcf.pyx":665 | |
39228 * self.error(line,self.ERROR_INFO_STRING) | |
39229 * | |
39230 * def inregion(self, chrom, pos): # <<<<<<<<<<<<<< | |
39231 * if not self._regions: return True | |
39232 * for r in self._regions: | |
39233 */ | |
39234 __pyx_tuple__87 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_chrom, __pyx_n_s_pos, __pyx_n_s_r); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 665, __pyx_L1_error) | |
39235 __Pyx_GOTREF(__pyx_tuple__87); | |
39236 __Pyx_GIVEREF(__pyx_tuple__87); | |
39237 __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_inregion, 665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 665, __pyx_L1_error) | |
39238 | |
39239 /* "pysam/libcvcf.pyx":671 | |
39240 * return False | |
39241 * | |
39242 * def parse_data( self, line, lineparse=False ): # <<<<<<<<<<<<<< | |
39243 * cols = line.split('\t') | |
39244 * if len(cols) != len(self._samples)+9: | |
39245 */ | |
39246 __pyx_tuple__89 = PyTuple_Pack(48, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_lineparse, __pyx_n_s_cols, __pyx_n_s_chrom, __pyx_n_s_pos, __pyx_n_s_id_2, __pyx_n_s_ref, __pyx_n_s_c, __pyx_n_s_left, __pyx_n_s_faref_leftflank, __pyx_n_s_faref, __pyx_n_s_alt, __pyx_n_s_qual, __pyx_n_s_filter_2, __pyx_n_s_info_2, __pyx_n_s_blurp, __pyx_n_s_elts, __pyx_n_s_v, __pyx_n_s_format, __pyx_n_s_f, __pyx_n_s_newalts, __pyx_n_s_have_deletions, __pyx_n_s_a, __pyx_n_s_l, __pyx_n_s_addns, __pyx_n_s_i, __pyx_n_s_na, __pyx_n_s_s, __pyx_n_s_addn, __pyx_n_s_allele, __pyx_n_s_movable, __pyx_n_s_longest, __pyx_n_s_shortest, __pyx_n_s_samples_3, __pyx_n_s_sample, __pyx_n_s_dict_3, __pyx_n_s_values, __pyx_n_s_idx, __pyx_n_s_expected_4, __pyx_n_s_value, __pyx_n_s_d, __pyx_n_s_key, __pyx_n_s_allele, __pyx_n_s_allele, __pyx_n_s_allele, __pyx_n_s_allele, __pyx_n_s_allele); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 671, __pyx_L1_error) | |
39247 __Pyx_GOTREF(__pyx_tuple__89); | |
39248 __Pyx_GIVEREF(__pyx_tuple__89); | |
39249 __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 48, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_parse_data, 671, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 671, __pyx_L1_error) | |
39250 | |
39251 /* "pysam/libcvcf.pyx":883 | |
39252 * | |
39253 * | |
39254 * def write_data(self, stream, data): # <<<<<<<<<<<<<< | |
39255 * required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples | |
39256 * for k in required: | |
39257 */ | |
39258 __pyx_tuple__91 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_data, __pyx_n_s_required_2, __pyx_n_s_k, __pyx_n_s_alt, __pyx_n_s_filter_2, __pyx_n_s_qual, __pyx_n_s_output_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 883, __pyx_L1_error) | |
39259 __Pyx_GOTREF(__pyx_tuple__91); | |
39260 __Pyx_GIVEREF(__pyx_tuple__91); | |
39261 __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_write_data, 883, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 883, __pyx_L1_error) | |
39262 | |
39263 /* "pysam/libcvcf.pyx":915 | |
39264 * stream.write( "\t".join(output) + "\n" ) | |
39265 * | |
39266 * def _parse_header(self, stream): # <<<<<<<<<<<<<< | |
39267 * self._lineno = 0 | |
39268 * for line in stream: | |
39269 */ | |
39270 __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_line); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 915, __pyx_L1_error) | |
39271 __Pyx_GOTREF(__pyx_tuple__93); | |
39272 __Pyx_GIVEREF(__pyx_tuple__93); | |
39273 __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_parse_header_2, 915, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 915, __pyx_L1_error) | |
39274 | |
39275 /* "pysam/libcvcf.pyx":929 | |
39276 * return line | |
39277 * | |
39278 * def _parse(self, line, stream): # <<<<<<<<<<<<<< | |
39279 * # deal with files with header only | |
39280 * if line.startswith("##"): return | |
39281 */ | |
39282 __pyx_tuple__95 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_stream, __pyx_n_s_d); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 929, __pyx_L1_error) | |
39283 __Pyx_GOTREF(__pyx_tuple__95); | |
39284 __Pyx_GIVEREF(__pyx_tuple__95); | |
39285 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_parse, 929, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 929, __pyx_L1_error) | |
39286 | |
39287 /* "pysam/libcvcf.pyx":947 | |
39288 * ###################################################################################################### | |
39289 * | |
39290 * def getsamples(self): # <<<<<<<<<<<<<< | |
39291 * """ List of samples in VCF file """ | |
39292 * return self._samples | |
39293 */ | |
39294 __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_getsamples, 947, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 947, __pyx_L1_error) | |
39295 | |
39296 /* "pysam/libcvcf.pyx":951 | |
39297 * return self._samples | |
39298 * | |
39299 * def setsamples(self,samples): # <<<<<<<<<<<<<< | |
39300 * """ List of samples in VCF file """ | |
39301 * self._samples = samples | |
39302 */ | |
39303 __pyx_tuple__97 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_samples_3); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 951, __pyx_L1_error) | |
39304 __Pyx_GOTREF(__pyx_tuple__97); | |
39305 __Pyx_GIVEREF(__pyx_tuple__97); | |
39306 __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_setsamples, 951, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 951, __pyx_L1_error) | |
39307 | |
39308 /* "pysam/libcvcf.pyx":955 | |
39309 * self._samples = samples | |
39310 * | |
39311 * def getheader(self): # <<<<<<<<<<<<<< | |
39312 * """ List of header key-value pairs (strings) """ | |
39313 * return self._header | |
39314 */ | |
39315 __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_getheader, 955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 955, __pyx_L1_error) | |
39316 | |
39317 /* "pysam/libcvcf.pyx":959 | |
39318 * return self._header | |
39319 * | |
39320 * def setheader(self,header): # <<<<<<<<<<<<<< | |
39321 * """ List of header key-value pairs (strings) """ | |
39322 * self._header = header | |
39323 */ | |
39324 __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_header_2); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 959, __pyx_L1_error) | |
39325 __Pyx_GOTREF(__pyx_tuple__100); | |
39326 __Pyx_GIVEREF(__pyx_tuple__100); | |
39327 __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_setheader, 959, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 959, __pyx_L1_error) | |
39328 | |
39329 /* "pysam/libcvcf.pyx":963 | |
39330 * self._header = header | |
39331 * | |
39332 * def getinfo(self): # <<<<<<<<<<<<<< | |
39333 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
39334 * return self._info | |
39335 */ | |
39336 __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_getinfo, 963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 963, __pyx_L1_error) | |
39337 | |
39338 /* "pysam/libcvcf.pyx":967 | |
39339 * return self._info | |
39340 * | |
39341 * def setinfo(self,info): # <<<<<<<<<<<<<< | |
39342 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
39343 * self._info = info | |
39344 */ | |
39345 __pyx_tuple__103 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_info_2); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 967, __pyx_L1_error) | |
39346 __Pyx_GOTREF(__pyx_tuple__103); | |
39347 __Pyx_GIVEREF(__pyx_tuple__103); | |
39348 __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_setinfo, 967, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 967, __pyx_L1_error) | |
39349 | |
39350 /* "pysam/libcvcf.pyx":971 | |
39351 * self._info = info | |
39352 * | |
39353 * def getformat(self): # <<<<<<<<<<<<<< | |
39354 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
39355 * return self._format | |
39356 */ | |
39357 __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_getformat, 971, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 971, __pyx_L1_error) | |
39358 | |
39359 /* "pysam/libcvcf.pyx":975 | |
39360 * return self._format | |
39361 * | |
39362 * def setformat(self,format): # <<<<<<<<<<<<<< | |
39363 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
39364 * self._format = format | |
39365 */ | |
39366 __pyx_tuple__106 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_format); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 975, __pyx_L1_error) | |
39367 __Pyx_GOTREF(__pyx_tuple__106); | |
39368 __Pyx_GIVEREF(__pyx_tuple__106); | |
39369 __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_setformat, 975, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 975, __pyx_L1_error) | |
39370 | |
39371 /* "pysam/libcvcf.pyx":979 | |
39372 * self._format = format | |
39373 * | |
39374 * def getfilter(self): # <<<<<<<<<<<<<< | |
39375 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
39376 * return self._filter | |
39377 */ | |
39378 __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_getfilter, 979, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 979, __pyx_L1_error) | |
39379 | |
39380 /* "pysam/libcvcf.pyx":983 | |
39381 * return self._filter | |
39382 * | |
39383 * def setfilter(self,filter): # <<<<<<<<<<<<<< | |
39384 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
39385 * self._filter = filter | |
39386 */ | |
39387 __pyx_tuple__109 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filter_2); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 983, __pyx_L1_error) | |
39388 __Pyx_GOTREF(__pyx_tuple__109); | |
39389 __Pyx_GIVEREF(__pyx_tuple__109); | |
39390 __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_setfilter, 983, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 983, __pyx_L1_error) | |
39391 | |
39392 /* "pysam/libcvcf.pyx":987 | |
39393 * self._filter = filter | |
39394 * | |
39395 * def setversion(self, version): # <<<<<<<<<<<<<< | |
39396 * if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files") | |
39397 * self._version = version | |
39398 */ | |
39399 __pyx_tuple__111 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_version_2); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 987, __pyx_L1_error) | |
39400 __Pyx_GOTREF(__pyx_tuple__111); | |
39401 __Pyx_GIVEREF(__pyx_tuple__111); | |
39402 __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_setversion, 987, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 987, __pyx_L1_error) | |
39403 | |
39404 /* "pysam/libcvcf.pyx":991 | |
39405 * self._version = version | |
39406 * | |
39407 * def setregions(self, regions): # <<<<<<<<<<<<<< | |
39408 * self._regions = regions | |
39409 * | |
39410 */ | |
39411 __pyx_tuple__113 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_regions); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 991, __pyx_L1_error) | |
39412 __Pyx_GOTREF(__pyx_tuple__113); | |
39413 __Pyx_GIVEREF(__pyx_tuple__113); | |
39414 __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_setregions, 991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 991, __pyx_L1_error) | |
39415 | |
39416 /* "pysam/libcvcf.pyx":994 | |
39417 * self._regions = regions | |
39418 * | |
39419 * def setreference(self, ref): # <<<<<<<<<<<<<< | |
39420 * """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """ | |
39421 * self._reference = ref | |
39422 */ | |
39423 __pyx_tuple__115 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ref); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 994, __pyx_L1_error) | |
39424 __Pyx_GOTREF(__pyx_tuple__115); | |
39425 __Pyx_GIVEREF(__pyx_tuple__115); | |
39426 __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_setreference, 994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 994, __pyx_L1_error) | |
39427 | |
39428 /* "pysam/libcvcf.pyx":998 | |
39429 * self._reference = ref | |
39430 * | |
39431 * def ignoreerror(self, errorstring): # <<<<<<<<<<<<<< | |
39432 * try: self._ignored_errors.add(self.__dict__[errorstring]) | |
39433 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
39434 */ | |
39435 __pyx_tuple__117 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_errorstring); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 998, __pyx_L1_error) | |
39436 __Pyx_GOTREF(__pyx_tuple__117); | |
39437 __Pyx_GIVEREF(__pyx_tuple__117); | |
39438 __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_ignoreerror, 998, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 998, __pyx_L1_error) | |
39439 | |
39440 /* "pysam/libcvcf.pyx":1002 | |
39441 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
39442 * | |
39443 * def warnerror(self, errorstring): # <<<<<<<<<<<<<< | |
39444 * try: self._warn_errors.add(self.__dict__[errorstring]) | |
39445 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
39446 */ | |
39447 __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_warnerror, 1002, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 1002, __pyx_L1_error) | |
39448 | |
39449 /* "pysam/libcvcf.pyx":1006 | |
39450 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
39451 * | |
39452 * def parse(self, stream): # <<<<<<<<<<<<<< | |
39453 * """ Parse a stream of VCF-formatted lines. Initializes class instance and return generator """ | |
39454 * last_line = self._parse_header(stream) | |
39455 */ | |
39456 __pyx_tuple__120 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_last_line); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1006, __pyx_L1_error) | |
39457 __Pyx_GOTREF(__pyx_tuple__120); | |
39458 __Pyx_GIVEREF(__pyx_tuple__120); | |
39459 __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_parse_2, 1006, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 1006, __pyx_L1_error) | |
39460 | |
39461 /* "pysam/libcvcf.pyx":1013 | |
39462 * return self._parse(last_line, stream) | |
39463 * | |
39464 * def write(self, stream, datagenerator): # <<<<<<<<<<<<<< | |
39465 * """ Writes a VCF file to a stream, using a data generator (or list) """ | |
39466 * self.write_header(stream) | |
39467 */ | |
39468 __pyx_tuple__122 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_datagenerator, __pyx_n_s_data); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 1013, __pyx_L1_error) | |
39469 __Pyx_GOTREF(__pyx_tuple__122); | |
39470 __Pyx_GIVEREF(__pyx_tuple__122); | |
39471 __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_write, 1013, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 1013, __pyx_L1_error) | |
39472 | |
39473 /* "pysam/libcvcf.pyx":1019 | |
39474 * for data in datagenerator: self.write_data(stream,data) | |
39475 * | |
39476 * def writeheader(self, stream): # <<<<<<<<<<<<<< | |
39477 * """ Writes a VCF header """ | |
39478 * self.write_header(stream) | |
39479 */ | |
39480 __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_writeheader, 1019, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 1019, __pyx_L1_error) | |
39481 | |
39482 /* "pysam/libcvcf.pyx":1024 | |
39483 * self.write_heading(stream) | |
39484 * | |
39485 * def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2): # <<<<<<<<<<<<<< | |
39486 * """ Utility function: compares two calls for equality """ | |
39487 * # a variant should always be assigned to a unique position, one base before | |
39488 */ | |
39489 __pyx_tuple__125 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_pos1, __pyx_n_s_ref1, __pyx_n_s_alt1, __pyx_n_s_pos2, __pyx_n_s_ref2, __pyx_n_s_alt2); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 1024, __pyx_L1_error) | |
39490 __Pyx_GOTREF(__pyx_tuple__125); | |
39491 __Pyx_GIVEREF(__pyx_tuple__125); | |
39492 __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_compare_calls, 1024, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 1024, __pyx_L1_error) | |
39493 | |
39494 /* "pysam/libcvcf.pyx":1046 | |
39495 * ########################################################################################################### | |
39496 * | |
39497 * def connect(self, filename, encoding="ascii"): # <<<<<<<<<<<<<< | |
39498 * '''connect to tabix file.''' | |
39499 * self.encoding=encoding | |
39500 */ | |
39501 __pyx_tuple__127 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 1046, __pyx_L1_error) | |
39502 __Pyx_GOTREF(__pyx_tuple__127); | |
39503 __Pyx_GIVEREF(__pyx_tuple__127); | |
39504 __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_connect, 1046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 1046, __pyx_L1_error) | |
39505 __pyx_tuple__129 = PyTuple_Pack(1, ((PyObject*)__pyx_n_u_ascii)); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 1046, __pyx_L1_error) | |
39506 __Pyx_GOTREF(__pyx_tuple__129); | |
39507 __Pyx_GIVEREF(__pyx_tuple__129); | |
39508 | |
39509 /* "pysam/libcvcf.pyx":1052 | |
39510 * self._parse_header(self.tabixfile.header) | |
39511 * | |
39512 * def __del__(self): # <<<<<<<<<<<<<< | |
39513 * self.close() | |
39514 * self.tabixfile = None | |
39515 */ | |
39516 __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_del, 1052, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 1052, __pyx_L1_error) | |
39517 | |
39518 /* "pysam/libcvcf.pyx":1056 | |
39519 * self.tabixfile = None | |
39520 * | |
39521 * def close(self): # <<<<<<<<<<<<<< | |
39522 * if self.tabixfile: | |
39523 * self.tabixfile.close() | |
39524 */ | |
39525 __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_close, 1056, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 1056, __pyx_L1_error) | |
39526 | |
39527 /* "pysam/libcvcf.pyx":1061 | |
39528 * self.tabixfile = None | |
39529 * | |
39530 * def fetch(self, # <<<<<<<<<<<<<< | |
39531 * reference=None, | |
39532 * start=None, | |
39533 */ | |
39534 __pyx_tuple__132 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_reference, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_region); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 1061, __pyx_L1_error) | |
39535 __Pyx_GOTREF(__pyx_tuple__132); | |
39536 __Pyx_GIVEREF(__pyx_tuple__132); | |
39537 __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_fetch, 1061, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 1061, __pyx_L1_error) | |
39538 __pyx_tuple__134 = PyTuple_Pack(4, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 1061, __pyx_L1_error) | |
39539 __Pyx_GOTREF(__pyx_tuple__134); | |
39540 __Pyx_GIVEREF(__pyx_tuple__134); | |
39541 | |
39542 /* "pysam/libcvcf.pyx":1075 | |
39543 * parser = asVCFRecord(self)) | |
39544 * | |
39545 * def validate(self, record): # <<<<<<<<<<<<<< | |
39546 * '''validate vcf record. | |
39547 * | |
39548 */ | |
39549 __pyx_tuple__135 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_record); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1075, __pyx_L1_error) | |
39550 __Pyx_GOTREF(__pyx_tuple__135); | |
39551 __Pyx_GIVEREF(__pyx_tuple__135); | |
39552 __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcvcf_pyx, __pyx_n_s_validate, 1075, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 1075, __pyx_L1_error) | |
39553 | |
39554 /* "(tree fragment)":1 | |
39555 * def __pyx_unpickle_asVCFRecord(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
39556 * cdef object __pyx_PickleError | |
39557 * cdef object __pyx_result | |
39558 */ | |
39559 __pyx_tuple__137 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(1, 1, __pyx_L1_error) | |
39560 __Pyx_GOTREF(__pyx_tuple__137); | |
39561 __Pyx_GIVEREF(__pyx_tuple__137); | |
39562 __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_asVCFRecord, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(1, 1, __pyx_L1_error) | |
39563 __Pyx_RefNannyFinishContext(); | |
39564 return 0; | |
39565 __pyx_L1_error:; | |
39566 __Pyx_RefNannyFinishContext(); | |
39567 return -1; | |
39568 } | |
39569 /* #### Code section: init_constants ### */ | |
39570 | |
39571 static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { | |
39572 if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); | |
39573 __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39574 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39575 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39576 __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39577 __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39578 __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39579 __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39580 __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39581 __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39582 __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39583 __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39584 __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39585 __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39586 __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39587 __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39588 __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39589 __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39590 __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39591 __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39592 __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39593 __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39594 __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39595 __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39596 __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39597 __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39598 __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39599 __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39600 __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39601 __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39602 __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39603 __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39604 __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39605 __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39606 __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39607 __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39608 __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39609 __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39610 __pyx_int_29527880 = PyInt_FromLong(29527880L); if (unlikely(!__pyx_int_29527880)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39611 __pyx_int_214161357 = PyInt_FromLong(214161357L); if (unlikely(!__pyx_int_214161357)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39612 __pyx_int_239654613 = PyInt_FromLong(239654613L); if (unlikely(!__pyx_int_239654613)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39613 __pyx_int_3000000000 = PyInt_FromString((char *)"3000000000", 0, 0); if (unlikely(!__pyx_int_3000000000)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39614 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39615 return 0; | |
39616 __pyx_L1_error:; | |
39617 return -1; | |
39618 } | |
39619 /* #### Code section: init_globals ### */ | |
39620 | |
39621 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { | |
39622 /* AssertionsEnabled.init */ | |
39623 if (likely(__Pyx_init_assertions_enabled() == 0)); else | |
39624 | |
39625 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) | |
39626 | |
39627 return 0; | |
39628 __pyx_L1_error:; | |
39629 return -1; | |
39630 } | |
39631 /* #### Code section: init_module ### */ | |
39632 | |
39633 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ | |
39634 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ | |
39635 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ | |
39636 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ | |
39637 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ | |
39638 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ | |
39639 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ | |
39640 | |
39641 static int __Pyx_modinit_global_init_code(void) { | |
39642 __Pyx_RefNannyDeclarations | |
39643 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); | |
39644 /*--- Global init code ---*/ | |
39645 __Pyx_RefNannyFinishContext(); | |
39646 return 0; | |
39647 } | |
39648 | |
39649 static int __Pyx_modinit_variable_export_code(void) { | |
39650 __Pyx_RefNannyDeclarations | |
39651 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); | |
39652 /*--- Variable export code ---*/ | |
39653 __Pyx_RefNannyFinishContext(); | |
39654 return 0; | |
39655 } | |
39656 | |
39657 static int __Pyx_modinit_function_export_code(void) { | |
39658 __Pyx_RefNannyDeclarations | |
39659 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); | |
39660 /*--- Function export code ---*/ | |
39661 __Pyx_RefNannyFinishContext(); | |
39662 return 0; | |
39663 } | |
39664 | |
39665 static int __Pyx_modinit_type_init_code(void) { | |
39666 __Pyx_RefNannyDeclarations | |
39667 PyObject *__pyx_t_1 = NULL; | |
39668 PyObject *__pyx_t_2 = NULL; | |
39669 PyObject *__pyx_t_3 = NULL; | |
39670 int __pyx_lineno = 0; | |
39671 const char *__pyx_filename = NULL; | |
39672 int __pyx_clineno = 0; | |
39673 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); | |
39674 /*--- Type init code ---*/ | |
39675 __pyx_t_1 = PyImport_ImportModule("pysam.libctabixproxies"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39676 __Pyx_GOTREF(__pyx_t_1); | |
39677 __pyx_ptype_5pysam_16libctabixproxies_TupleProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "TupleProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_TupleProxy) __PYX_ERR(0, 1, __pyx_L1_error) | |
39678 __pyx_vtabptr_5pysam_16libctabixproxies_TupleProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_TupleProxy)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39679 __pyx_vtabptr_5pysam_7libcvcf_VCFRecord = &__pyx_vtable_5pysam_7libcvcf_VCFRecord; | |
39680 __pyx_vtable_5pysam_7libcvcf_VCFRecord.__pyx_base = *__pyx_vtabptr_5pysam_16libctabixproxies_TupleProxy; | |
39681 __pyx_vtable_5pysam_7libcvcf_VCFRecord.__pyx_base.update = (PyObject *(*)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, char *, size_t))__pyx_f_5pysam_7libcvcf_9VCFRecord_update; | |
39682 #if CYTHON_USE_TYPE_SPECS | |
39683 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_16libctabixproxies_TupleProxy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) | |
39684 __Pyx_GOTREF(__pyx_t_2); | |
39685 __pyx_ptype_5pysam_7libcvcf_VCFRecord = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_7libcvcf_VCFRecord_spec, __pyx_t_2); | |
39686 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
39687 if (unlikely(!__pyx_ptype_5pysam_7libcvcf_VCFRecord)) __PYX_ERR(0, 104, __pyx_L1_error) | |
39688 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_7libcvcf_VCFRecord_spec, __pyx_ptype_5pysam_7libcvcf_VCFRecord) < 0) __PYX_ERR(0, 104, __pyx_L1_error) | |
39689 #else | |
39690 __pyx_ptype_5pysam_7libcvcf_VCFRecord = &__pyx_type_5pysam_7libcvcf_VCFRecord; | |
39691 #endif | |
39692 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39693 __pyx_ptype_5pysam_7libcvcf_VCFRecord->tp_base = __pyx_ptype_5pysam_16libctabixproxies_TupleProxy; | |
39694 #endif | |
39695 #if !CYTHON_USE_TYPE_SPECS | |
39696 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_7libcvcf_VCFRecord) < 0) __PYX_ERR(0, 104, __pyx_L1_error) | |
39697 #endif | |
39698 #if PY_MAJOR_VERSION < 3 | |
39699 __pyx_ptype_5pysam_7libcvcf_VCFRecord->tp_print = 0; | |
39700 #endif | |
39701 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39702 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_7libcvcf_VCFRecord->tp_dictoffset && __pyx_ptype_5pysam_7libcvcf_VCFRecord->tp_getattro == PyObject_GenericGetAttr)) { | |
39703 __pyx_ptype_5pysam_7libcvcf_VCFRecord->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
39704 } | |
39705 #endif | |
39706 if (__Pyx_SetVtable(__pyx_ptype_5pysam_7libcvcf_VCFRecord, __pyx_vtabptr_5pysam_7libcvcf_VCFRecord) < 0) __PYX_ERR(0, 104, __pyx_L1_error) | |
39707 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39708 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_7libcvcf_VCFRecord) < 0) __PYX_ERR(0, 104, __pyx_L1_error) | |
39709 #endif | |
39710 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VCFRecord, (PyObject *) __pyx_ptype_5pysam_7libcvcf_VCFRecord) < 0) __PYX_ERR(0, 104, __pyx_L1_error) | |
39711 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39712 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_7libcvcf_VCFRecord) < 0) __PYX_ERR(0, 104, __pyx_L1_error) | |
39713 #endif | |
39714 __pyx_t_2 = PyImport_ImportModule("pysam.libctabix"); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39715 __Pyx_GOTREF(__pyx_t_2); | |
39716 __pyx_ptype_5pysam_9libctabix_Parser = __Pyx_ImportType_3_0_11(__pyx_t_2, "pysam.libctabix", "Parser", sizeof(struct __pyx_obj_5pysam_9libctabix_Parser), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_Parser),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_Parser) __PYX_ERR(0, 1, __pyx_L1_error) | |
39717 __pyx_vtabptr_5pysam_9libctabix_Parser = (struct __pyx_vtabstruct_5pysam_9libctabix_Parser*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_Parser); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_Parser)) __PYX_ERR(0, 1, __pyx_L1_error) | |
39718 __pyx_vtabptr_5pysam_7libcvcf_asVCFRecord = &__pyx_vtable_5pysam_7libcvcf_asVCFRecord; | |
39719 __pyx_vtable_5pysam_7libcvcf_asVCFRecord.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_Parser; | |
39720 __pyx_vtable_5pysam_7libcvcf_asVCFRecord.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_9libctabix_Parser *, char *, int))__pyx_f_5pysam_7libcvcf_11asVCFRecord_parse; | |
39721 #if CYTHON_USE_TYPE_SPECS | |
39722 __pyx_t_3 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_Parser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) | |
39723 __Pyx_GOTREF(__pyx_t_3); | |
39724 __pyx_ptype_5pysam_7libcvcf_asVCFRecord = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_7libcvcf_asVCFRecord_spec, __pyx_t_3); | |
39725 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
39726 if (unlikely(!__pyx_ptype_5pysam_7libcvcf_asVCFRecord)) __PYX_ERR(0, 241, __pyx_L1_error) | |
39727 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_7libcvcf_asVCFRecord_spec, __pyx_ptype_5pysam_7libcvcf_asVCFRecord) < 0) __PYX_ERR(0, 241, __pyx_L1_error) | |
39728 #else | |
39729 __pyx_ptype_5pysam_7libcvcf_asVCFRecord = &__pyx_type_5pysam_7libcvcf_asVCFRecord; | |
39730 #endif | |
39731 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39732 __pyx_ptype_5pysam_7libcvcf_asVCFRecord->tp_base = __pyx_ptype_5pysam_9libctabix_Parser; | |
39733 #endif | |
39734 #if !CYTHON_USE_TYPE_SPECS | |
39735 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_7libcvcf_asVCFRecord) < 0) __PYX_ERR(0, 241, __pyx_L1_error) | |
39736 #endif | |
39737 #if PY_MAJOR_VERSION < 3 | |
39738 __pyx_ptype_5pysam_7libcvcf_asVCFRecord->tp_print = 0; | |
39739 #endif | |
39740 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39741 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_7libcvcf_asVCFRecord->tp_dictoffset && __pyx_ptype_5pysam_7libcvcf_asVCFRecord->tp_getattro == PyObject_GenericGetAttr)) { | |
39742 __pyx_ptype_5pysam_7libcvcf_asVCFRecord->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
39743 } | |
39744 #endif | |
39745 if (__Pyx_SetVtable(__pyx_ptype_5pysam_7libcvcf_asVCFRecord, __pyx_vtabptr_5pysam_7libcvcf_asVCFRecord) < 0) __PYX_ERR(0, 241, __pyx_L1_error) | |
39746 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39747 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_7libcvcf_asVCFRecord) < 0) __PYX_ERR(0, 241, __pyx_L1_error) | |
39748 #endif | |
39749 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_asVCFRecord, (PyObject *) __pyx_ptype_5pysam_7libcvcf_asVCFRecord) < 0) __PYX_ERR(0, 241, __pyx_L1_error) | |
39750 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39751 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_7libcvcf_asVCFRecord) < 0) __PYX_ERR(0, 241, __pyx_L1_error) | |
39752 #endif | |
39753 #if CYTHON_USE_TYPE_SPECS | |
39754 __pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse)) __PYX_ERR(0, 929, __pyx_L1_error) | |
39755 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse_spec, __pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse) < 0) __PYX_ERR(0, 929, __pyx_L1_error) | |
39756 #else | |
39757 __pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse = &__pyx_type_5pysam_7libcvcf___pyx_scope_struct___parse; | |
39758 #endif | |
39759 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39760 #endif | |
39761 #if !CYTHON_USE_TYPE_SPECS | |
39762 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse) < 0) __PYX_ERR(0, 929, __pyx_L1_error) | |
39763 #endif | |
39764 #if PY_MAJOR_VERSION < 3 | |
39765 __pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse->tp_print = 0; | |
39766 #endif | |
39767 #if !CYTHON_COMPILING_IN_LIMITED_API | |
39768 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse->tp_dictoffset && __pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse->tp_getattro == PyObject_GenericGetAttr)) { | |
39769 __pyx_ptype_5pysam_7libcvcf___pyx_scope_struct___parse->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; | |
39770 } | |
39771 #endif | |
39772 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
39773 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
39774 __Pyx_RefNannyFinishContext(); | |
39775 return 0; | |
39776 __pyx_L1_error:; | |
39777 __Pyx_XDECREF(__pyx_t_1); | |
39778 __Pyx_XDECREF(__pyx_t_2); | |
39779 __Pyx_XDECREF(__pyx_t_3); | |
39780 __Pyx_RefNannyFinishContext(); | |
39781 return -1; | |
39782 } | |
39783 | |
39784 static int __Pyx_modinit_type_import_code(void) { | |
39785 __Pyx_RefNannyDeclarations | |
39786 PyObject *__pyx_t_1 = NULL; | |
39787 int __pyx_lineno = 0; | |
39788 const char *__pyx_filename = NULL; | |
39789 int __pyx_clineno = 0; | |
39790 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); | |
39791 /*--- Type import code ---*/ | |
39792 __pyx_t_1 = PyImport_ImportModule("pysam.libchtslib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2706, __pyx_L1_error) | |
39793 __Pyx_GOTREF(__pyx_t_1); | |
39794 __pyx_ptype_5pysam_10libchtslib_HTSFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libchtslib", "HTSFile", sizeof(struct __pyx_obj_5pysam_10libchtslib_HTSFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_10libchtslib_HTSFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_10libchtslib_HTSFile) __PYX_ERR(4, 2706, __pyx_L1_error) | |
39795 __pyx_vtabptr_5pysam_10libchtslib_HTSFile = (struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_10libchtslib_HTSFile); if (unlikely(!__pyx_vtabptr_5pysam_10libchtslib_HTSFile)) __PYX_ERR(4, 2706, __pyx_L1_error) | |
39796 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
39797 __pyx_t_1 = PyImport_ImportModule("pysam.libctabix"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 48, __pyx_L1_error) | |
39798 __Pyx_GOTREF(__pyx_t_1); | |
39799 __pyx_ptype_5pysam_9libctabix_tabix_file_iterator = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "tabix_file_iterator", sizeof(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_tabix_file_iterator) __PYX_ERR(5, 48, __pyx_L1_error) | |
39800 __pyx_vtabptr_5pysam_9libctabix_tabix_file_iterator = (struct __pyx_vtabstruct_5pysam_9libctabix_tabix_file_iterator*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_tabix_file_iterator); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_tabix_file_iterator)) __PYX_ERR(5, 48, __pyx_L1_error) | |
39801 __pyx_ptype_5pysam_9libctabix_TabixFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "TabixFile", sizeof(struct __pyx_obj_5pysam_9libctabix_TabixFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_TabixFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_TabixFile) __PYX_ERR(5, 61, __pyx_L1_error) | |
39802 __pyx_vtabptr_5pysam_9libctabix_TabixFile = (struct __pyx_vtabstruct_5pysam_9libctabix_TabixFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_TabixFile); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_TabixFile)) __PYX_ERR(5, 61, __pyx_L1_error) | |
39803 __pyx_ptype_5pysam_9libctabix_asTuple = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "asTuple", sizeof(struct __pyx_obj_5pysam_9libctabix_asTuple), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_asTuple),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_asTuple) __PYX_ERR(5, 77, __pyx_L1_error) | |
39804 __pyx_vtabptr_5pysam_9libctabix_asTuple = (struct __pyx_vtabstruct_5pysam_9libctabix_asTuple*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_asTuple); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_asTuple)) __PYX_ERR(5, 77, __pyx_L1_error) | |
39805 __pyx_ptype_5pysam_9libctabix_asGTF = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "asGTF", sizeof(struct __pyx_obj_5pysam_9libctabix_asGTF), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_asGTF),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_asGTF) __PYX_ERR(5, 81, __pyx_L1_error) | |
39806 __pyx_vtabptr_5pysam_9libctabix_asGTF = (struct __pyx_vtabstruct_5pysam_9libctabix_asGTF*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_asGTF); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_asGTF)) __PYX_ERR(5, 81, __pyx_L1_error) | |
39807 __pyx_ptype_5pysam_9libctabix_asGFF3 = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "asGFF3", sizeof(struct __pyx_obj_5pysam_9libctabix_asGFF3), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_asGFF3),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_asGFF3) __PYX_ERR(5, 85, __pyx_L1_error) | |
39808 __pyx_vtabptr_5pysam_9libctabix_asGFF3 = (struct __pyx_vtabstruct_5pysam_9libctabix_asGFF3*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_asGFF3); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_asGFF3)) __PYX_ERR(5, 85, __pyx_L1_error) | |
39809 __pyx_ptype_5pysam_9libctabix_asBed = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "asBed", sizeof(struct __pyx_obj_5pysam_9libctabix_asBed), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_asBed),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_asBed) __PYX_ERR(5, 89, __pyx_L1_error) | |
39810 __pyx_vtabptr_5pysam_9libctabix_asBed = (struct __pyx_vtabstruct_5pysam_9libctabix_asBed*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_asBed); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_asBed)) __PYX_ERR(5, 89, __pyx_L1_error) | |
39811 __pyx_ptype_5pysam_9libctabix_asVCF = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "asVCF", sizeof(struct __pyx_obj_5pysam_9libctabix_asVCF), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_asVCF),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_asVCF) __PYX_ERR(5, 93, __pyx_L1_error) | |
39812 __pyx_vtabptr_5pysam_9libctabix_asVCF = (struct __pyx_vtabstruct_5pysam_9libctabix_asVCF*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_asVCF); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_asVCF)) __PYX_ERR(5, 93, __pyx_L1_error) | |
39813 __pyx_ptype_5pysam_9libctabix_TabixIterator = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "TabixIterator", sizeof(struct __pyx_obj_5pysam_9libctabix_TabixIterator), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_TabixIterator),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_TabixIterator) __PYX_ERR(5, 97, __pyx_L1_error) | |
39814 __pyx_vtabptr_5pysam_9libctabix_TabixIterator = (struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_TabixIterator); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_TabixIterator)) __PYX_ERR(5, 97, __pyx_L1_error) | |
39815 __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "TabixIteratorParsed", sizeof(struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed) __PYX_ERR(5, 105, __pyx_L1_error) | |
39816 __pyx_vtabptr_5pysam_9libctabix_TabixIteratorParsed = (struct __pyx_vtabstruct_5pysam_9libctabix_TabixIteratorParsed*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_TabixIteratorParsed)) __PYX_ERR(5, 105, __pyx_L1_error) | |
39817 __pyx_ptype_5pysam_9libctabix_GZIterator = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "GZIterator", sizeof(struct __pyx_obj_5pysam_9libctabix_GZIterator), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_GZIterator),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_GZIterator) __PYX_ERR(5, 109, __pyx_L1_error) | |
39818 __pyx_vtabptr_5pysam_9libctabix_GZIterator = (struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_GZIterator); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_GZIterator)) __PYX_ERR(5, 109, __pyx_L1_error) | |
39819 __pyx_ptype_5pysam_9libctabix_GZIteratorHead = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "GZIteratorHead", sizeof(struct __pyx_obj_5pysam_9libctabix_GZIteratorHead), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_GZIteratorHead),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_GZIteratorHead) __PYX_ERR(5, 118, __pyx_L1_error) | |
39820 __pyx_vtabptr_5pysam_9libctabix_GZIteratorHead = (struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorHead*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_GZIteratorHead); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_GZIteratorHead)) __PYX_ERR(5, 118, __pyx_L1_error) | |
39821 __pyx_ptype_5pysam_9libctabix_GZIteratorParsed = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "GZIteratorParsed", sizeof(struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_GZIteratorParsed) __PYX_ERR(5, 122, __pyx_L1_error) | |
39822 __pyx_vtabptr_5pysam_9libctabix_GZIteratorParsed = (struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorParsed*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_GZIteratorParsed); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_GZIteratorParsed)) __PYX_ERR(5, 122, __pyx_L1_error) | |
39823 __pyx_ptype_5pysam_9libctabix_Tabixfile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabix", "Tabixfile", sizeof(struct __pyx_obj_5pysam_9libctabix_Tabixfile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libctabix_Tabixfile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libctabix_Tabixfile) __PYX_ERR(5, 127, __pyx_L1_error) | |
39824 __pyx_vtabptr_5pysam_9libctabix_Tabixfile = (struct __pyx_vtabstruct_5pysam_9libctabix_Tabixfile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libctabix_Tabixfile); if (unlikely(!__pyx_vtabptr_5pysam_9libctabix_Tabixfile)) __PYX_ERR(5, 127, __pyx_L1_error) | |
39825 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
39826 __pyx_t_1 = PyImport_ImportModule("pysam.libctabixproxies"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 27, __pyx_L1_error) | |
39827 __Pyx_GOTREF(__pyx_t_1); | |
39828 __pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "TupleProxyIterator", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxyIterator), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxyIterator),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator) __PYX_ERR(6, 27, __pyx_L1_error) | |
39829 __pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "NamedTupleProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy) __PYX_ERR(6, 32, __pyx_L1_error) | |
39830 __pyx_vtabptr_5pysam_16libctabixproxies_NamedTupleProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_NamedTupleProxy)) __PYX_ERR(6, 32, __pyx_L1_error) | |
39831 __pyx_ptype_5pysam_16libctabixproxies_GTFProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "GTFProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_GTFProxy) __PYX_ERR(6, 36, __pyx_L1_error) | |
39832 __pyx_vtabptr_5pysam_16libctabixproxies_GTFProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_GTFProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_GTFProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_GTFProxy)) __PYX_ERR(6, 36, __pyx_L1_error) | |
39833 __pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "GFF3Proxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy) __PYX_ERR(6, 42, __pyx_L1_error) | |
39834 __pyx_vtabptr_5pysam_16libctabixproxies_GFF3Proxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_GFF3Proxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_GFF3Proxy)) __PYX_ERR(6, 42, __pyx_L1_error) | |
39835 __pyx_ptype_5pysam_16libctabixproxies_BedProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "BedProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_BedProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_BedProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_BedProxy) __PYX_ERR(6, 46, __pyx_L1_error) | |
39836 __pyx_vtabptr_5pysam_16libctabixproxies_BedProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_BedProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_BedProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_BedProxy)) __PYX_ERR(6, 46, __pyx_L1_error) | |
39837 __pyx_ptype_5pysam_16libctabixproxies_VCFProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "VCFProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_VCFProxy) __PYX_ERR(6, 58, __pyx_L1_error) | |
39838 __pyx_vtabptr_5pysam_16libctabixproxies_VCFProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_VCFProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_VCFProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_VCFProxy)) __PYX_ERR(6, 58, __pyx_L1_error) | |
39839 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
39840 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 9, __pyx_L1_error) | |
39841 __Pyx_GOTREF(__pyx_t_1); | |
39842 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", | |
39843 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 | |
39844 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), | |
39845 #elif CYTHON_COMPILING_IN_LIMITED_API | |
39846 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), | |
39847 #else | |
39848 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject), | |
39849 #endif | |
39850 __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(7, 9, __pyx_L1_error) | |
39851 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
39852 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 8, __pyx_L1_error) | |
39853 __Pyx_GOTREF(__pyx_t_1); | |
39854 __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(8, 8, __pyx_L1_error) | |
39855 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
39856 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 15, __pyx_L1_error) | |
39857 __Pyx_GOTREF(__pyx_t_1); | |
39858 __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(9, 15, __pyx_L1_error) | |
39859 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
39860 __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 69, __pyx_L1_error) | |
39861 __Pyx_GOTREF(__pyx_t_1); | |
39862 __pyx_ptype_7cpython_5array_array = __Pyx_ImportType_3_0_11(__pyx_t_1, "array", "array", sizeof(arrayobject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(arrayobject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(3, 69, __pyx_L1_error) | |
39863 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
39864 __Pyx_RefNannyFinishContext(); | |
39865 return 0; | |
39866 __pyx_L1_error:; | |
39867 __Pyx_XDECREF(__pyx_t_1); | |
39868 __Pyx_RefNannyFinishContext(); | |
39869 return -1; | |
39870 } | |
39871 | |
39872 static int __Pyx_modinit_variable_import_code(void) { | |
39873 __Pyx_RefNannyDeclarations | |
39874 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); | |
39875 /*--- Variable import code ---*/ | |
39876 __Pyx_RefNannyFinishContext(); | |
39877 return 0; | |
39878 } | |
39879 | |
39880 static int __Pyx_modinit_function_import_code(void) { | |
39881 __Pyx_RefNannyDeclarations | |
39882 PyObject *__pyx_t_1 = NULL; | |
39883 int __pyx_lineno = 0; | |
39884 const char *__pyx_filename = NULL; | |
39885 int __pyx_clineno = 0; | |
39886 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); | |
39887 /*--- Function import code ---*/ | |
39888 __pyx_t_1 = PyImport_ImportModule("pysam.libcutils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) | |
39889 __Pyx_GOTREF(__pyx_t_1); | |
39890 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "force_str", (void (**)(void))&__pyx_f_5pysam_9libcutils_force_str, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
39891 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
39892 __Pyx_RefNannyFinishContext(); | |
39893 return 0; | |
39894 __pyx_L1_error:; | |
39895 __Pyx_XDECREF(__pyx_t_1); | |
39896 __Pyx_RefNannyFinishContext(); | |
39897 return -1; | |
39898 } | |
39899 | |
39900 | |
39901 #if PY_MAJOR_VERSION >= 3 | |
39902 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
39903 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ | |
39904 static int __pyx_pymod_exec_libcvcf(PyObject* module); /*proto*/ | |
39905 static PyModuleDef_Slot __pyx_moduledef_slots[] = { | |
39906 {Py_mod_create, (void*)__pyx_pymod_create}, | |
39907 {Py_mod_exec, (void*)__pyx_pymod_exec_libcvcf}, | |
39908 {0, NULL} | |
39909 }; | |
39910 #endif | |
39911 | |
39912 #ifdef __cplusplus | |
39913 namespace { | |
39914 struct PyModuleDef __pyx_moduledef = | |
39915 #else | |
39916 static struct PyModuleDef __pyx_moduledef = | |
39917 #endif | |
39918 { | |
39919 PyModuleDef_HEAD_INIT, | |
39920 "libcvcf", | |
39921 0, /* m_doc */ | |
39922 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
39923 0, /* m_size */ | |
39924 #elif CYTHON_USE_MODULE_STATE | |
39925 sizeof(__pyx_mstate), /* m_size */ | |
39926 #else | |
39927 -1, /* m_size */ | |
39928 #endif | |
39929 __pyx_methods /* m_methods */, | |
39930 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
39931 __pyx_moduledef_slots, /* m_slots */ | |
39932 #else | |
39933 NULL, /* m_reload */ | |
39934 #endif | |
39935 #if CYTHON_USE_MODULE_STATE | |
39936 __pyx_m_traverse, /* m_traverse */ | |
39937 __pyx_m_clear, /* m_clear */ | |
39938 NULL /* m_free */ | |
39939 #else | |
39940 NULL, /* m_traverse */ | |
39941 NULL, /* m_clear */ | |
39942 NULL /* m_free */ | |
39943 #endif | |
39944 }; | |
39945 #ifdef __cplusplus | |
39946 } /* anonymous namespace */ | |
39947 #endif | |
39948 #endif | |
39949 | |
39950 #ifndef CYTHON_NO_PYINIT_EXPORT | |
39951 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC | |
39952 #elif PY_MAJOR_VERSION < 3 | |
39953 #ifdef __cplusplus | |
39954 #define __Pyx_PyMODINIT_FUNC extern "C" void | |
39955 #else | |
39956 #define __Pyx_PyMODINIT_FUNC void | |
39957 #endif | |
39958 #else | |
39959 #ifdef __cplusplus | |
39960 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * | |
39961 #else | |
39962 #define __Pyx_PyMODINIT_FUNC PyObject * | |
39963 #endif | |
39964 #endif | |
39965 | |
39966 | |
39967 #if PY_MAJOR_VERSION < 3 | |
39968 __Pyx_PyMODINIT_FUNC initlibcvcf(void) CYTHON_SMALL_CODE; /*proto*/ | |
39969 __Pyx_PyMODINIT_FUNC initlibcvcf(void) | |
39970 #else | |
39971 __Pyx_PyMODINIT_FUNC PyInit_libcvcf(void) CYTHON_SMALL_CODE; /*proto*/ | |
39972 __Pyx_PyMODINIT_FUNC PyInit_libcvcf(void) | |
39973 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
39974 { | |
39975 return PyModuleDef_Init(&__pyx_moduledef); | |
39976 } | |
39977 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { | |
39978 #if PY_VERSION_HEX >= 0x030700A1 | |
39979 static PY_INT64_T main_interpreter_id = -1; | |
39980 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); | |
39981 if (main_interpreter_id == -1) { | |
39982 main_interpreter_id = current_id; | |
39983 return (unlikely(current_id == -1)) ? -1 : 0; | |
39984 } else if (unlikely(main_interpreter_id != current_id)) | |
39985 #else | |
39986 static PyInterpreterState *main_interpreter = NULL; | |
39987 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; | |
39988 if (!main_interpreter) { | |
39989 main_interpreter = current_interpreter; | |
39990 } else if (unlikely(main_interpreter != current_interpreter)) | |
39991 #endif | |
39992 { | |
39993 PyErr_SetString( | |
39994 PyExc_ImportError, | |
39995 "Interpreter change detected - this module can only be loaded into one interpreter per process."); | |
39996 return -1; | |
39997 } | |
39998 return 0; | |
39999 } | |
40000 #if CYTHON_COMPILING_IN_LIMITED_API | |
40001 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) | |
40002 #else | |
40003 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) | |
40004 #endif | |
40005 { | |
40006 PyObject *value = PyObject_GetAttrString(spec, from_name); | |
40007 int result = 0; | |
40008 if (likely(value)) { | |
40009 if (allow_none || value != Py_None) { | |
40010 #if CYTHON_COMPILING_IN_LIMITED_API | |
40011 result = PyModule_AddObject(module, to_name, value); | |
40012 #else | |
40013 result = PyDict_SetItemString(moddict, to_name, value); | |
40014 #endif | |
40015 } | |
40016 Py_DECREF(value); | |
40017 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { | |
40018 PyErr_Clear(); | |
40019 } else { | |
40020 result = -1; | |
40021 } | |
40022 return result; | |
40023 } | |
40024 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { | |
40025 PyObject *module = NULL, *moddict, *modname; | |
40026 CYTHON_UNUSED_VAR(def); | |
40027 if (__Pyx_check_single_interpreter()) | |
40028 return NULL; | |
40029 if (__pyx_m) | |
40030 return __Pyx_NewRef(__pyx_m); | |
40031 modname = PyObject_GetAttrString(spec, "name"); | |
40032 if (unlikely(!modname)) goto bad; | |
40033 module = PyModule_NewObject(modname); | |
40034 Py_DECREF(modname); | |
40035 if (unlikely(!module)) goto bad; | |
40036 #if CYTHON_COMPILING_IN_LIMITED_API | |
40037 moddict = module; | |
40038 #else | |
40039 moddict = PyModule_GetDict(module); | |
40040 if (unlikely(!moddict)) goto bad; | |
40041 #endif | |
40042 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; | |
40043 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; | |
40044 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; | |
40045 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; | |
40046 return module; | |
40047 bad: | |
40048 Py_XDECREF(module); | |
40049 return NULL; | |
40050 } | |
40051 | |
40052 | |
40053 static CYTHON_SMALL_CODE int __pyx_pymod_exec_libcvcf(PyObject *__pyx_pyinit_module) | |
40054 #endif | |
40055 #endif | |
40056 { | |
40057 int stringtab_initialized = 0; | |
40058 #if CYTHON_USE_MODULE_STATE | |
40059 int pystate_addmodule_run = 0; | |
40060 #endif | |
40061 PyObject *__pyx_t_1 = NULL; | |
40062 PyObject *__pyx_t_2 = NULL; | |
40063 PyObject *__pyx_t_3 = NULL; | |
40064 PyObject *__pyx_t_4 = NULL; | |
40065 PyObject *__pyx_t_5 = NULL; | |
40066 int __pyx_lineno = 0; | |
40067 const char *__pyx_filename = NULL; | |
40068 int __pyx_clineno = 0; | |
40069 __Pyx_RefNannyDeclarations | |
40070 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
40071 if (__pyx_m) { | |
40072 if (__pyx_m == __pyx_pyinit_module) return 0; | |
40073 PyErr_SetString(PyExc_RuntimeError, "Module 'libcvcf' has already been imported. Re-initialisation is not supported."); | |
40074 return -1; | |
40075 } | |
40076 #elif PY_MAJOR_VERSION >= 3 | |
40077 if (__pyx_m) return __Pyx_NewRef(__pyx_m); | |
40078 #endif | |
40079 /*--- Module creation code ---*/ | |
40080 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
40081 __pyx_m = __pyx_pyinit_module; | |
40082 Py_INCREF(__pyx_m); | |
40083 #else | |
40084 #if PY_MAJOR_VERSION < 3 | |
40085 __pyx_m = Py_InitModule4("libcvcf", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); | |
40086 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40087 #elif CYTHON_USE_MODULE_STATE | |
40088 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40089 { | |
40090 int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); | |
40091 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "libcvcf" pseudovariable */ | |
40092 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
40093 pystate_addmodule_run = 1; | |
40094 } | |
40095 #else | |
40096 __pyx_m = PyModule_Create(&__pyx_moduledef); | |
40097 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40098 #endif | |
40099 #endif | |
40100 CYTHON_UNUSED_VAR(__pyx_t_1); | |
40101 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40102 Py_INCREF(__pyx_d); | |
40103 __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40104 __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40105 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40106 #if CYTHON_REFNANNY | |
40107 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); | |
40108 if (!__Pyx_RefNanny) { | |
40109 PyErr_Clear(); | |
40110 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); | |
40111 if (!__Pyx_RefNanny) | |
40112 Py_FatalError("failed to import 'refnanny' module"); | |
40113 } | |
40114 #endif | |
40115 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_libcvcf(void)", 0); | |
40116 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40117 #ifdef __Pxy_PyFrame_Initialize_Offsets | |
40118 __Pxy_PyFrame_Initialize_Offsets(); | |
40119 #endif | |
40120 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40121 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40122 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40123 #ifdef __Pyx_CyFunction_USED | |
40124 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40125 #endif | |
40126 #ifdef __Pyx_FusedFunction_USED | |
40127 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40128 #endif | |
40129 #ifdef __Pyx_Coroutine_USED | |
40130 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40131 #endif | |
40132 #ifdef __Pyx_Generator_USED | |
40133 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40134 #endif | |
40135 #ifdef __Pyx_AsyncGen_USED | |
40136 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40137 #endif | |
40138 #ifdef __Pyx_StopAsyncIteration_USED | |
40139 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40140 #endif | |
40141 /*--- Library function declarations ---*/ | |
40142 /*--- Threads initialization code ---*/ | |
40143 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS | |
40144 PyEval_InitThreads(); | |
40145 #endif | |
40146 /*--- Initialize various global constants etc. ---*/ | |
40147 if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40148 stringtab_initialized = 1; | |
40149 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40150 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) | |
40151 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40152 #endif | |
40153 if (__pyx_module_is_main_pysam__libcvcf) { | |
40154 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40155 } | |
40156 #if PY_MAJOR_VERSION >= 3 | |
40157 { | |
40158 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) | |
40159 if (!PyDict_GetItemString(modules, "pysam.libcvcf")) { | |
40160 if (unlikely((PyDict_SetItemString(modules, "pysam.libcvcf", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
40161 } | |
40162 } | |
40163 #endif | |
40164 /*--- Builtin init code ---*/ | |
40165 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40166 /*--- Constants init code ---*/ | |
40167 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40168 /*--- Global type/function init code ---*/ | |
40169 (void)__Pyx_modinit_global_init_code(); | |
40170 (void)__Pyx_modinit_variable_export_code(); | |
40171 (void)__Pyx_modinit_function_export_code(); | |
40172 if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
40173 if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
40174 (void)__Pyx_modinit_variable_import_code(); | |
40175 if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
40176 /*--- Execution code ---*/ | |
40177 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) | |
40178 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
40179 #endif | |
40180 | |
40181 /* "pysam/libcvcf.pyx":49 | |
40182 * # | |
40183 * | |
40184 * from collections import namedtuple, defaultdict # <<<<<<<<<<<<<< | |
40185 * from operator import itemgetter | |
40186 * import sys, re, copy, bisect | |
40187 */ | |
40188 __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) | |
40189 __Pyx_GOTREF(__pyx_t_2); | |
40190 __Pyx_INCREF(__pyx_n_s_namedtuple); | |
40191 __Pyx_GIVEREF(__pyx_n_s_namedtuple); | |
40192 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple)) __PYX_ERR(0, 49, __pyx_L1_error); | |
40193 __Pyx_INCREF(__pyx_n_s_defaultdict); | |
40194 __Pyx_GIVEREF(__pyx_n_s_defaultdict); | |
40195 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_defaultdict)) __PYX_ERR(0, 49, __pyx_L1_error); | |
40196 __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) | |
40197 __Pyx_GOTREF(__pyx_t_3); | |
40198 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40199 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) | |
40200 __Pyx_GOTREF(__pyx_t_2); | |
40201 if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) | |
40202 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40203 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) | |
40204 __Pyx_GOTREF(__pyx_t_2); | |
40205 if (PyDict_SetItem(__pyx_d, __pyx_n_s_defaultdict, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) | |
40206 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40207 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40208 | |
40209 /* "pysam/libcvcf.pyx":50 | |
40210 * | |
40211 * from collections import namedtuple, defaultdict | |
40212 * from operator import itemgetter # <<<<<<<<<<<<<< | |
40213 * import sys, re, copy, bisect | |
40214 * | |
40215 */ | |
40216 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) | |
40217 __Pyx_GOTREF(__pyx_t_3); | |
40218 __Pyx_INCREF(__pyx_n_s_itemgetter); | |
40219 __Pyx_GIVEREF(__pyx_n_s_itemgetter); | |
40220 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_itemgetter)) __PYX_ERR(0, 50, __pyx_L1_error); | |
40221 __pyx_t_2 = __Pyx_Import(__pyx_n_s_operator, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) | |
40222 __Pyx_GOTREF(__pyx_t_2); | |
40223 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40224 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) | |
40225 __Pyx_GOTREF(__pyx_t_3); | |
40226 if (PyDict_SetItem(__pyx_d, __pyx_n_s_itemgetter, __pyx_t_3) < 0) __PYX_ERR(0, 50, __pyx_L1_error) | |
40227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40228 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40229 | |
40230 /* "pysam/libcvcf.pyx":51 | |
40231 * from collections import namedtuple, defaultdict | |
40232 * from operator import itemgetter | |
40233 * import sys, re, copy, bisect # <<<<<<<<<<<<<< | |
40234 * | |
40235 * from libc.stdlib cimport atoi | |
40236 */ | |
40237 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) | |
40238 __Pyx_GOTREF(__pyx_t_2); | |
40239 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error) | |
40240 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40241 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) | |
40242 __Pyx_GOTREF(__pyx_t_2); | |
40243 if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error) | |
40244 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40245 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_copy_2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) | |
40246 __Pyx_GOTREF(__pyx_t_2); | |
40247 if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_2, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error) | |
40248 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40249 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_bisect, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) | |
40250 __Pyx_GOTREF(__pyx_t_2); | |
40251 if (PyDict_SetItem(__pyx_d, __pyx_n_s_bisect, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error) | |
40252 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40253 | |
40254 /* "pysam/libcvcf.pyx":62 | |
40255 * from pysam.libcutils cimport force_str | |
40256 * | |
40257 * import pysam # <<<<<<<<<<<<<< | |
40258 * | |
40259 * gtsRegEx = re.compile("[|/\\\\]") | |
40260 */ | |
40261 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pysam, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) | |
40262 __Pyx_GOTREF(__pyx_t_2); | |
40263 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pysam, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error) | |
40264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40265 | |
40266 /* "pysam/libcvcf.pyx":64 | |
40267 * import pysam | |
40268 * | |
40269 * gtsRegEx = re.compile("[|/\\\\]") # <<<<<<<<<<<<<< | |
40270 * alleleRegEx = re.compile('^[ACGTN]+$') | |
40271 * | |
40272 */ | |
40273 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) | |
40274 __Pyx_GOTREF(__pyx_t_2); | |
40275 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) | |
40276 __Pyx_GOTREF(__pyx_t_3); | |
40277 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40278 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) | |
40279 __Pyx_GOTREF(__pyx_t_2); | |
40280 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40281 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gtsRegEx, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error) | |
40282 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40283 | |
40284 /* "pysam/libcvcf.pyx":65 | |
40285 * | |
40286 * gtsRegEx = re.compile("[|/\\\\]") | |
40287 * alleleRegEx = re.compile('^[ACGTN]+$') # <<<<<<<<<<<<<< | |
40288 * | |
40289 * # Utility function. Uses 0-based coordinates | |
40290 */ | |
40291 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) | |
40292 __Pyx_GOTREF(__pyx_t_2); | |
40293 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) | |
40294 __Pyx_GOTREF(__pyx_t_3); | |
40295 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40296 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) | |
40297 __Pyx_GOTREF(__pyx_t_2); | |
40298 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40299 if (PyDict_SetItem(__pyx_d, __pyx_n_s_alleleRegEx, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) | |
40300 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40301 | |
40302 /* "pysam/libcvcf.pyx":68 | |
40303 * | |
40304 * # Utility function. Uses 0-based coordinates | |
40305 * def get_sequence(chrom, start, end, fa): # <<<<<<<<<<<<<< | |
40306 * # obtain sequence from .fa file, without truncation | |
40307 * if end<=start: return "" | |
40308 */ | |
40309 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_1get_sequence, 0, __pyx_n_s_get_sequence, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) | |
40310 __Pyx_GOTREF(__pyx_t_2); | |
40311 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_sequence, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) | |
40312 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40313 | |
40314 /* "pysam/libcvcf.pyx":78 | |
40315 * | |
40316 * # Utility function. Parses a region string | |
40317 * def parse_regions( string ): # <<<<<<<<<<<<<< | |
40318 * result = [] | |
40319 * for r in string.split(','): | |
40320 */ | |
40321 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3parse_regions, 0, __pyx_n_s_parse_regions, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) | |
40322 __Pyx_GOTREF(__pyx_t_2); | |
40323 if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_regions, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error) | |
40324 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40325 | |
40326 /* "pysam/libcvcf.pyx":96 | |
40327 * | |
40328 * | |
40329 * FORMAT = namedtuple('FORMAT','id numbertype number type description missingvalue') # <<<<<<<<<<<<<< | |
40330 * | |
40331 * ########################################################################################################### | |
40332 */ | |
40333 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) | |
40334 __Pyx_GOTREF(__pyx_t_2); | |
40335 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) | |
40336 __Pyx_GOTREF(__pyx_t_3); | |
40337 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
40338 if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORMAT, __pyx_t_3) < 0) __PYX_ERR(0, 96, __pyx_L1_error) | |
40339 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40340 | |
40341 /* "pysam/libcvcf.pyx":134 | |
40342 * self.encoding = vcf.encoding | |
40343 * | |
40344 * def error(self, line, error, opt=None): # <<<<<<<<<<<<<< | |
40345 * '''raise error.''' | |
40346 * # pass to vcf file for error handling | |
40347 */ | |
40348 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_9VCFRecord_5error, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_VCFRecord_error, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) | |
40349 __Pyx_GOTREF(__pyx_t_3); | |
40350 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__44); | |
40351 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_7libcvcf_VCFRecord, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 134, __pyx_L1_error) | |
40352 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40353 PyType_Modified(__pyx_ptype_5pysam_7libcvcf_VCFRecord); | |
40354 | |
40355 /* "(tree fragment)":1 | |
40356 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
40357 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
40358 * def __setstate_cython__(self, __pyx_state): | |
40359 */ | |
40360 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_9VCFRecord_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_VCFRecord___reduce_cython, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
40361 __Pyx_GOTREF(__pyx_t_3); | |
40362 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
40363 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40364 | |
40365 /* "(tree fragment)":3 | |
40366 * def __reduce_cython__(self): | |
40367 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
40368 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
40369 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
40370 */ | |
40371 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_9VCFRecord_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_VCFRecord___setstate_cython, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) | |
40372 __Pyx_GOTREF(__pyx_t_3); | |
40373 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
40374 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40375 | |
40376 /* "(tree fragment)":1 | |
40377 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
40378 * cdef tuple state | |
40379 * cdef object _dict | |
40380 */ | |
40381 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_11asVCFRecord_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asVCFRecord___reduce_cython, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
40382 __Pyx_GOTREF(__pyx_t_3); | |
40383 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_7libcvcf_asVCFRecord, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
40384 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40385 PyType_Modified(__pyx_ptype_5pysam_7libcvcf_asVCFRecord); | |
40386 | |
40387 /* "(tree fragment)":16 | |
40388 * else: | |
40389 * return __pyx_unpickle_asVCFRecord, (type(self), 0xe48d6d5, state) | |
40390 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
40391 * __pyx_unpickle_asVCFRecord__set_state(self, __pyx_state) | |
40392 */ | |
40393 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_11asVCFRecord_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asVCFRecord___setstate_cython, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error) | |
40394 __Pyx_GOTREF(__pyx_t_3); | |
40395 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_7libcvcf_asVCFRecord, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error) | |
40396 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
40397 PyType_Modified(__pyx_ptype_5pysam_7libcvcf_asVCFRecord); | |
40398 | |
40399 /* "pysam/libcvcf.pyx":253 | |
40400 * return r | |
40401 * | |
40402 * class VCF(object): # <<<<<<<<<<<<<< | |
40403 * | |
40404 * # types | |
40405 */ | |
40406 __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_tuple__53); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) | |
40407 __Pyx_GOTREF(__pyx_t_3); | |
40408 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) | |
40409 __Pyx_GOTREF(__pyx_t_2); | |
40410 __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_VCF, __pyx_n_s_VCF, (PyObject *) NULL, __pyx_n_s_pysam_libcvcf, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) | |
40411 __Pyx_GOTREF(__pyx_t_4); | |
40412 if (__pyx_t_3 != __pyx_tuple__53) { | |
40413 if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_tuple__53) < 0))) __PYX_ERR(0, 253, __pyx_L1_error) | |
40414 } | |
40415 | |
40416 /* "pysam/libcvcf.pyx":256 | |
40417 * | |
40418 * # types | |
40419 * NT_UNKNOWN = 0 # <<<<<<<<<<<<<< | |
40420 * NT_NUMBER = 1 | |
40421 * NT_ALLELES = 2 | |
40422 */ | |
40423 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_NT_UNKNOWN, __pyx_int_0) < 0) __PYX_ERR(0, 256, __pyx_L1_error) | |
40424 | |
40425 /* "pysam/libcvcf.pyx":257 | |
40426 * # types | |
40427 * NT_UNKNOWN = 0 | |
40428 * NT_NUMBER = 1 # <<<<<<<<<<<<<< | |
40429 * NT_ALLELES = 2 | |
40430 * NT_NR_ALLELES = 3 | |
40431 */ | |
40432 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_NT_NUMBER, __pyx_int_1) < 0) __PYX_ERR(0, 257, __pyx_L1_error) | |
40433 | |
40434 /* "pysam/libcvcf.pyx":258 | |
40435 * NT_UNKNOWN = 0 | |
40436 * NT_NUMBER = 1 | |
40437 * NT_ALLELES = 2 # <<<<<<<<<<<<<< | |
40438 * NT_NR_ALLELES = 3 | |
40439 * NT_GENOTYPES = 4 | |
40440 */ | |
40441 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_NT_ALLELES, __pyx_int_2) < 0) __PYX_ERR(0, 258, __pyx_L1_error) | |
40442 | |
40443 /* "pysam/libcvcf.pyx":259 | |
40444 * NT_NUMBER = 1 | |
40445 * NT_ALLELES = 2 | |
40446 * NT_NR_ALLELES = 3 # <<<<<<<<<<<<<< | |
40447 * NT_GENOTYPES = 4 | |
40448 * NT_PHASED_GENOTYPES = 5 | |
40449 */ | |
40450 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_NT_NR_ALLELES, __pyx_int_3) < 0) __PYX_ERR(0, 259, __pyx_L1_error) | |
40451 | |
40452 /* "pysam/libcvcf.pyx":260 | |
40453 * NT_ALLELES = 2 | |
40454 * NT_NR_ALLELES = 3 | |
40455 * NT_GENOTYPES = 4 # <<<<<<<<<<<<<< | |
40456 * NT_PHASED_GENOTYPES = 5 | |
40457 * | |
40458 */ | |
40459 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_NT_GENOTYPES, __pyx_int_4) < 0) __PYX_ERR(0, 260, __pyx_L1_error) | |
40460 | |
40461 /* "pysam/libcvcf.pyx":261 | |
40462 * NT_NR_ALLELES = 3 | |
40463 * NT_GENOTYPES = 4 | |
40464 * NT_PHASED_GENOTYPES = 5 # <<<<<<<<<<<<<< | |
40465 * | |
40466 * _errors = { 0:"UNKNOWN_FORMAT_STRING:Unknown file format identifier", | |
40467 */ | |
40468 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_NT_PHASED_GENOTYPES, __pyx_int_5) < 0) __PYX_ERR(0, 261, __pyx_L1_error) | |
40469 | |
40470 /* "pysam/libcvcf.pyx":263 | |
40471 * NT_PHASED_GENOTYPES = 5 | |
40472 * | |
40473 * _errors = { 0:"UNKNOWN_FORMAT_STRING:Unknown file format identifier", # <<<<<<<<<<<<<< | |
40474 * 1:"BADLY_FORMATTED_FORMAT_STRING:Formatting error in the format string", | |
40475 * 2:"BADLY_FORMATTED_HEADING:Did not find 9 required headings (CHROM, POS, ..., FORMAT) %s", | |
40476 */ | |
40477 __pyx_t_5 = __Pyx_PyDict_NewPresized(34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) | |
40478 __Pyx_GOTREF(__pyx_t_5); | |
40479 if (PyDict_SetItem(__pyx_t_5, __pyx_int_0, __pyx_kp_u_UNKNOWN_FORMAT_STRING_Unknown_fi) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40480 if (PyDict_SetItem(__pyx_t_5, __pyx_int_1, __pyx_kp_u_BADLY_FORMATTED_FORMAT_STRING_Fo) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40481 if (PyDict_SetItem(__pyx_t_5, __pyx_int_2, __pyx_kp_u_BADLY_FORMATTED_HEADING_Did_not) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40482 if (PyDict_SetItem(__pyx_t_5, __pyx_int_3, __pyx_kp_u_BAD_NUMBER_OF_COLUMNS_Wrong_numb) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40483 if (PyDict_SetItem(__pyx_t_5, __pyx_int_4, __pyx_kp_u_POS_NOT_NUMERICAL_Position_colum) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40484 if (PyDict_SetItem(__pyx_t_5, __pyx_int_5, __pyx_kp_u_UNKNOWN_CHAR_IN_REF_Unknown_char) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40485 if (PyDict_SetItem(__pyx_t_5, __pyx_int_6, __pyx_kp_u_V33_BAD_REF_Reference_should_be) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40486 if (PyDict_SetItem(__pyx_t_5, __pyx_int_7, __pyx_kp_u_V33_BAD_ALLELE_Cannot_interpret) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40487 if (PyDict_SetItem(__pyx_t_5, __pyx_int_8, __pyx_kp_u_POS_NOT_POSITIVE_Position_field) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40488 if (PyDict_SetItem(__pyx_t_5, __pyx_int_9, __pyx_kp_u_QUAL_NOT_NUMERICAL_Quality_field) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40489 if (PyDict_SetItem(__pyx_t_5, __pyx_int_10, __pyx_kp_u_ERROR_INFO_STRING_Error_while_pa) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40490 if (PyDict_SetItem(__pyx_t_5, __pyx_int_11, __pyx_kp_u_ERROR_UNKNOWN_KEY_Unknown_key_s) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40491 if (PyDict_SetItem(__pyx_t_5, __pyx_int_12, __pyx_kp_u_ERROR_FORMAT_NOT_NUMERICAL_Expec) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40492 if (PyDict_SetItem(__pyx_t_5, __pyx_int_13, __pyx_kp_u_ERROR_FORMAT_NOT_CHAR_Eexpected) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40493 if (PyDict_SetItem(__pyx_t_5, __pyx_int_14, __pyx_kp_u_FILTER_NOT_DEFINED_Identifier_s) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40494 if (PyDict_SetItem(__pyx_t_5, __pyx_int_15, __pyx_kp_u_FORMAT_NOT_DEFINED_Identifier_s) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40495 if (PyDict_SetItem(__pyx_t_5, __pyx_int_16, __pyx_kp_u_BAD_NUMBER_OF_VALUES_Found_too_m) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40496 if (PyDict_SetItem(__pyx_t_5, __pyx_int_17, __pyx_kp_u_BAD_NUMBER_OF_PARAMETERS_Found_u) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40497 if (PyDict_SetItem(__pyx_t_5, __pyx_int_18, __pyx_kp_u_BAD_GENOTYPE_Cannot_parse_genoty) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40498 if (PyDict_SetItem(__pyx_t_5, __pyx_int_19, __pyx_kp_u_V40_BAD_ALLELE_Bad_allele_found) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40499 if (PyDict_SetItem(__pyx_t_5, __pyx_int_20, __pyx_kp_u_MISSING_REF_Reference_allele_mis) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40500 if (PyDict_SetItem(__pyx_t_5, __pyx_int_21, __pyx_kp_u_V33_UNMATCHED_DELETION_Deleted_s) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40501 if (PyDict_SetItem(__pyx_t_5, __pyx_int_22, __pyx_kp_u_V40_MISSING_ANGLE_BRACKETS_Forma) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40502 if (PyDict_SetItem(__pyx_t_5, __pyx_int_23, __pyx_kp_u_FORMAT_MISSING_QUOTES_Descriptio) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40503 if (PyDict_SetItem(__pyx_t_5, __pyx_int_24, __pyx_kp_u_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40504 if (PyDict_SetItem(__pyx_t_5, __pyx_int_25, __pyx_kp_u_HEADING_NOT_SEPARATED_BY_TABS_He) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40505 if (PyDict_SetItem(__pyx_t_5, __pyx_int_26, __pyx_kp_u_WRONG_REF_Wrong_reference_s) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40506 if (PyDict_SetItem(__pyx_t_5, __pyx_int_27, __pyx_kp_u_ERROR_TRAILING_DATA_Numerical_fi) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40507 if (PyDict_SetItem(__pyx_t_5, __pyx_int_28, __pyx_kp_u_BAD_CHR_TAG_Error_calculating_ch) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40508 if (PyDict_SetItem(__pyx_t_5, __pyx_int_29, __pyx_kp_u_ZERO_LENGTH_ALLELE_Found_zero_le) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40509 if (PyDict_SetItem(__pyx_t_5, __pyx_int_30, __pyx_kp_u_MISSING_INDEL_ALLELE_REF_BASE_In) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40510 if (PyDict_SetItem(__pyx_t_5, __pyx_int_31, __pyx_kp_u_ZERO_FOR_NON_FLAG_FIELD_number_s) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40511 if (PyDict_SetItem(__pyx_t_5, __pyx_int_32, __pyx_kp_u_ERROR_FORMAT_NOT_INTEGER_Expecte) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40512 if (PyDict_SetItem(__pyx_t_5, __pyx_int_33, __pyx_kp_u_ERROR_FLAG_HAS_VALUE_Flag_fields) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40513 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_errors, __pyx_t_5) < 0) __PYX_ERR(0, 263, __pyx_L1_error) | |
40514 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40515 | |
40516 /* "pysam/libcvcf.pyx":300 | |
40517 * | |
40518 * # tag-value pairs; tags are not unique; does not include fileformat, INFO, FILTER or FORMAT fields | |
40519 * _header = [] # <<<<<<<<<<<<<< | |
40520 * | |
40521 * # version number; 33=v3.3; 40=v4.0 | |
40522 */ | |
40523 __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) | |
40524 __Pyx_GOTREF(__pyx_t_5); | |
40525 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_header, __pyx_t_5) < 0) __PYX_ERR(0, 300, __pyx_L1_error) | |
40526 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40527 | |
40528 /* "pysam/libcvcf.pyx":303 | |
40529 * | |
40530 * # version number; 33=v3.3; 40=v4.0 | |
40531 * _version = 40 # <<<<<<<<<<<<<< | |
40532 * | |
40533 * # info, filter and format data | |
40534 */ | |
40535 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_version, __pyx_int_40) < 0) __PYX_ERR(0, 303, __pyx_L1_error) | |
40536 | |
40537 /* "pysam/libcvcf.pyx":306 | |
40538 * | |
40539 * # info, filter and format data | |
40540 * _info = {} # <<<<<<<<<<<<<< | |
40541 * _filter = {} | |
40542 * _format = {} | |
40543 */ | |
40544 __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) | |
40545 __Pyx_GOTREF(__pyx_t_5); | |
40546 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_info, __pyx_t_5) < 0) __PYX_ERR(0, 306, __pyx_L1_error) | |
40547 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40548 | |
40549 /* "pysam/libcvcf.pyx":307 | |
40550 * # info, filter and format data | |
40551 * _info = {} | |
40552 * _filter = {} # <<<<<<<<<<<<<< | |
40553 * _format = {} | |
40554 * | |
40555 */ | |
40556 __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error) | |
40557 __Pyx_GOTREF(__pyx_t_5); | |
40558 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_filter, __pyx_t_5) < 0) __PYX_ERR(0, 307, __pyx_L1_error) | |
40559 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40560 | |
40561 /* "pysam/libcvcf.pyx":308 | |
40562 * _info = {} | |
40563 * _filter = {} | |
40564 * _format = {} # <<<<<<<<<<<<<< | |
40565 * | |
40566 * # header; and required columns | |
40567 */ | |
40568 __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) | |
40569 __Pyx_GOTREF(__pyx_t_5); | |
40570 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_format_2, __pyx_t_5) < 0) __PYX_ERR(0, 308, __pyx_L1_error) | |
40571 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40572 | |
40573 /* "pysam/libcvcf.pyx":311 | |
40574 * | |
40575 * # header; and required columns | |
40576 * _required = ["CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO","FORMAT"] # <<<<<<<<<<<<<< | |
40577 * _samples = [] | |
40578 * | |
40579 */ | |
40580 __pyx_t_5 = PyList_New(9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error) | |
40581 __Pyx_GOTREF(__pyx_t_5); | |
40582 __Pyx_INCREF(__pyx_n_u_CHROM); | |
40583 __Pyx_GIVEREF(__pyx_n_u_CHROM); | |
40584 if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_u_CHROM)) __PYX_ERR(0, 311, __pyx_L1_error); | |
40585 __Pyx_INCREF(__pyx_n_u_POS); | |
40586 __Pyx_GIVEREF(__pyx_n_u_POS); | |
40587 if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_u_POS)) __PYX_ERR(0, 311, __pyx_L1_error); | |
40588 __Pyx_INCREF(__pyx_n_u_ID_2); | |
40589 __Pyx_GIVEREF(__pyx_n_u_ID_2); | |
40590 if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_n_u_ID_2)) __PYX_ERR(0, 311, __pyx_L1_error); | |
40591 __Pyx_INCREF(__pyx_n_u_REF); | |
40592 __Pyx_GIVEREF(__pyx_n_u_REF); | |
40593 if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_n_u_REF)) __PYX_ERR(0, 311, __pyx_L1_error); | |
40594 __Pyx_INCREF(__pyx_n_u_ALT); | |
40595 __Pyx_GIVEREF(__pyx_n_u_ALT); | |
40596 if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 4, __pyx_n_u_ALT)) __PYX_ERR(0, 311, __pyx_L1_error); | |
40597 __Pyx_INCREF(__pyx_n_u_QUAL); | |
40598 __Pyx_GIVEREF(__pyx_n_u_QUAL); | |
40599 if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 5, __pyx_n_u_QUAL)) __PYX_ERR(0, 311, __pyx_L1_error); | |
40600 __Pyx_INCREF(__pyx_n_u_FILTER); | |
40601 __Pyx_GIVEREF(__pyx_n_u_FILTER); | |
40602 if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 6, __pyx_n_u_FILTER)) __PYX_ERR(0, 311, __pyx_L1_error); | |
40603 __Pyx_INCREF(__pyx_n_u_INFO); | |
40604 __Pyx_GIVEREF(__pyx_n_u_INFO); | |
40605 if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 7, __pyx_n_u_INFO)) __PYX_ERR(0, 311, __pyx_L1_error); | |
40606 __Pyx_INCREF(__pyx_n_u_FORMAT); | |
40607 __Pyx_GIVEREF(__pyx_n_u_FORMAT); | |
40608 if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 8, __pyx_n_u_FORMAT)) __PYX_ERR(0, 311, __pyx_L1_error); | |
40609 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_required, __pyx_t_5) < 0) __PYX_ERR(0, 311, __pyx_L1_error) | |
40610 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40611 | |
40612 /* "pysam/libcvcf.pyx":312 | |
40613 * # header; and required columns | |
40614 * _required = ["CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO","FORMAT"] | |
40615 * _samples = [] # <<<<<<<<<<<<<< | |
40616 * | |
40617 * # control behaviour | |
40618 */ | |
40619 __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) | |
40620 __Pyx_GOTREF(__pyx_t_5); | |
40621 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_samples, __pyx_t_5) < 0) __PYX_ERR(0, 312, __pyx_L1_error) | |
40622 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40623 | |
40624 /* "pysam/libcvcf.pyx":315 | |
40625 * | |
40626 * # control behaviour | |
40627 * _ignored_errors = set([11,31]) # ERROR_UNKNOWN_KEY, ERROR_ZERO_FOR_NON_FLAG_FIELD # <<<<<<<<<<<<<< | |
40628 * _warn_errors = set([]) | |
40629 * _leftalign = False | |
40630 */ | |
40631 __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error) | |
40632 __Pyx_GOTREF(__pyx_t_5); | |
40633 if (PySet_Add(__pyx_t_5, __pyx_int_11) < 0) __PYX_ERR(0, 315, __pyx_L1_error) | |
40634 if (PySet_Add(__pyx_t_5, __pyx_int_31) < 0) __PYX_ERR(0, 315, __pyx_L1_error) | |
40635 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_ignored_errors, __pyx_t_5) < 0) __PYX_ERR(0, 315, __pyx_L1_error) | |
40636 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40637 | |
40638 /* "pysam/libcvcf.pyx":316 | |
40639 * # control behaviour | |
40640 * _ignored_errors = set([11,31]) # ERROR_UNKNOWN_KEY, ERROR_ZERO_FOR_NON_FLAG_FIELD | |
40641 * _warn_errors = set([]) # <<<<<<<<<<<<<< | |
40642 * _leftalign = False | |
40643 * | |
40644 */ | |
40645 __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) | |
40646 __Pyx_GOTREF(__pyx_t_5); | |
40647 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_warn_errors, __pyx_t_5) < 0) __PYX_ERR(0, 316, __pyx_L1_error) | |
40648 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40649 | |
40650 /* "pysam/libcvcf.pyx":317 | |
40651 * _ignored_errors = set([11,31]) # ERROR_UNKNOWN_KEY, ERROR_ZERO_FOR_NON_FLAG_FIELD | |
40652 * _warn_errors = set([]) | |
40653 * _leftalign = False # <<<<<<<<<<<<<< | |
40654 * | |
40655 * # reference sequence | |
40656 */ | |
40657 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_leftalign_2, Py_False) < 0) __PYX_ERR(0, 317, __pyx_L1_error) | |
40658 | |
40659 /* "pysam/libcvcf.pyx":320 | |
40660 * | |
40661 * # reference sequence | |
40662 * _reference = None # <<<<<<<<<<<<<< | |
40663 * | |
40664 * # regions to include; None includes everything | |
40665 */ | |
40666 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_reference_2, Py_None) < 0) __PYX_ERR(0, 320, __pyx_L1_error) | |
40667 | |
40668 /* "pysam/libcvcf.pyx":323 | |
40669 * | |
40670 * # regions to include; None includes everything | |
40671 * _regions = None # <<<<<<<<<<<<<< | |
40672 * | |
40673 * # statefull stuff | |
40674 */ | |
40675 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_regions_2, Py_None) < 0) __PYX_ERR(0, 323, __pyx_L1_error) | |
40676 | |
40677 /* "pysam/libcvcf.pyx":326 | |
40678 * | |
40679 * # statefull stuff | |
40680 * _lineno = -1 # <<<<<<<<<<<<<< | |
40681 * _line = None | |
40682 * _lines = None | |
40683 */ | |
40684 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_lineno, __pyx_int_neg_1) < 0) __PYX_ERR(0, 326, __pyx_L1_error) | |
40685 | |
40686 /* "pysam/libcvcf.pyx":327 | |
40687 * # statefull stuff | |
40688 * _lineno = -1 | |
40689 * _line = None # <<<<<<<<<<<<<< | |
40690 * _lines = None | |
40691 * | |
40692 */ | |
40693 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_line_2, Py_None) < 0) __PYX_ERR(0, 327, __pyx_L1_error) | |
40694 | |
40695 /* "pysam/libcvcf.pyx":328 | |
40696 * _lineno = -1 | |
40697 * _line = None | |
40698 * _lines = None # <<<<<<<<<<<<<< | |
40699 * | |
40700 * def __init__(self, _copy=None, reference=None, regions=None, | |
40701 */ | |
40702 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_lines_2, Py_None) < 0) __PYX_ERR(0, 328, __pyx_L1_error) | |
40703 | |
40704 /* "pysam/libcvcf.pyx":330 | |
40705 * _lines = None | |
40706 * | |
40707 * def __init__(self, _copy=None, reference=None, regions=None, # <<<<<<<<<<<<<< | |
40708 * lines=None, leftalign=False): | |
40709 * # make error identifiers accessible by name | |
40710 */ | |
40711 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_1__init__, 0, __pyx_n_s_VCF___init, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) | |
40712 __Pyx_GOTREF(__pyx_t_5); | |
40713 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__56); | |
40714 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 330, __pyx_L1_error) | |
40715 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40716 | |
40717 /* "pysam/libcvcf.pyx":355 | |
40718 * self.tabixfile = None | |
40719 * | |
40720 * def error(self,line,error,opt=None): # <<<<<<<<<<<<<< | |
40721 * if error in self._ignored_errors: return | |
40722 * errorlabel, errorstring = self._errors[error].split(':') | |
40723 */ | |
40724 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_3error, 0, __pyx_n_s_VCF_error, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error) | |
40725 __Pyx_GOTREF(__pyx_t_5); | |
40726 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__44); | |
40727 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_error, __pyx_t_5) < 0) __PYX_ERR(0, 355, __pyx_L1_error) | |
40728 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40729 | |
40730 /* "pysam/libcvcf.pyx":364 | |
40731 * raise ValueError(errorstring) | |
40732 * | |
40733 * def parse_format(self,line,format,filter=False): # <<<<<<<<<<<<<< | |
40734 * if self._version == 40: | |
40735 * if not format.startswith('<'): | |
40736 */ | |
40737 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_5parse_format, 0, __pyx_n_s_VCF_parse_format, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error) | |
40738 __Pyx_GOTREF(__pyx_t_5); | |
40739 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__61); | |
40740 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_parse_format, __pyx_t_5) < 0) __PYX_ERR(0, 364, __pyx_L1_error) | |
40741 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40742 | |
40743 /* "pysam/libcvcf.pyx":436 | |
40744 * return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing']) | |
40745 * | |
40746 * def format_format( self, fmt, filter=False ): # <<<<<<<<<<<<<< | |
40747 * values = [('ID',fmt.id)] | |
40748 * if fmt.number != None and not filter: | |
40749 */ | |
40750 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_7format_format, 0, __pyx_n_s_VCF_format_format, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error) | |
40751 __Pyx_GOTREF(__pyx_t_5); | |
40752 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__61); | |
40753 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_format_format, __pyx_t_5) < 0) __PYX_ERR(0, 436, __pyx_L1_error) | |
40754 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40755 | |
40756 /* "pysam/libcvcf.pyx":456 | |
40757 * return format | |
40758 * | |
40759 * def get_expected(self, format, formatdict, alt): # <<<<<<<<<<<<<< | |
40760 * fmt = formatdict[format] | |
40761 * if fmt.numbertype == self.NT_UNKNOWN: return -1 | |
40762 */ | |
40763 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_9get_expected, 0, __pyx_n_s_VCF_get_expected, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) | |
40764 __Pyx_GOTREF(__pyx_t_5); | |
40765 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_get_expected, __pyx_t_5) < 0) __PYX_ERR(0, 456, __pyx_L1_error) | |
40766 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40767 | |
40768 /* "pysam/libcvcf.pyx":467 | |
40769 * | |
40770 * | |
40771 * def _add_definition(self, formatdict, key, data, line ): # <<<<<<<<<<<<<< | |
40772 * if key in formatdict: return | |
40773 * self.error(line,self.ERROR_UNKNOWN_KEY,key) | |
40774 */ | |
40775 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_11_add_definition, 0, __pyx_n_s_VCF__add_definition, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error) | |
40776 __Pyx_GOTREF(__pyx_t_5); | |
40777 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_add_definition, __pyx_t_5) < 0) __PYX_ERR(0, 467, __pyx_L1_error) | |
40778 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40779 | |
40780 /* "pysam/libcvcf.pyx":484 | |
40781 * | |
40782 * # todo: trim trailing missing values | |
40783 * def format_formatdata( self, data, format, key=True, value=True, separator=":" ): # <<<<<<<<<<<<<< | |
40784 * output, sdata = [], [] | |
40785 * if type(data) == type([]): # for FORMAT field, make data with dummy values | |
40786 */ | |
40787 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_13format_formatdata, 0, __pyx_n_s_VCF_format_formatdata, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error) | |
40788 __Pyx_GOTREF(__pyx_t_5); | |
40789 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__70); | |
40790 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_format_formatdata, __pyx_t_5) < 0) __PYX_ERR(0, 484, __pyx_L1_error) | |
40791 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40792 | |
40793 /* "pysam/libcvcf.pyx":518 | |
40794 * | |
40795 * | |
40796 * def enter_default_format(self): # <<<<<<<<<<<<<< | |
40797 * for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'), | |
40798 * FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1), | |
40799 */ | |
40800 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_15enter_default_format, 0, __pyx_n_s_VCF_enter_default_format, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error) | |
40801 __Pyx_GOTREF(__pyx_t_5); | |
40802 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_enter_default_format, __pyx_t_5) < 0) __PYX_ERR(0, 518, __pyx_L1_error) | |
40803 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40804 | |
40805 /* "pysam/libcvcf.pyx":537 | |
40806 * self._format[f.id] = f | |
40807 * | |
40808 * def parse_header(self, line): # <<<<<<<<<<<<<< | |
40809 * | |
40810 * assert line.startswith('##') | |
40811 */ | |
40812 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_17parse_header, 0, __pyx_n_s_VCF_parse_header, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error) | |
40813 __Pyx_GOTREF(__pyx_t_5); | |
40814 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_parse_header, __pyx_t_5) < 0) __PYX_ERR(0, 537, __pyx_L1_error) | |
40815 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40816 | |
40817 /* "pysam/libcvcf.pyx":570 | |
40818 * | |
40819 * | |
40820 * def write_header( self, stream ): # <<<<<<<<<<<<<< | |
40821 * stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10)) | |
40822 * for key,value in self._header: stream.write("##%s=%s\n" % (key,value)) | |
40823 */ | |
40824 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_19write_header, 0, __pyx_n_s_VCF_write_header, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) | |
40825 __Pyx_GOTREF(__pyx_t_5); | |
40826 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_write_header, __pyx_t_5) < 0) __PYX_ERR(0, 570, __pyx_L1_error) | |
40827 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40828 | |
40829 /* "pysam/libcvcf.pyx":577 | |
40830 * | |
40831 * | |
40832 * def parse_heading( self, line ): # <<<<<<<<<<<<<< | |
40833 * assert line.startswith('#') | |
40834 * assert not line.startswith('##') | |
40835 */ | |
40836 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_21parse_heading, 0, __pyx_n_s_VCF_parse_heading, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error) | |
40837 __Pyx_GOTREF(__pyx_t_5); | |
40838 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_parse_heading, __pyx_t_5) < 0) __PYX_ERR(0, 577, __pyx_L1_error) | |
40839 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40840 | |
40841 /* "pysam/libcvcf.pyx":605 | |
40842 * self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] ) | |
40843 * | |
40844 * def write_heading( self, stream ): # <<<<<<<<<<<<<< | |
40845 * stream.write("#" + "\t".join(self._required + self._samples) + "\n") | |
40846 * | |
40847 */ | |
40848 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_23write_heading, 0, __pyx_n_s_VCF_write_heading, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 605, __pyx_L1_error) | |
40849 __Pyx_GOTREF(__pyx_t_5); | |
40850 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_write_heading, __pyx_t_5) < 0) __PYX_ERR(0, 605, __pyx_L1_error) | |
40851 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40852 | |
40853 /* "pysam/libcvcf.pyx":608 | |
40854 * stream.write("#" + "\t".join(self._required + self._samples) + "\n") | |
40855 * | |
40856 * def convertGT(self, GTstring): # <<<<<<<<<<<<<< | |
40857 * if GTstring == ".": return ["."] | |
40858 * try: | |
40859 */ | |
40860 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_25convertGT, 0, __pyx_n_s_VCF_convertGT, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) | |
40861 __Pyx_GOTREF(__pyx_t_5); | |
40862 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_convertGT, __pyx_t_5) < 0) __PYX_ERR(0, 608, __pyx_L1_error) | |
40863 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40864 | |
40865 /* "pysam/libcvcf.pyx":620 | |
40866 * return [".","|","."] | |
40867 * | |
40868 * def convertGTback(self, GTdata): # <<<<<<<<<<<<<< | |
40869 * return ''.join(map(str,GTdata)) | |
40870 * | |
40871 */ | |
40872 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_27convertGTback, 0, __pyx_n_s_VCF_convertGTback, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) | |
40873 __Pyx_GOTREF(__pyx_t_5); | |
40874 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_convertGTback, __pyx_t_5) < 0) __PYX_ERR(0, 620, __pyx_L1_error) | |
40875 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40876 | |
40877 /* "pysam/libcvcf.pyx":623 | |
40878 * return ''.join(map(str,GTdata)) | |
40879 * | |
40880 * def parse_formatdata( self, key, value, formatdict, line ): # <<<<<<<<<<<<<< | |
40881 * # To do: check that the right number of values is present | |
40882 * f = formatdict.get(key,None) | |
40883 */ | |
40884 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_29parse_formatdata, 0, __pyx_n_s_VCF_parse_formatdata, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error) | |
40885 __Pyx_GOTREF(__pyx_t_5); | |
40886 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_parse_formatdata, __pyx_t_5) < 0) __PYX_ERR(0, 623, __pyx_L1_error) | |
40887 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40888 | |
40889 /* "pysam/libcvcf.pyx":665 | |
40890 * self.error(line,self.ERROR_INFO_STRING) | |
40891 * | |
40892 * def inregion(self, chrom, pos): # <<<<<<<<<<<<<< | |
40893 * if not self._regions: return True | |
40894 * for r in self._regions: | |
40895 */ | |
40896 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_31inregion, 0, __pyx_n_s_VCF_inregion, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L1_error) | |
40897 __Pyx_GOTREF(__pyx_t_5); | |
40898 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_inregion, __pyx_t_5) < 0) __PYX_ERR(0, 665, __pyx_L1_error) | |
40899 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40900 | |
40901 /* "pysam/libcvcf.pyx":671 | |
40902 * return False | |
40903 * | |
40904 * def parse_data( self, line, lineparse=False ): # <<<<<<<<<<<<<< | |
40905 * cols = line.split('\t') | |
40906 * if len(cols) != len(self._samples)+9: | |
40907 */ | |
40908 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_33parse_data, 0, __pyx_n_s_VCF_parse_data, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L1_error) | |
40909 __Pyx_GOTREF(__pyx_t_5); | |
40910 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__61); | |
40911 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_parse_data, __pyx_t_5) < 0) __PYX_ERR(0, 671, __pyx_L1_error) | |
40912 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40913 | |
40914 /* "pysam/libcvcf.pyx":883 | |
40915 * | |
40916 * | |
40917 * def write_data(self, stream, data): # <<<<<<<<<<<<<< | |
40918 * required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples | |
40919 * for k in required: | |
40920 */ | |
40921 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_35write_data, 0, __pyx_n_s_VCF_write_data, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 883, __pyx_L1_error) | |
40922 __Pyx_GOTREF(__pyx_t_5); | |
40923 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_write_data, __pyx_t_5) < 0) __PYX_ERR(0, 883, __pyx_L1_error) | |
40924 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40925 | |
40926 /* "pysam/libcvcf.pyx":915 | |
40927 * stream.write( "\t".join(output) + "\n" ) | |
40928 * | |
40929 * def _parse_header(self, stream): # <<<<<<<<<<<<<< | |
40930 * self._lineno = 0 | |
40931 * for line in stream: | |
40932 */ | |
40933 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_37_parse_header, 0, __pyx_n_s_VCF__parse_header, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __pyx_L1_error) | |
40934 __Pyx_GOTREF(__pyx_t_5); | |
40935 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_parse_header_2, __pyx_t_5) < 0) __PYX_ERR(0, 915, __pyx_L1_error) | |
40936 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40937 | |
40938 /* "pysam/libcvcf.pyx":929 | |
40939 * return line | |
40940 * | |
40941 * def _parse(self, line, stream): # <<<<<<<<<<<<<< | |
40942 * # deal with files with header only | |
40943 * if line.startswith("##"): return | |
40944 */ | |
40945 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_39_parse, 0, __pyx_n_s_VCF__parse, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 929, __pyx_L1_error) | |
40946 __Pyx_GOTREF(__pyx_t_5); | |
40947 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_parse, __pyx_t_5) < 0) __PYX_ERR(0, 929, __pyx_L1_error) | |
40948 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40949 | |
40950 /* "pysam/libcvcf.pyx":947 | |
40951 * ###################################################################################################### | |
40952 * | |
40953 * def getsamples(self): # <<<<<<<<<<<<<< | |
40954 * """ List of samples in VCF file """ | |
40955 * return self._samples | |
40956 */ | |
40957 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_42getsamples, 0, __pyx_n_s_VCF_getsamples, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 947, __pyx_L1_error) | |
40958 __Pyx_GOTREF(__pyx_t_5); | |
40959 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_getsamples, __pyx_t_5) < 0) __PYX_ERR(0, 947, __pyx_L1_error) | |
40960 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40961 | |
40962 /* "pysam/libcvcf.pyx":951 | |
40963 * return self._samples | |
40964 * | |
40965 * def setsamples(self,samples): # <<<<<<<<<<<<<< | |
40966 * """ List of samples in VCF file """ | |
40967 * self._samples = samples | |
40968 */ | |
40969 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_44setsamples, 0, __pyx_n_s_VCF_setsamples, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error) | |
40970 __Pyx_GOTREF(__pyx_t_5); | |
40971 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_setsamples, __pyx_t_5) < 0) __PYX_ERR(0, 951, __pyx_L1_error) | |
40972 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40973 | |
40974 /* "pysam/libcvcf.pyx":955 | |
40975 * self._samples = samples | |
40976 * | |
40977 * def getheader(self): # <<<<<<<<<<<<<< | |
40978 * """ List of header key-value pairs (strings) """ | |
40979 * return self._header | |
40980 */ | |
40981 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_46getheader, 0, __pyx_n_s_VCF_getheader, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error) | |
40982 __Pyx_GOTREF(__pyx_t_5); | |
40983 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_getheader, __pyx_t_5) < 0) __PYX_ERR(0, 955, __pyx_L1_error) | |
40984 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40985 | |
40986 /* "pysam/libcvcf.pyx":959 | |
40987 * return self._header | |
40988 * | |
40989 * def setheader(self,header): # <<<<<<<<<<<<<< | |
40990 * """ List of header key-value pairs (strings) """ | |
40991 * self._header = header | |
40992 */ | |
40993 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_48setheader, 0, __pyx_n_s_VCF_setheader, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error) | |
40994 __Pyx_GOTREF(__pyx_t_5); | |
40995 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_setheader, __pyx_t_5) < 0) __PYX_ERR(0, 959, __pyx_L1_error) | |
40996 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
40997 | |
40998 /* "pysam/libcvcf.pyx":963 | |
40999 * self._header = header | |
41000 * | |
41001 * def getinfo(self): # <<<<<<<<<<<<<< | |
41002 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
41003 * return self._info | |
41004 */ | |
41005 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_50getinfo, 0, __pyx_n_s_VCF_getinfo, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __pyx_L1_error) | |
41006 __Pyx_GOTREF(__pyx_t_5); | |
41007 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_getinfo, __pyx_t_5) < 0) __PYX_ERR(0, 963, __pyx_L1_error) | |
41008 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41009 | |
41010 /* "pysam/libcvcf.pyx":967 | |
41011 * return self._info | |
41012 * | |
41013 * def setinfo(self,info): # <<<<<<<<<<<<<< | |
41014 * """ Dictionary of ##INFO tags, as VCF.FORMAT values """ | |
41015 * self._info = info | |
41016 */ | |
41017 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_52setinfo, 0, __pyx_n_s_VCF_setinfo, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __pyx_L1_error) | |
41018 __Pyx_GOTREF(__pyx_t_5); | |
41019 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_setinfo, __pyx_t_5) < 0) __PYX_ERR(0, 967, __pyx_L1_error) | |
41020 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41021 | |
41022 /* "pysam/libcvcf.pyx":971 | |
41023 * self._info = info | |
41024 * | |
41025 * def getformat(self): # <<<<<<<<<<<<<< | |
41026 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
41027 * return self._format | |
41028 */ | |
41029 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_54getformat, 0, __pyx_n_s_VCF_getformat, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 971, __pyx_L1_error) | |
41030 __Pyx_GOTREF(__pyx_t_5); | |
41031 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_getformat, __pyx_t_5) < 0) __PYX_ERR(0, 971, __pyx_L1_error) | |
41032 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41033 | |
41034 /* "pysam/libcvcf.pyx":975 | |
41035 * return self._format | |
41036 * | |
41037 * def setformat(self,format): # <<<<<<<<<<<<<< | |
41038 * """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """ | |
41039 * self._format = format | |
41040 */ | |
41041 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_56setformat, 0, __pyx_n_s_VCF_setformat, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 975, __pyx_L1_error) | |
41042 __Pyx_GOTREF(__pyx_t_5); | |
41043 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_setformat, __pyx_t_5) < 0) __PYX_ERR(0, 975, __pyx_L1_error) | |
41044 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41045 | |
41046 /* "pysam/libcvcf.pyx":979 | |
41047 * self._format = format | |
41048 * | |
41049 * def getfilter(self): # <<<<<<<<<<<<<< | |
41050 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
41051 * return self._filter | |
41052 */ | |
41053 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_58getfilter, 0, __pyx_n_s_VCF_getfilter, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error) | |
41054 __Pyx_GOTREF(__pyx_t_5); | |
41055 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_getfilter, __pyx_t_5) < 0) __PYX_ERR(0, 979, __pyx_L1_error) | |
41056 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41057 | |
41058 /* "pysam/libcvcf.pyx":983 | |
41059 * return self._filter | |
41060 * | |
41061 * def setfilter(self,filter): # <<<<<<<<<<<<<< | |
41062 * """ Dictionary of ##FILTER tags, as VCF.FORMAT values """ | |
41063 * self._filter = filter | |
41064 */ | |
41065 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_60setfilter, 0, __pyx_n_s_VCF_setfilter, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 983, __pyx_L1_error) | |
41066 __Pyx_GOTREF(__pyx_t_5); | |
41067 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_setfilter, __pyx_t_5) < 0) __PYX_ERR(0, 983, __pyx_L1_error) | |
41068 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41069 | |
41070 /* "pysam/libcvcf.pyx":987 | |
41071 * self._filter = filter | |
41072 * | |
41073 * def setversion(self, version): # <<<<<<<<<<<<<< | |
41074 * if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files") | |
41075 * self._version = version | |
41076 */ | |
41077 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_62setversion, 0, __pyx_n_s_VCF_setversion, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 987, __pyx_L1_error) | |
41078 __Pyx_GOTREF(__pyx_t_5); | |
41079 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_setversion, __pyx_t_5) < 0) __PYX_ERR(0, 987, __pyx_L1_error) | |
41080 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41081 | |
41082 /* "pysam/libcvcf.pyx":991 | |
41083 * self._version = version | |
41084 * | |
41085 * def setregions(self, regions): # <<<<<<<<<<<<<< | |
41086 * self._regions = regions | |
41087 * | |
41088 */ | |
41089 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_64setregions, 0, __pyx_n_s_VCF_setregions, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 991, __pyx_L1_error) | |
41090 __Pyx_GOTREF(__pyx_t_5); | |
41091 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_setregions, __pyx_t_5) < 0) __PYX_ERR(0, 991, __pyx_L1_error) | |
41092 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41093 | |
41094 /* "pysam/libcvcf.pyx":994 | |
41095 * self._regions = regions | |
41096 * | |
41097 * def setreference(self, ref): # <<<<<<<<<<<<<< | |
41098 * """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """ | |
41099 * self._reference = ref | |
41100 */ | |
41101 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_66setreference, 0, __pyx_n_s_VCF_setreference, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 994, __pyx_L1_error) | |
41102 __Pyx_GOTREF(__pyx_t_5); | |
41103 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_setreference, __pyx_t_5) < 0) __PYX_ERR(0, 994, __pyx_L1_error) | |
41104 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41105 | |
41106 /* "pysam/libcvcf.pyx":998 | |
41107 * self._reference = ref | |
41108 * | |
41109 * def ignoreerror(self, errorstring): # <<<<<<<<<<<<<< | |
41110 * try: self._ignored_errors.add(self.__dict__[errorstring]) | |
41111 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
41112 */ | |
41113 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_68ignoreerror, 0, __pyx_n_s_VCF_ignoreerror, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error) | |
41114 __Pyx_GOTREF(__pyx_t_5); | |
41115 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_ignoreerror, __pyx_t_5) < 0) __PYX_ERR(0, 998, __pyx_L1_error) | |
41116 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41117 | |
41118 /* "pysam/libcvcf.pyx":1002 | |
41119 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
41120 * | |
41121 * def warnerror(self, errorstring): # <<<<<<<<<<<<<< | |
41122 * try: self._warn_errors.add(self.__dict__[errorstring]) | |
41123 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
41124 */ | |
41125 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_70warnerror, 0, __pyx_n_s_VCF_warnerror, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1002, __pyx_L1_error) | |
41126 __Pyx_GOTREF(__pyx_t_5); | |
41127 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_warnerror, __pyx_t_5) < 0) __PYX_ERR(0, 1002, __pyx_L1_error) | |
41128 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41129 | |
41130 /* "pysam/libcvcf.pyx":1006 | |
41131 * except KeyError: raise ValueError("Invalid error string: %s" % errorstring) | |
41132 * | |
41133 * def parse(self, stream): # <<<<<<<<<<<<<< | |
41134 * """ Parse a stream of VCF-formatted lines. Initializes class instance and return generator """ | |
41135 * last_line = self._parse_header(stream) | |
41136 */ | |
41137 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_72parse, 0, __pyx_n_s_VCF_parse, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1006, __pyx_L1_error) | |
41138 __Pyx_GOTREF(__pyx_t_5); | |
41139 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_parse_2, __pyx_t_5) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) | |
41140 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41141 | |
41142 /* "pysam/libcvcf.pyx":1013 | |
41143 * return self._parse(last_line, stream) | |
41144 * | |
41145 * def write(self, stream, datagenerator): # <<<<<<<<<<<<<< | |
41146 * """ Writes a VCF file to a stream, using a data generator (or list) """ | |
41147 * self.write_header(stream) | |
41148 */ | |
41149 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_74write, 0, __pyx_n_s_VCF_write, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1013, __pyx_L1_error) | |
41150 __Pyx_GOTREF(__pyx_t_5); | |
41151 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_write, __pyx_t_5) < 0) __PYX_ERR(0, 1013, __pyx_L1_error) | |
41152 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41153 | |
41154 /* "pysam/libcvcf.pyx":1019 | |
41155 * for data in datagenerator: self.write_data(stream,data) | |
41156 * | |
41157 * def writeheader(self, stream): # <<<<<<<<<<<<<< | |
41158 * """ Writes a VCF header """ | |
41159 * self.write_header(stream) | |
41160 */ | |
41161 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_76writeheader, 0, __pyx_n_s_VCF_writeheader, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1019, __pyx_L1_error) | |
41162 __Pyx_GOTREF(__pyx_t_5); | |
41163 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_writeheader, __pyx_t_5) < 0) __PYX_ERR(0, 1019, __pyx_L1_error) | |
41164 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41165 | |
41166 /* "pysam/libcvcf.pyx":1024 | |
41167 * self.write_heading(stream) | |
41168 * | |
41169 * def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2): # <<<<<<<<<<<<<< | |
41170 * """ Utility function: compares two calls for equality """ | |
41171 * # a variant should always be assigned to a unique position, one base before | |
41172 */ | |
41173 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_78compare_calls, 0, __pyx_n_s_VCF_compare_calls, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1024, __pyx_L1_error) | |
41174 __Pyx_GOTREF(__pyx_t_5); | |
41175 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_compare_calls, __pyx_t_5) < 0) __PYX_ERR(0, 1024, __pyx_L1_error) | |
41176 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41177 | |
41178 /* "pysam/libcvcf.pyx":1046 | |
41179 * ########################################################################################################### | |
41180 * | |
41181 * def connect(self, filename, encoding="ascii"): # <<<<<<<<<<<<<< | |
41182 * '''connect to tabix file.''' | |
41183 * self.encoding=encoding | |
41184 */ | |
41185 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_80connect, 0, __pyx_n_s_VCF_connect, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1046, __pyx_L1_error) | |
41186 __Pyx_GOTREF(__pyx_t_5); | |
41187 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__129); | |
41188 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_connect, __pyx_t_5) < 0) __PYX_ERR(0, 1046, __pyx_L1_error) | |
41189 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41190 | |
41191 /* "pysam/libcvcf.pyx":1052 | |
41192 * self._parse_header(self.tabixfile.header) | |
41193 * | |
41194 * def __del__(self): # <<<<<<<<<<<<<< | |
41195 * self.close() | |
41196 * self.tabixfile = None | |
41197 */ | |
41198 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_82__del__, 0, __pyx_n_s_VCF___del, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) | |
41199 __Pyx_GOTREF(__pyx_t_5); | |
41200 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_del, __pyx_t_5) < 0) __PYX_ERR(0, 1052, __pyx_L1_error) | |
41201 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41202 | |
41203 /* "pysam/libcvcf.pyx":1056 | |
41204 * self.tabixfile = None | |
41205 * | |
41206 * def close(self): # <<<<<<<<<<<<<< | |
41207 * if self.tabixfile: | |
41208 * self.tabixfile.close() | |
41209 */ | |
41210 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_84close, 0, __pyx_n_s_VCF_close, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1056, __pyx_L1_error) | |
41211 __Pyx_GOTREF(__pyx_t_5); | |
41212 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_close, __pyx_t_5) < 0) __PYX_ERR(0, 1056, __pyx_L1_error) | |
41213 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41214 | |
41215 /* "pysam/libcvcf.pyx":1061 | |
41216 * self.tabixfile = None | |
41217 * | |
41218 * def fetch(self, # <<<<<<<<<<<<<< | |
41219 * reference=None, | |
41220 * start=None, | |
41221 */ | |
41222 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_86fetch, 0, __pyx_n_s_VCF_fetch, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1061, __pyx_L1_error) | |
41223 __Pyx_GOTREF(__pyx_t_5); | |
41224 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__134); | |
41225 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_fetch, __pyx_t_5) < 0) __PYX_ERR(0, 1061, __pyx_L1_error) | |
41226 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41227 | |
41228 /* "pysam/libcvcf.pyx":1075 | |
41229 * parser = asVCFRecord(self)) | |
41230 * | |
41231 * def validate(self, record): # <<<<<<<<<<<<<< | |
41232 * '''validate vcf record. | |
41233 * | |
41234 */ | |
41235 __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_3VCF_88validate, 0, __pyx_n_s_VCF_validate, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1075, __pyx_L1_error) | |
41236 __Pyx_GOTREF(__pyx_t_5); | |
41237 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_validate, __pyx_t_5) < 0) __PYX_ERR(0, 1075, __pyx_L1_error) | |
41238 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41239 | |
41240 /* "pysam/libcvcf.pyx":253 | |
41241 * return r | |
41242 * | |
41243 * class VCF(object): # <<<<<<<<<<<<<< | |
41244 * | |
41245 * # types | |
41246 */ | |
41247 __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_VCF, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) | |
41248 __Pyx_GOTREF(__pyx_t_5); | |
41249 if (PyDict_SetItem(__pyx_d, __pyx_n_s_VCF, __pyx_t_5) < 0) __PYX_ERR(0, 253, __pyx_L1_error) | |
41250 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
41251 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
41252 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
41253 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
41254 | |
41255 /* "pysam/libcvcf.pyx":1202 | |
41256 * pos -= 1 | |
41257 * | |
41258 * __all__ = [ # <<<<<<<<<<<<<< | |
41259 * "VCF", "VCFRecord", ] | |
41260 */ | |
41261 __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) | |
41262 __Pyx_GOTREF(__pyx_t_3); | |
41263 __Pyx_INCREF(__pyx_n_u_VCF); | |
41264 __Pyx_GIVEREF(__pyx_n_u_VCF); | |
41265 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_VCF)) __PYX_ERR(0, 1202, __pyx_L1_error); | |
41266 __Pyx_INCREF(__pyx_n_u_VCFRecord); | |
41267 __Pyx_GIVEREF(__pyx_n_u_VCFRecord); | |
41268 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_VCFRecord)) __PYX_ERR(0, 1202, __pyx_L1_error); | |
41269 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_3) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) | |
41270 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
41271 | |
41272 /* "(tree fragment)":1 | |
41273 * def __pyx_unpickle_asVCFRecord(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
41274 * cdef object __pyx_PickleError | |
41275 * cdef object __pyx_result | |
41276 */ | |
41277 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_7libcvcf_5__pyx_unpickle_asVCFRecord, 0, __pyx_n_s_pyx_unpickle_asVCFRecord, NULL, __pyx_n_s_pysam_libcvcf, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
41278 __Pyx_GOTREF(__pyx_t_3); | |
41279 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_asVCFRecord, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
41280 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
41281 | |
41282 /* "pysam/libcvcf.pyx":1 | |
41283 * # cython: embedsignature=True # <<<<<<<<<<<<<< | |
41284 * # | |
41285 * # Code to read, write and edit VCF files | |
41286 */ | |
41287 __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) | |
41288 __Pyx_GOTREF(__pyx_t_3); | |
41289 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
41290 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
41291 | |
41292 /*--- Wrapped vars code ---*/ | |
41293 | |
41294 goto __pyx_L0; | |
41295 __pyx_L1_error:; | |
41296 __Pyx_XDECREF(__pyx_t_2); | |
41297 __Pyx_XDECREF(__pyx_t_3); | |
41298 __Pyx_XDECREF(__pyx_t_4); | |
41299 __Pyx_XDECREF(__pyx_t_5); | |
41300 if (__pyx_m) { | |
41301 if (__pyx_d && stringtab_initialized) { | |
41302 __Pyx_AddTraceback("init pysam.libcvcf", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
41303 } | |
41304 #if !CYTHON_USE_MODULE_STATE | |
41305 Py_CLEAR(__pyx_m); | |
41306 #else | |
41307 Py_DECREF(__pyx_m); | |
41308 if (pystate_addmodule_run) { | |
41309 PyObject *tp, *value, *tb; | |
41310 PyErr_Fetch(&tp, &value, &tb); | |
41311 PyState_RemoveModule(&__pyx_moduledef); | |
41312 PyErr_Restore(tp, value, tb); | |
41313 } | |
41314 #endif | |
41315 } else if (!PyErr_Occurred()) { | |
41316 PyErr_SetString(PyExc_ImportError, "init pysam.libcvcf"); | |
41317 } | |
41318 __pyx_L0:; | |
41319 __Pyx_RefNannyFinishContext(); | |
41320 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
41321 return (__pyx_m != NULL) ? 0 : -1; | |
41322 #elif PY_MAJOR_VERSION >= 3 | |
41323 return __pyx_m; | |
41324 #else | |
41325 return; | |
41326 #endif | |
41327 } | |
41328 /* #### Code section: cleanup_globals ### */ | |
41329 /* #### Code section: cleanup_module ### */ | |
41330 /* #### Code section: main_method ### */ | |
41331 /* #### Code section: utility_code_pragmas ### */ | |
41332 #ifdef _MSC_VER | |
41333 #pragma warning( push ) | |
41334 /* Warning 4127: conditional expression is constant | |
41335 * Cython uses constant conditional expressions to allow in inline functions to be optimized at | |
41336 * compile-time, so this warning is not useful | |
41337 */ | |
41338 #pragma warning( disable : 4127 ) | |
41339 #endif | |
41340 | |
41341 | |
41342 | |
41343 /* #### Code section: utility_code_def ### */ | |
41344 | |
41345 /* --- Runtime support code --- */ | |
41346 /* Refnanny */ | |
41347 #if CYTHON_REFNANNY | |
41348 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { | |
41349 PyObject *m = NULL, *p = NULL; | |
41350 void *r = NULL; | |
41351 m = PyImport_ImportModule(modname); | |
41352 if (!m) goto end; | |
41353 p = PyObject_GetAttrString(m, "RefNannyAPI"); | |
41354 if (!p) goto end; | |
41355 r = PyLong_AsVoidPtr(p); | |
41356 end: | |
41357 Py_XDECREF(p); | |
41358 Py_XDECREF(m); | |
41359 return (__Pyx_RefNannyAPIStruct *)r; | |
41360 } | |
41361 #endif | |
41362 | |
41363 /* PyErrExceptionMatches */ | |
41364 #if CYTHON_FAST_THREAD_STATE | |
41365 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { | |
41366 Py_ssize_t i, n; | |
41367 n = PyTuple_GET_SIZE(tuple); | |
41368 #if PY_MAJOR_VERSION >= 3 | |
41369 for (i=0; i<n; i++) { | |
41370 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; | |
41371 } | |
41372 #endif | |
41373 for (i=0; i<n; i++) { | |
41374 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1; | |
41375 } | |
41376 return 0; | |
41377 } | |
41378 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { | |
41379 int result; | |
41380 PyObject *exc_type; | |
41381 #if PY_VERSION_HEX >= 0x030C00A6 | |
41382 PyObject *current_exception = tstate->current_exception; | |
41383 if (unlikely(!current_exception)) return 0; | |
41384 exc_type = (PyObject*) Py_TYPE(current_exception); | |
41385 if (exc_type == err) return 1; | |
41386 #else | |
41387 exc_type = tstate->curexc_type; | |
41388 if (exc_type == err) return 1; | |
41389 if (unlikely(!exc_type)) return 0; | |
41390 #endif | |
41391 #if CYTHON_AVOID_BORROWED_REFS | |
41392 Py_INCREF(exc_type); | |
41393 #endif | |
41394 if (unlikely(PyTuple_Check(err))) { | |
41395 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); | |
41396 } else { | |
41397 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); | |
41398 } | |
41399 #if CYTHON_AVOID_BORROWED_REFS | |
41400 Py_DECREF(exc_type); | |
41401 #endif | |
41402 return result; | |
41403 } | |
41404 #endif | |
41405 | |
41406 /* PyErrFetchRestore */ | |
41407 #if CYTHON_FAST_THREAD_STATE | |
41408 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { | |
41409 #if PY_VERSION_HEX >= 0x030C00A6 | |
41410 PyObject *tmp_value; | |
41411 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); | |
41412 if (value) { | |
41413 #if CYTHON_COMPILING_IN_CPYTHON | |
41414 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) | |
41415 #endif | |
41416 PyException_SetTraceback(value, tb); | |
41417 } | |
41418 tmp_value = tstate->current_exception; | |
41419 tstate->current_exception = value; | |
41420 Py_XDECREF(tmp_value); | |
41421 Py_XDECREF(type); | |
41422 Py_XDECREF(tb); | |
41423 #else | |
41424 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
41425 tmp_type = tstate->curexc_type; | |
41426 tmp_value = tstate->curexc_value; | |
41427 tmp_tb = tstate->curexc_traceback; | |
41428 tstate->curexc_type = type; | |
41429 tstate->curexc_value = value; | |
41430 tstate->curexc_traceback = tb; | |
41431 Py_XDECREF(tmp_type); | |
41432 Py_XDECREF(tmp_value); | |
41433 Py_XDECREF(tmp_tb); | |
41434 #endif | |
41435 } | |
41436 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { | |
41437 #if PY_VERSION_HEX >= 0x030C00A6 | |
41438 PyObject* exc_value; | |
41439 exc_value = tstate->current_exception; | |
41440 tstate->current_exception = 0; | |
41441 *value = exc_value; | |
41442 *type = NULL; | |
41443 *tb = NULL; | |
41444 if (exc_value) { | |
41445 *type = (PyObject*) Py_TYPE(exc_value); | |
41446 Py_INCREF(*type); | |
41447 #if CYTHON_COMPILING_IN_CPYTHON | |
41448 *tb = ((PyBaseExceptionObject*) exc_value)->traceback; | |
41449 Py_XINCREF(*tb); | |
41450 #else | |
41451 *tb = PyException_GetTraceback(exc_value); | |
41452 #endif | |
41453 } | |
41454 #else | |
41455 *type = tstate->curexc_type; | |
41456 *value = tstate->curexc_value; | |
41457 *tb = tstate->curexc_traceback; | |
41458 tstate->curexc_type = 0; | |
41459 tstate->curexc_value = 0; | |
41460 tstate->curexc_traceback = 0; | |
41461 #endif | |
41462 } | |
41463 #endif | |
41464 | |
41465 /* PyObjectGetAttrStr */ | |
41466 #if CYTHON_USE_TYPE_SLOTS | |
41467 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { | |
41468 PyTypeObject* tp = Py_TYPE(obj); | |
41469 if (likely(tp->tp_getattro)) | |
41470 return tp->tp_getattro(obj, attr_name); | |
41471 #if PY_MAJOR_VERSION < 3 | |
41472 if (likely(tp->tp_getattr)) | |
41473 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); | |
41474 #endif | |
41475 return PyObject_GetAttr(obj, attr_name); | |
41476 } | |
41477 #endif | |
41478 | |
41479 /* PyObjectGetAttrStrNoError */ | |
41480 #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 | |
41481 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { | |
41482 __Pyx_PyThreadState_declare | |
41483 __Pyx_PyThreadState_assign | |
41484 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) | |
41485 __Pyx_PyErr_Clear(); | |
41486 } | |
41487 #endif | |
41488 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { | |
41489 PyObject *result; | |
41490 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 | |
41491 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); | |
41492 return result; | |
41493 #else | |
41494 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 | |
41495 PyTypeObject* tp = Py_TYPE(obj); | |
41496 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { | |
41497 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); | |
41498 } | |
41499 #endif | |
41500 result = __Pyx_PyObject_GetAttrStr(obj, attr_name); | |
41501 if (unlikely(!result)) { | |
41502 __Pyx_PyObject_GetAttrStr_ClearAttributeError(); | |
41503 } | |
41504 return result; | |
41505 #endif | |
41506 } | |
41507 | |
41508 /* GetBuiltinName */ | |
41509 static PyObject *__Pyx_GetBuiltinName(PyObject *name) { | |
41510 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); | |
41511 if (unlikely(!result) && !PyErr_Occurred()) { | |
41512 PyErr_Format(PyExc_NameError, | |
41513 #if PY_MAJOR_VERSION >= 3 | |
41514 "name '%U' is not defined", name); | |
41515 #else | |
41516 "name '%.200s' is not defined", PyString_AS_STRING(name)); | |
41517 #endif | |
41518 } | |
41519 return result; | |
41520 } | |
41521 | |
41522 /* TupleAndListFromArray */ | |
41523 #if CYTHON_COMPILING_IN_CPYTHON | |
41524 static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { | |
41525 PyObject *v; | |
41526 Py_ssize_t i; | |
41527 for (i = 0; i < length; i++) { | |
41528 v = dest[i] = src[i]; | |
41529 Py_INCREF(v); | |
41530 } | |
41531 } | |
41532 static CYTHON_INLINE PyObject * | |
41533 __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) | |
41534 { | |
41535 PyObject *res; | |
41536 if (n <= 0) { | |
41537 Py_INCREF(__pyx_empty_tuple); | |
41538 return __pyx_empty_tuple; | |
41539 } | |
41540 res = PyTuple_New(n); | |
41541 if (unlikely(res == NULL)) return NULL; | |
41542 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); | |
41543 return res; | |
41544 } | |
41545 static CYTHON_INLINE PyObject * | |
41546 __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) | |
41547 { | |
41548 PyObject *res; | |
41549 if (n <= 0) { | |
41550 return PyList_New(0); | |
41551 } | |
41552 res = PyList_New(n); | |
41553 if (unlikely(res == NULL)) return NULL; | |
41554 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); | |
41555 return res; | |
41556 } | |
41557 #endif | |
41558 | |
41559 /* BytesEquals */ | |
41560 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { | |
41561 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API | |
41562 return PyObject_RichCompareBool(s1, s2, equals); | |
41563 #else | |
41564 if (s1 == s2) { | |
41565 return (equals == Py_EQ); | |
41566 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { | |
41567 const char *ps1, *ps2; | |
41568 Py_ssize_t length = PyBytes_GET_SIZE(s1); | |
41569 if (length != PyBytes_GET_SIZE(s2)) | |
41570 return (equals == Py_NE); | |
41571 ps1 = PyBytes_AS_STRING(s1); | |
41572 ps2 = PyBytes_AS_STRING(s2); | |
41573 if (ps1[0] != ps2[0]) { | |
41574 return (equals == Py_NE); | |
41575 } else if (length == 1) { | |
41576 return (equals == Py_EQ); | |
41577 } else { | |
41578 int result; | |
41579 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) | |
41580 Py_hash_t hash1, hash2; | |
41581 hash1 = ((PyBytesObject*)s1)->ob_shash; | |
41582 hash2 = ((PyBytesObject*)s2)->ob_shash; | |
41583 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { | |
41584 return (equals == Py_NE); | |
41585 } | |
41586 #endif | |
41587 result = memcmp(ps1, ps2, (size_t)length); | |
41588 return (equals == Py_EQ) ? (result == 0) : (result != 0); | |
41589 } | |
41590 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { | |
41591 return (equals == Py_NE); | |
41592 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { | |
41593 return (equals == Py_NE); | |
41594 } else { | |
41595 int result; | |
41596 PyObject* py_result = PyObject_RichCompare(s1, s2, equals); | |
41597 if (!py_result) | |
41598 return -1; | |
41599 result = __Pyx_PyObject_IsTrue(py_result); | |
41600 Py_DECREF(py_result); | |
41601 return result; | |
41602 } | |
41603 #endif | |
41604 } | |
41605 | |
41606 /* UnicodeEquals */ | |
41607 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { | |
41608 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API | |
41609 return PyObject_RichCompareBool(s1, s2, equals); | |
41610 #else | |
41611 #if PY_MAJOR_VERSION < 3 | |
41612 PyObject* owned_ref = NULL; | |
41613 #endif | |
41614 int s1_is_unicode, s2_is_unicode; | |
41615 if (s1 == s2) { | |
41616 goto return_eq; | |
41617 } | |
41618 s1_is_unicode = PyUnicode_CheckExact(s1); | |
41619 s2_is_unicode = PyUnicode_CheckExact(s2); | |
41620 #if PY_MAJOR_VERSION < 3 | |
41621 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { | |
41622 owned_ref = PyUnicode_FromObject(s2); | |
41623 if (unlikely(!owned_ref)) | |
41624 return -1; | |
41625 s2 = owned_ref; | |
41626 s2_is_unicode = 1; | |
41627 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { | |
41628 owned_ref = PyUnicode_FromObject(s1); | |
41629 if (unlikely(!owned_ref)) | |
41630 return -1; | |
41631 s1 = owned_ref; | |
41632 s1_is_unicode = 1; | |
41633 } else if (((!s2_is_unicode) & (!s1_is_unicode))) { | |
41634 return __Pyx_PyBytes_Equals(s1, s2, equals); | |
41635 } | |
41636 #endif | |
41637 if (s1_is_unicode & s2_is_unicode) { | |
41638 Py_ssize_t length; | |
41639 int kind; | |
41640 void *data1, *data2; | |
41641 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) | |
41642 return -1; | |
41643 length = __Pyx_PyUnicode_GET_LENGTH(s1); | |
41644 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { | |
41645 goto return_ne; | |
41646 } | |
41647 #if CYTHON_USE_UNICODE_INTERNALS | |
41648 { | |
41649 Py_hash_t hash1, hash2; | |
41650 #if CYTHON_PEP393_ENABLED | |
41651 hash1 = ((PyASCIIObject*)s1)->hash; | |
41652 hash2 = ((PyASCIIObject*)s2)->hash; | |
41653 #else | |
41654 hash1 = ((PyUnicodeObject*)s1)->hash; | |
41655 hash2 = ((PyUnicodeObject*)s2)->hash; | |
41656 #endif | |
41657 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { | |
41658 goto return_ne; | |
41659 } | |
41660 } | |
41661 #endif | |
41662 kind = __Pyx_PyUnicode_KIND(s1); | |
41663 if (kind != __Pyx_PyUnicode_KIND(s2)) { | |
41664 goto return_ne; | |
41665 } | |
41666 data1 = __Pyx_PyUnicode_DATA(s1); | |
41667 data2 = __Pyx_PyUnicode_DATA(s2); | |
41668 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { | |
41669 goto return_ne; | |
41670 } else if (length == 1) { | |
41671 goto return_eq; | |
41672 } else { | |
41673 int result = memcmp(data1, data2, (size_t)(length * kind)); | |
41674 #if PY_MAJOR_VERSION < 3 | |
41675 Py_XDECREF(owned_ref); | |
41676 #endif | |
41677 return (equals == Py_EQ) ? (result == 0) : (result != 0); | |
41678 } | |
41679 } else if ((s1 == Py_None) & s2_is_unicode) { | |
41680 goto return_ne; | |
41681 } else if ((s2 == Py_None) & s1_is_unicode) { | |
41682 goto return_ne; | |
41683 } else { | |
41684 int result; | |
41685 PyObject* py_result = PyObject_RichCompare(s1, s2, equals); | |
41686 #if PY_MAJOR_VERSION < 3 | |
41687 Py_XDECREF(owned_ref); | |
41688 #endif | |
41689 if (!py_result) | |
41690 return -1; | |
41691 result = __Pyx_PyObject_IsTrue(py_result); | |
41692 Py_DECREF(py_result); | |
41693 return result; | |
41694 } | |
41695 return_eq: | |
41696 #if PY_MAJOR_VERSION < 3 | |
41697 Py_XDECREF(owned_ref); | |
41698 #endif | |
41699 return (equals == Py_EQ); | |
41700 return_ne: | |
41701 #if PY_MAJOR_VERSION < 3 | |
41702 Py_XDECREF(owned_ref); | |
41703 #endif | |
41704 return (equals == Py_NE); | |
41705 #endif | |
41706 } | |
41707 | |
41708 /* fastcall */ | |
41709 #if CYTHON_METH_FASTCALL | |
41710 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) | |
41711 { | |
41712 Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); | |
41713 for (i = 0; i < n; i++) | |
41714 { | |
41715 if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; | |
41716 } | |
41717 for (i = 0; i < n; i++) | |
41718 { | |
41719 int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); | |
41720 if (unlikely(eq != 0)) { | |
41721 if (unlikely(eq < 0)) return NULL; | |
41722 return kwvalues[i]; | |
41723 } | |
41724 } | |
41725 return NULL; | |
41726 } | |
41727 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
41728 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { | |
41729 Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); | |
41730 PyObject *dict; | |
41731 dict = PyDict_New(); | |
41732 if (unlikely(!dict)) | |
41733 return NULL; | |
41734 for (i=0; i<nkwargs; i++) { | |
41735 PyObject *key = PyTuple_GET_ITEM(kwnames, i); | |
41736 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0)) | |
41737 goto bad; | |
41738 } | |
41739 return dict; | |
41740 bad: | |
41741 Py_DECREF(dict); | |
41742 return NULL; | |
41743 } | |
41744 #endif | |
41745 #endif | |
41746 | |
41747 /* RaiseArgTupleInvalid */ | |
41748 static void __Pyx_RaiseArgtupleInvalid( | |
41749 const char* func_name, | |
41750 int exact, | |
41751 Py_ssize_t num_min, | |
41752 Py_ssize_t num_max, | |
41753 Py_ssize_t num_found) | |
41754 { | |
41755 Py_ssize_t num_expected; | |
41756 const char *more_or_less; | |
41757 if (num_found < num_min) { | |
41758 num_expected = num_min; | |
41759 more_or_less = "at least"; | |
41760 } else { | |
41761 num_expected = num_max; | |
41762 more_or_less = "at most"; | |
41763 } | |
41764 if (exact) { | |
41765 more_or_less = "exactly"; | |
41766 } | |
41767 PyErr_Format(PyExc_TypeError, | |
41768 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
41769 func_name, more_or_less, num_expected, | |
41770 (num_expected == 1) ? "" : "s", num_found); | |
41771 } | |
41772 | |
41773 /* RaiseDoubleKeywords */ | |
41774 static void __Pyx_RaiseDoubleKeywordsError( | |
41775 const char* func_name, | |
41776 PyObject* kw_name) | |
41777 { | |
41778 PyErr_Format(PyExc_TypeError, | |
41779 #if PY_MAJOR_VERSION >= 3 | |
41780 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); | |
41781 #else | |
41782 "%s() got multiple values for keyword argument '%s'", func_name, | |
41783 PyString_AsString(kw_name)); | |
41784 #endif | |
41785 } | |
41786 | |
41787 /* ParseKeywords */ | |
41788 static int __Pyx_ParseOptionalKeywords( | |
41789 PyObject *kwds, | |
41790 PyObject *const *kwvalues, | |
41791 PyObject **argnames[], | |
41792 PyObject *kwds2, | |
41793 PyObject *values[], | |
41794 Py_ssize_t num_pos_args, | |
41795 const char* function_name) | |
41796 { | |
41797 PyObject *key = 0, *value = 0; | |
41798 Py_ssize_t pos = 0; | |
41799 PyObject*** name; | |
41800 PyObject*** first_kw_arg = argnames + num_pos_args; | |
41801 int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); | |
41802 while (1) { | |
41803 Py_XDECREF(key); key = NULL; | |
41804 Py_XDECREF(value); value = NULL; | |
41805 if (kwds_is_tuple) { | |
41806 Py_ssize_t size; | |
41807 #if CYTHON_ASSUME_SAFE_MACROS | |
41808 size = PyTuple_GET_SIZE(kwds); | |
41809 #else | |
41810 size = PyTuple_Size(kwds); | |
41811 if (size < 0) goto bad; | |
41812 #endif | |
41813 if (pos >= size) break; | |
41814 #if CYTHON_AVOID_BORROWED_REFS | |
41815 key = __Pyx_PySequence_ITEM(kwds, pos); | |
41816 if (!key) goto bad; | |
41817 #elif CYTHON_ASSUME_SAFE_MACROS | |
41818 key = PyTuple_GET_ITEM(kwds, pos); | |
41819 #else | |
41820 key = PyTuple_GetItem(kwds, pos); | |
41821 if (!key) goto bad; | |
41822 #endif | |
41823 value = kwvalues[pos]; | |
41824 pos++; | |
41825 } | |
41826 else | |
41827 { | |
41828 if (!PyDict_Next(kwds, &pos, &key, &value)) break; | |
41829 #if CYTHON_AVOID_BORROWED_REFS | |
41830 Py_INCREF(key); | |
41831 #endif | |
41832 } | |
41833 name = first_kw_arg; | |
41834 while (*name && (**name != key)) name++; | |
41835 if (*name) { | |
41836 values[name-argnames] = value; | |
41837 #if CYTHON_AVOID_BORROWED_REFS | |
41838 Py_INCREF(value); | |
41839 Py_DECREF(key); | |
41840 #endif | |
41841 key = NULL; | |
41842 value = NULL; | |
41843 continue; | |
41844 } | |
41845 #if !CYTHON_AVOID_BORROWED_REFS | |
41846 Py_INCREF(key); | |
41847 #endif | |
41848 Py_INCREF(value); | |
41849 name = first_kw_arg; | |
41850 #if PY_MAJOR_VERSION < 3 | |
41851 if (likely(PyString_Check(key))) { | |
41852 while (*name) { | |
41853 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) | |
41854 && _PyString_Eq(**name, key)) { | |
41855 values[name-argnames] = value; | |
41856 #if CYTHON_AVOID_BORROWED_REFS | |
41857 value = NULL; | |
41858 #endif | |
41859 break; | |
41860 } | |
41861 name++; | |
41862 } | |
41863 if (*name) continue; | |
41864 else { | |
41865 PyObject*** argname = argnames; | |
41866 while (argname != first_kw_arg) { | |
41867 if ((**argname == key) || ( | |
41868 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) | |
41869 && _PyString_Eq(**argname, key))) { | |
41870 goto arg_passed_twice; | |
41871 } | |
41872 argname++; | |
41873 } | |
41874 } | |
41875 } else | |
41876 #endif | |
41877 if (likely(PyUnicode_Check(key))) { | |
41878 while (*name) { | |
41879 int cmp = ( | |
41880 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 | |
41881 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : | |
41882 #endif | |
41883 PyUnicode_Compare(**name, key) | |
41884 ); | |
41885 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; | |
41886 if (cmp == 0) { | |
41887 values[name-argnames] = value; | |
41888 #if CYTHON_AVOID_BORROWED_REFS | |
41889 value = NULL; | |
41890 #endif | |
41891 break; | |
41892 } | |
41893 name++; | |
41894 } | |
41895 if (*name) continue; | |
41896 else { | |
41897 PyObject*** argname = argnames; | |
41898 while (argname != first_kw_arg) { | |
41899 int cmp = (**argname == key) ? 0 : | |
41900 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 | |
41901 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : | |
41902 #endif | |
41903 PyUnicode_Compare(**argname, key); | |
41904 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; | |
41905 if (cmp == 0) goto arg_passed_twice; | |
41906 argname++; | |
41907 } | |
41908 } | |
41909 } else | |
41910 goto invalid_keyword_type; | |
41911 if (kwds2) { | |
41912 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; | |
41913 } else { | |
41914 goto invalid_keyword; | |
41915 } | |
41916 } | |
41917 Py_XDECREF(key); | |
41918 Py_XDECREF(value); | |
41919 return 0; | |
41920 arg_passed_twice: | |
41921 __Pyx_RaiseDoubleKeywordsError(function_name, key); | |
41922 goto bad; | |
41923 invalid_keyword_type: | |
41924 PyErr_Format(PyExc_TypeError, | |
41925 "%.200s() keywords must be strings", function_name); | |
41926 goto bad; | |
41927 invalid_keyword: | |
41928 #if PY_MAJOR_VERSION < 3 | |
41929 PyErr_Format(PyExc_TypeError, | |
41930 "%.200s() got an unexpected keyword argument '%.200s'", | |
41931 function_name, PyString_AsString(key)); | |
41932 #else | |
41933 PyErr_Format(PyExc_TypeError, | |
41934 "%s() got an unexpected keyword argument '%U'", | |
41935 function_name, key); | |
41936 #endif | |
41937 bad: | |
41938 Py_XDECREF(key); | |
41939 Py_XDECREF(value); | |
41940 return -1; | |
41941 } | |
41942 | |
41943 /* PyDictVersioning */ | |
41944 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS | |
41945 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { | |
41946 PyObject *dict = Py_TYPE(obj)->tp_dict; | |
41947 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; | |
41948 } | |
41949 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { | |
41950 PyObject **dictptr = NULL; | |
41951 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; | |
41952 if (offset) { | |
41953 #if CYTHON_COMPILING_IN_CPYTHON | |
41954 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); | |
41955 #else | |
41956 dictptr = _PyObject_GetDictPtr(obj); | |
41957 #endif | |
41958 } | |
41959 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; | |
41960 } | |
41961 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { | |
41962 PyObject *dict = Py_TYPE(obj)->tp_dict; | |
41963 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) | |
41964 return 0; | |
41965 return obj_dict_version == __Pyx_get_object_dict_version(obj); | |
41966 } | |
41967 #endif | |
41968 | |
41969 /* GetModuleGlobalName */ | |
41970 #if CYTHON_USE_DICT_VERSIONS | |
41971 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) | |
41972 #else | |
41973 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) | |
41974 #endif | |
41975 { | |
41976 PyObject *result; | |
41977 #if !CYTHON_AVOID_BORROWED_REFS | |
41978 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 | |
41979 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); | |
41980 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) | |
41981 if (likely(result)) { | |
41982 return __Pyx_NewRef(result); | |
41983 } else if (unlikely(PyErr_Occurred())) { | |
41984 return NULL; | |
41985 } | |
41986 #elif CYTHON_COMPILING_IN_LIMITED_API | |
41987 if (unlikely(!__pyx_m)) { | |
41988 return NULL; | |
41989 } | |
41990 result = PyObject_GetAttr(__pyx_m, name); | |
41991 if (likely(result)) { | |
41992 return result; | |
41993 } | |
41994 #else | |
41995 result = PyDict_GetItem(__pyx_d, name); | |
41996 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) | |
41997 if (likely(result)) { | |
41998 return __Pyx_NewRef(result); | |
41999 } | |
42000 #endif | |
42001 #else | |
42002 result = PyObject_GetItem(__pyx_d, name); | |
42003 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) | |
42004 if (likely(result)) { | |
42005 return __Pyx_NewRef(result); | |
42006 } | |
42007 PyErr_Clear(); | |
42008 #endif | |
42009 return __Pyx_GetBuiltinName(name); | |
42010 } | |
42011 | |
42012 /* PyFunctionFastCall */ | |
42013 #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL | |
42014 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, | |
42015 PyObject *globals) { | |
42016 PyFrameObject *f; | |
42017 PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
42018 PyObject **fastlocals; | |
42019 Py_ssize_t i; | |
42020 PyObject *result; | |
42021 assert(globals != NULL); | |
42022 /* XXX Perhaps we should create a specialized | |
42023 PyFrame_New() that doesn't take locals, but does | |
42024 take builtins without sanity checking them. | |
42025 */ | |
42026 assert(tstate != NULL); | |
42027 f = PyFrame_New(tstate, co, globals, NULL); | |
42028 if (f == NULL) { | |
42029 return NULL; | |
42030 } | |
42031 fastlocals = __Pyx_PyFrame_GetLocalsplus(f); | |
42032 for (i = 0; i < na; i++) { | |
42033 Py_INCREF(*args); | |
42034 fastlocals[i] = *args++; | |
42035 } | |
42036 result = PyEval_EvalFrameEx(f,0); | |
42037 ++tstate->recursion_depth; | |
42038 Py_DECREF(f); | |
42039 --tstate->recursion_depth; | |
42040 return result; | |
42041 } | |
42042 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { | |
42043 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); | |
42044 PyObject *globals = PyFunction_GET_GLOBALS(func); | |
42045 PyObject *argdefs = PyFunction_GET_DEFAULTS(func); | |
42046 PyObject *closure; | |
42047 #if PY_MAJOR_VERSION >= 3 | |
42048 PyObject *kwdefs; | |
42049 #endif | |
42050 PyObject *kwtuple, **k; | |
42051 PyObject **d; | |
42052 Py_ssize_t nd; | |
42053 Py_ssize_t nk; | |
42054 PyObject *result; | |
42055 assert(kwargs == NULL || PyDict_Check(kwargs)); | |
42056 nk = kwargs ? PyDict_Size(kwargs) : 0; | |
42057 #if PY_MAJOR_VERSION < 3 | |
42058 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { | |
42059 return NULL; | |
42060 } | |
42061 #else | |
42062 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { | |
42063 return NULL; | |
42064 } | |
42065 #endif | |
42066 if ( | |
42067 #if PY_MAJOR_VERSION >= 3 | |
42068 co->co_kwonlyargcount == 0 && | |
42069 #endif | |
42070 likely(kwargs == NULL || nk == 0) && | |
42071 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { | |
42072 if (argdefs == NULL && co->co_argcount == nargs) { | |
42073 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); | |
42074 goto done; | |
42075 } | |
42076 else if (nargs == 0 && argdefs != NULL | |
42077 && co->co_argcount == Py_SIZE(argdefs)) { | |
42078 /* function called with no arguments, but all parameters have | |
42079 a default value: use default values as arguments .*/ | |
42080 args = &PyTuple_GET_ITEM(argdefs, 0); | |
42081 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); | |
42082 goto done; | |
42083 } | |
42084 } | |
42085 if (kwargs != NULL) { | |
42086 Py_ssize_t pos, i; | |
42087 kwtuple = PyTuple_New(2 * nk); | |
42088 if (kwtuple == NULL) { | |
42089 result = NULL; | |
42090 goto done; | |
42091 } | |
42092 k = &PyTuple_GET_ITEM(kwtuple, 0); | |
42093 pos = i = 0; | |
42094 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { | |
42095 Py_INCREF(k[i]); | |
42096 Py_INCREF(k[i+1]); | |
42097 i += 2; | |
42098 } | |
42099 nk = i / 2; | |
42100 } | |
42101 else { | |
42102 kwtuple = NULL; | |
42103 k = NULL; | |
42104 } | |
42105 closure = PyFunction_GET_CLOSURE(func); | |
42106 #if PY_MAJOR_VERSION >= 3 | |
42107 kwdefs = PyFunction_GET_KW_DEFAULTS(func); | |
42108 #endif | |
42109 if (argdefs != NULL) { | |
42110 d = &PyTuple_GET_ITEM(argdefs, 0); | |
42111 nd = Py_SIZE(argdefs); | |
42112 } | |
42113 else { | |
42114 d = NULL; | |
42115 nd = 0; | |
42116 } | |
42117 #if PY_MAJOR_VERSION >= 3 | |
42118 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, | |
42119 args, (int)nargs, | |
42120 k, (int)nk, | |
42121 d, (int)nd, kwdefs, closure); | |
42122 #else | |
42123 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, | |
42124 args, (int)nargs, | |
42125 k, (int)nk, | |
42126 d, (int)nd, closure); | |
42127 #endif | |
42128 Py_XDECREF(kwtuple); | |
42129 done: | |
42130 Py_LeaveRecursiveCall(); | |
42131 return result; | |
42132 } | |
42133 #endif | |
42134 | |
42135 /* PyObjectCall */ | |
42136 #if CYTHON_COMPILING_IN_CPYTHON | |
42137 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
42138 PyObject *result; | |
42139 ternaryfunc call = Py_TYPE(func)->tp_call; | |
42140 if (unlikely(!call)) | |
42141 return PyObject_Call(func, arg, kw); | |
42142 #if PY_MAJOR_VERSION < 3 | |
42143 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) | |
42144 return NULL; | |
42145 #else | |
42146 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) | |
42147 return NULL; | |
42148 #endif | |
42149 result = (*call)(func, arg, kw); | |
42150 Py_LeaveRecursiveCall(); | |
42151 if (unlikely(!result) && unlikely(!PyErr_Occurred())) { | |
42152 PyErr_SetString( | |
42153 PyExc_SystemError, | |
42154 "NULL result without error in PyObject_Call"); | |
42155 } | |
42156 return result; | |
42157 } | |
42158 #endif | |
42159 | |
42160 /* PyObjectCallMethO */ | |
42161 #if CYTHON_COMPILING_IN_CPYTHON | |
42162 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { | |
42163 PyObject *self, *result; | |
42164 PyCFunction cfunc; | |
42165 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); | |
42166 self = __Pyx_CyOrPyCFunction_GET_SELF(func); | |
42167 #if PY_MAJOR_VERSION < 3 | |
42168 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) | |
42169 return NULL; | |
42170 #else | |
42171 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) | |
42172 return NULL; | |
42173 #endif | |
42174 result = cfunc(self, arg); | |
42175 Py_LeaveRecursiveCall(); | |
42176 if (unlikely(!result) && unlikely(!PyErr_Occurred())) { | |
42177 PyErr_SetString( | |
42178 PyExc_SystemError, | |
42179 "NULL result without error in PyObject_Call"); | |
42180 } | |
42181 return result; | |
42182 } | |
42183 #endif | |
42184 | |
42185 /* PyObjectFastCall */ | |
42186 #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API | |
42187 static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { | |
42188 PyObject *argstuple; | |
42189 PyObject *result = 0; | |
42190 size_t i; | |
42191 argstuple = PyTuple_New((Py_ssize_t)nargs); | |
42192 if (unlikely(!argstuple)) return NULL; | |
42193 for (i = 0; i < nargs; i++) { | |
42194 Py_INCREF(args[i]); | |
42195 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; | |
42196 } | |
42197 result = __Pyx_PyObject_Call(func, argstuple, kwargs); | |
42198 bad: | |
42199 Py_DECREF(argstuple); | |
42200 return result; | |
42201 } | |
42202 #endif | |
42203 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { | |
42204 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); | |
42205 #if CYTHON_COMPILING_IN_CPYTHON | |
42206 if (nargs == 0 && kwargs == NULL) { | |
42207 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) | |
42208 return __Pyx_PyObject_CallMethO(func, NULL); | |
42209 } | |
42210 else if (nargs == 1 && kwargs == NULL) { | |
42211 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) | |
42212 return __Pyx_PyObject_CallMethO(func, args[0]); | |
42213 } | |
42214 #endif | |
42215 #if PY_VERSION_HEX < 0x030800B1 | |
42216 #if CYTHON_FAST_PYCCALL | |
42217 if (PyCFunction_Check(func)) { | |
42218 if (kwargs) { | |
42219 return _PyCFunction_FastCallDict(func, args, nargs, kwargs); | |
42220 } else { | |
42221 return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); | |
42222 } | |
42223 } | |
42224 #if PY_VERSION_HEX >= 0x030700A1 | |
42225 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { | |
42226 return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); | |
42227 } | |
42228 #endif | |
42229 #endif | |
42230 #if CYTHON_FAST_PYCALL | |
42231 if (PyFunction_Check(func)) { | |
42232 return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); | |
42233 } | |
42234 #endif | |
42235 #endif | |
42236 if (kwargs == NULL) { | |
42237 #if CYTHON_VECTORCALL | |
42238 #if PY_VERSION_HEX < 0x03090000 | |
42239 vectorcallfunc f = _PyVectorcall_Function(func); | |
42240 #else | |
42241 vectorcallfunc f = PyVectorcall_Function(func); | |
42242 #endif | |
42243 if (f) { | |
42244 return f(func, args, (size_t)nargs, NULL); | |
42245 } | |
42246 #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL | |
42247 if (__Pyx_CyFunction_CheckExact(func)) { | |
42248 __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); | |
42249 if (f) return f(func, args, (size_t)nargs, NULL); | |
42250 } | |
42251 #endif | |
42252 } | |
42253 if (nargs == 0) { | |
42254 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); | |
42255 } | |
42256 #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API | |
42257 return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); | |
42258 #else | |
42259 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); | |
42260 #endif | |
42261 } | |
42262 | |
42263 /* GetItemInt */ | |
42264 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { | |
42265 PyObject *r; | |
42266 if (unlikely(!j)) return NULL; | |
42267 r = PyObject_GetItem(o, j); | |
42268 Py_DECREF(j); | |
42269 return r; | |
42270 } | |
42271 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, | |
42272 CYTHON_NCP_UNUSED int wraparound, | |
42273 CYTHON_NCP_UNUSED int boundscheck) { | |
42274 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
42275 Py_ssize_t wrapped_i = i; | |
42276 if (wraparound & unlikely(i < 0)) { | |
42277 wrapped_i += PyList_GET_SIZE(o); | |
42278 } | |
42279 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { | |
42280 PyObject *r = PyList_GET_ITEM(o, wrapped_i); | |
42281 Py_INCREF(r); | |
42282 return r; | |
42283 } | |
42284 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
42285 #else | |
42286 return PySequence_GetItem(o, i); | |
42287 #endif | |
42288 } | |
42289 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, | |
42290 CYTHON_NCP_UNUSED int wraparound, | |
42291 CYTHON_NCP_UNUSED int boundscheck) { | |
42292 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
42293 Py_ssize_t wrapped_i = i; | |
42294 if (wraparound & unlikely(i < 0)) { | |
42295 wrapped_i += PyTuple_GET_SIZE(o); | |
42296 } | |
42297 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { | |
42298 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); | |
42299 Py_INCREF(r); | |
42300 return r; | |
42301 } | |
42302 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
42303 #else | |
42304 return PySequence_GetItem(o, i); | |
42305 #endif | |
42306 } | |
42307 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, | |
42308 CYTHON_NCP_UNUSED int wraparound, | |
42309 CYTHON_NCP_UNUSED int boundscheck) { | |
42310 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS | |
42311 if (is_list || PyList_CheckExact(o)) { | |
42312 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); | |
42313 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { | |
42314 PyObject *r = PyList_GET_ITEM(o, n); | |
42315 Py_INCREF(r); | |
42316 return r; | |
42317 } | |
42318 } | |
42319 else if (PyTuple_CheckExact(o)) { | |
42320 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); | |
42321 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { | |
42322 PyObject *r = PyTuple_GET_ITEM(o, n); | |
42323 Py_INCREF(r); | |
42324 return r; | |
42325 } | |
42326 } else { | |
42327 PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; | |
42328 PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; | |
42329 if (mm && mm->mp_subscript) { | |
42330 PyObject *r, *key = PyInt_FromSsize_t(i); | |
42331 if (unlikely(!key)) return NULL; | |
42332 r = mm->mp_subscript(o, key); | |
42333 Py_DECREF(key); | |
42334 return r; | |
42335 } | |
42336 if (likely(sm && sm->sq_item)) { | |
42337 if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { | |
42338 Py_ssize_t l = sm->sq_length(o); | |
42339 if (likely(l >= 0)) { | |
42340 i += l; | |
42341 } else { | |
42342 if (!PyErr_ExceptionMatches(PyExc_OverflowError)) | |
42343 return NULL; | |
42344 PyErr_Clear(); | |
42345 } | |
42346 } | |
42347 return sm->sq_item(o, i); | |
42348 } | |
42349 } | |
42350 #else | |
42351 if (is_list || !PyMapping_Check(o)) { | |
42352 return PySequence_GetItem(o, i); | |
42353 } | |
42354 #endif | |
42355 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
42356 } | |
42357 | |
42358 /* PyObjectCallOneArg */ | |
42359 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { | |
42360 PyObject *args[2] = {NULL, arg}; | |
42361 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
42362 } | |
42363 | |
42364 /* PyIntBinop */ | |
42365 #if !CYTHON_COMPILING_IN_PYPY | |
42366 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { | |
42367 CYTHON_MAYBE_UNUSED_VAR(intval); | |
42368 CYTHON_MAYBE_UNUSED_VAR(inplace); | |
42369 CYTHON_UNUSED_VAR(zerodivision_check); | |
42370 #if PY_MAJOR_VERSION < 3 | |
42371 if (likely(PyInt_CheckExact(op1))) { | |
42372 const long b = intval; | |
42373 long x; | |
42374 long a = PyInt_AS_LONG(op1); | |
42375 | |
42376 x = (long)((unsigned long)a - (unsigned long)b); | |
42377 if (likely((x^a) >= 0 || (x^~b) >= 0)) | |
42378 return PyInt_FromLong(x); | |
42379 return PyLong_Type.tp_as_number->nb_subtract(op1, op2); | |
42380 } | |
42381 #endif | |
42382 #if CYTHON_USE_PYLONG_INTERNALS | |
42383 if (likely(PyLong_CheckExact(op1))) { | |
42384 const long b = intval; | |
42385 long a, x; | |
42386 #ifdef HAVE_LONG_LONG | |
42387 const PY_LONG_LONG llb = intval; | |
42388 PY_LONG_LONG lla, llx; | |
42389 #endif | |
42390 if (unlikely(__Pyx_PyLong_IsZero(op1))) { | |
42391 return PyLong_FromLong(-intval); | |
42392 } | |
42393 if (likely(__Pyx_PyLong_IsCompact(op1))) { | |
42394 a = __Pyx_PyLong_CompactValue(op1); | |
42395 } else { | |
42396 const digit* digits = __Pyx_PyLong_Digits(op1); | |
42397 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); | |
42398 switch (size) { | |
42399 case -2: | |
42400 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
42401 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
42402 break; | |
42403 #ifdef HAVE_LONG_LONG | |
42404 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
42405 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
42406 goto long_long; | |
42407 #endif | |
42408 } | |
42409 CYTHON_FALLTHROUGH; | |
42410 case 2: | |
42411 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
42412 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
42413 break; | |
42414 #ifdef HAVE_LONG_LONG | |
42415 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
42416 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
42417 goto long_long; | |
42418 #endif | |
42419 } | |
42420 CYTHON_FALLTHROUGH; | |
42421 case -3: | |
42422 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
42423 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
42424 break; | |
42425 #ifdef HAVE_LONG_LONG | |
42426 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
42427 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
42428 goto long_long; | |
42429 #endif | |
42430 } | |
42431 CYTHON_FALLTHROUGH; | |
42432 case 3: | |
42433 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
42434 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
42435 break; | |
42436 #ifdef HAVE_LONG_LONG | |
42437 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
42438 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
42439 goto long_long; | |
42440 #endif | |
42441 } | |
42442 CYTHON_FALLTHROUGH; | |
42443 case -4: | |
42444 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
42445 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
42446 break; | |
42447 #ifdef HAVE_LONG_LONG | |
42448 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
42449 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
42450 goto long_long; | |
42451 #endif | |
42452 } | |
42453 CYTHON_FALLTHROUGH; | |
42454 case 4: | |
42455 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
42456 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
42457 break; | |
42458 #ifdef HAVE_LONG_LONG | |
42459 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
42460 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
42461 goto long_long; | |
42462 #endif | |
42463 } | |
42464 CYTHON_FALLTHROUGH; | |
42465 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); | |
42466 } | |
42467 } | |
42468 x = a - b; | |
42469 return PyLong_FromLong(x); | |
42470 #ifdef HAVE_LONG_LONG | |
42471 long_long: | |
42472 llx = lla - llb; | |
42473 return PyLong_FromLongLong(llx); | |
42474 #endif | |
42475 | |
42476 | |
42477 } | |
42478 #endif | |
42479 if (PyFloat_CheckExact(op1)) { | |
42480 const long b = intval; | |
42481 #if CYTHON_COMPILING_IN_LIMITED_API | |
42482 double a = __pyx_PyFloat_AsDouble(op1); | |
42483 #else | |
42484 double a = PyFloat_AS_DOUBLE(op1); | |
42485 #endif | |
42486 double result; | |
42487 | |
42488 PyFPE_START_PROTECT("subtract", return NULL) | |
42489 result = ((double)a) - (double)b; | |
42490 PyFPE_END_PROTECT(result) | |
42491 return PyFloat_FromDouble(result); | |
42492 } | |
42493 return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); | |
42494 } | |
42495 #endif | |
42496 | |
42497 /* GetTopmostException */ | |
42498 #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE | |
42499 static _PyErr_StackItem * | |
42500 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) | |
42501 { | |
42502 _PyErr_StackItem *exc_info = tstate->exc_info; | |
42503 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && | |
42504 exc_info->previous_item != NULL) | |
42505 { | |
42506 exc_info = exc_info->previous_item; | |
42507 } | |
42508 return exc_info; | |
42509 } | |
42510 #endif | |
42511 | |
42512 /* SaveResetException */ | |
42513 #if CYTHON_FAST_THREAD_STATE | |
42514 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { | |
42515 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 | |
42516 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); | |
42517 PyObject *exc_value = exc_info->exc_value; | |
42518 if (exc_value == NULL || exc_value == Py_None) { | |
42519 *value = NULL; | |
42520 *type = NULL; | |
42521 *tb = NULL; | |
42522 } else { | |
42523 *value = exc_value; | |
42524 Py_INCREF(*value); | |
42525 *type = (PyObject*) Py_TYPE(exc_value); | |
42526 Py_INCREF(*type); | |
42527 *tb = PyException_GetTraceback(exc_value); | |
42528 } | |
42529 #elif CYTHON_USE_EXC_INFO_STACK | |
42530 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); | |
42531 *type = exc_info->exc_type; | |
42532 *value = exc_info->exc_value; | |
42533 *tb = exc_info->exc_traceback; | |
42534 Py_XINCREF(*type); | |
42535 Py_XINCREF(*value); | |
42536 Py_XINCREF(*tb); | |
42537 #else | |
42538 *type = tstate->exc_type; | |
42539 *value = tstate->exc_value; | |
42540 *tb = tstate->exc_traceback; | |
42541 Py_XINCREF(*type); | |
42542 Py_XINCREF(*value); | |
42543 Py_XINCREF(*tb); | |
42544 #endif | |
42545 } | |
42546 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { | |
42547 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 | |
42548 _PyErr_StackItem *exc_info = tstate->exc_info; | |
42549 PyObject *tmp_value = exc_info->exc_value; | |
42550 exc_info->exc_value = value; | |
42551 Py_XDECREF(tmp_value); | |
42552 Py_XDECREF(type); | |
42553 Py_XDECREF(tb); | |
42554 #else | |
42555 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
42556 #if CYTHON_USE_EXC_INFO_STACK | |
42557 _PyErr_StackItem *exc_info = tstate->exc_info; | |
42558 tmp_type = exc_info->exc_type; | |
42559 tmp_value = exc_info->exc_value; | |
42560 tmp_tb = exc_info->exc_traceback; | |
42561 exc_info->exc_type = type; | |
42562 exc_info->exc_value = value; | |
42563 exc_info->exc_traceback = tb; | |
42564 #else | |
42565 tmp_type = tstate->exc_type; | |
42566 tmp_value = tstate->exc_value; | |
42567 tmp_tb = tstate->exc_traceback; | |
42568 tstate->exc_type = type; | |
42569 tstate->exc_value = value; | |
42570 tstate->exc_traceback = tb; | |
42571 #endif | |
42572 Py_XDECREF(tmp_type); | |
42573 Py_XDECREF(tmp_value); | |
42574 Py_XDECREF(tmp_tb); | |
42575 #endif | |
42576 } | |
42577 #endif | |
42578 | |
42579 /* GetException */ | |
42580 #if CYTHON_FAST_THREAD_STATE | |
42581 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) | |
42582 #else | |
42583 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) | |
42584 #endif | |
42585 { | |
42586 PyObject *local_type = NULL, *local_value, *local_tb = NULL; | |
42587 #if CYTHON_FAST_THREAD_STATE | |
42588 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
42589 #if PY_VERSION_HEX >= 0x030C00A6 | |
42590 local_value = tstate->current_exception; | |
42591 tstate->current_exception = 0; | |
42592 if (likely(local_value)) { | |
42593 local_type = (PyObject*) Py_TYPE(local_value); | |
42594 Py_INCREF(local_type); | |
42595 local_tb = PyException_GetTraceback(local_value); | |
42596 } | |
42597 #else | |
42598 local_type = tstate->curexc_type; | |
42599 local_value = tstate->curexc_value; | |
42600 local_tb = tstate->curexc_traceback; | |
42601 tstate->curexc_type = 0; | |
42602 tstate->curexc_value = 0; | |
42603 tstate->curexc_traceback = 0; | |
42604 #endif | |
42605 #else | |
42606 PyErr_Fetch(&local_type, &local_value, &local_tb); | |
42607 #endif | |
42608 PyErr_NormalizeException(&local_type, &local_value, &local_tb); | |
42609 #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 | |
42610 if (unlikely(tstate->current_exception)) | |
42611 #elif CYTHON_FAST_THREAD_STATE | |
42612 if (unlikely(tstate->curexc_type)) | |
42613 #else | |
42614 if (unlikely(PyErr_Occurred())) | |
42615 #endif | |
42616 goto bad; | |
42617 #if PY_MAJOR_VERSION >= 3 | |
42618 if (local_tb) { | |
42619 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) | |
42620 goto bad; | |
42621 } | |
42622 #endif | |
42623 Py_XINCREF(local_tb); | |
42624 Py_XINCREF(local_type); | |
42625 Py_XINCREF(local_value); | |
42626 *type = local_type; | |
42627 *value = local_value; | |
42628 *tb = local_tb; | |
42629 #if CYTHON_FAST_THREAD_STATE | |
42630 #if CYTHON_USE_EXC_INFO_STACK | |
42631 { | |
42632 _PyErr_StackItem *exc_info = tstate->exc_info; | |
42633 #if PY_VERSION_HEX >= 0x030B00a4 | |
42634 tmp_value = exc_info->exc_value; | |
42635 exc_info->exc_value = local_value; | |
42636 tmp_type = NULL; | |
42637 tmp_tb = NULL; | |
42638 Py_XDECREF(local_type); | |
42639 Py_XDECREF(local_tb); | |
42640 #else | |
42641 tmp_type = exc_info->exc_type; | |
42642 tmp_value = exc_info->exc_value; | |
42643 tmp_tb = exc_info->exc_traceback; | |
42644 exc_info->exc_type = local_type; | |
42645 exc_info->exc_value = local_value; | |
42646 exc_info->exc_traceback = local_tb; | |
42647 #endif | |
42648 } | |
42649 #else | |
42650 tmp_type = tstate->exc_type; | |
42651 tmp_value = tstate->exc_value; | |
42652 tmp_tb = tstate->exc_traceback; | |
42653 tstate->exc_type = local_type; | |
42654 tstate->exc_value = local_value; | |
42655 tstate->exc_traceback = local_tb; | |
42656 #endif | |
42657 Py_XDECREF(tmp_type); | |
42658 Py_XDECREF(tmp_value); | |
42659 Py_XDECREF(tmp_tb); | |
42660 #else | |
42661 PyErr_SetExcInfo(local_type, local_value, local_tb); | |
42662 #endif | |
42663 return 0; | |
42664 bad: | |
42665 *type = 0; | |
42666 *value = 0; | |
42667 *tb = 0; | |
42668 Py_XDECREF(local_type); | |
42669 Py_XDECREF(local_value); | |
42670 Py_XDECREF(local_tb); | |
42671 return -1; | |
42672 } | |
42673 | |
42674 /* RaiseException */ | |
42675 #if PY_MAJOR_VERSION < 3 | |
42676 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { | |
42677 __Pyx_PyThreadState_declare | |
42678 CYTHON_UNUSED_VAR(cause); | |
42679 Py_XINCREF(type); | |
42680 if (!value || value == Py_None) | |
42681 value = NULL; | |
42682 else | |
42683 Py_INCREF(value); | |
42684 if (!tb || tb == Py_None) | |
42685 tb = NULL; | |
42686 else { | |
42687 Py_INCREF(tb); | |
42688 if (!PyTraceBack_Check(tb)) { | |
42689 PyErr_SetString(PyExc_TypeError, | |
42690 "raise: arg 3 must be a traceback or None"); | |
42691 goto raise_error; | |
42692 } | |
42693 } | |
42694 if (PyType_Check(type)) { | |
42695 #if CYTHON_COMPILING_IN_PYPY | |
42696 if (!value) { | |
42697 Py_INCREF(Py_None); | |
42698 value = Py_None; | |
42699 } | |
42700 #endif | |
42701 PyErr_NormalizeException(&type, &value, &tb); | |
42702 } else { | |
42703 if (value) { | |
42704 PyErr_SetString(PyExc_TypeError, | |
42705 "instance exception may not have a separate value"); | |
42706 goto raise_error; | |
42707 } | |
42708 value = type; | |
42709 type = (PyObject*) Py_TYPE(type); | |
42710 Py_INCREF(type); | |
42711 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { | |
42712 PyErr_SetString(PyExc_TypeError, | |
42713 "raise: exception class must be a subclass of BaseException"); | |
42714 goto raise_error; | |
42715 } | |
42716 } | |
42717 __Pyx_PyThreadState_assign | |
42718 __Pyx_ErrRestore(type, value, tb); | |
42719 return; | |
42720 raise_error: | |
42721 Py_XDECREF(value); | |
42722 Py_XDECREF(type); | |
42723 Py_XDECREF(tb); | |
42724 return; | |
42725 } | |
42726 #else | |
42727 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { | |
42728 PyObject* owned_instance = NULL; | |
42729 if (tb == Py_None) { | |
42730 tb = 0; | |
42731 } else if (tb && !PyTraceBack_Check(tb)) { | |
42732 PyErr_SetString(PyExc_TypeError, | |
42733 "raise: arg 3 must be a traceback or None"); | |
42734 goto bad; | |
42735 } | |
42736 if (value == Py_None) | |
42737 value = 0; | |
42738 if (PyExceptionInstance_Check(type)) { | |
42739 if (value) { | |
42740 PyErr_SetString(PyExc_TypeError, | |
42741 "instance exception may not have a separate value"); | |
42742 goto bad; | |
42743 } | |
42744 value = type; | |
42745 type = (PyObject*) Py_TYPE(value); | |
42746 } else if (PyExceptionClass_Check(type)) { | |
42747 PyObject *instance_class = NULL; | |
42748 if (value && PyExceptionInstance_Check(value)) { | |
42749 instance_class = (PyObject*) Py_TYPE(value); | |
42750 if (instance_class != type) { | |
42751 int is_subclass = PyObject_IsSubclass(instance_class, type); | |
42752 if (!is_subclass) { | |
42753 instance_class = NULL; | |
42754 } else if (unlikely(is_subclass == -1)) { | |
42755 goto bad; | |
42756 } else { | |
42757 type = instance_class; | |
42758 } | |
42759 } | |
42760 } | |
42761 if (!instance_class) { | |
42762 PyObject *args; | |
42763 if (!value) | |
42764 args = PyTuple_New(0); | |
42765 else if (PyTuple_Check(value)) { | |
42766 Py_INCREF(value); | |
42767 args = value; | |
42768 } else | |
42769 args = PyTuple_Pack(1, value); | |
42770 if (!args) | |
42771 goto bad; | |
42772 owned_instance = PyObject_Call(type, args, NULL); | |
42773 Py_DECREF(args); | |
42774 if (!owned_instance) | |
42775 goto bad; | |
42776 value = owned_instance; | |
42777 if (!PyExceptionInstance_Check(value)) { | |
42778 PyErr_Format(PyExc_TypeError, | |
42779 "calling %R should have returned an instance of " | |
42780 "BaseException, not %R", | |
42781 type, Py_TYPE(value)); | |
42782 goto bad; | |
42783 } | |
42784 } | |
42785 } else { | |
42786 PyErr_SetString(PyExc_TypeError, | |
42787 "raise: exception class must be a subclass of BaseException"); | |
42788 goto bad; | |
42789 } | |
42790 if (cause) { | |
42791 PyObject *fixed_cause; | |
42792 if (cause == Py_None) { | |
42793 fixed_cause = NULL; | |
42794 } else if (PyExceptionClass_Check(cause)) { | |
42795 fixed_cause = PyObject_CallObject(cause, NULL); | |
42796 if (fixed_cause == NULL) | |
42797 goto bad; | |
42798 } else if (PyExceptionInstance_Check(cause)) { | |
42799 fixed_cause = cause; | |
42800 Py_INCREF(fixed_cause); | |
42801 } else { | |
42802 PyErr_SetString(PyExc_TypeError, | |
42803 "exception causes must derive from " | |
42804 "BaseException"); | |
42805 goto bad; | |
42806 } | |
42807 PyException_SetCause(value, fixed_cause); | |
42808 } | |
42809 PyErr_SetObject(type, value); | |
42810 if (tb) { | |
42811 #if PY_VERSION_HEX >= 0x030C00A6 | |
42812 PyException_SetTraceback(value, tb); | |
42813 #elif CYTHON_FAST_THREAD_STATE | |
42814 PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
42815 PyObject* tmp_tb = tstate->curexc_traceback; | |
42816 if (tb != tmp_tb) { | |
42817 Py_INCREF(tb); | |
42818 tstate->curexc_traceback = tb; | |
42819 Py_XDECREF(tmp_tb); | |
42820 } | |
42821 #else | |
42822 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
42823 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); | |
42824 Py_INCREF(tb); | |
42825 PyErr_Restore(tmp_type, tmp_value, tb); | |
42826 Py_XDECREF(tmp_tb); | |
42827 #endif | |
42828 } | |
42829 bad: | |
42830 Py_XDECREF(owned_instance); | |
42831 return; | |
42832 } | |
42833 #endif | |
42834 | |
42835 /* pybytes_as_double */ | |
42836 static double __Pyx_SlowPyString_AsDouble(PyObject *obj) { | |
42837 PyObject *float_value; | |
42838 #if PY_MAJOR_VERSION >= 3 | |
42839 float_value = PyFloat_FromString(obj); | |
42840 #else | |
42841 float_value = PyFloat_FromString(obj, 0); | |
42842 #endif | |
42843 if (likely(float_value)) { | |
42844 #if CYTHON_ASSUME_SAFE_MACROS | |
42845 double value = PyFloat_AS_DOUBLE(float_value); | |
42846 #else | |
42847 double value = PyFloat_AsDouble(float_value); | |
42848 #endif | |
42849 Py_DECREF(float_value); | |
42850 return value; | |
42851 } | |
42852 return (double)-1; | |
42853 } | |
42854 static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) { | |
42855 int last_was_punctuation = 1; | |
42856 Py_ssize_t i; | |
42857 for (i=0; i < length; i++) { | |
42858 char chr = start[i]; | |
42859 int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E'); | |
42860 *buffer = chr; | |
42861 buffer += (chr != '_'); | |
42862 if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; | |
42863 last_was_punctuation = is_punctuation; | |
42864 } | |
42865 if (unlikely(last_was_punctuation)) goto parse_failure; | |
42866 *buffer = '\0'; | |
42867 return buffer; | |
42868 parse_failure: | |
42869 return NULL; | |
42870 } | |
42871 static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) { | |
42872 int matches = 1; | |
42873 char sign = start[0]; | |
42874 int is_signed = (sign == '+') | (sign == '-'); | |
42875 start += is_signed; | |
42876 length -= is_signed; | |
42877 switch (start[0]) { | |
42878 #ifdef Py_NAN | |
42879 case 'n': | |
42880 case 'N': | |
42881 if (unlikely(length != 3)) goto parse_failure; | |
42882 matches &= (start[1] == 'a' || start[1] == 'A'); | |
42883 matches &= (start[2] == 'n' || start[2] == 'N'); | |
42884 if (unlikely(!matches)) goto parse_failure; | |
42885 return (sign == '-') ? -Py_NAN : Py_NAN; | |
42886 #endif | |
42887 case 'i': | |
42888 case 'I': | |
42889 if (unlikely(length < 3)) goto parse_failure; | |
42890 matches &= (start[1] == 'n' || start[1] == 'N'); | |
42891 matches &= (start[2] == 'f' || start[2] == 'F'); | |
42892 if (likely(length == 3 && matches)) | |
42893 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; | |
42894 if (unlikely(length != 8)) goto parse_failure; | |
42895 matches &= (start[3] == 'i' || start[3] == 'I'); | |
42896 matches &= (start[4] == 'n' || start[4] == 'N'); | |
42897 matches &= (start[5] == 'i' || start[5] == 'I'); | |
42898 matches &= (start[6] == 't' || start[6] == 'T'); | |
42899 matches &= (start[7] == 'y' || start[7] == 'Y'); | |
42900 if (unlikely(!matches)) goto parse_failure; | |
42901 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; | |
42902 case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': | |
42903 break; | |
42904 default: | |
42905 goto parse_failure; | |
42906 } | |
42907 return 0.0; | |
42908 parse_failure: | |
42909 return -1.0; | |
42910 } | |
42911 static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) { | |
42912 return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd)); | |
42913 } | |
42914 CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) { | |
42915 double value; | |
42916 Py_ssize_t i, digits; | |
42917 const char *last = start + length; | |
42918 char *end; | |
42919 while (__Pyx__PyBytes_AsDouble_IsSpace(*start)) | |
42920 start++; | |
42921 while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1])) | |
42922 last--; | |
42923 length = last - start; | |
42924 if (unlikely(length <= 0)) goto fallback; | |
42925 value = __Pyx__PyBytes_AsDouble_inf_nan(start, length); | |
42926 if (unlikely(value == -1.0)) goto fallback; | |
42927 if (value != 0.0) return value; | |
42928 digits = 0; | |
42929 for (i=0; i < length; digits += start[i++] != '_'); | |
42930 if (likely(digits == length)) { | |
42931 value = PyOS_string_to_double(start, &end, NULL); | |
42932 } else if (digits < 40) { | |
42933 char number[40]; | |
42934 last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); | |
42935 if (unlikely(!last)) goto fallback; | |
42936 value = PyOS_string_to_double(number, &end, NULL); | |
42937 } else { | |
42938 char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char)); | |
42939 if (unlikely(!number)) goto fallback; | |
42940 last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); | |
42941 if (unlikely(!last)) { | |
42942 PyMem_Free(number); | |
42943 goto fallback; | |
42944 } | |
42945 value = PyOS_string_to_double(number, &end, NULL); | |
42946 PyMem_Free(number); | |
42947 } | |
42948 if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { | |
42949 return value; | |
42950 } | |
42951 fallback: | |
42952 return __Pyx_SlowPyString_AsDouble(obj); | |
42953 } | |
42954 | |
42955 /* pynumber_float */ | |
42956 static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) { | |
42957 double val; | |
42958 if (PyLong_CheckExact(obj)) { | |
42959 #if CYTHON_USE_PYLONG_INTERNALS | |
42960 if (likely(__Pyx_PyLong_IsCompact(obj))) { | |
42961 val = (double) __Pyx_PyLong_CompactValue(obj); | |
42962 goto no_error; | |
42963 } | |
42964 #endif | |
42965 val = PyLong_AsDouble(obj); | |
42966 } else if (PyUnicode_CheckExact(obj)) { | |
42967 val = __Pyx_PyUnicode_AsDouble(obj); | |
42968 } else if (PyBytes_CheckExact(obj)) { | |
42969 val = __Pyx_PyBytes_AsDouble(obj); | |
42970 } else if (PyByteArray_CheckExact(obj)) { | |
42971 val = __Pyx_PyByteArray_AsDouble(obj); | |
42972 } else { | |
42973 return PyNumber_Float(obj); | |
42974 } | |
42975 if (unlikely(val == -1 && PyErr_Occurred())) { | |
42976 return NULL; | |
42977 } | |
42978 #if CYTHON_USE_PYLONG_INTERNALS | |
42979 no_error: | |
42980 #endif | |
42981 return PyFloat_FromDouble(val); | |
42982 } | |
42983 | |
42984 /* RaiseUnboundLocalError */ | |
42985 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { | |
42986 PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); | |
42987 } | |
42988 | |
42989 /* ObjectGetItem */ | |
42990 #if CYTHON_USE_TYPE_SLOTS | |
42991 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { | |
42992 PyObject *runerr = NULL; | |
42993 Py_ssize_t key_value; | |
42994 key_value = __Pyx_PyIndex_AsSsize_t(index); | |
42995 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { | |
42996 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); | |
42997 } | |
42998 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { | |
42999 __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); | |
43000 PyErr_Clear(); | |
43001 PyErr_Format(PyExc_IndexError, | |
43002 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); | |
43003 __Pyx_DECREF_TypeName(index_type_name); | |
43004 } | |
43005 return NULL; | |
43006 } | |
43007 static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { | |
43008 __Pyx_TypeName obj_type_name; | |
43009 if (likely(PyType_Check(obj))) { | |
43010 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); | |
43011 if (!meth) { | |
43012 PyErr_Clear(); | |
43013 } else { | |
43014 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); | |
43015 Py_DECREF(meth); | |
43016 return result; | |
43017 } | |
43018 } | |
43019 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
43020 PyErr_Format(PyExc_TypeError, | |
43021 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); | |
43022 __Pyx_DECREF_TypeName(obj_type_name); | |
43023 return NULL; | |
43024 } | |
43025 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { | |
43026 PyTypeObject *tp = Py_TYPE(obj); | |
43027 PyMappingMethods *mm = tp->tp_as_mapping; | |
43028 PySequenceMethods *sm = tp->tp_as_sequence; | |
43029 if (likely(mm && mm->mp_subscript)) { | |
43030 return mm->mp_subscript(obj, key); | |
43031 } | |
43032 if (likely(sm && sm->sq_item)) { | |
43033 return __Pyx_PyObject_GetIndex(obj, key); | |
43034 } | |
43035 return __Pyx_PyObject_GetItem_Slow(obj, key); | |
43036 } | |
43037 #endif | |
43038 | |
43039 /* CIntToDigits */ | |
43040 static const char DIGIT_PAIRS_10[2*10*10+1] = { | |
43041 "00010203040506070809" | |
43042 "10111213141516171819" | |
43043 "20212223242526272829" | |
43044 "30313233343536373839" | |
43045 "40414243444546474849" | |
43046 "50515253545556575859" | |
43047 "60616263646566676869" | |
43048 "70717273747576777879" | |
43049 "80818283848586878889" | |
43050 "90919293949596979899" | |
43051 }; | |
43052 static const char DIGIT_PAIRS_8[2*8*8+1] = { | |
43053 "0001020304050607" | |
43054 "1011121314151617" | |
43055 "2021222324252627" | |
43056 "3031323334353637" | |
43057 "4041424344454647" | |
43058 "5051525354555657" | |
43059 "6061626364656667" | |
43060 "7071727374757677" | |
43061 }; | |
43062 static const char DIGITS_HEX[2*16+1] = { | |
43063 "0123456789abcdef" | |
43064 "0123456789ABCDEF" | |
43065 }; | |
43066 | |
43067 /* BuildPyUnicode */ | |
43068 static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, | |
43069 int prepend_sign, char padding_char) { | |
43070 PyObject *uval; | |
43071 Py_ssize_t uoffset = ulength - clength; | |
43072 #if CYTHON_USE_UNICODE_INTERNALS | |
43073 Py_ssize_t i; | |
43074 #if CYTHON_PEP393_ENABLED | |
43075 void *udata; | |
43076 uval = PyUnicode_New(ulength, 127); | |
43077 if (unlikely(!uval)) return NULL; | |
43078 udata = PyUnicode_DATA(uval); | |
43079 #else | |
43080 Py_UNICODE *udata; | |
43081 uval = PyUnicode_FromUnicode(NULL, ulength); | |
43082 if (unlikely(!uval)) return NULL; | |
43083 udata = PyUnicode_AS_UNICODE(uval); | |
43084 #endif | |
43085 if (uoffset > 0) { | |
43086 i = 0; | |
43087 if (prepend_sign) { | |
43088 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); | |
43089 i++; | |
43090 } | |
43091 for (; i < uoffset; i++) { | |
43092 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); | |
43093 } | |
43094 } | |
43095 for (i=0; i < clength; i++) { | |
43096 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); | |
43097 } | |
43098 #else | |
43099 { | |
43100 PyObject *sign = NULL, *padding = NULL; | |
43101 uval = NULL; | |
43102 if (uoffset > 0) { | |
43103 prepend_sign = !!prepend_sign; | |
43104 if (uoffset > prepend_sign) { | |
43105 padding = PyUnicode_FromOrdinal(padding_char); | |
43106 if (likely(padding) && uoffset > prepend_sign + 1) { | |
43107 PyObject *tmp; | |
43108 PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); | |
43109 if (unlikely(!repeat)) goto done_or_error; | |
43110 tmp = PyNumber_Multiply(padding, repeat); | |
43111 Py_DECREF(repeat); | |
43112 Py_DECREF(padding); | |
43113 padding = tmp; | |
43114 } | |
43115 if (unlikely(!padding)) goto done_or_error; | |
43116 } | |
43117 if (prepend_sign) { | |
43118 sign = PyUnicode_FromOrdinal('-'); | |
43119 if (unlikely(!sign)) goto done_or_error; | |
43120 } | |
43121 } | |
43122 uval = PyUnicode_DecodeASCII(chars, clength, NULL); | |
43123 if (likely(uval) && padding) { | |
43124 PyObject *tmp = PyNumber_Add(padding, uval); | |
43125 Py_DECREF(uval); | |
43126 uval = tmp; | |
43127 } | |
43128 if (likely(uval) && sign) { | |
43129 PyObject *tmp = PyNumber_Add(sign, uval); | |
43130 Py_DECREF(uval); | |
43131 uval = tmp; | |
43132 } | |
43133 done_or_error: | |
43134 Py_XDECREF(padding); | |
43135 Py_XDECREF(sign); | |
43136 } | |
43137 #endif | |
43138 return uval; | |
43139 } | |
43140 | |
43141 /* CIntToPyUnicode */ | |
43142 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) { | |
43143 char digits[sizeof(Py_ssize_t)*3+2]; | |
43144 char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2; | |
43145 const char *hex_digits = DIGITS_HEX; | |
43146 Py_ssize_t length, ulength; | |
43147 int prepend_sign, last_one_off; | |
43148 Py_ssize_t remaining; | |
43149 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
43150 #pragma GCC diagnostic push | |
43151 #pragma GCC diagnostic ignored "-Wconversion" | |
43152 #endif | |
43153 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0; | |
43154 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
43155 #pragma GCC diagnostic pop | |
43156 #endif | |
43157 const int is_unsigned = neg_one > const_zero; | |
43158 if (format_char == 'X') { | |
43159 hex_digits += 16; | |
43160 format_char = 'x'; | |
43161 } | |
43162 remaining = value; | |
43163 last_one_off = 0; | |
43164 dpos = end; | |
43165 do { | |
43166 int digit_pos; | |
43167 switch (format_char) { | |
43168 case 'o': | |
43169 digit_pos = abs((int)(remaining % (8*8))); | |
43170 remaining = (Py_ssize_t) (remaining / (8*8)); | |
43171 dpos -= 2; | |
43172 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); | |
43173 last_one_off = (digit_pos < 8); | |
43174 break; | |
43175 case 'd': | |
43176 digit_pos = abs((int)(remaining % (10*10))); | |
43177 remaining = (Py_ssize_t) (remaining / (10*10)); | |
43178 dpos -= 2; | |
43179 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); | |
43180 last_one_off = (digit_pos < 10); | |
43181 break; | |
43182 case 'x': | |
43183 *(--dpos) = hex_digits[abs((int)(remaining % 16))]; | |
43184 remaining = (Py_ssize_t) (remaining / 16); | |
43185 break; | |
43186 default: | |
43187 assert(0); | |
43188 break; | |
43189 } | |
43190 } while (unlikely(remaining != 0)); | |
43191 assert(!last_one_off || *dpos == '0'); | |
43192 dpos += last_one_off; | |
43193 length = end - dpos; | |
43194 ulength = length; | |
43195 prepend_sign = 0; | |
43196 if (!is_unsigned && value <= neg_one) { | |
43197 if (padding_char == ' ' || width <= length + 1) { | |
43198 *(--dpos) = '-'; | |
43199 ++length; | |
43200 } else { | |
43201 prepend_sign = 1; | |
43202 } | |
43203 ++ulength; | |
43204 } | |
43205 if (width > ulength) { | |
43206 ulength = width; | |
43207 } | |
43208 if (ulength == 1) { | |
43209 return PyUnicode_FromOrdinal(*dpos); | |
43210 } | |
43211 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); | |
43212 } | |
43213 | |
43214 /* PyObjectFormatAndDecref */ | |
43215 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { | |
43216 if (unlikely(!s)) return NULL; | |
43217 if (likely(PyUnicode_CheckExact(s))) return s; | |
43218 #if PY_MAJOR_VERSION < 3 | |
43219 if (likely(PyString_CheckExact(s))) { | |
43220 PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); | |
43221 Py_DECREF(s); | |
43222 return result; | |
43223 } | |
43224 #endif | |
43225 return __Pyx_PyObject_FormatAndDecref(s, f); | |
43226 } | |
43227 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { | |
43228 PyObject *result; | |
43229 if (unlikely(!s)) return NULL; | |
43230 result = PyObject_Format(s, f); | |
43231 Py_DECREF(s); | |
43232 return result; | |
43233 } | |
43234 | |
43235 /* JoinPyUnicode */ | |
43236 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, | |
43237 Py_UCS4 max_char) { | |
43238 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
43239 PyObject *result_uval; | |
43240 int result_ukind, kind_shift; | |
43241 Py_ssize_t i, char_pos; | |
43242 void *result_udata; | |
43243 CYTHON_MAYBE_UNUSED_VAR(max_char); | |
43244 #if CYTHON_PEP393_ENABLED | |
43245 result_uval = PyUnicode_New(result_ulength, max_char); | |
43246 if (unlikely(!result_uval)) return NULL; | |
43247 result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; | |
43248 kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; | |
43249 result_udata = PyUnicode_DATA(result_uval); | |
43250 #else | |
43251 result_uval = PyUnicode_FromUnicode(NULL, result_ulength); | |
43252 if (unlikely(!result_uval)) return NULL; | |
43253 result_ukind = sizeof(Py_UNICODE); | |
43254 kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; | |
43255 result_udata = PyUnicode_AS_UNICODE(result_uval); | |
43256 #endif | |
43257 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); | |
43258 char_pos = 0; | |
43259 for (i=0; i < value_count; i++) { | |
43260 int ukind; | |
43261 Py_ssize_t ulength; | |
43262 void *udata; | |
43263 PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); | |
43264 if (unlikely(__Pyx_PyUnicode_READY(uval))) | |
43265 goto bad; | |
43266 ulength = __Pyx_PyUnicode_GET_LENGTH(uval); | |
43267 if (unlikely(!ulength)) | |
43268 continue; | |
43269 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) | |
43270 goto overflow; | |
43271 ukind = __Pyx_PyUnicode_KIND(uval); | |
43272 udata = __Pyx_PyUnicode_DATA(uval); | |
43273 if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { | |
43274 memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); | |
43275 } else { | |
43276 #if PY_VERSION_HEX >= 0x030d0000 | |
43277 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; | |
43278 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) | |
43279 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); | |
43280 #else | |
43281 Py_ssize_t j; | |
43282 for (j=0; j < ulength; j++) { | |
43283 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); | |
43284 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); | |
43285 } | |
43286 #endif | |
43287 } | |
43288 char_pos += ulength; | |
43289 } | |
43290 return result_uval; | |
43291 overflow: | |
43292 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); | |
43293 bad: | |
43294 Py_DECREF(result_uval); | |
43295 return NULL; | |
43296 #else | |
43297 CYTHON_UNUSED_VAR(max_char); | |
43298 CYTHON_UNUSED_VAR(result_ulength); | |
43299 CYTHON_UNUSED_VAR(value_count); | |
43300 return PyUnicode_Join(__pyx_empty_unicode, value_tuple); | |
43301 #endif | |
43302 } | |
43303 | |
43304 /* PyIntCompare */ | |
43305 static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { | |
43306 CYTHON_MAYBE_UNUSED_VAR(intval); | |
43307 CYTHON_UNUSED_VAR(inplace); | |
43308 if (op1 == op2) { | |
43309 return 1; | |
43310 } | |
43311 #if PY_MAJOR_VERSION < 3 | |
43312 if (likely(PyInt_CheckExact(op1))) { | |
43313 const long b = intval; | |
43314 long a = PyInt_AS_LONG(op1); | |
43315 return (a == b); | |
43316 } | |
43317 #endif | |
43318 #if CYTHON_USE_PYLONG_INTERNALS | |
43319 if (likely(PyLong_CheckExact(op1))) { | |
43320 int unequal; | |
43321 unsigned long uintval; | |
43322 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); | |
43323 const digit* digits = __Pyx_PyLong_Digits(op1); | |
43324 if (intval == 0) { | |
43325 return (__Pyx_PyLong_IsZero(op1) == 1); | |
43326 } else if (intval < 0) { | |
43327 if (__Pyx_PyLong_IsNonNeg(op1)) | |
43328 return 0; | |
43329 intval = -intval; | |
43330 } else { | |
43331 if (__Pyx_PyLong_IsNeg(op1)) | |
43332 return 0; | |
43333 } | |
43334 uintval = (unsigned long) intval; | |
43335 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 | |
43336 if (uintval >> (PyLong_SHIFT * 4)) { | |
43337 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | |
43338 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); | |
43339 } else | |
43340 #endif | |
43341 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 | |
43342 if (uintval >> (PyLong_SHIFT * 3)) { | |
43343 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | |
43344 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); | |
43345 } else | |
43346 #endif | |
43347 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 | |
43348 if (uintval >> (PyLong_SHIFT * 2)) { | |
43349 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | |
43350 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); | |
43351 } else | |
43352 #endif | |
43353 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 | |
43354 if (uintval >> (PyLong_SHIFT * 1)) { | |
43355 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | |
43356 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); | |
43357 } else | |
43358 #endif | |
43359 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); | |
43360 return (unequal == 0); | |
43361 } | |
43362 #endif | |
43363 if (PyFloat_CheckExact(op1)) { | |
43364 const long b = intval; | |
43365 #if CYTHON_COMPILING_IN_LIMITED_API | |
43366 double a = __pyx_PyFloat_AsDouble(op1); | |
43367 #else | |
43368 double a = PyFloat_AS_DOUBLE(op1); | |
43369 #endif | |
43370 return ((double)a == (double)b); | |
43371 } | |
43372 return __Pyx_PyObject_IsTrueAndDecref( | |
43373 PyObject_RichCompare(op1, op2, Py_EQ)); | |
43374 } | |
43375 | |
43376 /* PyIntCompare */ | |
43377 static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { | |
43378 CYTHON_MAYBE_UNUSED_VAR(intval); | |
43379 CYTHON_UNUSED_VAR(inplace); | |
43380 if (op1 == op2) { | |
43381 return 0; | |
43382 } | |
43383 #if PY_MAJOR_VERSION < 3 | |
43384 if (likely(PyInt_CheckExact(op1))) { | |
43385 const long b = intval; | |
43386 long a = PyInt_AS_LONG(op1); | |
43387 return (a != b); | |
43388 } | |
43389 #endif | |
43390 #if CYTHON_USE_PYLONG_INTERNALS | |
43391 if (likely(PyLong_CheckExact(op1))) { | |
43392 int unequal; | |
43393 unsigned long uintval; | |
43394 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); | |
43395 const digit* digits = __Pyx_PyLong_Digits(op1); | |
43396 if (intval == 0) { | |
43397 return (__Pyx_PyLong_IsZero(op1) != 1); | |
43398 } else if (intval < 0) { | |
43399 if (__Pyx_PyLong_IsNonNeg(op1)) | |
43400 return 1; | |
43401 intval = -intval; | |
43402 } else { | |
43403 if (__Pyx_PyLong_IsNeg(op1)) | |
43404 return 1; | |
43405 } | |
43406 uintval = (unsigned long) intval; | |
43407 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 | |
43408 if (uintval >> (PyLong_SHIFT * 4)) { | |
43409 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | |
43410 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); | |
43411 } else | |
43412 #endif | |
43413 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 | |
43414 if (uintval >> (PyLong_SHIFT * 3)) { | |
43415 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | |
43416 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); | |
43417 } else | |
43418 #endif | |
43419 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 | |
43420 if (uintval >> (PyLong_SHIFT * 2)) { | |
43421 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | |
43422 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); | |
43423 } else | |
43424 #endif | |
43425 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 | |
43426 if (uintval >> (PyLong_SHIFT * 1)) { | |
43427 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | |
43428 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); | |
43429 } else | |
43430 #endif | |
43431 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); | |
43432 return (unequal != 0); | |
43433 } | |
43434 #endif | |
43435 if (PyFloat_CheckExact(op1)) { | |
43436 const long b = intval; | |
43437 #if CYTHON_COMPILING_IN_LIMITED_API | |
43438 double a = __pyx_PyFloat_AsDouble(op1); | |
43439 #else | |
43440 double a = PyFloat_AS_DOUBLE(op1); | |
43441 #endif | |
43442 return ((double)a != (double)b); | |
43443 } | |
43444 return __Pyx_PyObject_IsTrueAndDecref( | |
43445 PyObject_RichCompare(op1, op2, Py_NE)); | |
43446 } | |
43447 | |
43448 /* DictGetItem */ | |
43449 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY | |
43450 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { | |
43451 PyObject *value; | |
43452 value = PyDict_GetItemWithError(d, key); | |
43453 if (unlikely(!value)) { | |
43454 if (!PyErr_Occurred()) { | |
43455 if (unlikely(PyTuple_Check(key))) { | |
43456 PyObject* args = PyTuple_Pack(1, key); | |
43457 if (likely(args)) { | |
43458 PyErr_SetObject(PyExc_KeyError, args); | |
43459 Py_DECREF(args); | |
43460 } | |
43461 } else { | |
43462 PyErr_SetObject(PyExc_KeyError, key); | |
43463 } | |
43464 } | |
43465 return NULL; | |
43466 } | |
43467 Py_INCREF(value); | |
43468 return value; | |
43469 } | |
43470 #endif | |
43471 | |
43472 /* SliceObject */ | |
43473 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, | |
43474 Py_ssize_t cstart, Py_ssize_t cstop, | |
43475 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, | |
43476 int has_cstart, int has_cstop, int wraparound) { | |
43477 __Pyx_TypeName obj_type_name; | |
43478 #if CYTHON_USE_TYPE_SLOTS | |
43479 PyMappingMethods* mp; | |
43480 #if PY_MAJOR_VERSION < 3 | |
43481 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; | |
43482 if (likely(ms && ms->sq_slice)) { | |
43483 if (!has_cstart) { | |
43484 if (_py_start && (*_py_start != Py_None)) { | |
43485 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); | |
43486 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; | |
43487 } else | |
43488 cstart = 0; | |
43489 } | |
43490 if (!has_cstop) { | |
43491 if (_py_stop && (*_py_stop != Py_None)) { | |
43492 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); | |
43493 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; | |
43494 } else | |
43495 cstop = PY_SSIZE_T_MAX; | |
43496 } | |
43497 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { | |
43498 Py_ssize_t l = ms->sq_length(obj); | |
43499 if (likely(l >= 0)) { | |
43500 if (cstop < 0) { | |
43501 cstop += l; | |
43502 if (cstop < 0) cstop = 0; | |
43503 } | |
43504 if (cstart < 0) { | |
43505 cstart += l; | |
43506 if (cstart < 0) cstart = 0; | |
43507 } | |
43508 } else { | |
43509 if (!PyErr_ExceptionMatches(PyExc_OverflowError)) | |
43510 goto bad; | |
43511 PyErr_Clear(); | |
43512 } | |
43513 } | |
43514 return ms->sq_slice(obj, cstart, cstop); | |
43515 } | |
43516 #else | |
43517 CYTHON_UNUSED_VAR(wraparound); | |
43518 #endif | |
43519 mp = Py_TYPE(obj)->tp_as_mapping; | |
43520 if (likely(mp && mp->mp_subscript)) | |
43521 #else | |
43522 CYTHON_UNUSED_VAR(wraparound); | |
43523 #endif | |
43524 { | |
43525 PyObject* result; | |
43526 PyObject *py_slice, *py_start, *py_stop; | |
43527 if (_py_slice) { | |
43528 py_slice = *_py_slice; | |
43529 } else { | |
43530 PyObject* owned_start = NULL; | |
43531 PyObject* owned_stop = NULL; | |
43532 if (_py_start) { | |
43533 py_start = *_py_start; | |
43534 } else { | |
43535 if (has_cstart) { | |
43536 owned_start = py_start = PyInt_FromSsize_t(cstart); | |
43537 if (unlikely(!py_start)) goto bad; | |
43538 } else | |
43539 py_start = Py_None; | |
43540 } | |
43541 if (_py_stop) { | |
43542 py_stop = *_py_stop; | |
43543 } else { | |
43544 if (has_cstop) { | |
43545 owned_stop = py_stop = PyInt_FromSsize_t(cstop); | |
43546 if (unlikely(!py_stop)) { | |
43547 Py_XDECREF(owned_start); | |
43548 goto bad; | |
43549 } | |
43550 } else | |
43551 py_stop = Py_None; | |
43552 } | |
43553 py_slice = PySlice_New(py_start, py_stop, Py_None); | |
43554 Py_XDECREF(owned_start); | |
43555 Py_XDECREF(owned_stop); | |
43556 if (unlikely(!py_slice)) goto bad; | |
43557 } | |
43558 #if CYTHON_USE_TYPE_SLOTS | |
43559 result = mp->mp_subscript(obj, py_slice); | |
43560 #else | |
43561 result = PyObject_GetItem(obj, py_slice); | |
43562 #endif | |
43563 if (!_py_slice) { | |
43564 Py_DECREF(py_slice); | |
43565 } | |
43566 return result; | |
43567 } | |
43568 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
43569 PyErr_Format(PyExc_TypeError, | |
43570 "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); | |
43571 __Pyx_DECREF_TypeName(obj_type_name); | |
43572 bad: | |
43573 return NULL; | |
43574 } | |
43575 | |
43576 /* KeywordStringCheck */ | |
43577 static int __Pyx_CheckKeywordStrings( | |
43578 PyObject *kw, | |
43579 const char* function_name, | |
43580 int kw_allowed) | |
43581 { | |
43582 PyObject* key = 0; | |
43583 Py_ssize_t pos = 0; | |
43584 #if CYTHON_COMPILING_IN_PYPY | |
43585 if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) | |
43586 goto invalid_keyword; | |
43587 return 1; | |
43588 #else | |
43589 if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { | |
43590 Py_ssize_t kwsize; | |
43591 #if CYTHON_ASSUME_SAFE_MACROS | |
43592 kwsize = PyTuple_GET_SIZE(kw); | |
43593 #else | |
43594 kwsize = PyTuple_Size(kw); | |
43595 if (kwsize < 0) return 0; | |
43596 #endif | |
43597 if (unlikely(kwsize == 0)) | |
43598 return 1; | |
43599 if (!kw_allowed) { | |
43600 #if CYTHON_ASSUME_SAFE_MACROS | |
43601 key = PyTuple_GET_ITEM(kw, 0); | |
43602 #else | |
43603 key = PyTuple_GetItem(kw, pos); | |
43604 if (!key) return 0; | |
43605 #endif | |
43606 goto invalid_keyword; | |
43607 } | |
43608 #if PY_VERSION_HEX < 0x03090000 | |
43609 for (pos = 0; pos < kwsize; pos++) { | |
43610 #if CYTHON_ASSUME_SAFE_MACROS | |
43611 key = PyTuple_GET_ITEM(kw, pos); | |
43612 #else | |
43613 key = PyTuple_GetItem(kw, pos); | |
43614 if (!key) return 0; | |
43615 #endif | |
43616 if (unlikely(!PyUnicode_Check(key))) | |
43617 goto invalid_keyword_type; | |
43618 } | |
43619 #endif | |
43620 return 1; | |
43621 } | |
43622 while (PyDict_Next(kw, &pos, &key, 0)) { | |
43623 #if PY_MAJOR_VERSION < 3 | |
43624 if (unlikely(!PyString_Check(key))) | |
43625 #endif | |
43626 if (unlikely(!PyUnicode_Check(key))) | |
43627 goto invalid_keyword_type; | |
43628 } | |
43629 if (!kw_allowed && unlikely(key)) | |
43630 goto invalid_keyword; | |
43631 return 1; | |
43632 invalid_keyword_type: | |
43633 PyErr_Format(PyExc_TypeError, | |
43634 "%.200s() keywords must be strings", function_name); | |
43635 return 0; | |
43636 #endif | |
43637 invalid_keyword: | |
43638 #if PY_MAJOR_VERSION < 3 | |
43639 PyErr_Format(PyExc_TypeError, | |
43640 "%.200s() got an unexpected keyword argument '%.200s'", | |
43641 function_name, PyString_AsString(key)); | |
43642 #else | |
43643 PyErr_Format(PyExc_TypeError, | |
43644 "%s() got an unexpected keyword argument '%U'", | |
43645 function_name, key); | |
43646 #endif | |
43647 return 0; | |
43648 } | |
43649 | |
43650 /* GetAttr3 */ | |
43651 #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 | |
43652 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { | |
43653 __Pyx_PyThreadState_declare | |
43654 __Pyx_PyThreadState_assign | |
43655 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) | |
43656 return NULL; | |
43657 __Pyx_PyErr_Clear(); | |
43658 Py_INCREF(d); | |
43659 return d; | |
43660 } | |
43661 #endif | |
43662 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { | |
43663 PyObject *r; | |
43664 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 | |
43665 int res = PyObject_GetOptionalAttr(o, n, &r); | |
43666 return (res != 0) ? r : __Pyx_NewRef(d); | |
43667 #else | |
43668 #if CYTHON_USE_TYPE_SLOTS | |
43669 if (likely(PyString_Check(n))) { | |
43670 r = __Pyx_PyObject_GetAttrStrNoError(o, n); | |
43671 if (unlikely(!r) && likely(!PyErr_Occurred())) { | |
43672 r = __Pyx_NewRef(d); | |
43673 } | |
43674 return r; | |
43675 } | |
43676 #endif | |
43677 r = PyObject_GetAttr(o, n); | |
43678 return (likely(r)) ? r : __Pyx_GetAttr3Default(d); | |
43679 #endif | |
43680 } | |
43681 | |
43682 /* RaiseUnexpectedTypeError */ | |
43683 static int | |
43684 __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) | |
43685 { | |
43686 __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
43687 PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, | |
43688 expected, obj_type_name); | |
43689 __Pyx_DECREF_TypeName(obj_type_name); | |
43690 return 0; | |
43691 } | |
43692 | |
43693 /* IterFinish */ | |
43694 static CYTHON_INLINE int __Pyx_IterFinish(void) { | |
43695 PyObject* exc_type; | |
43696 __Pyx_PyThreadState_declare | |
43697 __Pyx_PyThreadState_assign | |
43698 exc_type = __Pyx_PyErr_CurrentExceptionType(); | |
43699 if (unlikely(exc_type)) { | |
43700 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) | |
43701 return -1; | |
43702 __Pyx_PyErr_Clear(); | |
43703 return 0; | |
43704 } | |
43705 return 0; | |
43706 } | |
43707 | |
43708 /* PyObjectCallNoArg */ | |
43709 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { | |
43710 PyObject *arg[2] = {NULL, NULL}; | |
43711 return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
43712 } | |
43713 | |
43714 /* PyObjectGetMethod */ | |
43715 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { | |
43716 PyObject *attr; | |
43717 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP | |
43718 __Pyx_TypeName type_name; | |
43719 PyTypeObject *tp = Py_TYPE(obj); | |
43720 PyObject *descr; | |
43721 descrgetfunc f = NULL; | |
43722 PyObject **dictptr, *dict; | |
43723 int meth_found = 0; | |
43724 assert (*method == NULL); | |
43725 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { | |
43726 attr = __Pyx_PyObject_GetAttrStr(obj, name); | |
43727 goto try_unpack; | |
43728 } | |
43729 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { | |
43730 return 0; | |
43731 } | |
43732 descr = _PyType_Lookup(tp, name); | |
43733 if (likely(descr != NULL)) { | |
43734 Py_INCREF(descr); | |
43735 #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR | |
43736 if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) | |
43737 #elif PY_MAJOR_VERSION >= 3 | |
43738 #ifdef __Pyx_CyFunction_USED | |
43739 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) | |
43740 #else | |
43741 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) | |
43742 #endif | |
43743 #else | |
43744 #ifdef __Pyx_CyFunction_USED | |
43745 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) | |
43746 #else | |
43747 if (likely(PyFunction_Check(descr))) | |
43748 #endif | |
43749 #endif | |
43750 { | |
43751 meth_found = 1; | |
43752 } else { | |
43753 f = Py_TYPE(descr)->tp_descr_get; | |
43754 if (f != NULL && PyDescr_IsData(descr)) { | |
43755 attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); | |
43756 Py_DECREF(descr); | |
43757 goto try_unpack; | |
43758 } | |
43759 } | |
43760 } | |
43761 dictptr = _PyObject_GetDictPtr(obj); | |
43762 if (dictptr != NULL && (dict = *dictptr) != NULL) { | |
43763 Py_INCREF(dict); | |
43764 attr = __Pyx_PyDict_GetItemStr(dict, name); | |
43765 if (attr != NULL) { | |
43766 Py_INCREF(attr); | |
43767 Py_DECREF(dict); | |
43768 Py_XDECREF(descr); | |
43769 goto try_unpack; | |
43770 } | |
43771 Py_DECREF(dict); | |
43772 } | |
43773 if (meth_found) { | |
43774 *method = descr; | |
43775 return 1; | |
43776 } | |
43777 if (f != NULL) { | |
43778 attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); | |
43779 Py_DECREF(descr); | |
43780 goto try_unpack; | |
43781 } | |
43782 if (likely(descr != NULL)) { | |
43783 *method = descr; | |
43784 return 0; | |
43785 } | |
43786 type_name = __Pyx_PyType_GetName(tp); | |
43787 PyErr_Format(PyExc_AttributeError, | |
43788 #if PY_MAJOR_VERSION >= 3 | |
43789 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", | |
43790 type_name, name); | |
43791 #else | |
43792 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", | |
43793 type_name, PyString_AS_STRING(name)); | |
43794 #endif | |
43795 __Pyx_DECREF_TypeName(type_name); | |
43796 return 0; | |
43797 #else | |
43798 attr = __Pyx_PyObject_GetAttrStr(obj, name); | |
43799 goto try_unpack; | |
43800 #endif | |
43801 try_unpack: | |
43802 #if CYTHON_UNPACK_METHODS | |
43803 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { | |
43804 PyObject *function = PyMethod_GET_FUNCTION(attr); | |
43805 Py_INCREF(function); | |
43806 Py_DECREF(attr); | |
43807 *method = function; | |
43808 return 1; | |
43809 } | |
43810 #endif | |
43811 *method = attr; | |
43812 return 0; | |
43813 } | |
43814 | |
43815 /* PyObjectCallMethod0 */ | |
43816 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { | |
43817 PyObject *method = NULL, *result = NULL; | |
43818 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); | |
43819 if (likely(is_method)) { | |
43820 result = __Pyx_PyObject_CallOneArg(method, obj); | |
43821 Py_DECREF(method); | |
43822 return result; | |
43823 } | |
43824 if (unlikely(!method)) goto bad; | |
43825 result = __Pyx_PyObject_CallNoArg(method); | |
43826 Py_DECREF(method); | |
43827 bad: | |
43828 return result; | |
43829 } | |
43830 | |
43831 /* RaiseNeedMoreValuesToUnpack */ | |
43832 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { | |
43833 PyErr_Format(PyExc_ValueError, | |
43834 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", | |
43835 index, (index == 1) ? "" : "s"); | |
43836 } | |
43837 | |
43838 /* RaiseTooManyValuesToUnpack */ | |
43839 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { | |
43840 PyErr_Format(PyExc_ValueError, | |
43841 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); | |
43842 } | |
43843 | |
43844 /* UnpackItemEndCheck */ | |
43845 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { | |
43846 if (unlikely(retval)) { | |
43847 Py_DECREF(retval); | |
43848 __Pyx_RaiseTooManyValuesError(expected); | |
43849 return -1; | |
43850 } | |
43851 return __Pyx_IterFinish(); | |
43852 } | |
43853 | |
43854 /* RaiseNoneIterError */ | |
43855 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { | |
43856 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); | |
43857 } | |
43858 | |
43859 /* UnpackTupleError */ | |
43860 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { | |
43861 if (t == Py_None) { | |
43862 __Pyx_RaiseNoneNotIterableError(); | |
43863 } else if (PyTuple_GET_SIZE(t) < index) { | |
43864 __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); | |
43865 } else { | |
43866 __Pyx_RaiseTooManyValuesError(index); | |
43867 } | |
43868 } | |
43869 | |
43870 /* UnpackTuple2 */ | |
43871 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( | |
43872 PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { | |
43873 PyObject *value1 = NULL, *value2 = NULL; | |
43874 #if CYTHON_COMPILING_IN_PYPY | |
43875 value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; | |
43876 value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; | |
43877 #else | |
43878 value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); | |
43879 value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); | |
43880 #endif | |
43881 if (decref_tuple) { | |
43882 Py_DECREF(tuple); | |
43883 } | |
43884 *pvalue1 = value1; | |
43885 *pvalue2 = value2; | |
43886 return 0; | |
43887 #if CYTHON_COMPILING_IN_PYPY | |
43888 bad: | |
43889 Py_XDECREF(value1); | |
43890 Py_XDECREF(value2); | |
43891 if (decref_tuple) { Py_XDECREF(tuple); } | |
43892 return -1; | |
43893 #endif | |
43894 } | |
43895 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, | |
43896 int has_known_size, int decref_tuple) { | |
43897 Py_ssize_t index; | |
43898 PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; | |
43899 iternextfunc iternext; | |
43900 iter = PyObject_GetIter(tuple); | |
43901 if (unlikely(!iter)) goto bad; | |
43902 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } | |
43903 iternext = __Pyx_PyObject_GetIterNextFunc(iter); | |
43904 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } | |
43905 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } | |
43906 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; | |
43907 Py_DECREF(iter); | |
43908 *pvalue1 = value1; | |
43909 *pvalue2 = value2; | |
43910 return 0; | |
43911 unpacking_failed: | |
43912 if (!has_known_size && __Pyx_IterFinish() == 0) | |
43913 __Pyx_RaiseNeedMoreValuesError(index); | |
43914 bad: | |
43915 Py_XDECREF(iter); | |
43916 Py_XDECREF(value1); | |
43917 Py_XDECREF(value2); | |
43918 if (decref_tuple) { Py_XDECREF(tuple); } | |
43919 return -1; | |
43920 } | |
43921 | |
43922 /* dict_iter */ | |
43923 #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 | |
43924 #include <string.h> | |
43925 #endif | |
43926 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, | |
43927 Py_ssize_t* p_orig_length, int* p_source_is_dict) { | |
43928 is_dict = is_dict || likely(PyDict_CheckExact(iterable)); | |
43929 *p_source_is_dict = is_dict; | |
43930 if (is_dict) { | |
43931 #if !CYTHON_COMPILING_IN_PYPY | |
43932 *p_orig_length = PyDict_Size(iterable); | |
43933 Py_INCREF(iterable); | |
43934 return iterable; | |
43935 #elif PY_MAJOR_VERSION >= 3 | |
43936 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; | |
43937 PyObject **pp = NULL; | |
43938 if (method_name) { | |
43939 const char *name = PyUnicode_AsUTF8(method_name); | |
43940 if (strcmp(name, "iteritems") == 0) pp = &py_items; | |
43941 else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; | |
43942 else if (strcmp(name, "itervalues") == 0) pp = &py_values; | |
43943 if (pp) { | |
43944 if (!*pp) { | |
43945 *pp = PyUnicode_FromString(name + 4); | |
43946 if (!*pp) | |
43947 return NULL; | |
43948 } | |
43949 method_name = *pp; | |
43950 } | |
43951 } | |
43952 #endif | |
43953 } | |
43954 *p_orig_length = 0; | |
43955 if (method_name) { | |
43956 PyObject* iter; | |
43957 iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); | |
43958 if (!iterable) | |
43959 return NULL; | |
43960 #if !CYTHON_COMPILING_IN_PYPY | |
43961 if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) | |
43962 return iterable; | |
43963 #endif | |
43964 iter = PyObject_GetIter(iterable); | |
43965 Py_DECREF(iterable); | |
43966 return iter; | |
43967 } | |
43968 return PyObject_GetIter(iterable); | |
43969 } | |
43970 static CYTHON_INLINE int __Pyx_dict_iter_next( | |
43971 PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, | |
43972 PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { | |
43973 PyObject* next_item; | |
43974 #if !CYTHON_COMPILING_IN_PYPY | |
43975 if (source_is_dict) { | |
43976 PyObject *key, *value; | |
43977 if (unlikely(orig_length != PyDict_Size(iter_obj))) { | |
43978 PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); | |
43979 return -1; | |
43980 } | |
43981 if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { | |
43982 return 0; | |
43983 } | |
43984 if (pitem) { | |
43985 PyObject* tuple = PyTuple_New(2); | |
43986 if (unlikely(!tuple)) { | |
43987 return -1; | |
43988 } | |
43989 Py_INCREF(key); | |
43990 Py_INCREF(value); | |
43991 PyTuple_SET_ITEM(tuple, 0, key); | |
43992 PyTuple_SET_ITEM(tuple, 1, value); | |
43993 *pitem = tuple; | |
43994 } else { | |
43995 if (pkey) { | |
43996 Py_INCREF(key); | |
43997 *pkey = key; | |
43998 } | |
43999 if (pvalue) { | |
44000 Py_INCREF(value); | |
44001 *pvalue = value; | |
44002 } | |
44003 } | |
44004 return 1; | |
44005 } else if (PyTuple_CheckExact(iter_obj)) { | |
44006 Py_ssize_t pos = *ppos; | |
44007 if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; | |
44008 *ppos = pos + 1; | |
44009 next_item = PyTuple_GET_ITEM(iter_obj, pos); | |
44010 Py_INCREF(next_item); | |
44011 } else if (PyList_CheckExact(iter_obj)) { | |
44012 Py_ssize_t pos = *ppos; | |
44013 if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; | |
44014 *ppos = pos + 1; | |
44015 next_item = PyList_GET_ITEM(iter_obj, pos); | |
44016 Py_INCREF(next_item); | |
44017 } else | |
44018 #endif | |
44019 { | |
44020 next_item = PyIter_Next(iter_obj); | |
44021 if (unlikely(!next_item)) { | |
44022 return __Pyx_IterFinish(); | |
44023 } | |
44024 } | |
44025 if (pitem) { | |
44026 *pitem = next_item; | |
44027 } else if (pkey && pvalue) { | |
44028 if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) | |
44029 return -1; | |
44030 } else if (pkey) { | |
44031 *pkey = next_item; | |
44032 } else { | |
44033 *pvalue = next_item; | |
44034 } | |
44035 return 1; | |
44036 } | |
44037 | |
44038 /* PyObjectSetAttrStr */ | |
44039 #if CYTHON_USE_TYPE_SLOTS | |
44040 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { | |
44041 PyTypeObject* tp = Py_TYPE(obj); | |
44042 if (likely(tp->tp_setattro)) | |
44043 return tp->tp_setattro(obj, attr_name, value); | |
44044 #if PY_MAJOR_VERSION < 3 | |
44045 if (likely(tp->tp_setattr)) | |
44046 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); | |
44047 #endif | |
44048 return PyObject_SetAttr(obj, attr_name, value); | |
44049 } | |
44050 #endif | |
44051 | |
44052 /* unicode_tailmatch */ | |
44053 static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings, | |
44054 Py_ssize_t start, Py_ssize_t end, int direction) { | |
44055 Py_ssize_t i, count = PyTuple_GET_SIZE(substrings); | |
44056 for (i = 0; i < count; i++) { | |
44057 Py_ssize_t result; | |
44058 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
44059 result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i), | |
44060 start, end, direction); | |
44061 #else | |
44062 PyObject* sub = PySequence_ITEM(substrings, i); | |
44063 if (unlikely(!sub)) return -1; | |
44064 result = PyUnicode_Tailmatch(s, sub, start, end, direction); | |
44065 Py_DECREF(sub); | |
44066 #endif | |
44067 if (result) { | |
44068 return (int) result; | |
44069 } | |
44070 } | |
44071 return 0; | |
44072 } | |
44073 static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, | |
44074 Py_ssize_t start, Py_ssize_t end, int direction) { | |
44075 if (unlikely(PyTuple_Check(substr))) { | |
44076 return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction); | |
44077 } | |
44078 return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); | |
44079 } | |
44080 | |
44081 /* PyUnicode_Substring */ | |
44082 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring( | |
44083 PyObject* text, Py_ssize_t start, Py_ssize_t stop) { | |
44084 Py_ssize_t length; | |
44085 if (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL; | |
44086 length = __Pyx_PyUnicode_GET_LENGTH(text); | |
44087 if (start < 0) { | |
44088 start += length; | |
44089 if (start < 0) | |
44090 start = 0; | |
44091 } | |
44092 if (stop < 0) | |
44093 stop += length; | |
44094 else if (stop > length) | |
44095 stop = length; | |
44096 if (stop <= start) | |
44097 return __Pyx_NewRef(__pyx_empty_unicode); | |
44098 if (start == 0 && stop == length) | |
44099 return __Pyx_NewRef(text); | |
44100 #if CYTHON_PEP393_ENABLED | |
44101 return PyUnicode_FromKindAndData(PyUnicode_KIND(text), | |
44102 PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start); | |
44103 #else | |
44104 return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(text)+start, stop-start); | |
44105 #endif | |
44106 } | |
44107 | |
44108 /* PyIntBinop */ | |
44109 #if !CYTHON_COMPILING_IN_PYPY | |
44110 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { | |
44111 CYTHON_MAYBE_UNUSED_VAR(intval); | |
44112 CYTHON_MAYBE_UNUSED_VAR(inplace); | |
44113 CYTHON_UNUSED_VAR(zerodivision_check); | |
44114 #if PY_MAJOR_VERSION < 3 | |
44115 if (likely(PyInt_CheckExact(op1))) { | |
44116 const long b = intval; | |
44117 long x; | |
44118 long a = PyInt_AS_LONG(op1); | |
44119 | |
44120 x = (long)((unsigned long)a + (unsigned long)b); | |
44121 if (likely((x^a) >= 0 || (x^b) >= 0)) | |
44122 return PyInt_FromLong(x); | |
44123 return PyLong_Type.tp_as_number->nb_add(op1, op2); | |
44124 } | |
44125 #endif | |
44126 #if CYTHON_USE_PYLONG_INTERNALS | |
44127 if (likely(PyLong_CheckExact(op1))) { | |
44128 const long b = intval; | |
44129 long a, x; | |
44130 #ifdef HAVE_LONG_LONG | |
44131 const PY_LONG_LONG llb = intval; | |
44132 PY_LONG_LONG lla, llx; | |
44133 #endif | |
44134 if (unlikely(__Pyx_PyLong_IsZero(op1))) { | |
44135 return __Pyx_NewRef(op2); | |
44136 } | |
44137 if (likely(__Pyx_PyLong_IsCompact(op1))) { | |
44138 a = __Pyx_PyLong_CompactValue(op1); | |
44139 } else { | |
44140 const digit* digits = __Pyx_PyLong_Digits(op1); | |
44141 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); | |
44142 switch (size) { | |
44143 case -2: | |
44144 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
44145 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44146 break; | |
44147 #ifdef HAVE_LONG_LONG | |
44148 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
44149 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44150 goto long_long; | |
44151 #endif | |
44152 } | |
44153 CYTHON_FALLTHROUGH; | |
44154 case 2: | |
44155 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
44156 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44157 break; | |
44158 #ifdef HAVE_LONG_LONG | |
44159 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
44160 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44161 goto long_long; | |
44162 #endif | |
44163 } | |
44164 CYTHON_FALLTHROUGH; | |
44165 case -3: | |
44166 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
44167 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44168 break; | |
44169 #ifdef HAVE_LONG_LONG | |
44170 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
44171 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44172 goto long_long; | |
44173 #endif | |
44174 } | |
44175 CYTHON_FALLTHROUGH; | |
44176 case 3: | |
44177 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
44178 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44179 break; | |
44180 #ifdef HAVE_LONG_LONG | |
44181 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
44182 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44183 goto long_long; | |
44184 #endif | |
44185 } | |
44186 CYTHON_FALLTHROUGH; | |
44187 case -4: | |
44188 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
44189 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44190 break; | |
44191 #ifdef HAVE_LONG_LONG | |
44192 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
44193 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44194 goto long_long; | |
44195 #endif | |
44196 } | |
44197 CYTHON_FALLTHROUGH; | |
44198 case 4: | |
44199 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
44200 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44201 break; | |
44202 #ifdef HAVE_LONG_LONG | |
44203 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
44204 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44205 goto long_long; | |
44206 #endif | |
44207 } | |
44208 CYTHON_FALLTHROUGH; | |
44209 default: return PyLong_Type.tp_as_number->nb_add(op1, op2); | |
44210 } | |
44211 } | |
44212 x = a + b; | |
44213 return PyLong_FromLong(x); | |
44214 #ifdef HAVE_LONG_LONG | |
44215 long_long: | |
44216 llx = lla + llb; | |
44217 return PyLong_FromLongLong(llx); | |
44218 #endif | |
44219 | |
44220 | |
44221 } | |
44222 #endif | |
44223 if (PyFloat_CheckExact(op1)) { | |
44224 const long b = intval; | |
44225 #if CYTHON_COMPILING_IN_LIMITED_API | |
44226 double a = __pyx_PyFloat_AsDouble(op1); | |
44227 #else | |
44228 double a = PyFloat_AS_DOUBLE(op1); | |
44229 #endif | |
44230 double result; | |
44231 | |
44232 PyFPE_START_PROTECT("add", return NULL) | |
44233 result = ((double)a) + (double)b; | |
44234 PyFPE_END_PROTECT(result) | |
44235 return PyFloat_FromDouble(result); | |
44236 } | |
44237 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); | |
44238 } | |
44239 #endif | |
44240 | |
44241 /* UnicodeConcatInPlace */ | |
44242 # if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
44243 static int | |
44244 __Pyx_unicode_modifiable(PyObject *unicode) | |
44245 { | |
44246 if (Py_REFCNT(unicode) != 1) | |
44247 return 0; | |
44248 if (!PyUnicode_CheckExact(unicode)) | |
44249 return 0; | |
44250 if (PyUnicode_CHECK_INTERNED(unicode)) | |
44251 return 0; | |
44252 return 1; | |
44253 } | |
44254 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right | |
44255 #if CYTHON_REFNANNY | |
44256 , void* __pyx_refnanny | |
44257 #endif | |
44258 ) { | |
44259 PyObject *left = *p_left; | |
44260 Py_ssize_t left_len, right_len, new_len; | |
44261 if (unlikely(__Pyx_PyUnicode_READY(left) == -1)) | |
44262 return NULL; | |
44263 if (unlikely(__Pyx_PyUnicode_READY(right) == -1)) | |
44264 return NULL; | |
44265 left_len = PyUnicode_GET_LENGTH(left); | |
44266 if (left_len == 0) { | |
44267 Py_INCREF(right); | |
44268 return right; | |
44269 } | |
44270 right_len = PyUnicode_GET_LENGTH(right); | |
44271 if (right_len == 0) { | |
44272 Py_INCREF(left); | |
44273 return left; | |
44274 } | |
44275 if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) { | |
44276 PyErr_SetString(PyExc_OverflowError, | |
44277 "strings are too large to concat"); | |
44278 return NULL; | |
44279 } | |
44280 new_len = left_len + right_len; | |
44281 if (__Pyx_unicode_modifiable(left) | |
44282 && PyUnicode_CheckExact(right) | |
44283 && PyUnicode_KIND(right) <= PyUnicode_KIND(left) | |
44284 && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { | |
44285 int ret; | |
44286 __Pyx_GIVEREF(*p_left); | |
44287 ret = PyUnicode_Resize(p_left, new_len); | |
44288 __Pyx_GOTREF(*p_left); | |
44289 if (unlikely(ret != 0)) | |
44290 return NULL; | |
44291 #if PY_VERSION_HEX >= 0x030d0000 | |
44292 if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; | |
44293 #else | |
44294 _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); | |
44295 #endif | |
44296 __Pyx_INCREF(*p_left); | |
44297 __Pyx_GIVEREF(*p_left); | |
44298 return *p_left; | |
44299 } else { | |
44300 return __Pyx_PyUnicode_Concat(left, right); | |
44301 } | |
44302 } | |
44303 #endif | |
44304 | |
44305 /* DivInt[Py_ssize_t] */ | |
44306 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { | |
44307 Py_ssize_t q = a / b; | |
44308 Py_ssize_t r = a - q*b; | |
44309 q -= ((r != 0) & ((r ^ b) < 0)); | |
44310 return q; | |
44311 } | |
44312 | |
44313 /* SliceTupleAndList */ | |
44314 #if CYTHON_COMPILING_IN_CPYTHON | |
44315 static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { | |
44316 Py_ssize_t start = *_start, stop = *_stop, length = *_length; | |
44317 if (start < 0) { | |
44318 start += length; | |
44319 if (start < 0) | |
44320 start = 0; | |
44321 } | |
44322 if (stop < 0) | |
44323 stop += length; | |
44324 else if (stop > length) | |
44325 stop = length; | |
44326 *_length = stop - start; | |
44327 *_start = start; | |
44328 *_stop = stop; | |
44329 } | |
44330 static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( | |
44331 PyObject* src, Py_ssize_t start, Py_ssize_t stop) { | |
44332 Py_ssize_t length = PyList_GET_SIZE(src); | |
44333 __Pyx_crop_slice(&start, &stop, &length); | |
44334 if (length <= 0) { | |
44335 return PyList_New(0); | |
44336 } | |
44337 return __Pyx_PyList_FromArray(((PyListObject*)src)->ob_item + start, length); | |
44338 } | |
44339 static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( | |
44340 PyObject* src, Py_ssize_t start, Py_ssize_t stop) { | |
44341 Py_ssize_t length = PyTuple_GET_SIZE(src); | |
44342 __Pyx_crop_slice(&start, &stop, &length); | |
44343 return __Pyx_PyTuple_FromArray(((PyTupleObject*)src)->ob_item + start, length); | |
44344 } | |
44345 #endif | |
44346 | |
44347 /* PyObjectCall2Args */ | |
44348 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { | |
44349 PyObject *args[3] = {NULL, arg1, arg2}; | |
44350 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
44351 } | |
44352 | |
44353 /* PyObjectCallMethod1 */ | |
44354 #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) | |
44355 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { | |
44356 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); | |
44357 Py_DECREF(method); | |
44358 return result; | |
44359 } | |
44360 #endif | |
44361 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { | |
44362 #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 | |
44363 PyObject *args[2] = {obj, arg}; | |
44364 (void) __Pyx_PyObject_GetMethod; | |
44365 (void) __Pyx_PyObject_CallOneArg; | |
44366 (void) __Pyx_PyObject_Call2Args; | |
44367 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); | |
44368 #else | |
44369 PyObject *method = NULL, *result; | |
44370 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); | |
44371 if (likely(is_method)) { | |
44372 result = __Pyx_PyObject_Call2Args(method, obj, arg); | |
44373 Py_DECREF(method); | |
44374 return result; | |
44375 } | |
44376 if (unlikely(!method)) return NULL; | |
44377 return __Pyx__PyObject_CallMethod1(method, arg); | |
44378 #endif | |
44379 } | |
44380 | |
44381 /* append */ | |
44382 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { | |
44383 if (likely(PyList_CheckExact(L))) { | |
44384 if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; | |
44385 } else { | |
44386 PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); | |
44387 if (unlikely(!retval)) | |
44388 return -1; | |
44389 Py_DECREF(retval); | |
44390 } | |
44391 return 0; | |
44392 } | |
44393 | |
44394 /* PyIntBinop */ | |
44395 #if !CYTHON_COMPILING_IN_PYPY | |
44396 static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { | |
44397 CYTHON_MAYBE_UNUSED_VAR(intval); | |
44398 CYTHON_MAYBE_UNUSED_VAR(inplace); | |
44399 CYTHON_UNUSED_VAR(zerodivision_check); | |
44400 #if PY_MAJOR_VERSION < 3 | |
44401 if (likely(PyInt_CheckExact(op1))) { | |
44402 const long b = intval; | |
44403 long x; | |
44404 long a = PyInt_AS_LONG(op1); | |
44405 | |
44406 if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a)) | |
44407 return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2); | |
44408 else { | |
44409 long q, r; | |
44410 q = a / b; | |
44411 r = a - q*b; | |
44412 q -= ((r != 0) & ((r ^ b) < 0)); | |
44413 x = q; | |
44414 } | |
44415 return PyInt_FromLong(x); | |
44416 } | |
44417 #endif | |
44418 #if CYTHON_USE_PYLONG_INTERNALS | |
44419 if (likely(PyLong_CheckExact(op1))) { | |
44420 const long b = intval; | |
44421 long a, x; | |
44422 #ifdef HAVE_LONG_LONG | |
44423 const PY_LONG_LONG llb = intval; | |
44424 PY_LONG_LONG lla, llx; | |
44425 #endif | |
44426 if (unlikely(__Pyx_PyLong_IsZero(op1))) { | |
44427 return __Pyx_NewRef(op1); | |
44428 } | |
44429 if (likely(__Pyx_PyLong_IsCompact(op1))) { | |
44430 a = __Pyx_PyLong_CompactValue(op1); | |
44431 } else { | |
44432 const digit* digits = __Pyx_PyLong_Digits(op1); | |
44433 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); | |
44434 switch (size) { | |
44435 case -2: | |
44436 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
44437 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44438 break; | |
44439 #ifdef HAVE_LONG_LONG | |
44440 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
44441 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44442 goto long_long; | |
44443 #endif | |
44444 } | |
44445 CYTHON_FALLTHROUGH; | |
44446 case 2: | |
44447 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
44448 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44449 break; | |
44450 #ifdef HAVE_LONG_LONG | |
44451 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
44452 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44453 goto long_long; | |
44454 #endif | |
44455 } | |
44456 CYTHON_FALLTHROUGH; | |
44457 case -3: | |
44458 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
44459 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44460 break; | |
44461 #ifdef HAVE_LONG_LONG | |
44462 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
44463 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44464 goto long_long; | |
44465 #endif | |
44466 } | |
44467 CYTHON_FALLTHROUGH; | |
44468 case 3: | |
44469 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
44470 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44471 break; | |
44472 #ifdef HAVE_LONG_LONG | |
44473 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
44474 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44475 goto long_long; | |
44476 #endif | |
44477 } | |
44478 CYTHON_FALLTHROUGH; | |
44479 case -4: | |
44480 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
44481 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44482 break; | |
44483 #ifdef HAVE_LONG_LONG | |
44484 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
44485 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44486 goto long_long; | |
44487 #endif | |
44488 } | |
44489 CYTHON_FALLTHROUGH; | |
44490 case 4: | |
44491 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
44492 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44493 break; | |
44494 #ifdef HAVE_LONG_LONG | |
44495 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
44496 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44497 goto long_long; | |
44498 #endif | |
44499 } | |
44500 CYTHON_FALLTHROUGH; | |
44501 default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2); | |
44502 } | |
44503 } | |
44504 { | |
44505 long q, r; | |
44506 q = a / b; | |
44507 r = a - q*b; | |
44508 q -= ((r != 0) & ((r ^ b) < 0)); | |
44509 x = q; | |
44510 } | |
44511 return PyLong_FromLong(x); | |
44512 #ifdef HAVE_LONG_LONG | |
44513 long_long: | |
44514 { | |
44515 PY_LONG_LONG q, r; | |
44516 q = lla / llb; | |
44517 r = lla - q*llb; | |
44518 q -= ((r != 0) & ((r ^ llb) < 0)); | |
44519 llx = q; | |
44520 } | |
44521 return PyLong_FromLongLong(llx); | |
44522 #endif | |
44523 | |
44524 | |
44525 } | |
44526 #endif | |
44527 return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2); | |
44528 } | |
44529 #endif | |
44530 | |
44531 /* PyIntBinop */ | |
44532 #if !CYTHON_COMPILING_IN_PYPY | |
44533 static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { | |
44534 CYTHON_MAYBE_UNUSED_VAR(intval); | |
44535 CYTHON_MAYBE_UNUSED_VAR(inplace); | |
44536 CYTHON_UNUSED_VAR(zerodivision_check); | |
44537 #if PY_MAJOR_VERSION < 3 | |
44538 if (likely(PyInt_CheckExact(op1))) { | |
44539 const long b = intval; | |
44540 long x; | |
44541 long a = PyInt_AS_LONG(op1); | |
44542 | |
44543 x = a % b; | |
44544 x += ((x != 0) & ((x ^ b) < 0)) * b; | |
44545 return PyInt_FromLong(x); | |
44546 } | |
44547 #endif | |
44548 #if CYTHON_USE_PYLONG_INTERNALS | |
44549 if (likely(PyLong_CheckExact(op1))) { | |
44550 const long b = intval; | |
44551 long a, x; | |
44552 #ifdef HAVE_LONG_LONG | |
44553 const PY_LONG_LONG llb = intval; | |
44554 PY_LONG_LONG lla, llx; | |
44555 #endif | |
44556 if (unlikely(__Pyx_PyLong_IsZero(op1))) { | |
44557 return __Pyx_NewRef(op1); | |
44558 } | |
44559 if (likely(__Pyx_PyLong_IsCompact(op1))) { | |
44560 a = __Pyx_PyLong_CompactValue(op1); | |
44561 } else { | |
44562 const digit* digits = __Pyx_PyLong_Digits(op1); | |
44563 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); | |
44564 switch (size) { | |
44565 case -2: | |
44566 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
44567 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44568 break; | |
44569 #ifdef HAVE_LONG_LONG | |
44570 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
44571 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44572 goto long_long; | |
44573 #endif | |
44574 } | |
44575 CYTHON_FALLTHROUGH; | |
44576 case 2: | |
44577 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
44578 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44579 break; | |
44580 #ifdef HAVE_LONG_LONG | |
44581 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
44582 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44583 goto long_long; | |
44584 #endif | |
44585 } | |
44586 CYTHON_FALLTHROUGH; | |
44587 case -3: | |
44588 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
44589 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44590 break; | |
44591 #ifdef HAVE_LONG_LONG | |
44592 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
44593 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44594 goto long_long; | |
44595 #endif | |
44596 } | |
44597 CYTHON_FALLTHROUGH; | |
44598 case 3: | |
44599 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
44600 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44601 break; | |
44602 #ifdef HAVE_LONG_LONG | |
44603 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
44604 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44605 goto long_long; | |
44606 #endif | |
44607 } | |
44608 CYTHON_FALLTHROUGH; | |
44609 case -4: | |
44610 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
44611 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44612 break; | |
44613 #ifdef HAVE_LONG_LONG | |
44614 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
44615 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44616 goto long_long; | |
44617 #endif | |
44618 } | |
44619 CYTHON_FALLTHROUGH; | |
44620 case 4: | |
44621 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
44622 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
44623 break; | |
44624 #ifdef HAVE_LONG_LONG | |
44625 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
44626 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
44627 goto long_long; | |
44628 #endif | |
44629 } | |
44630 CYTHON_FALLTHROUGH; | |
44631 default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2); | |
44632 } | |
44633 } | |
44634 x = a % b; | |
44635 x += ((x != 0) & ((x ^ b) < 0)) * b; | |
44636 return PyLong_FromLong(x); | |
44637 #ifdef HAVE_LONG_LONG | |
44638 long_long: | |
44639 llx = lla % llb; | |
44640 llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb; | |
44641 return PyLong_FromLongLong(llx); | |
44642 #endif | |
44643 | |
44644 | |
44645 } | |
44646 #endif | |
44647 return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2); | |
44648 } | |
44649 #endif | |
44650 | |
44651 /* SetItemInt */ | |
44652 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { | |
44653 int r; | |
44654 if (unlikely(!j)) return -1; | |
44655 r = PyObject_SetItem(o, j, v); | |
44656 Py_DECREF(j); | |
44657 return r; | |
44658 } | |
44659 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, | |
44660 CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { | |
44661 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS | |
44662 if (is_list || PyList_CheckExact(o)) { | |
44663 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); | |
44664 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { | |
44665 PyObject* old = PyList_GET_ITEM(o, n); | |
44666 Py_INCREF(v); | |
44667 PyList_SET_ITEM(o, n, v); | |
44668 Py_DECREF(old); | |
44669 return 1; | |
44670 } | |
44671 } else { | |
44672 PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; | |
44673 PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; | |
44674 if (mm && mm->mp_ass_subscript) { | |
44675 int r; | |
44676 PyObject *key = PyInt_FromSsize_t(i); | |
44677 if (unlikely(!key)) return -1; | |
44678 r = mm->mp_ass_subscript(o, key, v); | |
44679 Py_DECREF(key); | |
44680 return r; | |
44681 } | |
44682 if (likely(sm && sm->sq_ass_item)) { | |
44683 if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { | |
44684 Py_ssize_t l = sm->sq_length(o); | |
44685 if (likely(l >= 0)) { | |
44686 i += l; | |
44687 } else { | |
44688 if (!PyErr_ExceptionMatches(PyExc_OverflowError)) | |
44689 return -1; | |
44690 PyErr_Clear(); | |
44691 } | |
44692 } | |
44693 return sm->sq_ass_item(o, i, v); | |
44694 } | |
44695 } | |
44696 #else | |
44697 if (is_list || !PyMapping_Check(o)) | |
44698 { | |
44699 return PySequence_SetItem(o, i, v); | |
44700 } | |
44701 #endif | |
44702 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); | |
44703 } | |
44704 | |
44705 /* pyobject_as_double */ | |
44706 static double __Pyx__PyObject_AsDouble(PyObject* obj) { | |
44707 if (PyUnicode_CheckExact(obj)) { | |
44708 return __Pyx_PyUnicode_AsDouble(obj); | |
44709 } else if (PyBytes_CheckExact(obj)) { | |
44710 return __Pyx_PyBytes_AsDouble(obj); | |
44711 } else if (PyByteArray_CheckExact(obj)) { | |
44712 return __Pyx_PyByteArray_AsDouble(obj); | |
44713 } else { | |
44714 PyObject* float_value; | |
44715 #if !CYTHON_USE_TYPE_SLOTS | |
44716 float_value = PyNumber_Float(obj); if ((0)) goto bad; | |
44717 (void)__Pyx_PyObject_CallOneArg; | |
44718 #else | |
44719 PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; | |
44720 if (likely(nb) && likely(nb->nb_float)) { | |
44721 float_value = nb->nb_float(obj); | |
44722 if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { | |
44723 __Pyx_TypeName float_value_type_name = __Pyx_PyType_GetName(Py_TYPE(float_value)); | |
44724 PyErr_Format(PyExc_TypeError, | |
44725 "__float__ returned non-float (type " __Pyx_FMT_TYPENAME ")", | |
44726 float_value_type_name); | |
44727 __Pyx_DECREF_TypeName(float_value_type_name); | |
44728 Py_DECREF(float_value); | |
44729 goto bad; | |
44730 } | |
44731 } else { | |
44732 float_value = __Pyx_PyObject_CallOneArg((PyObject*)&PyFloat_Type, obj); | |
44733 } | |
44734 #endif | |
44735 if (likely(float_value)) { | |
44736 double value = PyFloat_AS_DOUBLE(float_value); | |
44737 Py_DECREF(float_value); | |
44738 return value; | |
44739 } | |
44740 } | |
44741 bad: | |
44742 return (double)-1; | |
44743 } | |
44744 | |
44745 /* PySequenceMultiply */ | |
44746 static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) { | |
44747 PyObject *result, *pymul = PyInt_FromSsize_t(mul); | |
44748 if (unlikely(!pymul)) | |
44749 return NULL; | |
44750 result = PyNumber_Multiply(seq, pymul); | |
44751 Py_DECREF(pymul); | |
44752 return result; | |
44753 } | |
44754 static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) { | |
44755 #if CYTHON_USE_TYPE_SLOTS | |
44756 PyTypeObject *type = Py_TYPE(seq); | |
44757 if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) { | |
44758 return type->tp_as_sequence->sq_repeat(seq, mul); | |
44759 } else | |
44760 #endif | |
44761 { | |
44762 return __Pyx_PySequence_Multiply_Generic(seq, mul); | |
44763 } | |
44764 } | |
44765 | |
44766 /* pep479 */ | |
44767 static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { | |
44768 PyObject *exc, *val, *tb, *cur_exc; | |
44769 __Pyx_PyThreadState_declare | |
44770 #ifdef __Pyx_StopAsyncIteration_USED | |
44771 int is_async_stopiteration = 0; | |
44772 #endif | |
44773 CYTHON_MAYBE_UNUSED_VAR(in_async_gen); | |
44774 cur_exc = PyErr_Occurred(); | |
44775 if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { | |
44776 #ifdef __Pyx_StopAsyncIteration_USED | |
44777 if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { | |
44778 is_async_stopiteration = 1; | |
44779 } else | |
44780 #endif | |
44781 return; | |
44782 } | |
44783 __Pyx_PyThreadState_assign | |
44784 __Pyx_GetException(&exc, &val, &tb); | |
44785 Py_XDECREF(exc); | |
44786 Py_XDECREF(val); | |
44787 Py_XDECREF(tb); | |
44788 PyErr_SetString(PyExc_RuntimeError, | |
44789 #ifdef __Pyx_StopAsyncIteration_USED | |
44790 is_async_stopiteration ? "async generator raised StopAsyncIteration" : | |
44791 in_async_gen ? "async generator raised StopIteration" : | |
44792 #endif | |
44793 "generator raised StopIteration"); | |
44794 } | |
44795 | |
44796 /* Import */ | |
44797 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { | |
44798 PyObject *module = 0; | |
44799 PyObject *empty_dict = 0; | |
44800 PyObject *empty_list = 0; | |
44801 #if PY_MAJOR_VERSION < 3 | |
44802 PyObject *py_import; | |
44803 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); | |
44804 if (unlikely(!py_import)) | |
44805 goto bad; | |
44806 if (!from_list) { | |
44807 empty_list = PyList_New(0); | |
44808 if (unlikely(!empty_list)) | |
44809 goto bad; | |
44810 from_list = empty_list; | |
44811 } | |
44812 #endif | |
44813 empty_dict = PyDict_New(); | |
44814 if (unlikely(!empty_dict)) | |
44815 goto bad; | |
44816 { | |
44817 #if PY_MAJOR_VERSION >= 3 | |
44818 if (level == -1) { | |
44819 if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { | |
44820 module = PyImport_ImportModuleLevelObject( | |
44821 name, __pyx_d, empty_dict, from_list, 1); | |
44822 if (unlikely(!module)) { | |
44823 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) | |
44824 goto bad; | |
44825 PyErr_Clear(); | |
44826 } | |
44827 } | |
44828 level = 0; | |
44829 } | |
44830 #endif | |
44831 if (!module) { | |
44832 #if PY_MAJOR_VERSION < 3 | |
44833 PyObject *py_level = PyInt_FromLong(level); | |
44834 if (unlikely(!py_level)) | |
44835 goto bad; | |
44836 module = PyObject_CallFunctionObjArgs(py_import, | |
44837 name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); | |
44838 Py_DECREF(py_level); | |
44839 #else | |
44840 module = PyImport_ImportModuleLevelObject( | |
44841 name, __pyx_d, empty_dict, from_list, level); | |
44842 #endif | |
44843 } | |
44844 } | |
44845 bad: | |
44846 Py_XDECREF(empty_dict); | |
44847 Py_XDECREF(empty_list); | |
44848 #if PY_MAJOR_VERSION < 3 | |
44849 Py_XDECREF(py_import); | |
44850 #endif | |
44851 return module; | |
44852 } | |
44853 | |
44854 /* ImportFrom */ | |
44855 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { | |
44856 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); | |
44857 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { | |
44858 const char* module_name_str = 0; | |
44859 PyObject* module_name = 0; | |
44860 PyObject* module_dot = 0; | |
44861 PyObject* full_name = 0; | |
44862 PyErr_Clear(); | |
44863 module_name_str = PyModule_GetName(module); | |
44864 if (unlikely(!module_name_str)) { goto modbad; } | |
44865 module_name = PyUnicode_FromString(module_name_str); | |
44866 if (unlikely(!module_name)) { goto modbad; } | |
44867 module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__5); | |
44868 if (unlikely(!module_dot)) { goto modbad; } | |
44869 full_name = PyUnicode_Concat(module_dot, name); | |
44870 if (unlikely(!full_name)) { goto modbad; } | |
44871 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) | |
44872 { | |
44873 PyObject *modules = PyImport_GetModuleDict(); | |
44874 if (unlikely(!modules)) | |
44875 goto modbad; | |
44876 value = PyObject_GetItem(modules, full_name); | |
44877 } | |
44878 #else | |
44879 value = PyImport_GetModule(full_name); | |
44880 #endif | |
44881 modbad: | |
44882 Py_XDECREF(full_name); | |
44883 Py_XDECREF(module_dot); | |
44884 Py_XDECREF(module_name); | |
44885 } | |
44886 if (unlikely(!value)) { | |
44887 PyErr_Format(PyExc_ImportError, | |
44888 #if PY_MAJOR_VERSION < 3 | |
44889 "cannot import name %.230s", PyString_AS_STRING(name)); | |
44890 #else | |
44891 "cannot import name %S", name); | |
44892 #endif | |
44893 } | |
44894 return value; | |
44895 } | |
44896 | |
44897 /* GetAttr */ | |
44898 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { | |
44899 #if CYTHON_USE_TYPE_SLOTS | |
44900 #if PY_MAJOR_VERSION >= 3 | |
44901 if (likely(PyUnicode_Check(n))) | |
44902 #else | |
44903 if (likely(PyString_Check(n))) | |
44904 #endif | |
44905 return __Pyx_PyObject_GetAttrStr(o, n); | |
44906 #endif | |
44907 return PyObject_GetAttr(o, n); | |
44908 } | |
44909 | |
44910 /* HasAttr */ | |
44911 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { | |
44912 PyObject *r; | |
44913 if (unlikely(!__Pyx_PyBaseString_Check(n))) { | |
44914 PyErr_SetString(PyExc_TypeError, | |
44915 "hasattr(): attribute name must be string"); | |
44916 return -1; | |
44917 } | |
44918 r = __Pyx_GetAttr(o, n); | |
44919 if (!r) { | |
44920 PyErr_Clear(); | |
44921 return 0; | |
44922 } else { | |
44923 Py_DECREF(r); | |
44924 return 1; | |
44925 } | |
44926 } | |
44927 | |
44928 /* CallNextTpDealloc */ | |
44929 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { | |
44930 PyTypeObject* type = Py_TYPE(obj); | |
44931 destructor tp_dealloc = NULL; | |
44932 while (type && __Pyx_PyType_GetSlot(type, tp_dealloc, destructor) != current_tp_dealloc) | |
44933 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
44934 while (type && (tp_dealloc = __Pyx_PyType_GetSlot(type, tp_dealloc, destructor)) == current_tp_dealloc) | |
44935 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
44936 if (type) | |
44937 tp_dealloc(obj); | |
44938 } | |
44939 | |
44940 /* CallNextTpTraverse */ | |
44941 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { | |
44942 PyTypeObject* type = Py_TYPE(obj); | |
44943 traverseproc tp_traverse = NULL; | |
44944 while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse) | |
44945 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
44946 while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse) | |
44947 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
44948 if (type && tp_traverse) | |
44949 return tp_traverse(obj, v, a); | |
44950 return 0; | |
44951 } | |
44952 | |
44953 /* CallNextTpClear */ | |
44954 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { | |
44955 PyTypeObject* type = Py_TYPE(obj); | |
44956 inquiry tp_clear = NULL; | |
44957 while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear) | |
44958 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
44959 while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear) | |
44960 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
44961 if (type && tp_clear) | |
44962 tp_clear(obj); | |
44963 } | |
44964 | |
44965 /* TypeImport */ | |
44966 #ifndef __PYX_HAVE_RT_ImportType_3_0_11 | |
44967 #define __PYX_HAVE_RT_ImportType_3_0_11 | |
44968 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name, | |
44969 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size) | |
44970 { | |
44971 PyObject *result = 0; | |
44972 char warning[200]; | |
44973 Py_ssize_t basicsize; | |
44974 Py_ssize_t itemsize; | |
44975 #if CYTHON_COMPILING_IN_LIMITED_API | |
44976 PyObject *py_basicsize; | |
44977 PyObject *py_itemsize; | |
44978 #endif | |
44979 result = PyObject_GetAttrString(module, class_name); | |
44980 if (!result) | |
44981 goto bad; | |
44982 if (!PyType_Check(result)) { | |
44983 PyErr_Format(PyExc_TypeError, | |
44984 "%.200s.%.200s is not a type object", | |
44985 module_name, class_name); | |
44986 goto bad; | |
44987 } | |
44988 #if !CYTHON_COMPILING_IN_LIMITED_API | |
44989 basicsize = ((PyTypeObject *)result)->tp_basicsize; | |
44990 itemsize = ((PyTypeObject *)result)->tp_itemsize; | |
44991 #else | |
44992 py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); | |
44993 if (!py_basicsize) | |
44994 goto bad; | |
44995 basicsize = PyLong_AsSsize_t(py_basicsize); | |
44996 Py_DECREF(py_basicsize); | |
44997 py_basicsize = 0; | |
44998 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) | |
44999 goto bad; | |
45000 py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); | |
45001 if (!py_itemsize) | |
45002 goto bad; | |
45003 itemsize = PyLong_AsSsize_t(py_itemsize); | |
45004 Py_DECREF(py_itemsize); | |
45005 py_itemsize = 0; | |
45006 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) | |
45007 goto bad; | |
45008 #endif | |
45009 if (itemsize) { | |
45010 if (size % alignment) { | |
45011 alignment = size % alignment; | |
45012 } | |
45013 if (itemsize < (Py_ssize_t)alignment) | |
45014 itemsize = (Py_ssize_t)alignment; | |
45015 } | |
45016 if ((size_t)(basicsize + itemsize) < size) { | |
45017 PyErr_Format(PyExc_ValueError, | |
45018 "%.200s.%.200s size changed, may indicate binary incompatibility. " | |
45019 "Expected %zd from C header, got %zd from PyObject", | |
45020 module_name, class_name, size, basicsize+itemsize); | |
45021 goto bad; | |
45022 } | |
45023 if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 && | |
45024 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { | |
45025 PyErr_Format(PyExc_ValueError, | |
45026 "%.200s.%.200s size changed, may indicate binary incompatibility. " | |
45027 "Expected %zd from C header, got %zd-%zd from PyObject", | |
45028 module_name, class_name, size, basicsize, basicsize+itemsize); | |
45029 goto bad; | |
45030 } | |
45031 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) { | |
45032 PyOS_snprintf(warning, sizeof(warning), | |
45033 "%s.%s size changed, may indicate binary incompatibility. " | |
45034 "Expected %zd from C header, got %zd from PyObject", | |
45035 module_name, class_name, size, basicsize); | |
45036 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; | |
45037 } | |
45038 return (PyTypeObject *)result; | |
45039 bad: | |
45040 Py_XDECREF(result); | |
45041 return NULL; | |
45042 } | |
45043 #endif | |
45044 | |
45045 /* GetVTable */ | |
45046 static void* __Pyx_GetVtable(PyTypeObject *type) { | |
45047 void* ptr; | |
45048 #if CYTHON_COMPILING_IN_LIMITED_API | |
45049 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); | |
45050 #else | |
45051 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); | |
45052 #endif | |
45053 if (!ob) | |
45054 goto bad; | |
45055 ptr = PyCapsule_GetPointer(ob, 0); | |
45056 if (!ptr && !PyErr_Occurred()) | |
45057 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); | |
45058 Py_DECREF(ob); | |
45059 return ptr; | |
45060 bad: | |
45061 Py_XDECREF(ob); | |
45062 return NULL; | |
45063 } | |
45064 | |
45065 /* FixUpExtensionType */ | |
45066 #if CYTHON_USE_TYPE_SPECS | |
45067 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { | |
45068 #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
45069 CYTHON_UNUSED_VAR(spec); | |
45070 CYTHON_UNUSED_VAR(type); | |
45071 #else | |
45072 const PyType_Slot *slot = spec->slots; | |
45073 while (slot && slot->slot && slot->slot != Py_tp_members) | |
45074 slot++; | |
45075 if (slot && slot->slot == Py_tp_members) { | |
45076 int changed = 0; | |
45077 #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) | |
45078 const | |
45079 #endif | |
45080 PyMemberDef *memb = (PyMemberDef*) slot->pfunc; | |
45081 while (memb && memb->name) { | |
45082 if (memb->name[0] == '_' && memb->name[1] == '_') { | |
45083 #if PY_VERSION_HEX < 0x030900b1 | |
45084 if (strcmp(memb->name, "__weaklistoffset__") == 0) { | |
45085 assert(memb->type == T_PYSSIZET); | |
45086 assert(memb->flags == READONLY); | |
45087 type->tp_weaklistoffset = memb->offset; | |
45088 changed = 1; | |
45089 } | |
45090 else if (strcmp(memb->name, "__dictoffset__") == 0) { | |
45091 assert(memb->type == T_PYSSIZET); | |
45092 assert(memb->flags == READONLY); | |
45093 type->tp_dictoffset = memb->offset; | |
45094 changed = 1; | |
45095 } | |
45096 #if CYTHON_METH_FASTCALL | |
45097 else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { | |
45098 assert(memb->type == T_PYSSIZET); | |
45099 assert(memb->flags == READONLY); | |
45100 #if PY_VERSION_HEX >= 0x030800b4 | |
45101 type->tp_vectorcall_offset = memb->offset; | |
45102 #else | |
45103 type->tp_print = (printfunc) memb->offset; | |
45104 #endif | |
45105 changed = 1; | |
45106 } | |
45107 #endif | |
45108 #else | |
45109 if ((0)); | |
45110 #endif | |
45111 #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON | |
45112 else if (strcmp(memb->name, "__module__") == 0) { | |
45113 PyObject *descr; | |
45114 assert(memb->type == T_OBJECT); | |
45115 assert(memb->flags == 0 || memb->flags == READONLY); | |
45116 descr = PyDescr_NewMember(type, memb); | |
45117 if (unlikely(!descr)) | |
45118 return -1; | |
45119 if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { | |
45120 Py_DECREF(descr); | |
45121 return -1; | |
45122 } | |
45123 Py_DECREF(descr); | |
45124 changed = 1; | |
45125 } | |
45126 #endif | |
45127 } | |
45128 memb++; | |
45129 } | |
45130 if (changed) | |
45131 PyType_Modified(type); | |
45132 } | |
45133 #endif | |
45134 return 0; | |
45135 } | |
45136 #endif | |
45137 | |
45138 /* ValidateBasesTuple */ | |
45139 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS | |
45140 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { | |
45141 Py_ssize_t i, n; | |
45142 #if CYTHON_ASSUME_SAFE_MACROS | |
45143 n = PyTuple_GET_SIZE(bases); | |
45144 #else | |
45145 n = PyTuple_Size(bases); | |
45146 if (n < 0) return -1; | |
45147 #endif | |
45148 for (i = 1; i < n; i++) | |
45149 { | |
45150 #if CYTHON_AVOID_BORROWED_REFS | |
45151 PyObject *b0 = PySequence_GetItem(bases, i); | |
45152 if (!b0) return -1; | |
45153 #elif CYTHON_ASSUME_SAFE_MACROS | |
45154 PyObject *b0 = PyTuple_GET_ITEM(bases, i); | |
45155 #else | |
45156 PyObject *b0 = PyTuple_GetItem(bases, i); | |
45157 if (!b0) return -1; | |
45158 #endif | |
45159 PyTypeObject *b; | |
45160 #if PY_MAJOR_VERSION < 3 | |
45161 if (PyClass_Check(b0)) | |
45162 { | |
45163 PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", | |
45164 PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); | |
45165 #if CYTHON_AVOID_BORROWED_REFS | |
45166 Py_DECREF(b0); | |
45167 #endif | |
45168 return -1; | |
45169 } | |
45170 #endif | |
45171 b = (PyTypeObject*) b0; | |
45172 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) | |
45173 { | |
45174 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); | |
45175 PyErr_Format(PyExc_TypeError, | |
45176 "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); | |
45177 __Pyx_DECREF_TypeName(b_name); | |
45178 #if CYTHON_AVOID_BORROWED_REFS | |
45179 Py_DECREF(b0); | |
45180 #endif | |
45181 return -1; | |
45182 } | |
45183 if (dictoffset == 0) | |
45184 { | |
45185 Py_ssize_t b_dictoffset = 0; | |
45186 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
45187 b_dictoffset = b->tp_dictoffset; | |
45188 #else | |
45189 PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); | |
45190 if (!py_b_dictoffset) goto dictoffset_return; | |
45191 b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); | |
45192 Py_DECREF(py_b_dictoffset); | |
45193 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; | |
45194 #endif | |
45195 if (b_dictoffset) { | |
45196 { | |
45197 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); | |
45198 PyErr_Format(PyExc_TypeError, | |
45199 "extension type '%.200s' has no __dict__ slot, " | |
45200 "but base type '" __Pyx_FMT_TYPENAME "' has: " | |
45201 "either add 'cdef dict __dict__' to the extension type " | |
45202 "or add '__slots__ = [...]' to the base type", | |
45203 type_name, b_name); | |
45204 __Pyx_DECREF_TypeName(b_name); | |
45205 } | |
45206 #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) | |
45207 dictoffset_return: | |
45208 #endif | |
45209 #if CYTHON_AVOID_BORROWED_REFS | |
45210 Py_DECREF(b0); | |
45211 #endif | |
45212 return -1; | |
45213 } | |
45214 } | |
45215 #if CYTHON_AVOID_BORROWED_REFS | |
45216 Py_DECREF(b0); | |
45217 #endif | |
45218 } | |
45219 return 0; | |
45220 } | |
45221 #endif | |
45222 | |
45223 /* PyType_Ready */ | |
45224 static int __Pyx_PyType_Ready(PyTypeObject *t) { | |
45225 #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) | |
45226 (void)__Pyx_PyObject_CallMethod0; | |
45227 #if CYTHON_USE_TYPE_SPECS | |
45228 (void)__Pyx_validate_bases_tuple; | |
45229 #endif | |
45230 return PyType_Ready(t); | |
45231 #else | |
45232 int r; | |
45233 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); | |
45234 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) | |
45235 return -1; | |
45236 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) | |
45237 { | |
45238 int gc_was_enabled; | |
45239 #if PY_VERSION_HEX >= 0x030A00b1 | |
45240 gc_was_enabled = PyGC_Disable(); | |
45241 (void)__Pyx_PyObject_CallMethod0; | |
45242 #else | |
45243 PyObject *ret, *py_status; | |
45244 PyObject *gc = NULL; | |
45245 #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) | |
45246 gc = PyImport_GetModule(__pyx_kp_u_gc); | |
45247 #endif | |
45248 if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); | |
45249 if (unlikely(!gc)) return -1; | |
45250 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); | |
45251 if (unlikely(!py_status)) { | |
45252 Py_DECREF(gc); | |
45253 return -1; | |
45254 } | |
45255 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); | |
45256 Py_DECREF(py_status); | |
45257 if (gc_was_enabled > 0) { | |
45258 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); | |
45259 if (unlikely(!ret)) { | |
45260 Py_DECREF(gc); | |
45261 return -1; | |
45262 } | |
45263 Py_DECREF(ret); | |
45264 } else if (unlikely(gc_was_enabled == -1)) { | |
45265 Py_DECREF(gc); | |
45266 return -1; | |
45267 } | |
45268 #endif | |
45269 t->tp_flags |= Py_TPFLAGS_HEAPTYPE; | |
45270 #if PY_VERSION_HEX >= 0x030A0000 | |
45271 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; | |
45272 #endif | |
45273 #else | |
45274 (void)__Pyx_PyObject_CallMethod0; | |
45275 #endif | |
45276 r = PyType_Ready(t); | |
45277 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) | |
45278 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; | |
45279 #if PY_VERSION_HEX >= 0x030A00b1 | |
45280 if (gc_was_enabled) | |
45281 PyGC_Enable(); | |
45282 #else | |
45283 if (gc_was_enabled) { | |
45284 PyObject *tp, *v, *tb; | |
45285 PyErr_Fetch(&tp, &v, &tb); | |
45286 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); | |
45287 if (likely(ret || r == -1)) { | |
45288 Py_XDECREF(ret); | |
45289 PyErr_Restore(tp, v, tb); | |
45290 } else { | |
45291 Py_XDECREF(tp); | |
45292 Py_XDECREF(v); | |
45293 Py_XDECREF(tb); | |
45294 r = -1; | |
45295 } | |
45296 } | |
45297 Py_DECREF(gc); | |
45298 #endif | |
45299 } | |
45300 #endif | |
45301 return r; | |
45302 #endif | |
45303 } | |
45304 | |
45305 /* PyObject_GenericGetAttrNoDict */ | |
45306 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
45307 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { | |
45308 __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); | |
45309 PyErr_Format(PyExc_AttributeError, | |
45310 #if PY_MAJOR_VERSION >= 3 | |
45311 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", | |
45312 type_name, attr_name); | |
45313 #else | |
45314 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", | |
45315 type_name, PyString_AS_STRING(attr_name)); | |
45316 #endif | |
45317 __Pyx_DECREF_TypeName(type_name); | |
45318 return NULL; | |
45319 } | |
45320 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { | |
45321 PyObject *descr; | |
45322 PyTypeObject *tp = Py_TYPE(obj); | |
45323 if (unlikely(!PyString_Check(attr_name))) { | |
45324 return PyObject_GenericGetAttr(obj, attr_name); | |
45325 } | |
45326 assert(!tp->tp_dictoffset); | |
45327 descr = _PyType_Lookup(tp, attr_name); | |
45328 if (unlikely(!descr)) { | |
45329 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); | |
45330 } | |
45331 Py_INCREF(descr); | |
45332 #if PY_MAJOR_VERSION < 3 | |
45333 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) | |
45334 #endif | |
45335 { | |
45336 descrgetfunc f = Py_TYPE(descr)->tp_descr_get; | |
45337 if (unlikely(f)) { | |
45338 PyObject *res = f(descr, obj, (PyObject *)tp); | |
45339 Py_DECREF(descr); | |
45340 return res; | |
45341 } | |
45342 } | |
45343 return descr; | |
45344 } | |
45345 #endif | |
45346 | |
45347 /* PyObject_GenericGetAttr */ | |
45348 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
45349 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { | |
45350 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { | |
45351 return PyObject_GenericGetAttr(obj, attr_name); | |
45352 } | |
45353 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); | |
45354 } | |
45355 #endif | |
45356 | |
45357 /* SetVTable */ | |
45358 static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { | |
45359 PyObject *ob = PyCapsule_New(vtable, 0, 0); | |
45360 if (unlikely(!ob)) | |
45361 goto bad; | |
45362 #if CYTHON_COMPILING_IN_LIMITED_API | |
45363 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) | |
45364 #else | |
45365 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) | |
45366 #endif | |
45367 goto bad; | |
45368 Py_DECREF(ob); | |
45369 return 0; | |
45370 bad: | |
45371 Py_XDECREF(ob); | |
45372 return -1; | |
45373 } | |
45374 | |
45375 /* MergeVTables */ | |
45376 #if !CYTHON_COMPILING_IN_LIMITED_API | |
45377 static int __Pyx_MergeVtables(PyTypeObject *type) { | |
45378 int i; | |
45379 void** base_vtables; | |
45380 __Pyx_TypeName tp_base_name; | |
45381 __Pyx_TypeName base_name; | |
45382 void* unknown = (void*)-1; | |
45383 PyObject* bases = type->tp_bases; | |
45384 int base_depth = 0; | |
45385 { | |
45386 PyTypeObject* base = type->tp_base; | |
45387 while (base) { | |
45388 base_depth += 1; | |
45389 base = base->tp_base; | |
45390 } | |
45391 } | |
45392 base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); | |
45393 base_vtables[0] = unknown; | |
45394 for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { | |
45395 void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); | |
45396 if (base_vtable != NULL) { | |
45397 int j; | |
45398 PyTypeObject* base = type->tp_base; | |
45399 for (j = 0; j < base_depth; j++) { | |
45400 if (base_vtables[j] == unknown) { | |
45401 base_vtables[j] = __Pyx_GetVtable(base); | |
45402 base_vtables[j + 1] = unknown; | |
45403 } | |
45404 if (base_vtables[j] == base_vtable) { | |
45405 break; | |
45406 } else if (base_vtables[j] == NULL) { | |
45407 goto bad; | |
45408 } | |
45409 base = base->tp_base; | |
45410 } | |
45411 } | |
45412 } | |
45413 PyErr_Clear(); | |
45414 free(base_vtables); | |
45415 return 0; | |
45416 bad: | |
45417 tp_base_name = __Pyx_PyType_GetName(type->tp_base); | |
45418 base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); | |
45419 PyErr_Format(PyExc_TypeError, | |
45420 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); | |
45421 __Pyx_DECREF_TypeName(tp_base_name); | |
45422 __Pyx_DECREF_TypeName(base_name); | |
45423 free(base_vtables); | |
45424 return -1; | |
45425 } | |
45426 #endif | |
45427 | |
45428 /* SetupReduce */ | |
45429 #if !CYTHON_COMPILING_IN_LIMITED_API | |
45430 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { | |
45431 int ret; | |
45432 PyObject *name_attr; | |
45433 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); | |
45434 if (likely(name_attr)) { | |
45435 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); | |
45436 } else { | |
45437 ret = -1; | |
45438 } | |
45439 if (unlikely(ret < 0)) { | |
45440 PyErr_Clear(); | |
45441 ret = 0; | |
45442 } | |
45443 Py_XDECREF(name_attr); | |
45444 return ret; | |
45445 } | |
45446 static int __Pyx_setup_reduce(PyObject* type_obj) { | |
45447 int ret = 0; | |
45448 PyObject *object_reduce = NULL; | |
45449 PyObject *object_getstate = NULL; | |
45450 PyObject *object_reduce_ex = NULL; | |
45451 PyObject *reduce = NULL; | |
45452 PyObject *reduce_ex = NULL; | |
45453 PyObject *reduce_cython = NULL; | |
45454 PyObject *setstate = NULL; | |
45455 PyObject *setstate_cython = NULL; | |
45456 PyObject *getstate = NULL; | |
45457 #if CYTHON_USE_PYTYPE_LOOKUP | |
45458 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); | |
45459 #else | |
45460 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); | |
45461 if (!getstate && PyErr_Occurred()) { | |
45462 goto __PYX_BAD; | |
45463 } | |
45464 #endif | |
45465 if (getstate) { | |
45466 #if CYTHON_USE_PYTYPE_LOOKUP | |
45467 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); | |
45468 #else | |
45469 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); | |
45470 if (!object_getstate && PyErr_Occurred()) { | |
45471 goto __PYX_BAD; | |
45472 } | |
45473 #endif | |
45474 if (object_getstate != getstate) { | |
45475 goto __PYX_GOOD; | |
45476 } | |
45477 } | |
45478 #if CYTHON_USE_PYTYPE_LOOKUP | |
45479 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; | |
45480 #else | |
45481 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; | |
45482 #endif | |
45483 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; | |
45484 if (reduce_ex == object_reduce_ex) { | |
45485 #if CYTHON_USE_PYTYPE_LOOKUP | |
45486 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; | |
45487 #else | |
45488 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; | |
45489 #endif | |
45490 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; | |
45491 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { | |
45492 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); | |
45493 if (likely(reduce_cython)) { | |
45494 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
45495 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
45496 } else if (reduce == object_reduce || PyErr_Occurred()) { | |
45497 goto __PYX_BAD; | |
45498 } | |
45499 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); | |
45500 if (!setstate) PyErr_Clear(); | |
45501 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { | |
45502 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); | |
45503 if (likely(setstate_cython)) { | |
45504 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
45505 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
45506 } else if (!setstate || PyErr_Occurred()) { | |
45507 goto __PYX_BAD; | |
45508 } | |
45509 } | |
45510 PyType_Modified((PyTypeObject*)type_obj); | |
45511 } | |
45512 } | |
45513 goto __PYX_GOOD; | |
45514 __PYX_BAD: | |
45515 if (!PyErr_Occurred()) { | |
45516 __Pyx_TypeName type_obj_name = | |
45517 __Pyx_PyType_GetName((PyTypeObject*)type_obj); | |
45518 PyErr_Format(PyExc_RuntimeError, | |
45519 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); | |
45520 __Pyx_DECREF_TypeName(type_obj_name); | |
45521 } | |
45522 ret = -1; | |
45523 __PYX_GOOD: | |
45524 #if !CYTHON_USE_PYTYPE_LOOKUP | |
45525 Py_XDECREF(object_reduce); | |
45526 Py_XDECREF(object_reduce_ex); | |
45527 Py_XDECREF(object_getstate); | |
45528 Py_XDECREF(getstate); | |
45529 #endif | |
45530 Py_XDECREF(reduce); | |
45531 Py_XDECREF(reduce_ex); | |
45532 Py_XDECREF(reduce_cython); | |
45533 Py_XDECREF(setstate); | |
45534 Py_XDECREF(setstate_cython); | |
45535 return ret; | |
45536 } | |
45537 #endif | |
45538 | |
45539 /* ImportDottedModule */ | |
45540 #if PY_MAJOR_VERSION >= 3 | |
45541 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { | |
45542 PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; | |
45543 if (unlikely(PyErr_Occurred())) { | |
45544 PyErr_Clear(); | |
45545 } | |
45546 if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { | |
45547 partial_name = name; | |
45548 } else { | |
45549 slice = PySequence_GetSlice(parts_tuple, 0, count); | |
45550 if (unlikely(!slice)) | |
45551 goto bad; | |
45552 sep = PyUnicode_FromStringAndSize(".", 1); | |
45553 if (unlikely(!sep)) | |
45554 goto bad; | |
45555 partial_name = PyUnicode_Join(sep, slice); | |
45556 } | |
45557 PyErr_Format( | |
45558 #if PY_MAJOR_VERSION < 3 | |
45559 PyExc_ImportError, | |
45560 "No module named '%s'", PyString_AS_STRING(partial_name)); | |
45561 #else | |
45562 #if PY_VERSION_HEX >= 0x030600B1 | |
45563 PyExc_ModuleNotFoundError, | |
45564 #else | |
45565 PyExc_ImportError, | |
45566 #endif | |
45567 "No module named '%U'", partial_name); | |
45568 #endif | |
45569 bad: | |
45570 Py_XDECREF(sep); | |
45571 Py_XDECREF(slice); | |
45572 Py_XDECREF(partial_name); | |
45573 return NULL; | |
45574 } | |
45575 #endif | |
45576 #if PY_MAJOR_VERSION >= 3 | |
45577 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { | |
45578 PyObject *imported_module; | |
45579 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) | |
45580 PyObject *modules = PyImport_GetModuleDict(); | |
45581 if (unlikely(!modules)) | |
45582 return NULL; | |
45583 imported_module = __Pyx_PyDict_GetItemStr(modules, name); | |
45584 Py_XINCREF(imported_module); | |
45585 #else | |
45586 imported_module = PyImport_GetModule(name); | |
45587 #endif | |
45588 return imported_module; | |
45589 } | |
45590 #endif | |
45591 #if PY_MAJOR_VERSION >= 3 | |
45592 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { | |
45593 Py_ssize_t i, nparts; | |
45594 nparts = PyTuple_GET_SIZE(parts_tuple); | |
45595 for (i=1; i < nparts && module; i++) { | |
45596 PyObject *part, *submodule; | |
45597 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
45598 part = PyTuple_GET_ITEM(parts_tuple, i); | |
45599 #else | |
45600 part = PySequence_ITEM(parts_tuple, i); | |
45601 #endif | |
45602 submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); | |
45603 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) | |
45604 Py_DECREF(part); | |
45605 #endif | |
45606 Py_DECREF(module); | |
45607 module = submodule; | |
45608 } | |
45609 if (unlikely(!module)) { | |
45610 return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); | |
45611 } | |
45612 return module; | |
45613 } | |
45614 #endif | |
45615 static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { | |
45616 #if PY_MAJOR_VERSION < 3 | |
45617 PyObject *module, *from_list, *star = __pyx_n_s__33; | |
45618 CYTHON_UNUSED_VAR(parts_tuple); | |
45619 from_list = PyList_New(1); | |
45620 if (unlikely(!from_list)) | |
45621 return NULL; | |
45622 Py_INCREF(star); | |
45623 PyList_SET_ITEM(from_list, 0, star); | |
45624 module = __Pyx_Import(name, from_list, 0); | |
45625 Py_DECREF(from_list); | |
45626 return module; | |
45627 #else | |
45628 PyObject *imported_module; | |
45629 PyObject *module = __Pyx_Import(name, NULL, 0); | |
45630 if (!parts_tuple || unlikely(!module)) | |
45631 return module; | |
45632 imported_module = __Pyx__ImportDottedModule_Lookup(name); | |
45633 if (likely(imported_module)) { | |
45634 Py_DECREF(module); | |
45635 return imported_module; | |
45636 } | |
45637 PyErr_Clear(); | |
45638 return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); | |
45639 #endif | |
45640 } | |
45641 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { | |
45642 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 | |
45643 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); | |
45644 if (likely(module)) { | |
45645 PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); | |
45646 if (likely(spec)) { | |
45647 PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); | |
45648 if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { | |
45649 Py_DECREF(spec); | |
45650 spec = NULL; | |
45651 } | |
45652 Py_XDECREF(unsafe); | |
45653 } | |
45654 if (likely(!spec)) { | |
45655 PyErr_Clear(); | |
45656 return module; | |
45657 } | |
45658 Py_DECREF(spec); | |
45659 Py_DECREF(module); | |
45660 } else if (PyErr_Occurred()) { | |
45661 PyErr_Clear(); | |
45662 } | |
45663 #endif | |
45664 return __Pyx__ImportDottedModule(name, parts_tuple); | |
45665 } | |
45666 | |
45667 /* FetchSharedCythonModule */ | |
45668 static PyObject *__Pyx_FetchSharedCythonABIModule(void) { | |
45669 return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); | |
45670 } | |
45671 | |
45672 /* FetchCommonType */ | |
45673 static int __Pyx_VerifyCachedType(PyObject *cached_type, | |
45674 const char *name, | |
45675 Py_ssize_t basicsize, | |
45676 Py_ssize_t expected_basicsize) { | |
45677 if (!PyType_Check(cached_type)) { | |
45678 PyErr_Format(PyExc_TypeError, | |
45679 "Shared Cython type %.200s is not a type object", name); | |
45680 return -1; | |
45681 } | |
45682 if (basicsize != expected_basicsize) { | |
45683 PyErr_Format(PyExc_TypeError, | |
45684 "Shared Cython type %.200s has the wrong size, try recompiling", | |
45685 name); | |
45686 return -1; | |
45687 } | |
45688 return 0; | |
45689 } | |
45690 #if !CYTHON_USE_TYPE_SPECS | |
45691 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { | |
45692 PyObject* abi_module; | |
45693 const char* object_name; | |
45694 PyTypeObject *cached_type = NULL; | |
45695 abi_module = __Pyx_FetchSharedCythonABIModule(); | |
45696 if (!abi_module) return NULL; | |
45697 object_name = strrchr(type->tp_name, '.'); | |
45698 object_name = object_name ? object_name+1 : type->tp_name; | |
45699 cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); | |
45700 if (cached_type) { | |
45701 if (__Pyx_VerifyCachedType( | |
45702 (PyObject *)cached_type, | |
45703 object_name, | |
45704 cached_type->tp_basicsize, | |
45705 type->tp_basicsize) < 0) { | |
45706 goto bad; | |
45707 } | |
45708 goto done; | |
45709 } | |
45710 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; | |
45711 PyErr_Clear(); | |
45712 if (PyType_Ready(type) < 0) goto bad; | |
45713 if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) | |
45714 goto bad; | |
45715 Py_INCREF(type); | |
45716 cached_type = type; | |
45717 done: | |
45718 Py_DECREF(abi_module); | |
45719 return cached_type; | |
45720 bad: | |
45721 Py_XDECREF(cached_type); | |
45722 cached_type = NULL; | |
45723 goto done; | |
45724 } | |
45725 #else | |
45726 static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { | |
45727 PyObject *abi_module, *cached_type = NULL; | |
45728 const char* object_name = strrchr(spec->name, '.'); | |
45729 object_name = object_name ? object_name+1 : spec->name; | |
45730 abi_module = __Pyx_FetchSharedCythonABIModule(); | |
45731 if (!abi_module) return NULL; | |
45732 cached_type = PyObject_GetAttrString(abi_module, object_name); | |
45733 if (cached_type) { | |
45734 Py_ssize_t basicsize; | |
45735 #if CYTHON_COMPILING_IN_LIMITED_API | |
45736 PyObject *py_basicsize; | |
45737 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); | |
45738 if (unlikely(!py_basicsize)) goto bad; | |
45739 basicsize = PyLong_AsSsize_t(py_basicsize); | |
45740 Py_DECREF(py_basicsize); | |
45741 py_basicsize = 0; | |
45742 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; | |
45743 #else | |
45744 basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; | |
45745 #endif | |
45746 if (__Pyx_VerifyCachedType( | |
45747 cached_type, | |
45748 object_name, | |
45749 basicsize, | |
45750 spec->basicsize) < 0) { | |
45751 goto bad; | |
45752 } | |
45753 goto done; | |
45754 } | |
45755 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; | |
45756 PyErr_Clear(); | |
45757 CYTHON_UNUSED_VAR(module); | |
45758 cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); | |
45759 if (unlikely(!cached_type)) goto bad; | |
45760 if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; | |
45761 if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; | |
45762 done: | |
45763 Py_DECREF(abi_module); | |
45764 assert(cached_type == NULL || PyType_Check(cached_type)); | |
45765 return (PyTypeObject *) cached_type; | |
45766 bad: | |
45767 Py_XDECREF(cached_type); | |
45768 cached_type = NULL; | |
45769 goto done; | |
45770 } | |
45771 #endif | |
45772 | |
45773 /* PyVectorcallFastCallDict */ | |
45774 #if CYTHON_METH_FASTCALL | |
45775 static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) | |
45776 { | |
45777 PyObject *res = NULL; | |
45778 PyObject *kwnames; | |
45779 PyObject **newargs; | |
45780 PyObject **kwvalues; | |
45781 Py_ssize_t i, pos; | |
45782 size_t j; | |
45783 PyObject *key, *value; | |
45784 unsigned long keys_are_strings; | |
45785 Py_ssize_t nkw = PyDict_GET_SIZE(kw); | |
45786 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); | |
45787 if (unlikely(newargs == NULL)) { | |
45788 PyErr_NoMemory(); | |
45789 return NULL; | |
45790 } | |
45791 for (j = 0; j < nargs; j++) newargs[j] = args[j]; | |
45792 kwnames = PyTuple_New(nkw); | |
45793 if (unlikely(kwnames == NULL)) { | |
45794 PyMem_Free(newargs); | |
45795 return NULL; | |
45796 } | |
45797 kwvalues = newargs + nargs; | |
45798 pos = i = 0; | |
45799 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; | |
45800 while (PyDict_Next(kw, &pos, &key, &value)) { | |
45801 keys_are_strings &= Py_TYPE(key)->tp_flags; | |
45802 Py_INCREF(key); | |
45803 Py_INCREF(value); | |
45804 PyTuple_SET_ITEM(kwnames, i, key); | |
45805 kwvalues[i] = value; | |
45806 i++; | |
45807 } | |
45808 if (unlikely(!keys_are_strings)) { | |
45809 PyErr_SetString(PyExc_TypeError, "keywords must be strings"); | |
45810 goto cleanup; | |
45811 } | |
45812 res = vc(func, newargs, nargs, kwnames); | |
45813 cleanup: | |
45814 Py_DECREF(kwnames); | |
45815 for (i = 0; i < nkw; i++) | |
45816 Py_DECREF(kwvalues[i]); | |
45817 PyMem_Free(newargs); | |
45818 return res; | |
45819 } | |
45820 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) | |
45821 { | |
45822 if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { | |
45823 return vc(func, args, nargs, NULL); | |
45824 } | |
45825 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); | |
45826 } | |
45827 #endif | |
45828 | |
45829 /* CythonFunctionShared */ | |
45830 #if CYTHON_COMPILING_IN_LIMITED_API | |
45831 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { | |
45832 if (__Pyx_CyFunction_Check(func)) { | |
45833 return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; | |
45834 } else if (PyCFunction_Check(func)) { | |
45835 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; | |
45836 } | |
45837 return 0; | |
45838 } | |
45839 #else | |
45840 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { | |
45841 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; | |
45842 } | |
45843 #endif | |
45844 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { | |
45845 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
45846 __Pyx_Py_XDECREF_SET( | |
45847 __Pyx_CyFunction_GetClassObj(f), | |
45848 ((classobj) ? __Pyx_NewRef(classobj) : NULL)); | |
45849 #else | |
45850 __Pyx_Py_XDECREF_SET( | |
45851 ((PyCMethodObject *) (f))->mm_class, | |
45852 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); | |
45853 #endif | |
45854 } | |
45855 static PyObject * | |
45856 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) | |
45857 { | |
45858 CYTHON_UNUSED_VAR(closure); | |
45859 if (unlikely(op->func_doc == NULL)) { | |
45860 #if CYTHON_COMPILING_IN_LIMITED_API | |
45861 op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); | |
45862 if (unlikely(!op->func_doc)) return NULL; | |
45863 #else | |
45864 if (((PyCFunctionObject*)op)->m_ml->ml_doc) { | |
45865 #if PY_MAJOR_VERSION >= 3 | |
45866 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); | |
45867 #else | |
45868 op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); | |
45869 #endif | |
45870 if (unlikely(op->func_doc == NULL)) | |
45871 return NULL; | |
45872 } else { | |
45873 Py_INCREF(Py_None); | |
45874 return Py_None; | |
45875 } | |
45876 #endif | |
45877 } | |
45878 Py_INCREF(op->func_doc); | |
45879 return op->func_doc; | |
45880 } | |
45881 static int | |
45882 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
45883 { | |
45884 CYTHON_UNUSED_VAR(context); | |
45885 if (value == NULL) { | |
45886 value = Py_None; | |
45887 } | |
45888 Py_INCREF(value); | |
45889 __Pyx_Py_XDECREF_SET(op->func_doc, value); | |
45890 return 0; | |
45891 } | |
45892 static PyObject * | |
45893 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) | |
45894 { | |
45895 CYTHON_UNUSED_VAR(context); | |
45896 if (unlikely(op->func_name == NULL)) { | |
45897 #if CYTHON_COMPILING_IN_LIMITED_API | |
45898 op->func_name = PyObject_GetAttrString(op->func, "__name__"); | |
45899 #elif PY_MAJOR_VERSION >= 3 | |
45900 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); | |
45901 #else | |
45902 op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); | |
45903 #endif | |
45904 if (unlikely(op->func_name == NULL)) | |
45905 return NULL; | |
45906 } | |
45907 Py_INCREF(op->func_name); | |
45908 return op->func_name; | |
45909 } | |
45910 static int | |
45911 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
45912 { | |
45913 CYTHON_UNUSED_VAR(context); | |
45914 #if PY_MAJOR_VERSION >= 3 | |
45915 if (unlikely(value == NULL || !PyUnicode_Check(value))) | |
45916 #else | |
45917 if (unlikely(value == NULL || !PyString_Check(value))) | |
45918 #endif | |
45919 { | |
45920 PyErr_SetString(PyExc_TypeError, | |
45921 "__name__ must be set to a string object"); | |
45922 return -1; | |
45923 } | |
45924 Py_INCREF(value); | |
45925 __Pyx_Py_XDECREF_SET(op->func_name, value); | |
45926 return 0; | |
45927 } | |
45928 static PyObject * | |
45929 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) | |
45930 { | |
45931 CYTHON_UNUSED_VAR(context); | |
45932 Py_INCREF(op->func_qualname); | |
45933 return op->func_qualname; | |
45934 } | |
45935 static int | |
45936 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
45937 { | |
45938 CYTHON_UNUSED_VAR(context); | |
45939 #if PY_MAJOR_VERSION >= 3 | |
45940 if (unlikely(value == NULL || !PyUnicode_Check(value))) | |
45941 #else | |
45942 if (unlikely(value == NULL || !PyString_Check(value))) | |
45943 #endif | |
45944 { | |
45945 PyErr_SetString(PyExc_TypeError, | |
45946 "__qualname__ must be set to a string object"); | |
45947 return -1; | |
45948 } | |
45949 Py_INCREF(value); | |
45950 __Pyx_Py_XDECREF_SET(op->func_qualname, value); | |
45951 return 0; | |
45952 } | |
45953 static PyObject * | |
45954 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) | |
45955 { | |
45956 CYTHON_UNUSED_VAR(context); | |
45957 if (unlikely(op->func_dict == NULL)) { | |
45958 op->func_dict = PyDict_New(); | |
45959 if (unlikely(op->func_dict == NULL)) | |
45960 return NULL; | |
45961 } | |
45962 Py_INCREF(op->func_dict); | |
45963 return op->func_dict; | |
45964 } | |
45965 static int | |
45966 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
45967 { | |
45968 CYTHON_UNUSED_VAR(context); | |
45969 if (unlikely(value == NULL)) { | |
45970 PyErr_SetString(PyExc_TypeError, | |
45971 "function's dictionary may not be deleted"); | |
45972 return -1; | |
45973 } | |
45974 if (unlikely(!PyDict_Check(value))) { | |
45975 PyErr_SetString(PyExc_TypeError, | |
45976 "setting function's dictionary to a non-dict"); | |
45977 return -1; | |
45978 } | |
45979 Py_INCREF(value); | |
45980 __Pyx_Py_XDECREF_SET(op->func_dict, value); | |
45981 return 0; | |
45982 } | |
45983 static PyObject * | |
45984 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) | |
45985 { | |
45986 CYTHON_UNUSED_VAR(context); | |
45987 Py_INCREF(op->func_globals); | |
45988 return op->func_globals; | |
45989 } | |
45990 static PyObject * | |
45991 __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) | |
45992 { | |
45993 CYTHON_UNUSED_VAR(op); | |
45994 CYTHON_UNUSED_VAR(context); | |
45995 Py_INCREF(Py_None); | |
45996 return Py_None; | |
45997 } | |
45998 static PyObject * | |
45999 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) | |
46000 { | |
46001 PyObject* result = (op->func_code) ? op->func_code : Py_None; | |
46002 CYTHON_UNUSED_VAR(context); | |
46003 Py_INCREF(result); | |
46004 return result; | |
46005 } | |
46006 static int | |
46007 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { | |
46008 int result = 0; | |
46009 PyObject *res = op->defaults_getter((PyObject *) op); | |
46010 if (unlikely(!res)) | |
46011 return -1; | |
46012 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
46013 op->defaults_tuple = PyTuple_GET_ITEM(res, 0); | |
46014 Py_INCREF(op->defaults_tuple); | |
46015 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); | |
46016 Py_INCREF(op->defaults_kwdict); | |
46017 #else | |
46018 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); | |
46019 if (unlikely(!op->defaults_tuple)) result = -1; | |
46020 else { | |
46021 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); | |
46022 if (unlikely(!op->defaults_kwdict)) result = -1; | |
46023 } | |
46024 #endif | |
46025 Py_DECREF(res); | |
46026 return result; | |
46027 } | |
46028 static int | |
46029 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
46030 CYTHON_UNUSED_VAR(context); | |
46031 if (!value) { | |
46032 value = Py_None; | |
46033 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { | |
46034 PyErr_SetString(PyExc_TypeError, | |
46035 "__defaults__ must be set to a tuple object"); | |
46036 return -1; | |
46037 } | |
46038 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " | |
46039 "currently affect the values used in function calls", 1); | |
46040 Py_INCREF(value); | |
46041 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); | |
46042 return 0; | |
46043 } | |
46044 static PyObject * | |
46045 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { | |
46046 PyObject* result = op->defaults_tuple; | |
46047 CYTHON_UNUSED_VAR(context); | |
46048 if (unlikely(!result)) { | |
46049 if (op->defaults_getter) { | |
46050 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; | |
46051 result = op->defaults_tuple; | |
46052 } else { | |
46053 result = Py_None; | |
46054 } | |
46055 } | |
46056 Py_INCREF(result); | |
46057 return result; | |
46058 } | |
46059 static int | |
46060 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
46061 CYTHON_UNUSED_VAR(context); | |
46062 if (!value) { | |
46063 value = Py_None; | |
46064 } else if (unlikely(value != Py_None && !PyDict_Check(value))) { | |
46065 PyErr_SetString(PyExc_TypeError, | |
46066 "__kwdefaults__ must be set to a dict object"); | |
46067 return -1; | |
46068 } | |
46069 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " | |
46070 "currently affect the values used in function calls", 1); | |
46071 Py_INCREF(value); | |
46072 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); | |
46073 return 0; | |
46074 } | |
46075 static PyObject * | |
46076 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { | |
46077 PyObject* result = op->defaults_kwdict; | |
46078 CYTHON_UNUSED_VAR(context); | |
46079 if (unlikely(!result)) { | |
46080 if (op->defaults_getter) { | |
46081 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; | |
46082 result = op->defaults_kwdict; | |
46083 } else { | |
46084 result = Py_None; | |
46085 } | |
46086 } | |
46087 Py_INCREF(result); | |
46088 return result; | |
46089 } | |
46090 static int | |
46091 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
46092 CYTHON_UNUSED_VAR(context); | |
46093 if (!value || value == Py_None) { | |
46094 value = NULL; | |
46095 } else if (unlikely(!PyDict_Check(value))) { | |
46096 PyErr_SetString(PyExc_TypeError, | |
46097 "__annotations__ must be set to a dict object"); | |
46098 return -1; | |
46099 } | |
46100 Py_XINCREF(value); | |
46101 __Pyx_Py_XDECREF_SET(op->func_annotations, value); | |
46102 return 0; | |
46103 } | |
46104 static PyObject * | |
46105 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { | |
46106 PyObject* result = op->func_annotations; | |
46107 CYTHON_UNUSED_VAR(context); | |
46108 if (unlikely(!result)) { | |
46109 result = PyDict_New(); | |
46110 if (unlikely(!result)) return NULL; | |
46111 op->func_annotations = result; | |
46112 } | |
46113 Py_INCREF(result); | |
46114 return result; | |
46115 } | |
46116 static PyObject * | |
46117 __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { | |
46118 int is_coroutine; | |
46119 CYTHON_UNUSED_VAR(context); | |
46120 if (op->func_is_coroutine) { | |
46121 return __Pyx_NewRef(op->func_is_coroutine); | |
46122 } | |
46123 is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; | |
46124 #if PY_VERSION_HEX >= 0x03050000 | |
46125 if (is_coroutine) { | |
46126 PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; | |
46127 fromlist = PyList_New(1); | |
46128 if (unlikely(!fromlist)) return NULL; | |
46129 Py_INCREF(marker); | |
46130 #if CYTHON_ASSUME_SAFE_MACROS | |
46131 PyList_SET_ITEM(fromlist, 0, marker); | |
46132 #else | |
46133 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { | |
46134 Py_DECREF(marker); | |
46135 Py_DECREF(fromlist); | |
46136 return NULL; | |
46137 } | |
46138 #endif | |
46139 module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); | |
46140 Py_DECREF(fromlist); | |
46141 if (unlikely(!module)) goto ignore; | |
46142 op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); | |
46143 Py_DECREF(module); | |
46144 if (likely(op->func_is_coroutine)) { | |
46145 return __Pyx_NewRef(op->func_is_coroutine); | |
46146 } | |
46147 ignore: | |
46148 PyErr_Clear(); | |
46149 } | |
46150 #endif | |
46151 op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); | |
46152 return __Pyx_NewRef(op->func_is_coroutine); | |
46153 } | |
46154 #if CYTHON_COMPILING_IN_LIMITED_API | |
46155 static PyObject * | |
46156 __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { | |
46157 CYTHON_UNUSED_VAR(context); | |
46158 return PyObject_GetAttrString(op->func, "__module__"); | |
46159 } | |
46160 static int | |
46161 __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
46162 CYTHON_UNUSED_VAR(context); | |
46163 return PyObject_SetAttrString(op->func, "__module__", value); | |
46164 } | |
46165 #endif | |
46166 static PyGetSetDef __pyx_CyFunction_getsets[] = { | |
46167 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, | |
46168 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, | |
46169 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, | |
46170 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, | |
46171 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, | |
46172 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, | |
46173 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, | |
46174 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, | |
46175 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, | |
46176 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, | |
46177 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, | |
46178 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, | |
46179 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, | |
46180 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, | |
46181 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, | |
46182 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, | |
46183 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, | |
46184 {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, | |
46185 #if CYTHON_COMPILING_IN_LIMITED_API | |
46186 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, | |
46187 #endif | |
46188 {0, 0, 0, 0, 0} | |
46189 }; | |
46190 static PyMemberDef __pyx_CyFunction_members[] = { | |
46191 #if !CYTHON_COMPILING_IN_LIMITED_API | |
46192 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, | |
46193 #endif | |
46194 #if CYTHON_USE_TYPE_SPECS | |
46195 {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, | |
46196 #if CYTHON_METH_FASTCALL | |
46197 #if CYTHON_BACKPORT_VECTORCALL | |
46198 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, | |
46199 #else | |
46200 #if !CYTHON_COMPILING_IN_LIMITED_API | |
46201 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, | |
46202 #endif | |
46203 #endif | |
46204 #endif | |
46205 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API | |
46206 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, | |
46207 #else | |
46208 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, | |
46209 #endif | |
46210 #endif | |
46211 {0, 0, 0, 0, 0} | |
46212 }; | |
46213 static PyObject * | |
46214 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) | |
46215 { | |
46216 CYTHON_UNUSED_VAR(args); | |
46217 #if PY_MAJOR_VERSION >= 3 | |
46218 Py_INCREF(m->func_qualname); | |
46219 return m->func_qualname; | |
46220 #else | |
46221 return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); | |
46222 #endif | |
46223 } | |
46224 static PyMethodDef __pyx_CyFunction_methods[] = { | |
46225 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, | |
46226 {0, 0, 0, 0} | |
46227 }; | |
46228 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API | |
46229 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) | |
46230 #else | |
46231 #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) | |
46232 #endif | |
46233 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, | |
46234 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { | |
46235 #if !CYTHON_COMPILING_IN_LIMITED_API | |
46236 PyCFunctionObject *cf = (PyCFunctionObject*) op; | |
46237 #endif | |
46238 if (unlikely(op == NULL)) | |
46239 return NULL; | |
46240 #if CYTHON_COMPILING_IN_LIMITED_API | |
46241 op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); | |
46242 if (unlikely(!op->func)) return NULL; | |
46243 #endif | |
46244 op->flags = flags; | |
46245 __Pyx_CyFunction_weakreflist(op) = NULL; | |
46246 #if !CYTHON_COMPILING_IN_LIMITED_API | |
46247 cf->m_ml = ml; | |
46248 cf->m_self = (PyObject *) op; | |
46249 #endif | |
46250 Py_XINCREF(closure); | |
46251 op->func_closure = closure; | |
46252 #if !CYTHON_COMPILING_IN_LIMITED_API | |
46253 Py_XINCREF(module); | |
46254 cf->m_module = module; | |
46255 #endif | |
46256 op->func_dict = NULL; | |
46257 op->func_name = NULL; | |
46258 Py_INCREF(qualname); | |
46259 op->func_qualname = qualname; | |
46260 op->func_doc = NULL; | |
46261 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
46262 op->func_classobj = NULL; | |
46263 #else | |
46264 ((PyCMethodObject*)op)->mm_class = NULL; | |
46265 #endif | |
46266 op->func_globals = globals; | |
46267 Py_INCREF(op->func_globals); | |
46268 Py_XINCREF(code); | |
46269 op->func_code = code; | |
46270 op->defaults_pyobjects = 0; | |
46271 op->defaults_size = 0; | |
46272 op->defaults = NULL; | |
46273 op->defaults_tuple = NULL; | |
46274 op->defaults_kwdict = NULL; | |
46275 op->defaults_getter = NULL; | |
46276 op->func_annotations = NULL; | |
46277 op->func_is_coroutine = NULL; | |
46278 #if CYTHON_METH_FASTCALL | |
46279 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { | |
46280 case METH_NOARGS: | |
46281 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; | |
46282 break; | |
46283 case METH_O: | |
46284 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; | |
46285 break; | |
46286 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: | |
46287 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; | |
46288 break; | |
46289 case METH_FASTCALL | METH_KEYWORDS: | |
46290 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; | |
46291 break; | |
46292 case METH_VARARGS | METH_KEYWORDS: | |
46293 __Pyx_CyFunction_func_vectorcall(op) = NULL; | |
46294 break; | |
46295 default: | |
46296 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); | |
46297 Py_DECREF(op); | |
46298 return NULL; | |
46299 } | |
46300 #endif | |
46301 return (PyObject *) op; | |
46302 } | |
46303 static int | |
46304 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) | |
46305 { | |
46306 Py_CLEAR(m->func_closure); | |
46307 #if CYTHON_COMPILING_IN_LIMITED_API | |
46308 Py_CLEAR(m->func); | |
46309 #else | |
46310 Py_CLEAR(((PyCFunctionObject*)m)->m_module); | |
46311 #endif | |
46312 Py_CLEAR(m->func_dict); | |
46313 Py_CLEAR(m->func_name); | |
46314 Py_CLEAR(m->func_qualname); | |
46315 Py_CLEAR(m->func_doc); | |
46316 Py_CLEAR(m->func_globals); | |
46317 Py_CLEAR(m->func_code); | |
46318 #if !CYTHON_COMPILING_IN_LIMITED_API | |
46319 #if PY_VERSION_HEX < 0x030900B1 | |
46320 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); | |
46321 #else | |
46322 { | |
46323 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; | |
46324 ((PyCMethodObject *) (m))->mm_class = NULL; | |
46325 Py_XDECREF(cls); | |
46326 } | |
46327 #endif | |
46328 #endif | |
46329 Py_CLEAR(m->defaults_tuple); | |
46330 Py_CLEAR(m->defaults_kwdict); | |
46331 Py_CLEAR(m->func_annotations); | |
46332 Py_CLEAR(m->func_is_coroutine); | |
46333 if (m->defaults) { | |
46334 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); | |
46335 int i; | |
46336 for (i = 0; i < m->defaults_pyobjects; i++) | |
46337 Py_XDECREF(pydefaults[i]); | |
46338 PyObject_Free(m->defaults); | |
46339 m->defaults = NULL; | |
46340 } | |
46341 return 0; | |
46342 } | |
46343 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) | |
46344 { | |
46345 if (__Pyx_CyFunction_weakreflist(m) != NULL) | |
46346 PyObject_ClearWeakRefs((PyObject *) m); | |
46347 __Pyx_CyFunction_clear(m); | |
46348 __Pyx_PyHeapTypeObject_GC_Del(m); | |
46349 } | |
46350 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) | |
46351 { | |
46352 PyObject_GC_UnTrack(m); | |
46353 __Pyx__CyFunction_dealloc(m); | |
46354 } | |
46355 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) | |
46356 { | |
46357 Py_VISIT(m->func_closure); | |
46358 #if CYTHON_COMPILING_IN_LIMITED_API | |
46359 Py_VISIT(m->func); | |
46360 #else | |
46361 Py_VISIT(((PyCFunctionObject*)m)->m_module); | |
46362 #endif | |
46363 Py_VISIT(m->func_dict); | |
46364 Py_VISIT(m->func_name); | |
46365 Py_VISIT(m->func_qualname); | |
46366 Py_VISIT(m->func_doc); | |
46367 Py_VISIT(m->func_globals); | |
46368 Py_VISIT(m->func_code); | |
46369 #if !CYTHON_COMPILING_IN_LIMITED_API | |
46370 Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); | |
46371 #endif | |
46372 Py_VISIT(m->defaults_tuple); | |
46373 Py_VISIT(m->defaults_kwdict); | |
46374 Py_VISIT(m->func_is_coroutine); | |
46375 if (m->defaults) { | |
46376 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); | |
46377 int i; | |
46378 for (i = 0; i < m->defaults_pyobjects; i++) | |
46379 Py_VISIT(pydefaults[i]); | |
46380 } | |
46381 return 0; | |
46382 } | |
46383 static PyObject* | |
46384 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) | |
46385 { | |
46386 #if PY_MAJOR_VERSION >= 3 | |
46387 return PyUnicode_FromFormat("<cyfunction %U at %p>", | |
46388 op->func_qualname, (void *)op); | |
46389 #else | |
46390 return PyString_FromFormat("<cyfunction %s at %p>", | |
46391 PyString_AsString(op->func_qualname), (void *)op); | |
46392 #endif | |
46393 } | |
46394 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { | |
46395 #if CYTHON_COMPILING_IN_LIMITED_API | |
46396 PyObject *f = ((__pyx_CyFunctionObject*)func)->func; | |
46397 PyObject *py_name = NULL; | |
46398 PyCFunction meth; | |
46399 int flags; | |
46400 meth = PyCFunction_GetFunction(f); | |
46401 if (unlikely(!meth)) return NULL; | |
46402 flags = PyCFunction_GetFlags(f); | |
46403 if (unlikely(flags < 0)) return NULL; | |
46404 #else | |
46405 PyCFunctionObject* f = (PyCFunctionObject*)func; | |
46406 PyCFunction meth = f->m_ml->ml_meth; | |
46407 int flags = f->m_ml->ml_flags; | |
46408 #endif | |
46409 Py_ssize_t size; | |
46410 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { | |
46411 case METH_VARARGS: | |
46412 if (likely(kw == NULL || PyDict_Size(kw) == 0)) | |
46413 return (*meth)(self, arg); | |
46414 break; | |
46415 case METH_VARARGS | METH_KEYWORDS: | |
46416 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); | |
46417 case METH_NOARGS: | |
46418 if (likely(kw == NULL || PyDict_Size(kw) == 0)) { | |
46419 #if CYTHON_ASSUME_SAFE_MACROS | |
46420 size = PyTuple_GET_SIZE(arg); | |
46421 #else | |
46422 size = PyTuple_Size(arg); | |
46423 if (unlikely(size < 0)) return NULL; | |
46424 #endif | |
46425 if (likely(size == 0)) | |
46426 return (*meth)(self, NULL); | |
46427 #if CYTHON_COMPILING_IN_LIMITED_API | |
46428 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); | |
46429 if (!py_name) return NULL; | |
46430 PyErr_Format(PyExc_TypeError, | |
46431 "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
46432 py_name, size); | |
46433 Py_DECREF(py_name); | |
46434 #else | |
46435 PyErr_Format(PyExc_TypeError, | |
46436 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
46437 f->m_ml->ml_name, size); | |
46438 #endif | |
46439 return NULL; | |
46440 } | |
46441 break; | |
46442 case METH_O: | |
46443 if (likely(kw == NULL || PyDict_Size(kw) == 0)) { | |
46444 #if CYTHON_ASSUME_SAFE_MACROS | |
46445 size = PyTuple_GET_SIZE(arg); | |
46446 #else | |
46447 size = PyTuple_Size(arg); | |
46448 if (unlikely(size < 0)) return NULL; | |
46449 #endif | |
46450 if (likely(size == 1)) { | |
46451 PyObject *result, *arg0; | |
46452 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
46453 arg0 = PyTuple_GET_ITEM(arg, 0); | |
46454 #else | |
46455 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; | |
46456 #endif | |
46457 result = (*meth)(self, arg0); | |
46458 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) | |
46459 Py_DECREF(arg0); | |
46460 #endif | |
46461 return result; | |
46462 } | |
46463 #if CYTHON_COMPILING_IN_LIMITED_API | |
46464 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); | |
46465 if (!py_name) return NULL; | |
46466 PyErr_Format(PyExc_TypeError, | |
46467 "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
46468 py_name, size); | |
46469 Py_DECREF(py_name); | |
46470 #else | |
46471 PyErr_Format(PyExc_TypeError, | |
46472 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
46473 f->m_ml->ml_name, size); | |
46474 #endif | |
46475 return NULL; | |
46476 } | |
46477 break; | |
46478 default: | |
46479 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); | |
46480 return NULL; | |
46481 } | |
46482 #if CYTHON_COMPILING_IN_LIMITED_API | |
46483 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); | |
46484 if (!py_name) return NULL; | |
46485 PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", | |
46486 py_name); | |
46487 Py_DECREF(py_name); | |
46488 #else | |
46489 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", | |
46490 f->m_ml->ml_name); | |
46491 #endif | |
46492 return NULL; | |
46493 } | |
46494 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
46495 PyObject *self, *result; | |
46496 #if CYTHON_COMPILING_IN_LIMITED_API | |
46497 self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); | |
46498 if (unlikely(!self) && PyErr_Occurred()) return NULL; | |
46499 #else | |
46500 self = ((PyCFunctionObject*)func)->m_self; | |
46501 #endif | |
46502 result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); | |
46503 return result; | |
46504 } | |
46505 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { | |
46506 PyObject *result; | |
46507 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; | |
46508 #if CYTHON_METH_FASTCALL | |
46509 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); | |
46510 if (vc) { | |
46511 #if CYTHON_ASSUME_SAFE_MACROS | |
46512 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); | |
46513 #else | |
46514 (void) &__Pyx_PyVectorcall_FastCallDict; | |
46515 return PyVectorcall_Call(func, args, kw); | |
46516 #endif | |
46517 } | |
46518 #endif | |
46519 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { | |
46520 Py_ssize_t argc; | |
46521 PyObject *new_args; | |
46522 PyObject *self; | |
46523 #if CYTHON_ASSUME_SAFE_MACROS | |
46524 argc = PyTuple_GET_SIZE(args); | |
46525 #else | |
46526 argc = PyTuple_Size(args); | |
46527 if (unlikely(!argc) < 0) return NULL; | |
46528 #endif | |
46529 new_args = PyTuple_GetSlice(args, 1, argc); | |
46530 if (unlikely(!new_args)) | |
46531 return NULL; | |
46532 self = PyTuple_GetItem(args, 0); | |
46533 if (unlikely(!self)) { | |
46534 Py_DECREF(new_args); | |
46535 #if PY_MAJOR_VERSION > 2 | |
46536 PyErr_Format(PyExc_TypeError, | |
46537 "unbound method %.200S() needs an argument", | |
46538 cyfunc->func_qualname); | |
46539 #else | |
46540 PyErr_SetString(PyExc_TypeError, | |
46541 "unbound method needs an argument"); | |
46542 #endif | |
46543 return NULL; | |
46544 } | |
46545 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); | |
46546 Py_DECREF(new_args); | |
46547 } else { | |
46548 result = __Pyx_CyFunction_Call(func, args, kw); | |
46549 } | |
46550 return result; | |
46551 } | |
46552 #if CYTHON_METH_FASTCALL | |
46553 static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) | |
46554 { | |
46555 int ret = 0; | |
46556 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { | |
46557 if (unlikely(nargs < 1)) { | |
46558 PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", | |
46559 ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); | |
46560 return -1; | |
46561 } | |
46562 ret = 1; | |
46563 } | |
46564 if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { | |
46565 PyErr_Format(PyExc_TypeError, | |
46566 "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); | |
46567 return -1; | |
46568 } | |
46569 return ret; | |
46570 } | |
46571 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
46572 { | |
46573 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
46574 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
46575 #if CYTHON_BACKPORT_VECTORCALL | |
46576 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
46577 #else | |
46578 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
46579 #endif | |
46580 PyObject *self; | |
46581 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { | |
46582 case 1: | |
46583 self = args[0]; | |
46584 args += 1; | |
46585 nargs -= 1; | |
46586 break; | |
46587 case 0: | |
46588 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
46589 break; | |
46590 default: | |
46591 return NULL; | |
46592 } | |
46593 if (unlikely(nargs != 0)) { | |
46594 PyErr_Format(PyExc_TypeError, | |
46595 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
46596 def->ml_name, nargs); | |
46597 return NULL; | |
46598 } | |
46599 return def->ml_meth(self, NULL); | |
46600 } | |
46601 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
46602 { | |
46603 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
46604 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
46605 #if CYTHON_BACKPORT_VECTORCALL | |
46606 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
46607 #else | |
46608 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
46609 #endif | |
46610 PyObject *self; | |
46611 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { | |
46612 case 1: | |
46613 self = args[0]; | |
46614 args += 1; | |
46615 nargs -= 1; | |
46616 break; | |
46617 case 0: | |
46618 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
46619 break; | |
46620 default: | |
46621 return NULL; | |
46622 } | |
46623 if (unlikely(nargs != 1)) { | |
46624 PyErr_Format(PyExc_TypeError, | |
46625 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
46626 def->ml_name, nargs); | |
46627 return NULL; | |
46628 } | |
46629 return def->ml_meth(self, args[0]); | |
46630 } | |
46631 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
46632 { | |
46633 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
46634 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
46635 #if CYTHON_BACKPORT_VECTORCALL | |
46636 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
46637 #else | |
46638 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
46639 #endif | |
46640 PyObject *self; | |
46641 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { | |
46642 case 1: | |
46643 self = args[0]; | |
46644 args += 1; | |
46645 nargs -= 1; | |
46646 break; | |
46647 case 0: | |
46648 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
46649 break; | |
46650 default: | |
46651 return NULL; | |
46652 } | |
46653 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); | |
46654 } | |
46655 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
46656 { | |
46657 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
46658 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
46659 PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); | |
46660 #if CYTHON_BACKPORT_VECTORCALL | |
46661 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
46662 #else | |
46663 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
46664 #endif | |
46665 PyObject *self; | |
46666 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { | |
46667 case 1: | |
46668 self = args[0]; | |
46669 args += 1; | |
46670 nargs -= 1; | |
46671 break; | |
46672 case 0: | |
46673 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
46674 break; | |
46675 default: | |
46676 return NULL; | |
46677 } | |
46678 return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); | |
46679 } | |
46680 #endif | |
46681 #if CYTHON_USE_TYPE_SPECS | |
46682 static PyType_Slot __pyx_CyFunctionType_slots[] = { | |
46683 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, | |
46684 {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, | |
46685 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, | |
46686 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, | |
46687 {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, | |
46688 {Py_tp_methods, (void *)__pyx_CyFunction_methods}, | |
46689 {Py_tp_members, (void *)__pyx_CyFunction_members}, | |
46690 {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, | |
46691 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, | |
46692 {0, 0}, | |
46693 }; | |
46694 static PyType_Spec __pyx_CyFunctionType_spec = { | |
46695 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", | |
46696 sizeof(__pyx_CyFunctionObject), | |
46697 0, | |
46698 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR | |
46699 Py_TPFLAGS_METHOD_DESCRIPTOR | | |
46700 #endif | |
46701 #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) | |
46702 _Py_TPFLAGS_HAVE_VECTORCALL | | |
46703 #endif | |
46704 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, | |
46705 __pyx_CyFunctionType_slots | |
46706 }; | |
46707 #else | |
46708 static PyTypeObject __pyx_CyFunctionType_type = { | |
46709 PyVarObject_HEAD_INIT(0, 0) | |
46710 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", | |
46711 sizeof(__pyx_CyFunctionObject), | |
46712 0, | |
46713 (destructor) __Pyx_CyFunction_dealloc, | |
46714 #if !CYTHON_METH_FASTCALL | |
46715 0, | |
46716 #elif CYTHON_BACKPORT_VECTORCALL | |
46717 (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), | |
46718 #else | |
46719 offsetof(PyCFunctionObject, vectorcall), | |
46720 #endif | |
46721 0, | |
46722 0, | |
46723 #if PY_MAJOR_VERSION < 3 | |
46724 0, | |
46725 #else | |
46726 0, | |
46727 #endif | |
46728 (reprfunc) __Pyx_CyFunction_repr, | |
46729 0, | |
46730 0, | |
46731 0, | |
46732 0, | |
46733 __Pyx_CyFunction_CallAsMethod, | |
46734 0, | |
46735 0, | |
46736 0, | |
46737 0, | |
46738 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR | |
46739 Py_TPFLAGS_METHOD_DESCRIPTOR | | |
46740 #endif | |
46741 #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL | |
46742 _Py_TPFLAGS_HAVE_VECTORCALL | | |
46743 #endif | |
46744 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, | |
46745 0, | |
46746 (traverseproc) __Pyx_CyFunction_traverse, | |
46747 (inquiry) __Pyx_CyFunction_clear, | |
46748 0, | |
46749 #if PY_VERSION_HEX < 0x030500A0 | |
46750 offsetof(__pyx_CyFunctionObject, func_weakreflist), | |
46751 #else | |
46752 offsetof(PyCFunctionObject, m_weakreflist), | |
46753 #endif | |
46754 0, | |
46755 0, | |
46756 __pyx_CyFunction_methods, | |
46757 __pyx_CyFunction_members, | |
46758 __pyx_CyFunction_getsets, | |
46759 0, | |
46760 0, | |
46761 __Pyx_PyMethod_New, | |
46762 0, | |
46763 offsetof(__pyx_CyFunctionObject, func_dict), | |
46764 0, | |
46765 0, | |
46766 0, | |
46767 0, | |
46768 0, | |
46769 0, | |
46770 0, | |
46771 0, | |
46772 0, | |
46773 0, | |
46774 0, | |
46775 0, | |
46776 #if PY_VERSION_HEX >= 0x030400a1 | |
46777 0, | |
46778 #endif | |
46779 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
46780 0, | |
46781 #endif | |
46782 #if __PYX_NEED_TP_PRINT_SLOT | |
46783 0, | |
46784 #endif | |
46785 #if PY_VERSION_HEX >= 0x030C0000 | |
46786 0, | |
46787 #endif | |
46788 #if PY_VERSION_HEX >= 0x030d00A4 | |
46789 0, | |
46790 #endif | |
46791 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
46792 0, | |
46793 #endif | |
46794 }; | |
46795 #endif | |
46796 static int __pyx_CyFunction_init(PyObject *module) { | |
46797 #if CYTHON_USE_TYPE_SPECS | |
46798 __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); | |
46799 #else | |
46800 CYTHON_UNUSED_VAR(module); | |
46801 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); | |
46802 #endif | |
46803 if (unlikely(__pyx_CyFunctionType == NULL)) { | |
46804 return -1; | |
46805 } | |
46806 return 0; | |
46807 } | |
46808 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { | |
46809 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
46810 m->defaults = PyObject_Malloc(size); | |
46811 if (unlikely(!m->defaults)) | |
46812 return PyErr_NoMemory(); | |
46813 memset(m->defaults, 0, size); | |
46814 m->defaults_pyobjects = pyobjects; | |
46815 m->defaults_size = size; | |
46816 return m->defaults; | |
46817 } | |
46818 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { | |
46819 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
46820 m->defaults_tuple = tuple; | |
46821 Py_INCREF(tuple); | |
46822 } | |
46823 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { | |
46824 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
46825 m->defaults_kwdict = dict; | |
46826 Py_INCREF(dict); | |
46827 } | |
46828 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { | |
46829 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
46830 m->func_annotations = dict; | |
46831 Py_INCREF(dict); | |
46832 } | |
46833 | |
46834 /* CythonFunction */ | |
46835 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, | |
46836 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { | |
46837 PyObject *op = __Pyx_CyFunction_Init( | |
46838 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), | |
46839 ml, flags, qualname, closure, module, globals, code | |
46840 ); | |
46841 if (likely(op)) { | |
46842 PyObject_GC_Track(op); | |
46843 } | |
46844 return op; | |
46845 } | |
46846 | |
46847 /* Py3UpdateBases */ | |
46848 static PyObject* | |
46849 __Pyx_PEP560_update_bases(PyObject *bases) | |
46850 { | |
46851 Py_ssize_t i, j, size_bases; | |
46852 PyObject *base, *meth, *new_base, *result, *new_bases = NULL; | |
46853 size_bases = PyTuple_GET_SIZE(bases); | |
46854 for (i = 0; i < size_bases; i++) { | |
46855 base = PyTuple_GET_ITEM(bases, i); | |
46856 if (PyType_Check(base)) { | |
46857 if (new_bases) { | |
46858 if (PyList_Append(new_bases, base) < 0) { | |
46859 goto error; | |
46860 } | |
46861 } | |
46862 continue; | |
46863 } | |
46864 meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); | |
46865 if (!meth && PyErr_Occurred()) { | |
46866 goto error; | |
46867 } | |
46868 if (!meth) { | |
46869 if (new_bases) { | |
46870 if (PyList_Append(new_bases, base) < 0) { | |
46871 goto error; | |
46872 } | |
46873 } | |
46874 continue; | |
46875 } | |
46876 new_base = __Pyx_PyObject_CallOneArg(meth, bases); | |
46877 Py_DECREF(meth); | |
46878 if (!new_base) { | |
46879 goto error; | |
46880 } | |
46881 if (!PyTuple_Check(new_base)) { | |
46882 PyErr_SetString(PyExc_TypeError, | |
46883 "__mro_entries__ must return a tuple"); | |
46884 Py_DECREF(new_base); | |
46885 goto error; | |
46886 } | |
46887 if (!new_bases) { | |
46888 if (!(new_bases = PyList_New(i))) { | |
46889 goto error; | |
46890 } | |
46891 for (j = 0; j < i; j++) { | |
46892 base = PyTuple_GET_ITEM(bases, j); | |
46893 PyList_SET_ITEM(new_bases, j, base); | |
46894 Py_INCREF(base); | |
46895 } | |
46896 } | |
46897 j = PyList_GET_SIZE(new_bases); | |
46898 if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { | |
46899 goto error; | |
46900 } | |
46901 Py_DECREF(new_base); | |
46902 } | |
46903 if (!new_bases) { | |
46904 Py_INCREF(bases); | |
46905 return bases; | |
46906 } | |
46907 result = PyList_AsTuple(new_bases); | |
46908 Py_DECREF(new_bases); | |
46909 return result; | |
46910 error: | |
46911 Py_XDECREF(new_bases); | |
46912 return NULL; | |
46913 } | |
46914 | |
46915 /* CalculateMetaclass */ | |
46916 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { | |
46917 Py_ssize_t i, nbases; | |
46918 #if CYTHON_ASSUME_SAFE_MACROS | |
46919 nbases = PyTuple_GET_SIZE(bases); | |
46920 #else | |
46921 nbases = PyTuple_Size(bases); | |
46922 if (nbases < 0) return NULL; | |
46923 #endif | |
46924 for (i=0; i < nbases; i++) { | |
46925 PyTypeObject *tmptype; | |
46926 #if CYTHON_ASSUME_SAFE_MACROS | |
46927 PyObject *tmp = PyTuple_GET_ITEM(bases, i); | |
46928 #else | |
46929 PyObject *tmp = PyTuple_GetItem(bases, i); | |
46930 if (!tmp) return NULL; | |
46931 #endif | |
46932 tmptype = Py_TYPE(tmp); | |
46933 #if PY_MAJOR_VERSION < 3 | |
46934 if (tmptype == &PyClass_Type) | |
46935 continue; | |
46936 #endif | |
46937 if (!metaclass) { | |
46938 metaclass = tmptype; | |
46939 continue; | |
46940 } | |
46941 if (PyType_IsSubtype(metaclass, tmptype)) | |
46942 continue; | |
46943 if (PyType_IsSubtype(tmptype, metaclass)) { | |
46944 metaclass = tmptype; | |
46945 continue; | |
46946 } | |
46947 PyErr_SetString(PyExc_TypeError, | |
46948 "metaclass conflict: " | |
46949 "the metaclass of a derived class " | |
46950 "must be a (non-strict) subclass " | |
46951 "of the metaclasses of all its bases"); | |
46952 return NULL; | |
46953 } | |
46954 if (!metaclass) { | |
46955 #if PY_MAJOR_VERSION < 3 | |
46956 metaclass = &PyClass_Type; | |
46957 #else | |
46958 metaclass = &PyType_Type; | |
46959 #endif | |
46960 } | |
46961 Py_INCREF((PyObject*) metaclass); | |
46962 return (PyObject*) metaclass; | |
46963 } | |
46964 | |
46965 /* PyObjectLookupSpecial */ | |
46966 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
46967 static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { | |
46968 PyObject *res; | |
46969 PyTypeObject *tp = Py_TYPE(obj); | |
46970 #if PY_MAJOR_VERSION < 3 | |
46971 if (unlikely(PyInstance_Check(obj))) | |
46972 return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); | |
46973 #endif | |
46974 res = _PyType_Lookup(tp, attr_name); | |
46975 if (likely(res)) { | |
46976 descrgetfunc f = Py_TYPE(res)->tp_descr_get; | |
46977 if (!f) { | |
46978 Py_INCREF(res); | |
46979 } else { | |
46980 res = f(res, obj, (PyObject *)tp); | |
46981 } | |
46982 } else if (with_error) { | |
46983 PyErr_SetObject(PyExc_AttributeError, attr_name); | |
46984 } | |
46985 return res; | |
46986 } | |
46987 #endif | |
46988 | |
46989 /* Py3ClassCreate */ | |
46990 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, | |
46991 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { | |
46992 PyObject *ns; | |
46993 if (metaclass) { | |
46994 PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); | |
46995 if (prep) { | |
46996 PyObject *pargs[3] = {NULL, name, bases}; | |
46997 ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); | |
46998 Py_DECREF(prep); | |
46999 } else { | |
47000 if (unlikely(PyErr_Occurred())) | |
47001 return NULL; | |
47002 ns = PyDict_New(); | |
47003 } | |
47004 } else { | |
47005 ns = PyDict_New(); | |
47006 } | |
47007 if (unlikely(!ns)) | |
47008 return NULL; | |
47009 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; | |
47010 #if PY_VERSION_HEX >= 0x03030000 | |
47011 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; | |
47012 #else | |
47013 CYTHON_MAYBE_UNUSED_VAR(qualname); | |
47014 #endif | |
47015 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; | |
47016 return ns; | |
47017 bad: | |
47018 Py_DECREF(ns); | |
47019 return NULL; | |
47020 } | |
47021 #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS | |
47022 static int __Pyx_SetNamesPEP487(PyObject *type_obj) { | |
47023 PyTypeObject *type = (PyTypeObject*) type_obj; | |
47024 PyObject *names_to_set, *key, *value, *set_name, *tmp; | |
47025 Py_ssize_t i = 0; | |
47026 #if CYTHON_USE_TYPE_SLOTS | |
47027 names_to_set = PyDict_Copy(type->tp_dict); | |
47028 #else | |
47029 { | |
47030 PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); | |
47031 names_to_set = NULL; | |
47032 if (likely(d)) { | |
47033 PyObject *names_to_set = PyDict_New(); | |
47034 int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; | |
47035 Py_DECREF(d); | |
47036 if (unlikely(ret < 0)) | |
47037 Py_CLEAR(names_to_set); | |
47038 } | |
47039 } | |
47040 #endif | |
47041 if (unlikely(names_to_set == NULL)) | |
47042 goto bad; | |
47043 while (PyDict_Next(names_to_set, &i, &key, &value)) { | |
47044 set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); | |
47045 if (unlikely(set_name != NULL)) { | |
47046 tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); | |
47047 Py_DECREF(set_name); | |
47048 if (unlikely(tmp == NULL)) { | |
47049 __Pyx_TypeName value_type_name = | |
47050 __Pyx_PyType_GetName(Py_TYPE(value)); | |
47051 __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); | |
47052 PyErr_Format(PyExc_RuntimeError, | |
47053 #if PY_MAJOR_VERSION >= 3 | |
47054 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", | |
47055 value_type_name, key, type_name); | |
47056 #else | |
47057 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", | |
47058 value_type_name, | |
47059 PyString_Check(key) ? PyString_AS_STRING(key) : "?", | |
47060 type_name); | |
47061 #endif | |
47062 goto bad; | |
47063 } else { | |
47064 Py_DECREF(tmp); | |
47065 } | |
47066 } | |
47067 else if (unlikely(PyErr_Occurred())) { | |
47068 goto bad; | |
47069 } | |
47070 } | |
47071 Py_DECREF(names_to_set); | |
47072 return 0; | |
47073 bad: | |
47074 Py_XDECREF(names_to_set); | |
47075 return -1; | |
47076 } | |
47077 static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { | |
47078 #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
47079 PyTypeObject *type = (PyTypeObject*) type_obj; | |
47080 PyObject *mro = type->tp_mro; | |
47081 Py_ssize_t i, nbases; | |
47082 if (unlikely(!mro)) goto done; | |
47083 (void) &__Pyx_GetBuiltinName; | |
47084 Py_INCREF(mro); | |
47085 nbases = PyTuple_GET_SIZE(mro); | |
47086 assert(PyTuple_GET_ITEM(mro, 0) == type_obj); | |
47087 for (i = 1; i < nbases-1; i++) { | |
47088 PyObject *base, *dict, *meth; | |
47089 base = PyTuple_GET_ITEM(mro, i); | |
47090 dict = ((PyTypeObject *)base)->tp_dict; | |
47091 meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); | |
47092 if (unlikely(meth)) { | |
47093 descrgetfunc f = Py_TYPE(meth)->tp_descr_get; | |
47094 PyObject *res; | |
47095 Py_INCREF(meth); | |
47096 if (likely(f)) { | |
47097 res = f(meth, NULL, type_obj); | |
47098 Py_DECREF(meth); | |
47099 if (unlikely(!res)) goto bad; | |
47100 meth = res; | |
47101 } | |
47102 res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); | |
47103 Py_DECREF(meth); | |
47104 if (unlikely(!res)) goto bad; | |
47105 Py_DECREF(res); | |
47106 goto done; | |
47107 } else if (unlikely(PyErr_Occurred())) { | |
47108 goto bad; | |
47109 } | |
47110 } | |
47111 done: | |
47112 Py_XDECREF(mro); | |
47113 return type_obj; | |
47114 bad: | |
47115 Py_XDECREF(mro); | |
47116 Py_DECREF(type_obj); | |
47117 return NULL; | |
47118 #else | |
47119 PyObject *super_type, *super, *func, *res; | |
47120 #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) | |
47121 super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); | |
47122 #else | |
47123 super_type = (PyObject*) &PySuper_Type; | |
47124 (void) &__Pyx_GetBuiltinName; | |
47125 #endif | |
47126 super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; | |
47127 #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) | |
47128 Py_XDECREF(super_type); | |
47129 #endif | |
47130 if (unlikely(!super)) { | |
47131 Py_CLEAR(type_obj); | |
47132 goto done; | |
47133 } | |
47134 func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); | |
47135 Py_DECREF(super); | |
47136 if (likely(!func)) { | |
47137 if (unlikely(PyErr_Occurred())) | |
47138 Py_CLEAR(type_obj); | |
47139 goto done; | |
47140 } | |
47141 res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); | |
47142 Py_DECREF(func); | |
47143 if (unlikely(!res)) | |
47144 Py_CLEAR(type_obj); | |
47145 Py_XDECREF(res); | |
47146 done: | |
47147 return type_obj; | |
47148 #endif | |
47149 } | |
47150 #endif | |
47151 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, | |
47152 PyObject *dict, PyObject *mkw, | |
47153 int calculate_metaclass, int allow_py2_metaclass) { | |
47154 PyObject *result; | |
47155 PyObject *owned_metaclass = NULL; | |
47156 PyObject *margs[4] = {NULL, name, bases, dict}; | |
47157 if (allow_py2_metaclass) { | |
47158 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); | |
47159 if (owned_metaclass) { | |
47160 metaclass = owned_metaclass; | |
47161 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { | |
47162 PyErr_Clear(); | |
47163 } else { | |
47164 return NULL; | |
47165 } | |
47166 } | |
47167 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { | |
47168 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); | |
47169 Py_XDECREF(owned_metaclass); | |
47170 if (unlikely(!metaclass)) | |
47171 return NULL; | |
47172 owned_metaclass = metaclass; | |
47173 } | |
47174 result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, | |
47175 #if PY_VERSION_HEX < 0x030600A4 | |
47176 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw | |
47177 #else | |
47178 mkw | |
47179 #endif | |
47180 ); | |
47181 Py_XDECREF(owned_metaclass); | |
47182 #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS | |
47183 if (likely(result) && likely(PyType_Check(result))) { | |
47184 if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { | |
47185 Py_CLEAR(result); | |
47186 } else { | |
47187 result = __Pyx_InitSubclassPEP487(result, mkw); | |
47188 } | |
47189 } | |
47190 #else | |
47191 (void) &__Pyx_GetBuiltinName; | |
47192 #endif | |
47193 return result; | |
47194 } | |
47195 | |
47196 /* CLineInTraceback */ | |
47197 #ifndef CYTHON_CLINE_IN_TRACEBACK | |
47198 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { | |
47199 PyObject *use_cline; | |
47200 PyObject *ptype, *pvalue, *ptraceback; | |
47201 #if CYTHON_COMPILING_IN_CPYTHON | |
47202 PyObject **cython_runtime_dict; | |
47203 #endif | |
47204 CYTHON_MAYBE_UNUSED_VAR(tstate); | |
47205 if (unlikely(!__pyx_cython_runtime)) { | |
47206 return c_line; | |
47207 } | |
47208 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); | |
47209 #if CYTHON_COMPILING_IN_CPYTHON | |
47210 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); | |
47211 if (likely(cython_runtime_dict)) { | |
47212 __PYX_PY_DICT_LOOKUP_IF_MODIFIED( | |
47213 use_cline, *cython_runtime_dict, | |
47214 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) | |
47215 } else | |
47216 #endif | |
47217 { | |
47218 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); | |
47219 if (use_cline_obj) { | |
47220 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; | |
47221 Py_DECREF(use_cline_obj); | |
47222 } else { | |
47223 PyErr_Clear(); | |
47224 use_cline = NULL; | |
47225 } | |
47226 } | |
47227 if (!use_cline) { | |
47228 c_line = 0; | |
47229 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); | |
47230 } | |
47231 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { | |
47232 c_line = 0; | |
47233 } | |
47234 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); | |
47235 return c_line; | |
47236 } | |
47237 #endif | |
47238 | |
47239 /* CodeObjectCache */ | |
47240 #if !CYTHON_COMPILING_IN_LIMITED_API | |
47241 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { | |
47242 int start = 0, mid = 0, end = count - 1; | |
47243 if (end >= 0 && code_line > entries[end].code_line) { | |
47244 return count; | |
47245 } | |
47246 while (start < end) { | |
47247 mid = start + (end - start) / 2; | |
47248 if (code_line < entries[mid].code_line) { | |
47249 end = mid; | |
47250 } else if (code_line > entries[mid].code_line) { | |
47251 start = mid + 1; | |
47252 } else { | |
47253 return mid; | |
47254 } | |
47255 } | |
47256 if (code_line <= entries[mid].code_line) { | |
47257 return mid; | |
47258 } else { | |
47259 return mid + 1; | |
47260 } | |
47261 } | |
47262 static PyCodeObject *__pyx_find_code_object(int code_line) { | |
47263 PyCodeObject* code_object; | |
47264 int pos; | |
47265 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { | |
47266 return NULL; | |
47267 } | |
47268 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); | |
47269 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { | |
47270 return NULL; | |
47271 } | |
47272 code_object = __pyx_code_cache.entries[pos].code_object; | |
47273 Py_INCREF(code_object); | |
47274 return code_object; | |
47275 } | |
47276 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { | |
47277 int pos, i; | |
47278 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; | |
47279 if (unlikely(!code_line)) { | |
47280 return; | |
47281 } | |
47282 if (unlikely(!entries)) { | |
47283 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); | |
47284 if (likely(entries)) { | |
47285 __pyx_code_cache.entries = entries; | |
47286 __pyx_code_cache.max_count = 64; | |
47287 __pyx_code_cache.count = 1; | |
47288 entries[0].code_line = code_line; | |
47289 entries[0].code_object = code_object; | |
47290 Py_INCREF(code_object); | |
47291 } | |
47292 return; | |
47293 } | |
47294 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); | |
47295 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { | |
47296 PyCodeObject* tmp = entries[pos].code_object; | |
47297 entries[pos].code_object = code_object; | |
47298 Py_DECREF(tmp); | |
47299 return; | |
47300 } | |
47301 if (__pyx_code_cache.count == __pyx_code_cache.max_count) { | |
47302 int new_max = __pyx_code_cache.max_count + 64; | |
47303 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( | |
47304 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); | |
47305 if (unlikely(!entries)) { | |
47306 return; | |
47307 } | |
47308 __pyx_code_cache.entries = entries; | |
47309 __pyx_code_cache.max_count = new_max; | |
47310 } | |
47311 for (i=__pyx_code_cache.count; i>pos; i--) { | |
47312 entries[i] = entries[i-1]; | |
47313 } | |
47314 entries[pos].code_line = code_line; | |
47315 entries[pos].code_object = code_object; | |
47316 __pyx_code_cache.count++; | |
47317 Py_INCREF(code_object); | |
47318 } | |
47319 #endif | |
47320 | |
47321 /* AddTraceback */ | |
47322 #include "compile.h" | |
47323 #include "frameobject.h" | |
47324 #include "traceback.h" | |
47325 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API | |
47326 #ifndef Py_BUILD_CORE | |
47327 #define Py_BUILD_CORE 1 | |
47328 #endif | |
47329 #include "internal/pycore_frame.h" | |
47330 #endif | |
47331 #if CYTHON_COMPILING_IN_LIMITED_API | |
47332 static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, | |
47333 PyObject *firstlineno, PyObject *name) { | |
47334 PyObject *replace = NULL; | |
47335 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; | |
47336 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; | |
47337 replace = PyObject_GetAttrString(code, "replace"); | |
47338 if (likely(replace)) { | |
47339 PyObject *result; | |
47340 result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); | |
47341 Py_DECREF(replace); | |
47342 return result; | |
47343 } | |
47344 PyErr_Clear(); | |
47345 #if __PYX_LIMITED_VERSION_HEX < 0x030780000 | |
47346 { | |
47347 PyObject *compiled = NULL, *result = NULL; | |
47348 if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; | |
47349 if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; | |
47350 compiled = Py_CompileString( | |
47351 "out = type(code)(\n" | |
47352 " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" | |
47353 " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" | |
47354 " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" | |
47355 " code.co_lnotab)\n", "<dummy>", Py_file_input); | |
47356 if (!compiled) return NULL; | |
47357 result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); | |
47358 Py_DECREF(compiled); | |
47359 if (!result) PyErr_Print(); | |
47360 Py_DECREF(result); | |
47361 result = PyDict_GetItemString(scratch_dict, "out"); | |
47362 if (result) Py_INCREF(result); | |
47363 return result; | |
47364 } | |
47365 #else | |
47366 return NULL; | |
47367 #endif | |
47368 } | |
47369 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
47370 int py_line, const char *filename) { | |
47371 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; | |
47372 PyObject *replace = NULL, *getframe = NULL, *frame = NULL; | |
47373 PyObject *exc_type, *exc_value, *exc_traceback; | |
47374 int success = 0; | |
47375 if (c_line) { | |
47376 (void) __pyx_cfilenm; | |
47377 (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); | |
47378 } | |
47379 PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); | |
47380 code_object = Py_CompileString("_getframe()", filename, Py_eval_input); | |
47381 if (unlikely(!code_object)) goto bad; | |
47382 py_py_line = PyLong_FromLong(py_line); | |
47383 if (unlikely(!py_py_line)) goto bad; | |
47384 py_funcname = PyUnicode_FromString(funcname); | |
47385 if (unlikely(!py_funcname)) goto bad; | |
47386 dict = PyDict_New(); | |
47387 if (unlikely(!dict)) goto bad; | |
47388 { | |
47389 PyObject *old_code_object = code_object; | |
47390 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); | |
47391 Py_DECREF(old_code_object); | |
47392 } | |
47393 if (unlikely(!code_object)) goto bad; | |
47394 getframe = PySys_GetObject("_getframe"); | |
47395 if (unlikely(!getframe)) goto bad; | |
47396 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; | |
47397 frame = PyEval_EvalCode(code_object, dict, dict); | |
47398 if (unlikely(!frame) || frame == Py_None) goto bad; | |
47399 success = 1; | |
47400 bad: | |
47401 PyErr_Restore(exc_type, exc_value, exc_traceback); | |
47402 Py_XDECREF(code_object); | |
47403 Py_XDECREF(py_py_line); | |
47404 Py_XDECREF(py_funcname); | |
47405 Py_XDECREF(dict); | |
47406 Py_XDECREF(replace); | |
47407 if (success) { | |
47408 PyTraceBack_Here( | |
47409 (struct _frame*)frame); | |
47410 } | |
47411 Py_XDECREF(frame); | |
47412 } | |
47413 #else | |
47414 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( | |
47415 const char *funcname, int c_line, | |
47416 int py_line, const char *filename) { | |
47417 PyCodeObject *py_code = NULL; | |
47418 PyObject *py_funcname = NULL; | |
47419 #if PY_MAJOR_VERSION < 3 | |
47420 PyObject *py_srcfile = NULL; | |
47421 py_srcfile = PyString_FromString(filename); | |
47422 if (!py_srcfile) goto bad; | |
47423 #endif | |
47424 if (c_line) { | |
47425 #if PY_MAJOR_VERSION < 3 | |
47426 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); | |
47427 if (!py_funcname) goto bad; | |
47428 #else | |
47429 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); | |
47430 if (!py_funcname) goto bad; | |
47431 funcname = PyUnicode_AsUTF8(py_funcname); | |
47432 if (!funcname) goto bad; | |
47433 #endif | |
47434 } | |
47435 else { | |
47436 #if PY_MAJOR_VERSION < 3 | |
47437 py_funcname = PyString_FromString(funcname); | |
47438 if (!py_funcname) goto bad; | |
47439 #endif | |
47440 } | |
47441 #if PY_MAJOR_VERSION < 3 | |
47442 py_code = __Pyx_PyCode_New( | |
47443 0, | |
47444 0, | |
47445 0, | |
47446 0, | |
47447 0, | |
47448 0, | |
47449 __pyx_empty_bytes, /*PyObject *code,*/ | |
47450 __pyx_empty_tuple, /*PyObject *consts,*/ | |
47451 __pyx_empty_tuple, /*PyObject *names,*/ | |
47452 __pyx_empty_tuple, /*PyObject *varnames,*/ | |
47453 __pyx_empty_tuple, /*PyObject *freevars,*/ | |
47454 __pyx_empty_tuple, /*PyObject *cellvars,*/ | |
47455 py_srcfile, /*PyObject *filename,*/ | |
47456 py_funcname, /*PyObject *name,*/ | |
47457 py_line, | |
47458 __pyx_empty_bytes /*PyObject *lnotab*/ | |
47459 ); | |
47460 Py_DECREF(py_srcfile); | |
47461 #else | |
47462 py_code = PyCode_NewEmpty(filename, funcname, py_line); | |
47463 #endif | |
47464 Py_XDECREF(py_funcname); | |
47465 return py_code; | |
47466 bad: | |
47467 Py_XDECREF(py_funcname); | |
47468 #if PY_MAJOR_VERSION < 3 | |
47469 Py_XDECREF(py_srcfile); | |
47470 #endif | |
47471 return NULL; | |
47472 } | |
47473 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
47474 int py_line, const char *filename) { | |
47475 PyCodeObject *py_code = 0; | |
47476 PyFrameObject *py_frame = 0; | |
47477 PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
47478 PyObject *ptype, *pvalue, *ptraceback; | |
47479 if (c_line) { | |
47480 c_line = __Pyx_CLineForTraceback(tstate, c_line); | |
47481 } | |
47482 py_code = __pyx_find_code_object(c_line ? -c_line : py_line); | |
47483 if (!py_code) { | |
47484 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); | |
47485 py_code = __Pyx_CreateCodeObjectForTraceback( | |
47486 funcname, c_line, py_line, filename); | |
47487 if (!py_code) { | |
47488 /* If the code object creation fails, then we should clear the | |
47489 fetched exception references and propagate the new exception */ | |
47490 Py_XDECREF(ptype); | |
47491 Py_XDECREF(pvalue); | |
47492 Py_XDECREF(ptraceback); | |
47493 goto bad; | |
47494 } | |
47495 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); | |
47496 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); | |
47497 } | |
47498 py_frame = PyFrame_New( | |
47499 tstate, /*PyThreadState *tstate,*/ | |
47500 py_code, /*PyCodeObject *code,*/ | |
47501 __pyx_d, /*PyObject *globals,*/ | |
47502 0 /*PyObject *locals*/ | |
47503 ); | |
47504 if (!py_frame) goto bad; | |
47505 __Pyx_PyFrame_SetLineNumber(py_frame, py_line); | |
47506 PyTraceBack_Here(py_frame); | |
47507 bad: | |
47508 Py_XDECREF(py_code); | |
47509 Py_XDECREF(py_frame); | |
47510 } | |
47511 #endif | |
47512 | |
47513 /* CIntFromPyVerify */ | |
47514 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ | |
47515 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) | |
47516 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ | |
47517 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) | |
47518 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ | |
47519 {\ | |
47520 func_type value = func_value;\ | |
47521 if (sizeof(target_type) < sizeof(func_type)) {\ | |
47522 if (unlikely(value != (func_type) (target_type) value)) {\ | |
47523 func_type zero = 0;\ | |
47524 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ | |
47525 return (target_type) -1;\ | |
47526 if (is_unsigned && unlikely(value < zero))\ | |
47527 goto raise_neg_overflow;\ | |
47528 else\ | |
47529 goto raise_overflow;\ | |
47530 }\ | |
47531 }\ | |
47532 return (target_type) value;\ | |
47533 } | |
47534 | |
47535 /* CIntFromPy */ | |
47536 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { | |
47537 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
47538 #pragma GCC diagnostic push | |
47539 #pragma GCC diagnostic ignored "-Wconversion" | |
47540 #endif | |
47541 const long neg_one = (long) -1, const_zero = (long) 0; | |
47542 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
47543 #pragma GCC diagnostic pop | |
47544 #endif | |
47545 const int is_unsigned = neg_one > const_zero; | |
47546 #if PY_MAJOR_VERSION < 3 | |
47547 if (likely(PyInt_Check(x))) { | |
47548 if ((sizeof(long) < sizeof(long))) { | |
47549 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) | |
47550 } else { | |
47551 long val = PyInt_AS_LONG(x); | |
47552 if (is_unsigned && unlikely(val < 0)) { | |
47553 goto raise_neg_overflow; | |
47554 } | |
47555 return (long) val; | |
47556 } | |
47557 } | |
47558 #endif | |
47559 if (unlikely(!PyLong_Check(x))) { | |
47560 long val; | |
47561 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); | |
47562 if (!tmp) return (long) -1; | |
47563 val = __Pyx_PyInt_As_long(tmp); | |
47564 Py_DECREF(tmp); | |
47565 return val; | |
47566 } | |
47567 if (is_unsigned) { | |
47568 #if CYTHON_USE_PYLONG_INTERNALS | |
47569 if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
47570 goto raise_neg_overflow; | |
47571 } else if (__Pyx_PyLong_IsCompact(x)) { | |
47572 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
47573 } else { | |
47574 const digit* digits = __Pyx_PyLong_Digits(x); | |
47575 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
47576 switch (__Pyx_PyLong_DigitCount(x)) { | |
47577 case 2: | |
47578 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { | |
47579 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
47580 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47581 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { | |
47582 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
47583 } | |
47584 } | |
47585 break; | |
47586 case 3: | |
47587 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { | |
47588 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
47589 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47590 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { | |
47591 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
47592 } | |
47593 } | |
47594 break; | |
47595 case 4: | |
47596 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { | |
47597 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
47598 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47599 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { | |
47600 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
47601 } | |
47602 } | |
47603 break; | |
47604 } | |
47605 } | |
47606 #endif | |
47607 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 | |
47608 if (unlikely(Py_SIZE(x) < 0)) { | |
47609 goto raise_neg_overflow; | |
47610 } | |
47611 #else | |
47612 { | |
47613 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
47614 if (unlikely(result < 0)) | |
47615 return (long) -1; | |
47616 if (unlikely(result == 1)) | |
47617 goto raise_neg_overflow; | |
47618 } | |
47619 #endif | |
47620 if ((sizeof(long) <= sizeof(unsigned long))) { | |
47621 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) | |
47622 #ifdef HAVE_LONG_LONG | |
47623 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { | |
47624 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
47625 #endif | |
47626 } | |
47627 } else { | |
47628 #if CYTHON_USE_PYLONG_INTERNALS | |
47629 if (__Pyx_PyLong_IsCompact(x)) { | |
47630 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
47631 } else { | |
47632 const digit* digits = __Pyx_PyLong_Digits(x); | |
47633 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
47634 switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
47635 case -2: | |
47636 if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { | |
47637 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
47638 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47639 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
47640 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
47641 } | |
47642 } | |
47643 break; | |
47644 case 2: | |
47645 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { | |
47646 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
47647 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47648 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
47649 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
47650 } | |
47651 } | |
47652 break; | |
47653 case -3: | |
47654 if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
47655 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
47656 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47657 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
47658 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
47659 } | |
47660 } | |
47661 break; | |
47662 case 3: | |
47663 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { | |
47664 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
47665 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47666 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
47667 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
47668 } | |
47669 } | |
47670 break; | |
47671 case -4: | |
47672 if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
47673 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
47674 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47675 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { | |
47676 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
47677 } | |
47678 } | |
47679 break; | |
47680 case 4: | |
47681 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { | |
47682 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
47683 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47684 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { | |
47685 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
47686 } | |
47687 } | |
47688 break; | |
47689 } | |
47690 } | |
47691 #endif | |
47692 if ((sizeof(long) <= sizeof(long))) { | |
47693 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) | |
47694 #ifdef HAVE_LONG_LONG | |
47695 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { | |
47696 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
47697 #endif | |
47698 } | |
47699 } | |
47700 { | |
47701 long val; | |
47702 int ret = -1; | |
47703 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API | |
47704 Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
47705 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
47706 if (unlikely(bytes_copied == -1)) { | |
47707 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
47708 goto raise_overflow; | |
47709 } else { | |
47710 ret = 0; | |
47711 } | |
47712 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) | |
47713 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
47714 unsigned char *bytes = (unsigned char *)&val; | |
47715 ret = _PyLong_AsByteArray((PyLongObject *)x, | |
47716 bytes, sizeof(val), | |
47717 is_little, !is_unsigned); | |
47718 #else | |
47719 PyObject *v; | |
47720 PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
47721 int bits, remaining_bits, is_negative = 0; | |
47722 int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
47723 if (likely(PyLong_CheckExact(x))) { | |
47724 v = __Pyx_NewRef(x); | |
47725 } else { | |
47726 v = PyNumber_Long(x); | |
47727 if (unlikely(!v)) return (long) -1; | |
47728 assert(PyLong_CheckExact(v)); | |
47729 } | |
47730 { | |
47731 int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
47732 if (unlikely(result < 0)) { | |
47733 Py_DECREF(v); | |
47734 return (long) -1; | |
47735 } | |
47736 is_negative = result == 1; | |
47737 } | |
47738 if (is_unsigned && unlikely(is_negative)) { | |
47739 Py_DECREF(v); | |
47740 goto raise_neg_overflow; | |
47741 } else if (is_negative) { | |
47742 stepval = PyNumber_Invert(v); | |
47743 Py_DECREF(v); | |
47744 if (unlikely(!stepval)) | |
47745 return (long) -1; | |
47746 } else { | |
47747 stepval = v; | |
47748 } | |
47749 v = NULL; | |
47750 val = (long) 0; | |
47751 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
47752 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
47753 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { | |
47754 PyObject *tmp, *digit; | |
47755 long idigit; | |
47756 digit = PyNumber_And(stepval, mask); | |
47757 if (unlikely(!digit)) goto done; | |
47758 idigit = PyLong_AsLong(digit); | |
47759 Py_DECREF(digit); | |
47760 if (unlikely(idigit < 0)) goto done; | |
47761 val |= ((long) idigit) << bits; | |
47762 tmp = PyNumber_Rshift(stepval, shift); | |
47763 if (unlikely(!tmp)) goto done; | |
47764 Py_DECREF(stepval); stepval = tmp; | |
47765 } | |
47766 Py_DECREF(shift); shift = NULL; | |
47767 Py_DECREF(mask); mask = NULL; | |
47768 { | |
47769 long idigit = PyLong_AsLong(stepval); | |
47770 if (unlikely(idigit < 0)) goto done; | |
47771 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); | |
47772 if (unlikely(idigit >= (1L << remaining_bits))) | |
47773 goto raise_overflow; | |
47774 val |= ((long) idigit) << bits; | |
47775 } | |
47776 if (!is_unsigned) { | |
47777 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) | |
47778 goto raise_overflow; | |
47779 if (is_negative) | |
47780 val = ~val; | |
47781 } | |
47782 ret = 0; | |
47783 done: | |
47784 Py_XDECREF(shift); | |
47785 Py_XDECREF(mask); | |
47786 Py_XDECREF(stepval); | |
47787 #endif | |
47788 if (unlikely(ret)) | |
47789 return (long) -1; | |
47790 return val; | |
47791 } | |
47792 raise_overflow: | |
47793 PyErr_SetString(PyExc_OverflowError, | |
47794 "value too large to convert to long"); | |
47795 return (long) -1; | |
47796 raise_neg_overflow: | |
47797 PyErr_SetString(PyExc_OverflowError, | |
47798 "can't convert negative value to long"); | |
47799 return (long) -1; | |
47800 } | |
47801 | |
47802 /* CIntToPy */ | |
47803 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { | |
47804 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
47805 #pragma GCC diagnostic push | |
47806 #pragma GCC diagnostic ignored "-Wconversion" | |
47807 #endif | |
47808 const long neg_one = (long) -1, const_zero = (long) 0; | |
47809 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
47810 #pragma GCC diagnostic pop | |
47811 #endif | |
47812 const int is_unsigned = neg_one > const_zero; | |
47813 if (is_unsigned) { | |
47814 if (sizeof(long) < sizeof(long)) { | |
47815 return PyInt_FromLong((long) value); | |
47816 } else if (sizeof(long) <= sizeof(unsigned long)) { | |
47817 return PyLong_FromUnsignedLong((unsigned long) value); | |
47818 #ifdef HAVE_LONG_LONG | |
47819 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { | |
47820 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); | |
47821 #endif | |
47822 } | |
47823 } else { | |
47824 if (sizeof(long) <= sizeof(long)) { | |
47825 return PyInt_FromLong((long) value); | |
47826 #ifdef HAVE_LONG_LONG | |
47827 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { | |
47828 return PyLong_FromLongLong((PY_LONG_LONG) value); | |
47829 #endif | |
47830 } | |
47831 } | |
47832 { | |
47833 unsigned char *bytes = (unsigned char *)&value; | |
47834 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 | |
47835 if (is_unsigned) { | |
47836 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); | |
47837 } else { | |
47838 return PyLong_FromNativeBytes(bytes, sizeof(value), -1); | |
47839 } | |
47840 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 | |
47841 int one = 1; int little = (int)*(unsigned char *)&one; | |
47842 return _PyLong_FromByteArray(bytes, sizeof(long), | |
47843 little, !is_unsigned); | |
47844 #else | |
47845 int one = 1; int little = (int)*(unsigned char *)&one; | |
47846 PyObject *from_bytes, *result = NULL; | |
47847 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; | |
47848 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); | |
47849 if (!from_bytes) return NULL; | |
47850 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); | |
47851 if (!py_bytes) goto limited_bad; | |
47852 order_str = PyUnicode_FromString(little ? "little" : "big"); | |
47853 if (!order_str) goto limited_bad; | |
47854 arg_tuple = PyTuple_Pack(2, py_bytes, order_str); | |
47855 if (!arg_tuple) goto limited_bad; | |
47856 if (!is_unsigned) { | |
47857 kwds = PyDict_New(); | |
47858 if (!kwds) goto limited_bad; | |
47859 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; | |
47860 } | |
47861 result = PyObject_Call(from_bytes, arg_tuple, kwds); | |
47862 limited_bad: | |
47863 Py_XDECREF(kwds); | |
47864 Py_XDECREF(arg_tuple); | |
47865 Py_XDECREF(order_str); | |
47866 Py_XDECREF(py_bytes); | |
47867 Py_XDECREF(from_bytes); | |
47868 return result; | |
47869 #endif | |
47870 } | |
47871 } | |
47872 | |
47873 /* CIntToPy */ | |
47874 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { | |
47875 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
47876 #pragma GCC diagnostic push | |
47877 #pragma GCC diagnostic ignored "-Wconversion" | |
47878 #endif | |
47879 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; | |
47880 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
47881 #pragma GCC diagnostic pop | |
47882 #endif | |
47883 const int is_unsigned = neg_one > const_zero; | |
47884 if (is_unsigned) { | |
47885 if (sizeof(uint32_t) < sizeof(long)) { | |
47886 return PyInt_FromLong((long) value); | |
47887 } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { | |
47888 return PyLong_FromUnsignedLong((unsigned long) value); | |
47889 #ifdef HAVE_LONG_LONG | |
47890 } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { | |
47891 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); | |
47892 #endif | |
47893 } | |
47894 } else { | |
47895 if (sizeof(uint32_t) <= sizeof(long)) { | |
47896 return PyInt_FromLong((long) value); | |
47897 #ifdef HAVE_LONG_LONG | |
47898 } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { | |
47899 return PyLong_FromLongLong((PY_LONG_LONG) value); | |
47900 #endif | |
47901 } | |
47902 } | |
47903 { | |
47904 unsigned char *bytes = (unsigned char *)&value; | |
47905 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 | |
47906 if (is_unsigned) { | |
47907 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); | |
47908 } else { | |
47909 return PyLong_FromNativeBytes(bytes, sizeof(value), -1); | |
47910 } | |
47911 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 | |
47912 int one = 1; int little = (int)*(unsigned char *)&one; | |
47913 return _PyLong_FromByteArray(bytes, sizeof(uint32_t), | |
47914 little, !is_unsigned); | |
47915 #else | |
47916 int one = 1; int little = (int)*(unsigned char *)&one; | |
47917 PyObject *from_bytes, *result = NULL; | |
47918 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; | |
47919 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); | |
47920 if (!from_bytes) return NULL; | |
47921 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); | |
47922 if (!py_bytes) goto limited_bad; | |
47923 order_str = PyUnicode_FromString(little ? "little" : "big"); | |
47924 if (!order_str) goto limited_bad; | |
47925 arg_tuple = PyTuple_Pack(2, py_bytes, order_str); | |
47926 if (!arg_tuple) goto limited_bad; | |
47927 if (!is_unsigned) { | |
47928 kwds = PyDict_New(); | |
47929 if (!kwds) goto limited_bad; | |
47930 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; | |
47931 } | |
47932 result = PyObject_Call(from_bytes, arg_tuple, kwds); | |
47933 limited_bad: | |
47934 Py_XDECREF(kwds); | |
47935 Py_XDECREF(arg_tuple); | |
47936 Py_XDECREF(order_str); | |
47937 Py_XDECREF(py_bytes); | |
47938 Py_XDECREF(from_bytes); | |
47939 return result; | |
47940 #endif | |
47941 } | |
47942 } | |
47943 | |
47944 /* CIntFromPy */ | |
47945 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { | |
47946 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
47947 #pragma GCC diagnostic push | |
47948 #pragma GCC diagnostic ignored "-Wconversion" | |
47949 #endif | |
47950 const int neg_one = (int) -1, const_zero = (int) 0; | |
47951 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
47952 #pragma GCC diagnostic pop | |
47953 #endif | |
47954 const int is_unsigned = neg_one > const_zero; | |
47955 #if PY_MAJOR_VERSION < 3 | |
47956 if (likely(PyInt_Check(x))) { | |
47957 if ((sizeof(int) < sizeof(long))) { | |
47958 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) | |
47959 } else { | |
47960 long val = PyInt_AS_LONG(x); | |
47961 if (is_unsigned && unlikely(val < 0)) { | |
47962 goto raise_neg_overflow; | |
47963 } | |
47964 return (int) val; | |
47965 } | |
47966 } | |
47967 #endif | |
47968 if (unlikely(!PyLong_Check(x))) { | |
47969 int val; | |
47970 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); | |
47971 if (!tmp) return (int) -1; | |
47972 val = __Pyx_PyInt_As_int(tmp); | |
47973 Py_DECREF(tmp); | |
47974 return val; | |
47975 } | |
47976 if (is_unsigned) { | |
47977 #if CYTHON_USE_PYLONG_INTERNALS | |
47978 if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
47979 goto raise_neg_overflow; | |
47980 } else if (__Pyx_PyLong_IsCompact(x)) { | |
47981 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
47982 } else { | |
47983 const digit* digits = __Pyx_PyLong_Digits(x); | |
47984 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
47985 switch (__Pyx_PyLong_DigitCount(x)) { | |
47986 case 2: | |
47987 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { | |
47988 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
47989 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47990 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { | |
47991 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
47992 } | |
47993 } | |
47994 break; | |
47995 case 3: | |
47996 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { | |
47997 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
47998 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
47999 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { | |
48000 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
48001 } | |
48002 } | |
48003 break; | |
48004 case 4: | |
48005 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { | |
48006 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
48007 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
48008 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { | |
48009 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
48010 } | |
48011 } | |
48012 break; | |
48013 } | |
48014 } | |
48015 #endif | |
48016 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 | |
48017 if (unlikely(Py_SIZE(x) < 0)) { | |
48018 goto raise_neg_overflow; | |
48019 } | |
48020 #else | |
48021 { | |
48022 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
48023 if (unlikely(result < 0)) | |
48024 return (int) -1; | |
48025 if (unlikely(result == 1)) | |
48026 goto raise_neg_overflow; | |
48027 } | |
48028 #endif | |
48029 if ((sizeof(int) <= sizeof(unsigned long))) { | |
48030 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) | |
48031 #ifdef HAVE_LONG_LONG | |
48032 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { | |
48033 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
48034 #endif | |
48035 } | |
48036 } else { | |
48037 #if CYTHON_USE_PYLONG_INTERNALS | |
48038 if (__Pyx_PyLong_IsCompact(x)) { | |
48039 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
48040 } else { | |
48041 const digit* digits = __Pyx_PyLong_Digits(x); | |
48042 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
48043 switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
48044 case -2: | |
48045 if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { | |
48046 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
48047 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
48048 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
48049 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
48050 } | |
48051 } | |
48052 break; | |
48053 case 2: | |
48054 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { | |
48055 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
48056 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
48057 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
48058 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
48059 } | |
48060 } | |
48061 break; | |
48062 case -3: | |
48063 if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
48064 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
48065 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
48066 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
48067 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
48068 } | |
48069 } | |
48070 break; | |
48071 case 3: | |
48072 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { | |
48073 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
48074 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
48075 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
48076 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
48077 } | |
48078 } | |
48079 break; | |
48080 case -4: | |
48081 if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
48082 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
48083 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
48084 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { | |
48085 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
48086 } | |
48087 } | |
48088 break; | |
48089 case 4: | |
48090 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { | |
48091 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
48092 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
48093 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { | |
48094 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
48095 } | |
48096 } | |
48097 break; | |
48098 } | |
48099 } | |
48100 #endif | |
48101 if ((sizeof(int) <= sizeof(long))) { | |
48102 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) | |
48103 #ifdef HAVE_LONG_LONG | |
48104 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { | |
48105 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
48106 #endif | |
48107 } | |
48108 } | |
48109 { | |
48110 int val; | |
48111 int ret = -1; | |
48112 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API | |
48113 Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
48114 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
48115 if (unlikely(bytes_copied == -1)) { | |
48116 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
48117 goto raise_overflow; | |
48118 } else { | |
48119 ret = 0; | |
48120 } | |
48121 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) | |
48122 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
48123 unsigned char *bytes = (unsigned char *)&val; | |
48124 ret = _PyLong_AsByteArray((PyLongObject *)x, | |
48125 bytes, sizeof(val), | |
48126 is_little, !is_unsigned); | |
48127 #else | |
48128 PyObject *v; | |
48129 PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
48130 int bits, remaining_bits, is_negative = 0; | |
48131 int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
48132 if (likely(PyLong_CheckExact(x))) { | |
48133 v = __Pyx_NewRef(x); | |
48134 } else { | |
48135 v = PyNumber_Long(x); | |
48136 if (unlikely(!v)) return (int) -1; | |
48137 assert(PyLong_CheckExact(v)); | |
48138 } | |
48139 { | |
48140 int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
48141 if (unlikely(result < 0)) { | |
48142 Py_DECREF(v); | |
48143 return (int) -1; | |
48144 } | |
48145 is_negative = result == 1; | |
48146 } | |
48147 if (is_unsigned && unlikely(is_negative)) { | |
48148 Py_DECREF(v); | |
48149 goto raise_neg_overflow; | |
48150 } else if (is_negative) { | |
48151 stepval = PyNumber_Invert(v); | |
48152 Py_DECREF(v); | |
48153 if (unlikely(!stepval)) | |
48154 return (int) -1; | |
48155 } else { | |
48156 stepval = v; | |
48157 } | |
48158 v = NULL; | |
48159 val = (int) 0; | |
48160 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
48161 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
48162 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { | |
48163 PyObject *tmp, *digit; | |
48164 long idigit; | |
48165 digit = PyNumber_And(stepval, mask); | |
48166 if (unlikely(!digit)) goto done; | |
48167 idigit = PyLong_AsLong(digit); | |
48168 Py_DECREF(digit); | |
48169 if (unlikely(idigit < 0)) goto done; | |
48170 val |= ((int) idigit) << bits; | |
48171 tmp = PyNumber_Rshift(stepval, shift); | |
48172 if (unlikely(!tmp)) goto done; | |
48173 Py_DECREF(stepval); stepval = tmp; | |
48174 } | |
48175 Py_DECREF(shift); shift = NULL; | |
48176 Py_DECREF(mask); mask = NULL; | |
48177 { | |
48178 long idigit = PyLong_AsLong(stepval); | |
48179 if (unlikely(idigit < 0)) goto done; | |
48180 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); | |
48181 if (unlikely(idigit >= (1L << remaining_bits))) | |
48182 goto raise_overflow; | |
48183 val |= ((int) idigit) << bits; | |
48184 } | |
48185 if (!is_unsigned) { | |
48186 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) | |
48187 goto raise_overflow; | |
48188 if (is_negative) | |
48189 val = ~val; | |
48190 } | |
48191 ret = 0; | |
48192 done: | |
48193 Py_XDECREF(shift); | |
48194 Py_XDECREF(mask); | |
48195 Py_XDECREF(stepval); | |
48196 #endif | |
48197 if (unlikely(ret)) | |
48198 return (int) -1; | |
48199 return val; | |
48200 } | |
48201 raise_overflow: | |
48202 PyErr_SetString(PyExc_OverflowError, | |
48203 "value too large to convert to int"); | |
48204 return (int) -1; | |
48205 raise_neg_overflow: | |
48206 PyErr_SetString(PyExc_OverflowError, | |
48207 "can't convert negative value to int"); | |
48208 return (int) -1; | |
48209 } | |
48210 | |
48211 /* FormatTypeName */ | |
48212 #if CYTHON_COMPILING_IN_LIMITED_API | |
48213 static __Pyx_TypeName | |
48214 __Pyx_PyType_GetName(PyTypeObject* tp) | |
48215 { | |
48216 PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, | |
48217 __pyx_n_s_name); | |
48218 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { | |
48219 PyErr_Clear(); | |
48220 Py_XDECREF(name); | |
48221 name = __Pyx_NewRef(__pyx_n_s__139); | |
48222 } | |
48223 return name; | |
48224 } | |
48225 #endif | |
48226 | |
48227 /* FastTypeChecks */ | |
48228 #if CYTHON_COMPILING_IN_CPYTHON | |
48229 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { | |
48230 while (a) { | |
48231 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); | |
48232 if (a == b) | |
48233 return 1; | |
48234 } | |
48235 return b == &PyBaseObject_Type; | |
48236 } | |
48237 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { | |
48238 PyObject *mro; | |
48239 if (a == b) return 1; | |
48240 mro = a->tp_mro; | |
48241 if (likely(mro)) { | |
48242 Py_ssize_t i, n; | |
48243 n = PyTuple_GET_SIZE(mro); | |
48244 for (i = 0; i < n; i++) { | |
48245 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) | |
48246 return 1; | |
48247 } | |
48248 return 0; | |
48249 } | |
48250 return __Pyx_InBases(a, b); | |
48251 } | |
48252 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { | |
48253 PyObject *mro; | |
48254 if (cls == a || cls == b) return 1; | |
48255 mro = cls->tp_mro; | |
48256 if (likely(mro)) { | |
48257 Py_ssize_t i, n; | |
48258 n = PyTuple_GET_SIZE(mro); | |
48259 for (i = 0; i < n; i++) { | |
48260 PyObject *base = PyTuple_GET_ITEM(mro, i); | |
48261 if (base == (PyObject *)a || base == (PyObject *)b) | |
48262 return 1; | |
48263 } | |
48264 return 0; | |
48265 } | |
48266 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); | |
48267 } | |
48268 #if PY_MAJOR_VERSION == 2 | |
48269 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { | |
48270 PyObject *exception, *value, *tb; | |
48271 int res; | |
48272 __Pyx_PyThreadState_declare | |
48273 __Pyx_PyThreadState_assign | |
48274 __Pyx_ErrFetch(&exception, &value, &tb); | |
48275 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; | |
48276 if (unlikely(res == -1)) { | |
48277 PyErr_WriteUnraisable(err); | |
48278 res = 0; | |
48279 } | |
48280 if (!res) { | |
48281 res = PyObject_IsSubclass(err, exc_type2); | |
48282 if (unlikely(res == -1)) { | |
48283 PyErr_WriteUnraisable(err); | |
48284 res = 0; | |
48285 } | |
48286 } | |
48287 __Pyx_ErrRestore(exception, value, tb); | |
48288 return res; | |
48289 } | |
48290 #else | |
48291 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { | |
48292 if (exc_type1) { | |
48293 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); | |
48294 } else { | |
48295 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); | |
48296 } | |
48297 } | |
48298 #endif | |
48299 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { | |
48300 Py_ssize_t i, n; | |
48301 assert(PyExceptionClass_Check(exc_type)); | |
48302 n = PyTuple_GET_SIZE(tuple); | |
48303 #if PY_MAJOR_VERSION >= 3 | |
48304 for (i=0; i<n; i++) { | |
48305 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; | |
48306 } | |
48307 #endif | |
48308 for (i=0; i<n; i++) { | |
48309 PyObject *t = PyTuple_GET_ITEM(tuple, i); | |
48310 #if PY_MAJOR_VERSION < 3 | |
48311 if (likely(exc_type == t)) return 1; | |
48312 #endif | |
48313 if (likely(PyExceptionClass_Check(t))) { | |
48314 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1; | |
48315 } else { | |
48316 } | |
48317 } | |
48318 return 0; | |
48319 } | |
48320 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { | |
48321 if (likely(err == exc_type)) return 1; | |
48322 if (likely(PyExceptionClass_Check(err))) { | |
48323 if (likely(PyExceptionClass_Check(exc_type))) { | |
48324 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); | |
48325 } else if (likely(PyTuple_Check(exc_type))) { | |
48326 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type); | |
48327 } else { | |
48328 } | |
48329 } | |
48330 return PyErr_GivenExceptionMatches(err, exc_type); | |
48331 } | |
48332 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { | |
48333 assert(PyExceptionClass_Check(exc_type1)); | |
48334 assert(PyExceptionClass_Check(exc_type2)); | |
48335 if (likely(err == exc_type1 || err == exc_type2)) return 1; | |
48336 if (likely(PyExceptionClass_Check(err))) { | |
48337 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); | |
48338 } | |
48339 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); | |
48340 } | |
48341 #endif | |
48342 | |
48343 /* SwapException */ | |
48344 #if CYTHON_FAST_THREAD_STATE | |
48345 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { | |
48346 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
48347 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 | |
48348 _PyErr_StackItem *exc_info = tstate->exc_info; | |
48349 tmp_value = exc_info->exc_value; | |
48350 exc_info->exc_value = *value; | |
48351 if (tmp_value == NULL || tmp_value == Py_None) { | |
48352 Py_XDECREF(tmp_value); | |
48353 tmp_value = NULL; | |
48354 tmp_type = NULL; | |
48355 tmp_tb = NULL; | |
48356 } else { | |
48357 tmp_type = (PyObject*) Py_TYPE(tmp_value); | |
48358 Py_INCREF(tmp_type); | |
48359 #if CYTHON_COMPILING_IN_CPYTHON | |
48360 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; | |
48361 Py_XINCREF(tmp_tb); | |
48362 #else | |
48363 tmp_tb = PyException_GetTraceback(tmp_value); | |
48364 #endif | |
48365 } | |
48366 #elif CYTHON_USE_EXC_INFO_STACK | |
48367 _PyErr_StackItem *exc_info = tstate->exc_info; | |
48368 tmp_type = exc_info->exc_type; | |
48369 tmp_value = exc_info->exc_value; | |
48370 tmp_tb = exc_info->exc_traceback; | |
48371 exc_info->exc_type = *type; | |
48372 exc_info->exc_value = *value; | |
48373 exc_info->exc_traceback = *tb; | |
48374 #else | |
48375 tmp_type = tstate->exc_type; | |
48376 tmp_value = tstate->exc_value; | |
48377 tmp_tb = tstate->exc_traceback; | |
48378 tstate->exc_type = *type; | |
48379 tstate->exc_value = *value; | |
48380 tstate->exc_traceback = *tb; | |
48381 #endif | |
48382 *type = tmp_type; | |
48383 *value = tmp_value; | |
48384 *tb = tmp_tb; | |
48385 } | |
48386 #else | |
48387 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { | |
48388 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
48389 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); | |
48390 PyErr_SetExcInfo(*type, *value, *tb); | |
48391 *type = tmp_type; | |
48392 *value = tmp_value; | |
48393 *tb = tmp_tb; | |
48394 } | |
48395 #endif | |
48396 | |
48397 /* CoroutineBase */ | |
48398 #include <frameobject.h> | |
48399 #if PY_VERSION_HEX >= 0x030b00a6 | |
48400 #ifndef Py_BUILD_CORE | |
48401 #define Py_BUILD_CORE 1 | |
48402 #endif | |
48403 #include "internal/pycore_frame.h" | |
48404 #endif | |
48405 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) | |
48406 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { | |
48407 PyObject *et, *ev, *tb; | |
48408 PyObject *value = NULL; | |
48409 CYTHON_UNUSED_VAR(__pyx_tstate); | |
48410 __Pyx_ErrFetch(&et, &ev, &tb); | |
48411 if (!et) { | |
48412 Py_XDECREF(tb); | |
48413 Py_XDECREF(ev); | |
48414 Py_INCREF(Py_None); | |
48415 *pvalue = Py_None; | |
48416 return 0; | |
48417 } | |
48418 if (likely(et == PyExc_StopIteration)) { | |
48419 if (!ev) { | |
48420 Py_INCREF(Py_None); | |
48421 value = Py_None; | |
48422 } | |
48423 #if PY_VERSION_HEX >= 0x030300A0 | |
48424 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { | |
48425 value = ((PyStopIterationObject *)ev)->value; | |
48426 Py_INCREF(value); | |
48427 Py_DECREF(ev); | |
48428 } | |
48429 #endif | |
48430 else if (unlikely(PyTuple_Check(ev))) { | |
48431 if (PyTuple_GET_SIZE(ev) >= 1) { | |
48432 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
48433 value = PyTuple_GET_ITEM(ev, 0); | |
48434 Py_INCREF(value); | |
48435 #else | |
48436 value = PySequence_ITEM(ev, 0); | |
48437 #endif | |
48438 } else { | |
48439 Py_INCREF(Py_None); | |
48440 value = Py_None; | |
48441 } | |
48442 Py_DECREF(ev); | |
48443 } | |
48444 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { | |
48445 value = ev; | |
48446 } | |
48447 if (likely(value)) { | |
48448 Py_XDECREF(tb); | |
48449 Py_DECREF(et); | |
48450 *pvalue = value; | |
48451 return 0; | |
48452 } | |
48453 } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { | |
48454 __Pyx_ErrRestore(et, ev, tb); | |
48455 return -1; | |
48456 } | |
48457 PyErr_NormalizeException(&et, &ev, &tb); | |
48458 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { | |
48459 __Pyx_ErrRestore(et, ev, tb); | |
48460 return -1; | |
48461 } | |
48462 Py_XDECREF(tb); | |
48463 Py_DECREF(et); | |
48464 #if PY_VERSION_HEX >= 0x030300A0 | |
48465 value = ((PyStopIterationObject *)ev)->value; | |
48466 Py_INCREF(value); | |
48467 Py_DECREF(ev); | |
48468 #else | |
48469 { | |
48470 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); | |
48471 Py_DECREF(ev); | |
48472 if (likely(args)) { | |
48473 value = PySequence_GetItem(args, 0); | |
48474 Py_DECREF(args); | |
48475 } | |
48476 if (unlikely(!value)) { | |
48477 __Pyx_ErrRestore(NULL, NULL, NULL); | |
48478 Py_INCREF(Py_None); | |
48479 value = Py_None; | |
48480 } | |
48481 } | |
48482 #endif | |
48483 *pvalue = value; | |
48484 return 0; | |
48485 } | |
48486 static CYTHON_INLINE | |
48487 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { | |
48488 #if PY_VERSION_HEX >= 0x030B00a4 | |
48489 Py_CLEAR(exc_state->exc_value); | |
48490 #else | |
48491 PyObject *t, *v, *tb; | |
48492 t = exc_state->exc_type; | |
48493 v = exc_state->exc_value; | |
48494 tb = exc_state->exc_traceback; | |
48495 exc_state->exc_type = NULL; | |
48496 exc_state->exc_value = NULL; | |
48497 exc_state->exc_traceback = NULL; | |
48498 Py_XDECREF(t); | |
48499 Py_XDECREF(v); | |
48500 Py_XDECREF(tb); | |
48501 #endif | |
48502 } | |
48503 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) | |
48504 static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { | |
48505 const char *msg; | |
48506 CYTHON_MAYBE_UNUSED_VAR(gen); | |
48507 if ((0)) { | |
48508 #ifdef __Pyx_Coroutine_USED | |
48509 } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { | |
48510 msg = "coroutine already executing"; | |
48511 #endif | |
48512 #ifdef __Pyx_AsyncGen_USED | |
48513 } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { | |
48514 msg = "async generator already executing"; | |
48515 #endif | |
48516 } else { | |
48517 msg = "generator already executing"; | |
48518 } | |
48519 PyErr_SetString(PyExc_ValueError, msg); | |
48520 } | |
48521 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) | |
48522 static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { | |
48523 const char *msg; | |
48524 CYTHON_MAYBE_UNUSED_VAR(gen); | |
48525 if ((0)) { | |
48526 #ifdef __Pyx_Coroutine_USED | |
48527 } else if (__Pyx_Coroutine_Check(gen)) { | |
48528 msg = "can't send non-None value to a just-started coroutine"; | |
48529 #endif | |
48530 #ifdef __Pyx_AsyncGen_USED | |
48531 } else if (__Pyx_AsyncGen_CheckExact(gen)) { | |
48532 msg = "can't send non-None value to a just-started async generator"; | |
48533 #endif | |
48534 } else { | |
48535 msg = "can't send non-None value to a just-started generator"; | |
48536 } | |
48537 PyErr_SetString(PyExc_TypeError, msg); | |
48538 } | |
48539 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) | |
48540 static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { | |
48541 CYTHON_MAYBE_UNUSED_VAR(gen); | |
48542 CYTHON_MAYBE_UNUSED_VAR(closing); | |
48543 #ifdef __Pyx_Coroutine_USED | |
48544 if (!closing && __Pyx_Coroutine_Check(gen)) { | |
48545 PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); | |
48546 } else | |
48547 #endif | |
48548 if (value) { | |
48549 #ifdef __Pyx_AsyncGen_USED | |
48550 if (__Pyx_AsyncGen_CheckExact(gen)) | |
48551 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); | |
48552 else | |
48553 #endif | |
48554 PyErr_SetNone(PyExc_StopIteration); | |
48555 } | |
48556 } | |
48557 static | |
48558 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { | |
48559 __Pyx_PyThreadState_declare | |
48560 PyThreadState *tstate; | |
48561 __Pyx_ExcInfoStruct *exc_state; | |
48562 PyObject *retval; | |
48563 assert(!self->is_running); | |
48564 if (unlikely(self->resume_label == 0)) { | |
48565 if (unlikely(value && value != Py_None)) { | |
48566 return __Pyx_Coroutine_NotStartedError((PyObject*)self); | |
48567 } | |
48568 } | |
48569 if (unlikely(self->resume_label == -1)) { | |
48570 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); | |
48571 } | |
48572 #if CYTHON_FAST_THREAD_STATE | |
48573 __Pyx_PyThreadState_assign | |
48574 tstate = __pyx_tstate; | |
48575 #else | |
48576 tstate = __Pyx_PyThreadState_Current; | |
48577 #endif | |
48578 exc_state = &self->gi_exc_state; | |
48579 if (exc_state->exc_value) { | |
48580 #if CYTHON_COMPILING_IN_PYPY | |
48581 #else | |
48582 PyObject *exc_tb; | |
48583 #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON | |
48584 exc_tb = PyException_GetTraceback(exc_state->exc_value); | |
48585 #elif PY_VERSION_HEX >= 0x030B00a4 | |
48586 exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; | |
48587 #else | |
48588 exc_tb = exc_state->exc_traceback; | |
48589 #endif | |
48590 if (exc_tb) { | |
48591 PyTracebackObject *tb = (PyTracebackObject *) exc_tb; | |
48592 PyFrameObject *f = tb->tb_frame; | |
48593 assert(f->f_back == NULL); | |
48594 #if PY_VERSION_HEX >= 0x030B00A1 | |
48595 f->f_back = PyThreadState_GetFrame(tstate); | |
48596 #else | |
48597 Py_XINCREF(tstate->frame); | |
48598 f->f_back = tstate->frame; | |
48599 #endif | |
48600 #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON | |
48601 Py_DECREF(exc_tb); | |
48602 #endif | |
48603 } | |
48604 #endif | |
48605 } | |
48606 #if CYTHON_USE_EXC_INFO_STACK | |
48607 exc_state->previous_item = tstate->exc_info; | |
48608 tstate->exc_info = exc_state; | |
48609 #else | |
48610 if (exc_state->exc_type) { | |
48611 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); | |
48612 } else { | |
48613 __Pyx_Coroutine_ExceptionClear(exc_state); | |
48614 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); | |
48615 } | |
48616 #endif | |
48617 self->is_running = 1; | |
48618 retval = self->body(self, tstate, value); | |
48619 self->is_running = 0; | |
48620 #if CYTHON_USE_EXC_INFO_STACK | |
48621 exc_state = &self->gi_exc_state; | |
48622 tstate->exc_info = exc_state->previous_item; | |
48623 exc_state->previous_item = NULL; | |
48624 __Pyx_Coroutine_ResetFrameBackpointer(exc_state); | |
48625 #endif | |
48626 return retval; | |
48627 } | |
48628 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { | |
48629 #if CYTHON_COMPILING_IN_PYPY | |
48630 CYTHON_UNUSED_VAR(exc_state); | |
48631 #else | |
48632 PyObject *exc_tb; | |
48633 #if PY_VERSION_HEX >= 0x030B00a4 | |
48634 if (!exc_state->exc_value) return; | |
48635 exc_tb = PyException_GetTraceback(exc_state->exc_value); | |
48636 #else | |
48637 exc_tb = exc_state->exc_traceback; | |
48638 #endif | |
48639 if (likely(exc_tb)) { | |
48640 PyTracebackObject *tb = (PyTracebackObject *) exc_tb; | |
48641 PyFrameObject *f = tb->tb_frame; | |
48642 Py_CLEAR(f->f_back); | |
48643 #if PY_VERSION_HEX >= 0x030B00a4 | |
48644 Py_DECREF(exc_tb); | |
48645 #endif | |
48646 } | |
48647 #endif | |
48648 } | |
48649 static CYTHON_INLINE | |
48650 PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { | |
48651 CYTHON_MAYBE_UNUSED_VAR(gen); | |
48652 if (unlikely(!retval)) { | |
48653 __Pyx_PyThreadState_declare | |
48654 __Pyx_PyThreadState_assign | |
48655 if (!__Pyx_PyErr_Occurred()) { | |
48656 PyObject *exc = PyExc_StopIteration; | |
48657 #ifdef __Pyx_AsyncGen_USED | |
48658 if (__Pyx_AsyncGen_CheckExact(gen)) | |
48659 exc = __Pyx_PyExc_StopAsyncIteration; | |
48660 #endif | |
48661 __Pyx_PyErr_SetNone(exc); | |
48662 } | |
48663 } | |
48664 return retval; | |
48665 } | |
48666 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) | |
48667 static CYTHON_INLINE | |
48668 PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { | |
48669 #if PY_VERSION_HEX <= 0x030A00A1 | |
48670 return _PyGen_Send(gen, arg); | |
48671 #else | |
48672 PyObject *result; | |
48673 if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { | |
48674 if (PyAsyncGen_CheckExact(gen)) { | |
48675 assert(result == Py_None); | |
48676 PyErr_SetNone(PyExc_StopAsyncIteration); | |
48677 } | |
48678 else if (result == Py_None) { | |
48679 PyErr_SetNone(PyExc_StopIteration); | |
48680 } | |
48681 else { | |
48682 #if PY_VERSION_HEX < 0x030d00A1 | |
48683 _PyGen_SetStopIterationValue(result); | |
48684 #else | |
48685 if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { | |
48686 PyErr_SetObject(PyExc_StopIteration, result); | |
48687 } else { | |
48688 PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); | |
48689 if (likely(exc != NULL)) { | |
48690 PyErr_SetObject(PyExc_StopIteration, exc); | |
48691 Py_DECREF(exc); | |
48692 } | |
48693 } | |
48694 #endif | |
48695 } | |
48696 Py_DECREF(result); | |
48697 result = NULL; | |
48698 } | |
48699 return result; | |
48700 #endif | |
48701 } | |
48702 #endif | |
48703 static CYTHON_INLINE | |
48704 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { | |
48705 PyObject *ret; | |
48706 PyObject *val = NULL; | |
48707 __Pyx_Coroutine_Undelegate(gen); | |
48708 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); | |
48709 ret = __Pyx_Coroutine_SendEx(gen, val, 0); | |
48710 Py_XDECREF(val); | |
48711 return ret; | |
48712 } | |
48713 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { | |
48714 PyObject *retval; | |
48715 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; | |
48716 PyObject *yf = gen->yieldfrom; | |
48717 if (unlikely(gen->is_running)) | |
48718 return __Pyx_Coroutine_AlreadyRunningError(gen); | |
48719 if (yf) { | |
48720 PyObject *ret; | |
48721 gen->is_running = 1; | |
48722 #ifdef __Pyx_Generator_USED | |
48723 if (__Pyx_Generator_CheckExact(yf)) { | |
48724 ret = __Pyx_Coroutine_Send(yf, value); | |
48725 } else | |
48726 #endif | |
48727 #ifdef __Pyx_Coroutine_USED | |
48728 if (__Pyx_Coroutine_Check(yf)) { | |
48729 ret = __Pyx_Coroutine_Send(yf, value); | |
48730 } else | |
48731 #endif | |
48732 #ifdef __Pyx_AsyncGen_USED | |
48733 if (__pyx_PyAsyncGenASend_CheckExact(yf)) { | |
48734 ret = __Pyx_async_gen_asend_send(yf, value); | |
48735 } else | |
48736 #endif | |
48737 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) | |
48738 if (PyGen_CheckExact(yf)) { | |
48739 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); | |
48740 } else | |
48741 #endif | |
48742 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) | |
48743 if (PyCoro_CheckExact(yf)) { | |
48744 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); | |
48745 } else | |
48746 #endif | |
48747 { | |
48748 if (value == Py_None) | |
48749 ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); | |
48750 else | |
48751 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); | |
48752 } | |
48753 gen->is_running = 0; | |
48754 if (likely(ret)) { | |
48755 return ret; | |
48756 } | |
48757 retval = __Pyx_Coroutine_FinishDelegation(gen); | |
48758 } else { | |
48759 retval = __Pyx_Coroutine_SendEx(gen, value, 0); | |
48760 } | |
48761 return __Pyx_Coroutine_MethodReturn(self, retval); | |
48762 } | |
48763 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { | |
48764 PyObject *retval = NULL; | |
48765 int err = 0; | |
48766 #ifdef __Pyx_Generator_USED | |
48767 if (__Pyx_Generator_CheckExact(yf)) { | |
48768 retval = __Pyx_Coroutine_Close(yf); | |
48769 if (!retval) | |
48770 return -1; | |
48771 } else | |
48772 #endif | |
48773 #ifdef __Pyx_Coroutine_USED | |
48774 if (__Pyx_Coroutine_Check(yf)) { | |
48775 retval = __Pyx_Coroutine_Close(yf); | |
48776 if (!retval) | |
48777 return -1; | |
48778 } else | |
48779 if (__Pyx_CoroutineAwait_CheckExact(yf)) { | |
48780 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); | |
48781 if (!retval) | |
48782 return -1; | |
48783 } else | |
48784 #endif | |
48785 #ifdef __Pyx_AsyncGen_USED | |
48786 if (__pyx_PyAsyncGenASend_CheckExact(yf)) { | |
48787 retval = __Pyx_async_gen_asend_close(yf, NULL); | |
48788 } else | |
48789 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { | |
48790 retval = __Pyx_async_gen_athrow_close(yf, NULL); | |
48791 } else | |
48792 #endif | |
48793 { | |
48794 PyObject *meth; | |
48795 gen->is_running = 1; | |
48796 meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); | |
48797 if (unlikely(!meth)) { | |
48798 if (unlikely(PyErr_Occurred())) { | |
48799 PyErr_WriteUnraisable(yf); | |
48800 } | |
48801 } else { | |
48802 retval = __Pyx_PyObject_CallNoArg(meth); | |
48803 Py_DECREF(meth); | |
48804 if (unlikely(!retval)) | |
48805 err = -1; | |
48806 } | |
48807 gen->is_running = 0; | |
48808 } | |
48809 Py_XDECREF(retval); | |
48810 return err; | |
48811 } | |
48812 static PyObject *__Pyx_Generator_Next(PyObject *self) { | |
48813 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; | |
48814 PyObject *yf = gen->yieldfrom; | |
48815 if (unlikely(gen->is_running)) | |
48816 return __Pyx_Coroutine_AlreadyRunningError(gen); | |
48817 if (yf) { | |
48818 PyObject *ret; | |
48819 gen->is_running = 1; | |
48820 #ifdef __Pyx_Generator_USED | |
48821 if (__Pyx_Generator_CheckExact(yf)) { | |
48822 ret = __Pyx_Generator_Next(yf); | |
48823 } else | |
48824 #endif | |
48825 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) | |
48826 if (PyGen_CheckExact(yf)) { | |
48827 ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); | |
48828 } else | |
48829 #endif | |
48830 #ifdef __Pyx_Coroutine_USED | |
48831 if (__Pyx_Coroutine_Check(yf)) { | |
48832 ret = __Pyx_Coroutine_Send(yf, Py_None); | |
48833 } else | |
48834 #endif | |
48835 ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); | |
48836 gen->is_running = 0; | |
48837 if (likely(ret)) { | |
48838 return ret; | |
48839 } | |
48840 return __Pyx_Coroutine_FinishDelegation(gen); | |
48841 } | |
48842 return __Pyx_Coroutine_SendEx(gen, Py_None, 0); | |
48843 } | |
48844 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { | |
48845 CYTHON_UNUSED_VAR(arg); | |
48846 return __Pyx_Coroutine_Close(self); | |
48847 } | |
48848 static PyObject *__Pyx_Coroutine_Close(PyObject *self) { | |
48849 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; | |
48850 PyObject *retval, *raised_exception; | |
48851 PyObject *yf = gen->yieldfrom; | |
48852 int err = 0; | |
48853 if (unlikely(gen->is_running)) | |
48854 return __Pyx_Coroutine_AlreadyRunningError(gen); | |
48855 if (yf) { | |
48856 Py_INCREF(yf); | |
48857 err = __Pyx_Coroutine_CloseIter(gen, yf); | |
48858 __Pyx_Coroutine_Undelegate(gen); | |
48859 Py_DECREF(yf); | |
48860 } | |
48861 if (err == 0) | |
48862 PyErr_SetNone(PyExc_GeneratorExit); | |
48863 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); | |
48864 if (unlikely(retval)) { | |
48865 const char *msg; | |
48866 Py_DECREF(retval); | |
48867 if ((0)) { | |
48868 #ifdef __Pyx_Coroutine_USED | |
48869 } else if (__Pyx_Coroutine_Check(self)) { | |
48870 msg = "coroutine ignored GeneratorExit"; | |
48871 #endif | |
48872 #ifdef __Pyx_AsyncGen_USED | |
48873 } else if (__Pyx_AsyncGen_CheckExact(self)) { | |
48874 #if PY_VERSION_HEX < 0x03060000 | |
48875 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; | |
48876 #else | |
48877 msg = "async generator ignored GeneratorExit"; | |
48878 #endif | |
48879 #endif | |
48880 } else { | |
48881 msg = "generator ignored GeneratorExit"; | |
48882 } | |
48883 PyErr_SetString(PyExc_RuntimeError, msg); | |
48884 return NULL; | |
48885 } | |
48886 raised_exception = PyErr_Occurred(); | |
48887 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { | |
48888 if (raised_exception) PyErr_Clear(); | |
48889 Py_INCREF(Py_None); | |
48890 return Py_None; | |
48891 } | |
48892 return NULL; | |
48893 } | |
48894 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, | |
48895 PyObject *args, int close_on_genexit) { | |
48896 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; | |
48897 PyObject *yf = gen->yieldfrom; | |
48898 if (unlikely(gen->is_running)) | |
48899 return __Pyx_Coroutine_AlreadyRunningError(gen); | |
48900 if (yf) { | |
48901 PyObject *ret; | |
48902 Py_INCREF(yf); | |
48903 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { | |
48904 int err = __Pyx_Coroutine_CloseIter(gen, yf); | |
48905 Py_DECREF(yf); | |
48906 __Pyx_Coroutine_Undelegate(gen); | |
48907 if (err < 0) | |
48908 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); | |
48909 goto throw_here; | |
48910 } | |
48911 gen->is_running = 1; | |
48912 if (0 | |
48913 #ifdef __Pyx_Generator_USED | |
48914 || __Pyx_Generator_CheckExact(yf) | |
48915 #endif | |
48916 #ifdef __Pyx_Coroutine_USED | |
48917 || __Pyx_Coroutine_Check(yf) | |
48918 #endif | |
48919 ) { | |
48920 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); | |
48921 #ifdef __Pyx_Coroutine_USED | |
48922 } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { | |
48923 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); | |
48924 #endif | |
48925 } else { | |
48926 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); | |
48927 if (unlikely(!meth)) { | |
48928 Py_DECREF(yf); | |
48929 if (unlikely(PyErr_Occurred())) { | |
48930 gen->is_running = 0; | |
48931 return NULL; | |
48932 } | |
48933 __Pyx_Coroutine_Undelegate(gen); | |
48934 gen->is_running = 0; | |
48935 goto throw_here; | |
48936 } | |
48937 if (likely(args)) { | |
48938 ret = __Pyx_PyObject_Call(meth, args, NULL); | |
48939 } else { | |
48940 PyObject *cargs[4] = {NULL, typ, val, tb}; | |
48941 ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
48942 } | |
48943 Py_DECREF(meth); | |
48944 } | |
48945 gen->is_running = 0; | |
48946 Py_DECREF(yf); | |
48947 if (!ret) { | |
48948 ret = __Pyx_Coroutine_FinishDelegation(gen); | |
48949 } | |
48950 return __Pyx_Coroutine_MethodReturn(self, ret); | |
48951 } | |
48952 throw_here: | |
48953 __Pyx_Raise(typ, val, tb, NULL); | |
48954 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); | |
48955 } | |
48956 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { | |
48957 PyObject *typ; | |
48958 PyObject *val = NULL; | |
48959 PyObject *tb = NULL; | |
48960 if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) | |
48961 return NULL; | |
48962 return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); | |
48963 } | |
48964 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { | |
48965 #if PY_VERSION_HEX >= 0x030B00a4 | |
48966 Py_VISIT(exc_state->exc_value); | |
48967 #else | |
48968 Py_VISIT(exc_state->exc_type); | |
48969 Py_VISIT(exc_state->exc_value); | |
48970 Py_VISIT(exc_state->exc_traceback); | |
48971 #endif | |
48972 return 0; | |
48973 } | |
48974 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { | |
48975 Py_VISIT(gen->closure); | |
48976 Py_VISIT(gen->classobj); | |
48977 Py_VISIT(gen->yieldfrom); | |
48978 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); | |
48979 } | |
48980 static int __Pyx_Coroutine_clear(PyObject *self) { | |
48981 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; | |
48982 Py_CLEAR(gen->closure); | |
48983 Py_CLEAR(gen->classobj); | |
48984 Py_CLEAR(gen->yieldfrom); | |
48985 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); | |
48986 #ifdef __Pyx_AsyncGen_USED | |
48987 if (__Pyx_AsyncGen_CheckExact(self)) { | |
48988 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); | |
48989 } | |
48990 #endif | |
48991 Py_CLEAR(gen->gi_code); | |
48992 Py_CLEAR(gen->gi_frame); | |
48993 Py_CLEAR(gen->gi_name); | |
48994 Py_CLEAR(gen->gi_qualname); | |
48995 Py_CLEAR(gen->gi_modulename); | |
48996 return 0; | |
48997 } | |
48998 static void __Pyx_Coroutine_dealloc(PyObject *self) { | |
48999 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; | |
49000 PyObject_GC_UnTrack(gen); | |
49001 if (gen->gi_weakreflist != NULL) | |
49002 PyObject_ClearWeakRefs(self); | |
49003 if (gen->resume_label >= 0) { | |
49004 PyObject_GC_Track(self); | |
49005 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE | |
49006 if (unlikely(PyObject_CallFinalizerFromDealloc(self))) | |
49007 #else | |
49008 Py_TYPE(gen)->tp_del(self); | |
49009 if (unlikely(Py_REFCNT(self) > 0)) | |
49010 #endif | |
49011 { | |
49012 return; | |
49013 } | |
49014 PyObject_GC_UnTrack(self); | |
49015 } | |
49016 #ifdef __Pyx_AsyncGen_USED | |
49017 if (__Pyx_AsyncGen_CheckExact(self)) { | |
49018 /* We have to handle this case for asynchronous generators | |
49019 right here, because this code has to be between UNTRACK | |
49020 and GC_Del. */ | |
49021 Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); | |
49022 } | |
49023 #endif | |
49024 __Pyx_Coroutine_clear(self); | |
49025 __Pyx_PyHeapTypeObject_GC_Del(gen); | |
49026 } | |
49027 static void __Pyx_Coroutine_del(PyObject *self) { | |
49028 PyObject *error_type, *error_value, *error_traceback; | |
49029 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; | |
49030 __Pyx_PyThreadState_declare | |
49031 if (gen->resume_label < 0) { | |
49032 return; | |
49033 } | |
49034 #if !CYTHON_USE_TP_FINALIZE | |
49035 assert(self->ob_refcnt == 0); | |
49036 __Pyx_SET_REFCNT(self, 1); | |
49037 #endif | |
49038 __Pyx_PyThreadState_assign | |
49039 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); | |
49040 #ifdef __Pyx_AsyncGen_USED | |
49041 if (__Pyx_AsyncGen_CheckExact(self)) { | |
49042 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; | |
49043 PyObject *finalizer = agen->ag_finalizer; | |
49044 if (finalizer && !agen->ag_closed) { | |
49045 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); | |
49046 if (unlikely(!res)) { | |
49047 PyErr_WriteUnraisable(self); | |
49048 } else { | |
49049 Py_DECREF(res); | |
49050 } | |
49051 __Pyx_ErrRestore(error_type, error_value, error_traceback); | |
49052 return; | |
49053 } | |
49054 } | |
49055 #endif | |
49056 if (unlikely(gen->resume_label == 0 && !error_value)) { | |
49057 #ifdef __Pyx_Coroutine_USED | |
49058 #ifdef __Pyx_Generator_USED | |
49059 if (!__Pyx_Generator_CheckExact(self)) | |
49060 #endif | |
49061 { | |
49062 PyObject_GC_UnTrack(self); | |
49063 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) | |
49064 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) | |
49065 PyErr_WriteUnraisable(self); | |
49066 #else | |
49067 {PyObject *msg; | |
49068 char *cmsg; | |
49069 #if CYTHON_COMPILING_IN_PYPY | |
49070 msg = NULL; | |
49071 cmsg = (char*) "coroutine was never awaited"; | |
49072 #else | |
49073 char *cname; | |
49074 PyObject *qualname; | |
49075 qualname = gen->gi_qualname; | |
49076 cname = PyString_AS_STRING(qualname); | |
49077 msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); | |
49078 if (unlikely(!msg)) { | |
49079 PyErr_Clear(); | |
49080 cmsg = (char*) "coroutine was never awaited"; | |
49081 } else { | |
49082 cmsg = PyString_AS_STRING(msg); | |
49083 } | |
49084 #endif | |
49085 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) | |
49086 PyErr_WriteUnraisable(self); | |
49087 Py_XDECREF(msg);} | |
49088 #endif | |
49089 PyObject_GC_Track(self); | |
49090 } | |
49091 #endif | |
49092 } else { | |
49093 PyObject *res = __Pyx_Coroutine_Close(self); | |
49094 if (unlikely(!res)) { | |
49095 if (PyErr_Occurred()) | |
49096 PyErr_WriteUnraisable(self); | |
49097 } else { | |
49098 Py_DECREF(res); | |
49099 } | |
49100 } | |
49101 __Pyx_ErrRestore(error_type, error_value, error_traceback); | |
49102 #if !CYTHON_USE_TP_FINALIZE | |
49103 assert(Py_REFCNT(self) > 0); | |
49104 if (likely(--self->ob_refcnt == 0)) { | |
49105 return; | |
49106 } | |
49107 { | |
49108 Py_ssize_t refcnt = Py_REFCNT(self); | |
49109 _Py_NewReference(self); | |
49110 __Pyx_SET_REFCNT(self, refcnt); | |
49111 } | |
49112 #if CYTHON_COMPILING_IN_CPYTHON | |
49113 assert(PyType_IS_GC(Py_TYPE(self)) && | |
49114 _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); | |
49115 _Py_DEC_REFTOTAL; | |
49116 #endif | |
49117 #ifdef COUNT_ALLOCS | |
49118 --Py_TYPE(self)->tp_frees; | |
49119 --Py_TYPE(self)->tp_allocs; | |
49120 #endif | |
49121 #endif | |
49122 } | |
49123 static PyObject * | |
49124 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) | |
49125 { | |
49126 PyObject *name = self->gi_name; | |
49127 CYTHON_UNUSED_VAR(context); | |
49128 if (unlikely(!name)) name = Py_None; | |
49129 Py_INCREF(name); | |
49130 return name; | |
49131 } | |
49132 static int | |
49133 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) | |
49134 { | |
49135 CYTHON_UNUSED_VAR(context); | |
49136 #if PY_MAJOR_VERSION >= 3 | |
49137 if (unlikely(value == NULL || !PyUnicode_Check(value))) | |
49138 #else | |
49139 if (unlikely(value == NULL || !PyString_Check(value))) | |
49140 #endif | |
49141 { | |
49142 PyErr_SetString(PyExc_TypeError, | |
49143 "__name__ must be set to a string object"); | |
49144 return -1; | |
49145 } | |
49146 Py_INCREF(value); | |
49147 __Pyx_Py_XDECREF_SET(self->gi_name, value); | |
49148 return 0; | |
49149 } | |
49150 static PyObject * | |
49151 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) | |
49152 { | |
49153 PyObject *name = self->gi_qualname; | |
49154 CYTHON_UNUSED_VAR(context); | |
49155 if (unlikely(!name)) name = Py_None; | |
49156 Py_INCREF(name); | |
49157 return name; | |
49158 } | |
49159 static int | |
49160 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) | |
49161 { | |
49162 CYTHON_UNUSED_VAR(context); | |
49163 #if PY_MAJOR_VERSION >= 3 | |
49164 if (unlikely(value == NULL || !PyUnicode_Check(value))) | |
49165 #else | |
49166 if (unlikely(value == NULL || !PyString_Check(value))) | |
49167 #endif | |
49168 { | |
49169 PyErr_SetString(PyExc_TypeError, | |
49170 "__qualname__ must be set to a string object"); | |
49171 return -1; | |
49172 } | |
49173 Py_INCREF(value); | |
49174 __Pyx_Py_XDECREF_SET(self->gi_qualname, value); | |
49175 return 0; | |
49176 } | |
49177 static PyObject * | |
49178 __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) | |
49179 { | |
49180 PyObject *frame = self->gi_frame; | |
49181 CYTHON_UNUSED_VAR(context); | |
49182 if (!frame) { | |
49183 if (unlikely(!self->gi_code)) { | |
49184 Py_RETURN_NONE; | |
49185 } | |
49186 frame = (PyObject *) PyFrame_New( | |
49187 PyThreadState_Get(), /*PyThreadState *tstate,*/ | |
49188 (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ | |
49189 __pyx_d, /*PyObject *globals,*/ | |
49190 0 /*PyObject *locals*/ | |
49191 ); | |
49192 if (unlikely(!frame)) | |
49193 return NULL; | |
49194 self->gi_frame = frame; | |
49195 } | |
49196 Py_INCREF(frame); | |
49197 return frame; | |
49198 } | |
49199 static __pyx_CoroutineObject *__Pyx__Coroutine_New( | |
49200 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, | |
49201 PyObject *name, PyObject *qualname, PyObject *module_name) { | |
49202 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); | |
49203 if (unlikely(!gen)) | |
49204 return NULL; | |
49205 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); | |
49206 } | |
49207 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( | |
49208 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, | |
49209 PyObject *name, PyObject *qualname, PyObject *module_name) { | |
49210 gen->body = body; | |
49211 gen->closure = closure; | |
49212 Py_XINCREF(closure); | |
49213 gen->is_running = 0; | |
49214 gen->resume_label = 0; | |
49215 gen->classobj = NULL; | |
49216 gen->yieldfrom = NULL; | |
49217 #if PY_VERSION_HEX >= 0x030B00a4 | |
49218 gen->gi_exc_state.exc_value = NULL; | |
49219 #else | |
49220 gen->gi_exc_state.exc_type = NULL; | |
49221 gen->gi_exc_state.exc_value = NULL; | |
49222 gen->gi_exc_state.exc_traceback = NULL; | |
49223 #endif | |
49224 #if CYTHON_USE_EXC_INFO_STACK | |
49225 gen->gi_exc_state.previous_item = NULL; | |
49226 #endif | |
49227 gen->gi_weakreflist = NULL; | |
49228 Py_XINCREF(qualname); | |
49229 gen->gi_qualname = qualname; | |
49230 Py_XINCREF(name); | |
49231 gen->gi_name = name; | |
49232 Py_XINCREF(module_name); | |
49233 gen->gi_modulename = module_name; | |
49234 Py_XINCREF(code); | |
49235 gen->gi_code = code; | |
49236 gen->gi_frame = NULL; | |
49237 PyObject_GC_Track(gen); | |
49238 return gen; | |
49239 } | |
49240 | |
49241 /* PatchModuleWithCoroutine */ | |
49242 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { | |
49243 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) | |
49244 int result; | |
49245 PyObject *globals, *result_obj; | |
49246 globals = PyDict_New(); if (unlikely(!globals)) goto ignore; | |
49247 result = PyDict_SetItemString(globals, "_cython_coroutine_type", | |
49248 #ifdef __Pyx_Coroutine_USED | |
49249 (PyObject*)__pyx_CoroutineType); | |
49250 #else | |
49251 Py_None); | |
49252 #endif | |
49253 if (unlikely(result < 0)) goto ignore; | |
49254 result = PyDict_SetItemString(globals, "_cython_generator_type", | |
49255 #ifdef __Pyx_Generator_USED | |
49256 (PyObject*)__pyx_GeneratorType); | |
49257 #else | |
49258 Py_None); | |
49259 #endif | |
49260 if (unlikely(result < 0)) goto ignore; | |
49261 if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; | |
49262 if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; | |
49263 result_obj = PyRun_String(py_code, Py_file_input, globals, globals); | |
49264 if (unlikely(!result_obj)) goto ignore; | |
49265 Py_DECREF(result_obj); | |
49266 Py_DECREF(globals); | |
49267 return module; | |
49268 ignore: | |
49269 Py_XDECREF(globals); | |
49270 PyErr_WriteUnraisable(module); | |
49271 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { | |
49272 Py_DECREF(module); | |
49273 module = NULL; | |
49274 } | |
49275 #else | |
49276 py_code++; | |
49277 #endif | |
49278 return module; | |
49279 } | |
49280 | |
49281 /* PatchGeneratorABC */ | |
49282 #ifndef CYTHON_REGISTER_ABCS | |
49283 #define CYTHON_REGISTER_ABCS 1 | |
49284 #endif | |
49285 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) | |
49286 static PyObject* __Pyx_patch_abc_module(PyObject *module); | |
49287 static PyObject* __Pyx_patch_abc_module(PyObject *module) { | |
49288 module = __Pyx_Coroutine_patch_module( | |
49289 module, "" | |
49290 "if _cython_generator_type is not None:\n" | |
49291 " try: Generator = _module.Generator\n" | |
49292 " except AttributeError: pass\n" | |
49293 " else: Generator.register(_cython_generator_type)\n" | |
49294 "if _cython_coroutine_type is not None:\n" | |
49295 " try: Coroutine = _module.Coroutine\n" | |
49296 " except AttributeError: pass\n" | |
49297 " else: Coroutine.register(_cython_coroutine_type)\n" | |
49298 ); | |
49299 return module; | |
49300 } | |
49301 #endif | |
49302 static int __Pyx_patch_abc(void) { | |
49303 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) | |
49304 static int abc_patched = 0; | |
49305 if (CYTHON_REGISTER_ABCS && !abc_patched) { | |
49306 PyObject *module; | |
49307 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); | |
49308 if (unlikely(!module)) { | |
49309 PyErr_WriteUnraisable(NULL); | |
49310 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, | |
49311 ((PY_MAJOR_VERSION >= 3) ? | |
49312 "Cython module failed to register with collections.abc module" : | |
49313 "Cython module failed to register with collections module"), 1) < 0)) { | |
49314 return -1; | |
49315 } | |
49316 } else { | |
49317 module = __Pyx_patch_abc_module(module); | |
49318 abc_patched = 1; | |
49319 if (unlikely(!module)) | |
49320 return -1; | |
49321 Py_DECREF(module); | |
49322 } | |
49323 module = PyImport_ImportModule("backports_abc"); | |
49324 if (module) { | |
49325 module = __Pyx_patch_abc_module(module); | |
49326 Py_XDECREF(module); | |
49327 } | |
49328 if (!module) { | |
49329 PyErr_Clear(); | |
49330 } | |
49331 } | |
49332 #else | |
49333 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); | |
49334 #endif | |
49335 return 0; | |
49336 } | |
49337 | |
49338 /* Generator */ | |
49339 static PyMethodDef __pyx_Generator_methods[] = { | |
49340 {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, | |
49341 (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, | |
49342 {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, | |
49343 (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, | |
49344 {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, | |
49345 (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, | |
49346 {0, 0, 0, 0} | |
49347 }; | |
49348 static PyMemberDef __pyx_Generator_memberlist[] = { | |
49349 {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, | |
49350 {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, | |
49351 (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, | |
49352 {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, | |
49353 {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, | |
49354 #if CYTHON_USE_TYPE_SPECS | |
49355 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, | |
49356 #endif | |
49357 {0, 0, 0, 0, 0} | |
49358 }; | |
49359 static PyGetSetDef __pyx_Generator_getsets[] = { | |
49360 {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, | |
49361 (char*) PyDoc_STR("name of the generator"), 0}, | |
49362 {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, | |
49363 (char*) PyDoc_STR("qualified name of the generator"), 0}, | |
49364 {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, | |
49365 (char*) PyDoc_STR("Frame of the generator"), 0}, | |
49366 {0, 0, 0, 0, 0} | |
49367 }; | |
49368 #if CYTHON_USE_TYPE_SPECS | |
49369 static PyType_Slot __pyx_GeneratorType_slots[] = { | |
49370 {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, | |
49371 {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, | |
49372 {Py_tp_iter, (void *)PyObject_SelfIter}, | |
49373 {Py_tp_iternext, (void *)__Pyx_Generator_Next}, | |
49374 {Py_tp_methods, (void *)__pyx_Generator_methods}, | |
49375 {Py_tp_members, (void *)__pyx_Generator_memberlist}, | |
49376 {Py_tp_getset, (void *)__pyx_Generator_getsets}, | |
49377 {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, | |
49378 #if CYTHON_USE_TP_FINALIZE | |
49379 {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, | |
49380 #endif | |
49381 {0, 0}, | |
49382 }; | |
49383 static PyType_Spec __pyx_GeneratorType_spec = { | |
49384 __PYX_TYPE_MODULE_PREFIX "generator", | |
49385 sizeof(__pyx_CoroutineObject), | |
49386 0, | |
49387 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, | |
49388 __pyx_GeneratorType_slots | |
49389 }; | |
49390 #else | |
49391 static PyTypeObject __pyx_GeneratorType_type = { | |
49392 PyVarObject_HEAD_INIT(0, 0) | |
49393 __PYX_TYPE_MODULE_PREFIX "generator", | |
49394 sizeof(__pyx_CoroutineObject), | |
49395 0, | |
49396 (destructor) __Pyx_Coroutine_dealloc, | |
49397 0, | |
49398 0, | |
49399 0, | |
49400 0, | |
49401 0, | |
49402 0, | |
49403 0, | |
49404 0, | |
49405 0, | |
49406 0, | |
49407 0, | |
49408 0, | |
49409 0, | |
49410 0, | |
49411 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, | |
49412 0, | |
49413 (traverseproc) __Pyx_Coroutine_traverse, | |
49414 0, | |
49415 0, | |
49416 offsetof(__pyx_CoroutineObject, gi_weakreflist), | |
49417 0, | |
49418 (iternextfunc) __Pyx_Generator_Next, | |
49419 __pyx_Generator_methods, | |
49420 __pyx_Generator_memberlist, | |
49421 __pyx_Generator_getsets, | |
49422 0, | |
49423 0, | |
49424 0, | |
49425 0, | |
49426 0, | |
49427 0, | |
49428 0, | |
49429 0, | |
49430 0, | |
49431 0, | |
49432 0, | |
49433 0, | |
49434 0, | |
49435 0, | |
49436 0, | |
49437 #if CYTHON_USE_TP_FINALIZE | |
49438 0, | |
49439 #else | |
49440 __Pyx_Coroutine_del, | |
49441 #endif | |
49442 0, | |
49443 #if CYTHON_USE_TP_FINALIZE | |
49444 __Pyx_Coroutine_del, | |
49445 #elif PY_VERSION_HEX >= 0x030400a1 | |
49446 0, | |
49447 #endif | |
49448 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
49449 0, | |
49450 #endif | |
49451 #if __PYX_NEED_TP_PRINT_SLOT | |
49452 0, | |
49453 #endif | |
49454 #if PY_VERSION_HEX >= 0x030C0000 | |
49455 0, | |
49456 #endif | |
49457 #if PY_VERSION_HEX >= 0x030d00A4 | |
49458 0, | |
49459 #endif | |
49460 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
49461 0, | |
49462 #endif | |
49463 }; | |
49464 #endif | |
49465 static int __pyx_Generator_init(PyObject *module) { | |
49466 #if CYTHON_USE_TYPE_SPECS | |
49467 __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); | |
49468 #else | |
49469 CYTHON_UNUSED_VAR(module); | |
49470 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; | |
49471 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; | |
49472 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); | |
49473 #endif | |
49474 if (unlikely(!__pyx_GeneratorType)) { | |
49475 return -1; | |
49476 } | |
49477 return 0; | |
49478 } | |
49479 | |
49480 /* CheckBinaryVersion */ | |
49481 static unsigned long __Pyx_get_runtime_version(void) { | |
49482 #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 | |
49483 return Py_Version & ~0xFFUL; | |
49484 #else | |
49485 const char* rt_version = Py_GetVersion(); | |
49486 unsigned long version = 0; | |
49487 unsigned long factor = 0x01000000UL; | |
49488 unsigned int digit = 0; | |
49489 int i = 0; | |
49490 while (factor) { | |
49491 while ('0' <= rt_version[i] && rt_version[i] <= '9') { | |
49492 digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); | |
49493 ++i; | |
49494 } | |
49495 version += factor * digit; | |
49496 if (rt_version[i] != '.') | |
49497 break; | |
49498 digit = 0; | |
49499 factor >>= 8; | |
49500 ++i; | |
49501 } | |
49502 return version; | |
49503 #endif | |
49504 } | |
49505 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { | |
49506 const unsigned long MAJOR_MINOR = 0xFFFF0000UL; | |
49507 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) | |
49508 return 0; | |
49509 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) | |
49510 return 1; | |
49511 { | |
49512 char message[200]; | |
49513 PyOS_snprintf(message, sizeof(message), | |
49514 "compile time Python version %d.%d " | |
49515 "of module '%.100s' " | |
49516 "%s " | |
49517 "runtime version %d.%d", | |
49518 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), | |
49519 __Pyx_MODULE_NAME, | |
49520 (allow_newer) ? "was newer than" : "does not match", | |
49521 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) | |
49522 ); | |
49523 return PyErr_WarnEx(NULL, message, 1); | |
49524 } | |
49525 } | |
49526 | |
49527 /* FunctionImport */ | |
49528 #ifndef __PYX_HAVE_RT_ImportFunction_3_0_11 | |
49529 #define __PYX_HAVE_RT_ImportFunction_3_0_11 | |
49530 static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { | |
49531 PyObject *d = 0; | |
49532 PyObject *cobj = 0; | |
49533 union { | |
49534 void (*fp)(void); | |
49535 void *p; | |
49536 } tmp; | |
49537 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); | |
49538 if (!d) | |
49539 goto bad; | |
49540 cobj = PyDict_GetItemString(d, funcname); | |
49541 if (!cobj) { | |
49542 PyErr_Format(PyExc_ImportError, | |
49543 "%.200s does not export expected C function %.200s", | |
49544 PyModule_GetName(module), funcname); | |
49545 goto bad; | |
49546 } | |
49547 if (!PyCapsule_IsValid(cobj, sig)) { | |
49548 PyErr_Format(PyExc_TypeError, | |
49549 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", | |
49550 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); | |
49551 goto bad; | |
49552 } | |
49553 tmp.p = PyCapsule_GetPointer(cobj, sig); | |
49554 *f = tmp.fp; | |
49555 if (!(*f)) | |
49556 goto bad; | |
49557 Py_DECREF(d); | |
49558 return 0; | |
49559 bad: | |
49560 Py_XDECREF(d); | |
49561 return -1; | |
49562 } | |
49563 #endif | |
49564 | |
49565 /* InitStrings */ | |
49566 #if PY_MAJOR_VERSION >= 3 | |
49567 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { | |
49568 if (t.is_unicode | t.is_str) { | |
49569 if (t.intern) { | |
49570 *str = PyUnicode_InternFromString(t.s); | |
49571 } else if (t.encoding) { | |
49572 *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); | |
49573 } else { | |
49574 *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); | |
49575 } | |
49576 } else { | |
49577 *str = PyBytes_FromStringAndSize(t.s, t.n - 1); | |
49578 } | |
49579 if (!*str) | |
49580 return -1; | |
49581 if (PyObject_Hash(*str) == -1) | |
49582 return -1; | |
49583 return 0; | |
49584 } | |
49585 #endif | |
49586 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { | |
49587 while (t->p) { | |
49588 #if PY_MAJOR_VERSION >= 3 | |
49589 __Pyx_InitString(*t, t->p); | |
49590 #else | |
49591 if (t->is_unicode) { | |
49592 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); | |
49593 } else if (t->intern) { | |
49594 *t->p = PyString_InternFromString(t->s); | |
49595 } else { | |
49596 *t->p = PyString_FromStringAndSize(t->s, t->n - 1); | |
49597 } | |
49598 if (!*t->p) | |
49599 return -1; | |
49600 if (PyObject_Hash(*t->p) == -1) | |
49601 return -1; | |
49602 #endif | |
49603 ++t; | |
49604 } | |
49605 return 0; | |
49606 } | |
49607 | |
49608 #include <string.h> | |
49609 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { | |
49610 size_t len = strlen(s); | |
49611 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { | |
49612 PyErr_SetString(PyExc_OverflowError, "byte string is too long"); | |
49613 return -1; | |
49614 } | |
49615 return (Py_ssize_t) len; | |
49616 } | |
49617 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { | |
49618 Py_ssize_t len = __Pyx_ssize_strlen(c_str); | |
49619 if (unlikely(len < 0)) return NULL; | |
49620 return __Pyx_PyUnicode_FromStringAndSize(c_str, len); | |
49621 } | |
49622 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { | |
49623 Py_ssize_t len = __Pyx_ssize_strlen(c_str); | |
49624 if (unlikely(len < 0)) return NULL; | |
49625 return PyByteArray_FromStringAndSize(c_str, len); | |
49626 } | |
49627 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { | |
49628 Py_ssize_t ignore; | |
49629 return __Pyx_PyObject_AsStringAndSize(o, &ignore); | |
49630 } | |
49631 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
49632 #if !CYTHON_PEP393_ENABLED | |
49633 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
49634 char* defenc_c; | |
49635 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); | |
49636 if (!defenc) return NULL; | |
49637 defenc_c = PyBytes_AS_STRING(defenc); | |
49638 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
49639 { | |
49640 char* end = defenc_c + PyBytes_GET_SIZE(defenc); | |
49641 char* c; | |
49642 for (c = defenc_c; c < end; c++) { | |
49643 if ((unsigned char) (*c) >= 128) { | |
49644 PyUnicode_AsASCIIString(o); | |
49645 return NULL; | |
49646 } | |
49647 } | |
49648 } | |
49649 #endif | |
49650 *length = PyBytes_GET_SIZE(defenc); | |
49651 return defenc_c; | |
49652 } | |
49653 #else | |
49654 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
49655 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; | |
49656 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
49657 if (likely(PyUnicode_IS_ASCII(o))) { | |
49658 *length = PyUnicode_GET_LENGTH(o); | |
49659 return PyUnicode_AsUTF8(o); | |
49660 } else { | |
49661 PyUnicode_AsASCIIString(o); | |
49662 return NULL; | |
49663 } | |
49664 #else | |
49665 return PyUnicode_AsUTF8AndSize(o, length); | |
49666 #endif | |
49667 } | |
49668 #endif | |
49669 #endif | |
49670 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
49671 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
49672 if ( | |
49673 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
49674 __Pyx_sys_getdefaultencoding_not_ascii && | |
49675 #endif | |
49676 PyUnicode_Check(o)) { | |
49677 return __Pyx_PyUnicode_AsStringAndSize(o, length); | |
49678 } else | |
49679 #endif | |
49680 #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) | |
49681 if (PyByteArray_Check(o)) { | |
49682 *length = PyByteArray_GET_SIZE(o); | |
49683 return PyByteArray_AS_STRING(o); | |
49684 } else | |
49685 #endif | |
49686 { | |
49687 char* result; | |
49688 int r = PyBytes_AsStringAndSize(o, &result, length); | |
49689 if (unlikely(r < 0)) { | |
49690 return NULL; | |
49691 } else { | |
49692 return result; | |
49693 } | |
49694 } | |
49695 } | |
49696 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { | |
49697 int is_true = x == Py_True; | |
49698 if (is_true | (x == Py_False) | (x == Py_None)) return is_true; | |
49699 else return PyObject_IsTrue(x); | |
49700 } | |
49701 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { | |
49702 int retval; | |
49703 if (unlikely(!x)) return -1; | |
49704 retval = __Pyx_PyObject_IsTrue(x); | |
49705 Py_DECREF(x); | |
49706 return retval; | |
49707 } | |
49708 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { | |
49709 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); | |
49710 #if PY_MAJOR_VERSION >= 3 | |
49711 if (PyLong_Check(result)) { | |
49712 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, | |
49713 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " | |
49714 "The ability to return an instance of a strict subclass of int is deprecated, " | |
49715 "and may be removed in a future version of Python.", | |
49716 result_type_name)) { | |
49717 __Pyx_DECREF_TypeName(result_type_name); | |
49718 Py_DECREF(result); | |
49719 return NULL; | |
49720 } | |
49721 __Pyx_DECREF_TypeName(result_type_name); | |
49722 return result; | |
49723 } | |
49724 #endif | |
49725 PyErr_Format(PyExc_TypeError, | |
49726 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", | |
49727 type_name, type_name, result_type_name); | |
49728 __Pyx_DECREF_TypeName(result_type_name); | |
49729 Py_DECREF(result); | |
49730 return NULL; | |
49731 } | |
49732 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { | |
49733 #if CYTHON_USE_TYPE_SLOTS | |
49734 PyNumberMethods *m; | |
49735 #endif | |
49736 const char *name = NULL; | |
49737 PyObject *res = NULL; | |
49738 #if PY_MAJOR_VERSION < 3 | |
49739 if (likely(PyInt_Check(x) || PyLong_Check(x))) | |
49740 #else | |
49741 if (likely(PyLong_Check(x))) | |
49742 #endif | |
49743 return __Pyx_NewRef(x); | |
49744 #if CYTHON_USE_TYPE_SLOTS | |
49745 m = Py_TYPE(x)->tp_as_number; | |
49746 #if PY_MAJOR_VERSION < 3 | |
49747 if (m && m->nb_int) { | |
49748 name = "int"; | |
49749 res = m->nb_int(x); | |
49750 } | |
49751 else if (m && m->nb_long) { | |
49752 name = "long"; | |
49753 res = m->nb_long(x); | |
49754 } | |
49755 #else | |
49756 if (likely(m && m->nb_int)) { | |
49757 name = "int"; | |
49758 res = m->nb_int(x); | |
49759 } | |
49760 #endif | |
49761 #else | |
49762 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { | |
49763 res = PyNumber_Int(x); | |
49764 } | |
49765 #endif | |
49766 if (likely(res)) { | |
49767 #if PY_MAJOR_VERSION < 3 | |
49768 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { | |
49769 #else | |
49770 if (unlikely(!PyLong_CheckExact(res))) { | |
49771 #endif | |
49772 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); | |
49773 } | |
49774 } | |
49775 else if (!PyErr_Occurred()) { | |
49776 PyErr_SetString(PyExc_TypeError, | |
49777 "an integer is required"); | |
49778 } | |
49779 return res; | |
49780 } | |
49781 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { | |
49782 Py_ssize_t ival; | |
49783 PyObject *x; | |
49784 #if PY_MAJOR_VERSION < 3 | |
49785 if (likely(PyInt_CheckExact(b))) { | |
49786 if (sizeof(Py_ssize_t) >= sizeof(long)) | |
49787 return PyInt_AS_LONG(b); | |
49788 else | |
49789 return PyInt_AsSsize_t(b); | |
49790 } | |
49791 #endif | |
49792 if (likely(PyLong_CheckExact(b))) { | |
49793 #if CYTHON_USE_PYLONG_INTERNALS | |
49794 if (likely(__Pyx_PyLong_IsCompact(b))) { | |
49795 return __Pyx_PyLong_CompactValue(b); | |
49796 } else { | |
49797 const digit* digits = __Pyx_PyLong_Digits(b); | |
49798 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); | |
49799 switch (size) { | |
49800 case 2: | |
49801 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { | |
49802 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
49803 } | |
49804 break; | |
49805 case -2: | |
49806 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { | |
49807 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
49808 } | |
49809 break; | |
49810 case 3: | |
49811 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { | |
49812 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
49813 } | |
49814 break; | |
49815 case -3: | |
49816 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { | |
49817 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
49818 } | |
49819 break; | |
49820 case 4: | |
49821 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { | |
49822 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
49823 } | |
49824 break; | |
49825 case -4: | |
49826 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { | |
49827 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
49828 } | |
49829 break; | |
49830 } | |
49831 } | |
49832 #endif | |
49833 return PyLong_AsSsize_t(b); | |
49834 } | |
49835 x = PyNumber_Index(b); | |
49836 if (!x) return -1; | |
49837 ival = PyInt_AsSsize_t(x); | |
49838 Py_DECREF(x); | |
49839 return ival; | |
49840 } | |
49841 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { | |
49842 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { | |
49843 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); | |
49844 #if PY_MAJOR_VERSION < 3 | |
49845 } else if (likely(PyInt_CheckExact(o))) { | |
49846 return PyInt_AS_LONG(o); | |
49847 #endif | |
49848 } else { | |
49849 Py_ssize_t ival; | |
49850 PyObject *x; | |
49851 x = PyNumber_Index(o); | |
49852 if (!x) return -1; | |
49853 ival = PyInt_AsLong(x); | |
49854 Py_DECREF(x); | |
49855 return ival; | |
49856 } | |
49857 } | |
49858 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { | |
49859 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); | |
49860 } | |
49861 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { | |
49862 return PyInt_FromSize_t(ival); | |
49863 } | |
49864 | |
49865 | |
49866 /* #### Code section: utility_code_pragmas_end ### */ | |
49867 #ifdef _MSC_VER | |
49868 #pragma warning( pop ) | |
49869 #endif | |
49870 | |
49871 | |
49872 | |
49873 /* #### Code section: end ### */ | |
49874 #endif /* Py_PYTHON_H */ |