Imported Upstream version 0.6
[pysam.git] / pysam / cvcf.c
1 /* Generated by Cython 0.14.1 on Sat Oct 15 05:27:48 2011 */
2
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6     #error Python headers needed to compile C extensions, please install development version of Python.
7 #else
8
9 #include <stddef.h> /* For offsetof */
10 #ifndef offsetof
11 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
12 #endif
13
14 #if !defined(WIN32) && !defined(MS_WINDOWS)
15   #ifndef __stdcall
16     #define __stdcall
17   #endif
18   #ifndef __cdecl
19     #define __cdecl
20   #endif
21   #ifndef __fastcall
22     #define __fastcall
23   #endif
24 #endif
25
26 #ifndef DL_IMPORT
27   #define DL_IMPORT(t) t
28 #endif
29 #ifndef DL_EXPORT
30   #define DL_EXPORT(t) t
31 #endif
32
33 #ifndef PY_LONG_LONG
34   #define PY_LONG_LONG LONG_LONG
35 #endif
36
37 #if PY_VERSION_HEX < 0x02040000
38   #define METH_COEXIST 0
39   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
40   #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
41 #endif
42
43 #if PY_VERSION_HEX < 0x02050000
44   typedef int Py_ssize_t;
45   #define PY_SSIZE_T_MAX INT_MAX
46   #define PY_SSIZE_T_MIN INT_MIN
47   #define PY_FORMAT_SIZE_T ""
48   #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
49   #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
50   #define PyNumber_Index(o)    PyNumber_Int(o)
51   #define PyIndex_Check(o)     PyNumber_Check(o)
52   #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
53 #endif
54
55 #if PY_VERSION_HEX < 0x02060000
56   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
57   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
58   #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
59   #define PyVarObject_HEAD_INIT(type, size) \
60           PyObject_HEAD_INIT(type) size,
61   #define PyType_Modified(t)
62
63   typedef struct {
64      void *buf;
65      PyObject *obj;
66      Py_ssize_t len;
67      Py_ssize_t itemsize;
68      int readonly;
69      int ndim;
70      char *format;
71      Py_ssize_t *shape;
72      Py_ssize_t *strides;
73      Py_ssize_t *suboffsets;
74      void *internal;
75   } Py_buffer;
76
77   #define PyBUF_SIMPLE 0
78   #define PyBUF_WRITABLE 0x0001
79   #define PyBUF_FORMAT 0x0004
80   #define PyBUF_ND 0x0008
81   #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
82   #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
83   #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
84   #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
85   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
86
87 #endif
88
89 #if PY_MAJOR_VERSION < 3
90   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
91 #else
92   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
93 #endif
94
95 #if PY_MAJOR_VERSION >= 3
96   #define Py_TPFLAGS_CHECKTYPES 0
97   #define Py_TPFLAGS_HAVE_INDEX 0
98 #endif
99
100 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
101   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
102 #endif
103
104 #if PY_MAJOR_VERSION >= 3
105   #define PyBaseString_Type            PyUnicode_Type
106   #define PyStringObject               PyUnicodeObject
107   #define PyString_Type                PyUnicode_Type
108   #define PyString_Check               PyUnicode_Check
109   #define PyString_CheckExact          PyUnicode_CheckExact
110 #endif
111
112 #if PY_VERSION_HEX < 0x02060000
113   #define PyBytesObject                PyStringObject
114   #define PyBytes_Type                 PyString_Type
115   #define PyBytes_Check                PyString_Check
116   #define PyBytes_CheckExact           PyString_CheckExact
117   #define PyBytes_FromString           PyString_FromString
118   #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
119   #define PyBytes_FromFormat           PyString_FromFormat
120   #define PyBytes_DecodeEscape         PyString_DecodeEscape
121   #define PyBytes_AsString             PyString_AsString
122   #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
123   #define PyBytes_Size                 PyString_Size
124   #define PyBytes_AS_STRING            PyString_AS_STRING
125   #define PyBytes_GET_SIZE             PyString_GET_SIZE
126   #define PyBytes_Repr                 PyString_Repr
127   #define PyBytes_Concat               PyString_Concat
128   #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
129 #endif
130
131 #if PY_VERSION_HEX < 0x02060000
132   #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
133   #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
134 #endif
135 #ifndef PySet_CheckExact
136   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
137 #endif
138
139 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
140
141 #if PY_MAJOR_VERSION >= 3
142   #define PyIntObject                  PyLongObject
143   #define PyInt_Type                   PyLong_Type
144   #define PyInt_Check(op)              PyLong_Check(op)
145   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
146   #define PyInt_FromString             PyLong_FromString
147   #define PyInt_FromUnicode            PyLong_FromUnicode
148   #define PyInt_FromLong               PyLong_FromLong
149   #define PyInt_FromSize_t             PyLong_FromSize_t
150   #define PyInt_FromSsize_t            PyLong_FromSsize_t
151   #define PyInt_AsLong                 PyLong_AsLong
152   #define PyInt_AS_LONG                PyLong_AS_LONG
153   #define PyInt_AsSsize_t              PyLong_AsSsize_t
154   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
155   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
156 #endif
157
158 #if PY_MAJOR_VERSION >= 3
159   #define PyBoolObject                 PyLongObject
160 #endif
161
162
163 #if PY_MAJOR_VERSION >= 3
164   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
165   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
166 #else
167   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
168   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
169 #endif
170
171 #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
172   #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
173   #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
174   #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
175 #else
176   #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
177         (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
178         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
179             (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
180   #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
181         (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
182         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
183             (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
184   #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
185         (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
186         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
187             (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
188 #endif
189
190 #if PY_MAJOR_VERSION >= 3
191   #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
192 #endif
193
194 #if PY_VERSION_HEX < 0x02050000
195   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
196   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
197   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
198 #else
199   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
200   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
201   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
202 #endif
203
204 #if PY_VERSION_HEX < 0x02050000
205   #define __Pyx_NAMESTR(n) ((char *)(n))
206   #define __Pyx_DOCSTR(n)  ((char *)(n))
207 #else
208   #define __Pyx_NAMESTR(n) (n)
209   #define __Pyx_DOCSTR(n)  (n)
210 #endif
211
212 #ifdef __cplusplus
213 #define __PYX_EXTERN_C extern "C"
214 #else
215 #define __PYX_EXTERN_C extern
216 #endif
217
218 #if defined(WIN32) || defined(MS_WINDOWS)
219 #define _USE_MATH_DEFINES
220 #endif
221 #include <math.h>
222 #define __PYX_HAVE_API__cvcf
223 #include "stdlib.h"
224 #include "string.h"
225 #include "stdint.h"
226 #include "stdio.h"
227 #include "ctype.h"
228 #include "sys/types.h"
229 #include "sys/stat.h"
230 #include "fcntl.h"
231 #include "unistd.h"
232 #include "bgzf.h"
233 #include "tabix.h"
234
235 #ifdef PYREX_WITHOUT_ASSERTIONS
236 #define CYTHON_WITHOUT_ASSERTIONS
237 #endif
238
239
240 /* inline attribute */
241 #ifndef CYTHON_INLINE
242   #if defined(__GNUC__)
243     #define CYTHON_INLINE __inline__
244   #elif defined(_MSC_VER)
245     #define CYTHON_INLINE __inline
246   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
247     #define CYTHON_INLINE inline
248   #else
249     #define CYTHON_INLINE
250   #endif
251 #endif
252
253 /* unused attribute */
254 #ifndef CYTHON_UNUSED
255 # if defined(__GNUC__)
256 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
257 #     define CYTHON_UNUSED __attribute__ ((__unused__))
258 #   else
259 #     define CYTHON_UNUSED
260 #   endif
261 # elif defined(__ICC) || defined(__INTEL_COMPILER)
262 #   define CYTHON_UNUSED __attribute__ ((__unused__))
263 # else
264 #   define CYTHON_UNUSED
265 # endif
266 #endif
267
268 typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
269
270
271 /* Type Conversion Predeclarations */
272
273 #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
274 #define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
275
276 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
277 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
278 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
279
280 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
281 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
282 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
283
284 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
285
286
287 #ifdef __GNUC__
288 /* Test for GCC > 2.95 */
289 #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
290 #define likely(x)   __builtin_expect(!!(x), 1)
291 #define unlikely(x) __builtin_expect(!!(x), 0)
292 #else /* __GNUC__ > 2 ... */
293 #define likely(x)   (x)
294 #define unlikely(x) (x)
295 #endif /* __GNUC__ > 2 ... */
296 #else /* __GNUC__ */
297 #define likely(x)   (x)
298 #define unlikely(x) (x)
299 #endif /* __GNUC__ */
300     
301 static PyObject *__pyx_m;
302 static PyObject *__pyx_b;
303 static PyObject *__pyx_empty_tuple;
304 static PyObject *__pyx_empty_bytes;
305 static int __pyx_lineno;
306 static int __pyx_clineno = 0;
307 static const char * __pyx_cfilenm= __FILE__;
308 static const char *__pyx_filename;
309
310
311 static const char *__pyx_f[] = {
312   "cvcf.pyx",
313   "ctabix.pxd",
314   "TabProxies.pxd",
315 };
316
317 /* Type declarations */
318
319 /* "TabProxies.pxd":42
320  *   ctypedef int uint64_t
321  * 
322  * cdef class TupleProxy:             # <<<<<<<<<<<<<<
323  * 
324  *     cdef:
325  */
326
327 struct __pyx_obj_10TabProxies_TupleProxy {
328   PyObject_HEAD
329   struct __pyx_vtabstruct_10TabProxies_TupleProxy *__pyx_vtab;
330   char *data;
331   char **fields;
332   int nfields;
333   int index;
334   int nbytes;
335   int offset;
336   int is_modified;
337 };
338
339 /* "TabProxies.pxd":77
340  *     cdef update( self, char * buffer, size_t nbytes )
341  * 
342  * cdef class NamedTupleProxy( TupleProxy) :             # <<<<<<<<<<<<<<
343  *     pass
344  * 
345  */
346
347 struct __pyx_obj_10TabProxies_NamedTupleProxy {
348   struct __pyx_obj_10TabProxies_TupleProxy __pyx_base;
349 };
350
351 /* "TabProxies.pxd":80
352  *     pass
353  * 
354  * cdef class BedProxy( NamedTupleProxy) :             # <<<<<<<<<<<<<<
355  * 
356  *     cdef:
357  */
358
359 struct __pyx_obj_10TabProxies_BedProxy {
360   struct __pyx_obj_10TabProxies_NamedTupleProxy __pyx_base;
361   char *contig;
362   uint32_t start;
363   uint32_t end;
364   int bedfields;
365 };
366
367 /* "cvcf.pyx":94
368  * ###########################################################################################################
369  * 
370  * cdef class VCFRecord( TabProxies.TupleProxy):             # <<<<<<<<<<<<<<
371  *     '''vcf record.
372  * 
373  */
374
375 struct __pyx_obj_4cvcf_VCFRecord {
376   struct __pyx_obj_10TabProxies_TupleProxy __pyx_base;
377   PyObject *vcf;
378   char *contig;
379   uint32_t pos;
380 };
381
382 /* "TabProxies.pxd":91
383  *     cdef update( self, char * buffer, size_t nbytes )
384  * 
385  * cdef class VCFProxy( NamedTupleProxy) :             # <<<<<<<<<<<<<<
386  * 
387  *     cdef:
388  */
389
390 struct __pyx_obj_10TabProxies_VCFProxy {
391   struct __pyx_obj_10TabProxies_NamedTupleProxy __pyx_base;
392   char *contig;
393   uint32_t pos;
394 };
395
396 /* "ctabix.pxd":178
397  *     cdef tabix_t * tabixfile
398  * 
399  * cdef class Parser:             # <<<<<<<<<<<<<<
400  *      pass
401  */
402
403 struct __pyx_obj_6ctabix_Parser {
404   PyObject_HEAD
405 };
406
407 /* "TabProxies.pxd":60
408  *     cdef update( self, char * buffer, size_t nbytes )
409  * 
410  * cdef class GTFProxy( TupleProxy) :             # <<<<<<<<<<<<<<
411  * 
412  *     cdef:
413  */
414
415 struct __pyx_obj_10TabProxies_GTFProxy {
416   struct __pyx_obj_10TabProxies_TupleProxy __pyx_base;
417   char *contig;
418   char *source;
419   char *feature;
420   uint32_t start;
421   uint32_t end;
422   char *score;
423   char *strand;
424   char *frame;
425   char *attributes;
426   int hasOwnAttributes;
427 };
428
429 /* "cvcf.pyx":221
430  * 
431  * 
432  * cdef class asVCFRecord( ctabix.Parser ):             # <<<<<<<<<<<<<<
433  *     '''converts a :term:`tabix row` into a VCF record.'''
434  *     cdef vcffile
435  */
436
437 struct __pyx_obj_4cvcf_asVCFRecord {
438   struct __pyx_obj_6ctabix_Parser __pyx_base;
439   PyObject *vcffile;
440 };
441
442 /* "ctabix.pxd":172
443  *   # char *ti_iter_read(BGZF *fp, ti_iter_t iter, int *len)
444  * 
445  * cdef class Tabixfile:             # <<<<<<<<<<<<<<
446  *     cdef char * filename
447  * 
448  */
449
450 struct __pyx_obj_6ctabix_Tabixfile {
451   PyObject_HEAD
452   char *filename;
453   tabix_t *tabixfile;
454 };
455
456
457 /* "TabProxies.pxd":42
458  *   ctypedef int uint64_t
459  * 
460  * cdef class TupleProxy:             # <<<<<<<<<<<<<<
461  * 
462  *     cdef:
463  */
464
465 struct __pyx_vtabstruct_10TabProxies_TupleProxy {
466   int (*getMaxFields)(struct __pyx_obj_10TabProxies_TupleProxy *, size_t);
467   PyObject *(*take)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
468   PyObject *(*present)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
469   PyObject *(*copy)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
470   PyObject *(*update)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
471 };
472 static struct __pyx_vtabstruct_10TabProxies_TupleProxy *__pyx_vtabptr_10TabProxies_TupleProxy;
473
474
475 /* "TabProxies.pxd":77
476  *     cdef update( self, char * buffer, size_t nbytes )
477  * 
478  * cdef class NamedTupleProxy( TupleProxy) :             # <<<<<<<<<<<<<<
479  *     pass
480  * 
481  */
482
483 struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy {
484   struct __pyx_vtabstruct_10TabProxies_TupleProxy __pyx_base;
485 };
486 static struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy *__pyx_vtabptr_10TabProxies_NamedTupleProxy;
487
488
489 /* "TabProxies.pxd":91
490  *     cdef update( self, char * buffer, size_t nbytes )
491  * 
492  * cdef class VCFProxy( NamedTupleProxy) :             # <<<<<<<<<<<<<<
493  * 
494  *     cdef:
495  */
496
497 struct __pyx_vtabstruct_10TabProxies_VCFProxy {
498   struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy __pyx_base;
499 };
500 static struct __pyx_vtabstruct_10TabProxies_VCFProxy *__pyx_vtabptr_10TabProxies_VCFProxy;
501
502
503 /* "TabProxies.pxd":60
504  *     cdef update( self, char * buffer, size_t nbytes )
505  * 
506  * cdef class GTFProxy( TupleProxy) :             # <<<<<<<<<<<<<<
507  * 
508  *     cdef:
509  */
510
511 struct __pyx_vtabstruct_10TabProxies_GTFProxy {
512   struct __pyx_vtabstruct_10TabProxies_TupleProxy __pyx_base;
513 };
514 static struct __pyx_vtabstruct_10TabProxies_GTFProxy *__pyx_vtabptr_10TabProxies_GTFProxy;
515
516
517 /* "cvcf.pyx":94
518  * ###########################################################################################################
519  * 
520  * cdef class VCFRecord( TabProxies.TupleProxy):             # <<<<<<<<<<<<<<
521  *     '''vcf record.
522  * 
523  */
524
525 struct __pyx_vtabstruct_4cvcf_VCFRecord {
526   struct __pyx_vtabstruct_10TabProxies_TupleProxy __pyx_base;
527 };
528 static struct __pyx_vtabstruct_4cvcf_VCFRecord *__pyx_vtabptr_4cvcf_VCFRecord;
529
530
531 /* "TabProxies.pxd":80
532  *     pass
533  * 
534  * cdef class BedProxy( NamedTupleProxy) :             # <<<<<<<<<<<<<<
535  * 
536  *     cdef:
537  */
538
539 struct __pyx_vtabstruct_10TabProxies_BedProxy {
540   struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy __pyx_base;
541 };
542 static struct __pyx_vtabstruct_10TabProxies_BedProxy *__pyx_vtabptr_10TabProxies_BedProxy;
543
544 #ifndef CYTHON_REFNANNY
545   #define CYTHON_REFNANNY 0
546 #endif
547
548 #if CYTHON_REFNANNY
549   typedef struct {
550     void (*INCREF)(void*, PyObject*, int);
551     void (*DECREF)(void*, PyObject*, int);
552     void (*GOTREF)(void*, PyObject*, int);
553     void (*GIVEREF)(void*, PyObject*, int);
554     void* (*SetupContext)(const char*, int, const char*);
555     void (*FinishContext)(void**);
556   } __Pyx_RefNannyAPIStruct;
557   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
558   static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
559     PyObject *m = NULL, *p = NULL;
560     void *r = NULL;
561     m = PyImport_ImportModule((char *)modname);
562     if (!m) goto end;
563     p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
564     if (!p) goto end;
565     r = PyLong_AsVoidPtr(p);
566   end:
567     Py_XDECREF(p);
568     Py_XDECREF(m);
569     return (__Pyx_RefNannyAPIStruct *)r;
570   }
571   #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
572   #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
573   #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
574   #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
575   #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
576   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
577   #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
578 #else
579   #define __Pyx_RefNannySetupContext(name)
580   #define __Pyx_RefNannyFinishContext()
581   #define __Pyx_INCREF(r) Py_INCREF(r)
582   #define __Pyx_DECREF(r) Py_DECREF(r)
583   #define __Pyx_GOTREF(r)
584   #define __Pyx_GIVEREF(r)
585   #define __Pyx_XDECREF(r) Py_XDECREF(r)
586 #endif /* CYTHON_REFNANNY */
587 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
588 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
589
590 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
591
592 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
593     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
594
595 static void __Pyx_RaiseDoubleKeywordsError(
596     const char* func_name, PyObject* kw_name); /*proto*/
597
598 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
599
600
601 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
602     PyObject *r;
603     if (!j) return NULL;
604     r = PyObject_GetItem(o, j);
605     Py_DECREF(j);
606     return r;
607 }
608
609
610 #define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
611                                                     __Pyx_GetItemInt_List_Fast(o, i) : \
612                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
613
614 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
615     if (likely(o != Py_None)) {
616         if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
617             PyObject *r = PyList_GET_ITEM(o, i);
618             Py_INCREF(r);
619             return r;
620         }
621         else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
622             PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
623             Py_INCREF(r);
624             return r;
625         }
626     }
627     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
628 }
629
630 #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
631                                                     __Pyx_GetItemInt_Tuple_Fast(o, i) : \
632                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
633
634 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
635     if (likely(o != Py_None)) {
636         if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
637             PyObject *r = PyTuple_GET_ITEM(o, i);
638             Py_INCREF(r);
639             return r;
640         }
641         else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
642             PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
643             Py_INCREF(r);
644             return r;
645         }
646     }
647     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
648 }
649
650
651 #define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
652                                                     __Pyx_GetItemInt_Fast(o, i) : \
653                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
654
655 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
656     PyObject *r;
657     if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
658         r = PyList_GET_ITEM(o, i);
659         Py_INCREF(r);
660     }
661     else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
662         r = PyTuple_GET_ITEM(o, i);
663         Py_INCREF(r);
664     }
665     else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
666         r = PySequence_GetItem(o, i);
667     }
668     else {
669         r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
670     }
671     return r;
672 }
673
674 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
675
676 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
677 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
678
679 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
680
681 static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
682
683 #define __Pyx_PyObject_AsDouble(obj) \
684     ((likely(PyFloat_CheckExact(obj))) ? \
685      PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
686
687 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);
688
689 #if PY_MAJOR_VERSION >= 3
690 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
691     PyObject *value;
692     if (unlikely(d == Py_None)) {
693         __Pyx_RaiseNoneIndexingError();
694         return NULL;
695     }
696     value = PyDict_GetItemWithError(d, key);
697     if (unlikely(!value)) {
698         if (!PyErr_Occurred())
699             PyErr_SetObject(PyExc_KeyError, key);
700         return NULL;
701     }
702     Py_INCREF(value);
703     return value;
704 }
705 #else
706     #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
707 #endif
708
709 static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
710 static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
711     return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
712 }
713
714 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
715
716 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
717
718 static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
719 static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/
720
721 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
722
723 static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
724     if (likely(PyList_CheckExact(L))) {
725         if (PyList_Append(L, x) < 0) return NULL;
726         Py_INCREF(Py_None);
727         return Py_None; /* this is just to have an accurate signature */
728     }
729     else {
730         PyObject *r, *m;
731         m = __Pyx_GetAttrString(L, "append");
732         if (!m) return NULL;
733         r = PyObject_CallFunctionObjArgs(m, x, NULL);
734         Py_DECREF(m);
735         return r;
736     }
737 }
738
739 #define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
740                                                     __Pyx_SetItemInt_Fast(o, i, v) : \
741                                                     __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
742
743 static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
744     int r;
745     if (!j) return -1;
746     r = PyObject_SetItem(o, j, v);
747     Py_DECREF(j);
748     return r;
749 }
750
751 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
752     if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
753         Py_INCREF(v);
754         Py_DECREF(PyList_GET_ITEM(o, i));
755         PyList_SET_ITEM(o, i, v);
756         return 1;
757     }
758     else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0)))
759         return PySequence_SetItem(o, i, v);
760     else {
761         PyObject *j = PyInt_FromSsize_t(i);
762         return __Pyx_SetItemInt_Generic(o, j, v);
763     }
764 }
765
766 #if PY_VERSION_HEX < 0x02050000
767 #ifndef PyAnySet_CheckExact
768
769 #define PyAnySet_CheckExact(ob) \
770     ((ob)->ob_type == &PySet_Type || \
771      (ob)->ob_type == &PyFrozenSet_Type)
772
773 #define PySet_New(iterable) \
774     PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL)
775
776 #define Pyx_PyFrozenSet_New(iterable) \
777     PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL)
778
779 #define PySet_Size(anyset) \
780     PyObject_Size((anyset))
781
782 #define PySet_Contains(anyset, key) \
783     PySequence_Contains((anyset), (key))
784
785 #define PySet_Pop(set) \
786     PyObject_CallMethod(set, (char *)"pop", NULL)
787
788 static CYTHON_INLINE int PySet_Clear(PyObject *set) {
789     PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL);
790     if (!ret) return -1;
791     Py_DECREF(ret); return 0;
792 }
793
794 static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) {
795     PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key);
796     if (!ret) return -1;
797     Py_DECREF(ret); return 0;
798 }
799
800 static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) {
801     PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key);
802     if (!ret) return -1;
803     Py_DECREF(ret); return 0;
804 }
805
806 #endif /* PyAnySet_CheckExact (<= Py2.4) */
807
808 #if PY_VERSION_HEX < 0x02040000
809 #ifndef Py_SETOBJECT_H
810 #define Py_SETOBJECT_H
811
812 static PyTypeObject *__Pyx_PySet_Type = NULL;
813 static PyTypeObject *__Pyx_PyFrozenSet_Type = NULL;
814
815 #define PySet_Type (*__Pyx_PySet_Type)
816 #define PyFrozenSet_Type (*__Pyx_PyFrozenSet_Type)
817
818 #define PyAnySet_Check(ob) \
819     (PyAnySet_CheckExact(ob) || \
820      PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \
821      PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type))
822
823 #define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type)
824
825 static int __Pyx_Py23SetsImport(void) {
826     PyObject *sets=0, *Set=0, *ImmutableSet=0;
827
828     sets = PyImport_ImportModule((char *)"sets");
829     if (!sets) goto bad;
830     Set = PyObject_GetAttrString(sets, (char *)"Set");
831     if (!Set) goto bad;
832     ImmutableSet = PyObject_GetAttrString(sets, (char *)"ImmutableSet");
833     if (!ImmutableSet) goto bad;
834     Py_DECREF(sets);
835
836     __Pyx_PySet_Type       = (PyTypeObject*) Set;
837     __Pyx_PyFrozenSet_Type = (PyTypeObject*) ImmutableSet;
838
839     return 0;
840
841  bad:
842     Py_XDECREF(sets);
843     Py_XDECREF(Set);
844     Py_XDECREF(ImmutableSet);
845     return -1;
846 }
847
848 #else
849 static int __Pyx_Py23SetsImport(void) { return 0; }
850 #endif /* !Py_SETOBJECT_H */
851 #endif /* < Py2.4  */
852 #endif /* < Py2.5  */
853
854 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
855 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
856
857 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
858
859 static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/
860
861 static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
862                                    PyObject *modname); /*proto*/
863
864 #define __pyx_binding_PyCFunctionType_USED 1
865
866 typedef struct {
867     PyCFunctionObject func;
868 } __pyx_binding_PyCFunctionType_object;
869
870 static PyTypeObject __pyx_binding_PyCFunctionType_type;
871 static PyTypeObject *__pyx_binding_PyCFunctionType = NULL;
872
873 static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */
874 #define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL)
875
876 static int __pyx_binding_PyCFunctionType_init(void); /* proto */
877
878 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint32_t(uint32_t);
879
880 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
881
882 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
883
884 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
885
886 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
887
888 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
889
890 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
891
892 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
893
894 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
895
896 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
897
898 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
899
900 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
901
902 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
903
904 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
905
906 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
907
908 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
909
910 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
911
912 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict);  /*proto*/
913
914 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
915
916 static void* __Pyx_GetVtable(PyObject *dict); /*proto*/
917
918 static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
919
920 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
921
922 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
923 /* Module declarations from ctabix */
924
925 static PyTypeObject *__pyx_ptype_6ctabix_Tabixfile = 0;
926 static PyTypeObject *__pyx_ptype_6ctabix_Parser = 0;
927 /* Module declarations from TabProxies */
928
929 static PyTypeObject *__pyx_ptype_10TabProxies_TupleProxy = 0;
930 static PyTypeObject *__pyx_ptype_10TabProxies_GTFProxy = 0;
931 static PyTypeObject *__pyx_ptype_10TabProxies_NamedTupleProxy = 0;
932 static PyTypeObject *__pyx_ptype_10TabProxies_BedProxy = 0;
933 static PyTypeObject *__pyx_ptype_10TabProxies_VCFProxy = 0;
934 /* Module declarations from cvcf */
935
936 static PyTypeObject *__pyx_ptype_4cvcf_VCFRecord = 0;
937 static PyTypeObject *__pyx_ptype_4cvcf_asVCFRecord = 0;
938 #define __Pyx_MODULE_NAME "cvcf"
939 static int __pyx_module_is_main_cvcf = 0;
940
941 /* Implementation of cvcf */
942 static PyObject *__pyx_builtin_object;
943 static PyObject *__pyx_builtin_ValueError;
944 static PyObject *__pyx_builtin_range;
945 static PyObject *__pyx_builtin_enumerate;
946 static PyObject *__pyx_builtin_map;
947 static PyObject *__pyx_builtin_min;
948 static PyObject *__pyx_builtin_len;
949 static PyObject *__pyx_builtin_zip;
950 static PyObject *__pyx_builtin_StopIteration;
951 static PyObject *__pyx_builtin_KeyError;
952 static PyObject *__pyx_builtin_NotImplementedError;
953 static char __pyx_k_1[] = "";
954 static char __pyx_k_2[] = ",";
955 static char __pyx_k_4[] = ":";
956 static char __pyx_k_6[] = "-";
957 static char __pyx_k_8[] = "Don't understand region string '%s'";
958 static char __pyx_k_9[] = ".";
959 static char __pyx_k_11[] = ";";
960 static char __pyx_k_14[] = "=";
961 static char __pyx_k_18[] = "BAD_NUMBER_OF_VALUES";
962 static char __pyx_k_19[] = "(found %s values in element %s; expected %s)";
963 static char __pyx_k_20[] = "BAD_NUMBER_OF_PARAMETERS";
964 static char __pyx_k_21[] = "id=%s, expected %s parameters, got %s";
965 static char __pyx_k_25[] = "Line %s: '%s'\n%s %s: %s\n";
966 static char __pyx_k_27[] = "<";
967 static char __pyx_k_29[] = "V40_MISSING_ANGLE_BRACKETS";
968 static char __pyx_k_30[] = ">";
969 static char __pyx_k_34[] = "\"";
970 static char __pyx_k_38[] = "V40_FORMAT_MUST_HAVE_NAMED_FIELDS";
971 static char __pyx_k_39[] = "BADLY_FORMATTED_FORMAT_STRING";
972 static char __pyx_k_40[] = "ID=";
973 static char __pyx_k_41[] = "Number=";
974 static char __pyx_k_42[] = "Type=";
975 static char __pyx_k_43[] = "Description=";
976 static char __pyx_k_52[] = "FORMAT_MISSING_QUOTES";
977 static char __pyx_k_55[] = "<none>";
978 static char __pyx_k_56[] = "#alleles";
979 static char __pyx_k_57[] = "#nonref_alleles";
980 static char __pyx_k_58[] = "#genotypes";
981 static char __pyx_k_59[] = "#phased_genotypes";
982 static char __pyx_k_61[] = "Unknown number type encountered: %s";
983 static char __pyx_k_62[] = "%s=%s";
984 static char __pyx_k_63[] = "(Undefined tag)";
985 static char __pyx_k_66[] = "(output)";
986 static char __pyx_k_69[] = "Genotype Quality";
987 static char __pyx_k_70[] = "Read depth at this position for this sample";
988 static char __pyx_k_71[] = "Haplotype Quality";
989 static char __pyx_k_72[] = "Sample Genotype Filter";
990 static char __pyx_k_73[] = "##";
991 static char __pyx_k_76[] = "VCFv3.3";
992 static char __pyx_k_77[] = "VCFv4.0";
993 static char __pyx_k_78[] = "VCFv4.1";
994 static char __pyx_k_79[] = "UNKNOWN_FORMAT_STRING";
995 static char __pyx_k_80[] = "##fileformat=VCFv%s.%s\n";
996 static char __pyx_k_81[] = "##%s=%s\n";
997 static char __pyx_k_82[] = "#";
998 static char __pyx_k_85[] = "\t";
999 static char __pyx_k_87[] = "HEADING_NOT_SEPARATED_BY_TABS";
1000 static char __pyx_k_88[] = "(%sth entry not found)";
1001 static char __pyx_k_89[] = "(found %s, expected %s)";
1002 static char __pyx_k_90[] = "BADLY_FORMATTED_HEADING";
1003 static char __pyx_k_91[] = "\n";
1004 static char __pyx_k_92[] = "|";
1005 static char __pyx_k_93[] = "ERROR_FLAG_HAS_VALUE";
1006 static char __pyx_k_97[] = "ERROR_FORMAT_NOT_NUMERICAL";
1007 static char __pyx_k_98[] = "ERROR_FORMAT_NOT_CHAR";
1008 static char __pyx_k__0[] = "0";
1009 static char __pyx_k__D[] = "D";
1010 static char __pyx_k__I[] = "I";
1011 static char __pyx_k__N[] = "N";
1012 static char __pyx_k_101[] = "BAD_NUMBER_OF_COLUMNS";
1013 static char __pyx_k_102[] = "expected %s for %s samples (%s), got %s";
1014 static char __pyx_k_103[] = "(reference is %s, VCF says %s)";
1015 static char __pyx_k_111[] = "V33_UNMATCHED_DELETION";
1016 static char __pyx_k_112[] = "(deletion is %s, reference is %s)";
1017 static char __pyx_k_113[] = "MISSING_INDEL_ALLELE_REF_BASE";
1018 static char __pyx_k_115[] = "Required key %s not found in data";
1019 static char __pyx_k_118[] = "enter_default_format";
1020 static char __pyx_k_119[] = "Can only handle v3.3 and v4.0 VCF files";
1021 static char __pyx_k_121[] = "Invalid error string: %s";
1022 static char __pyx_k_122[] = "needs to be checked";
1023 static char __pyx_k_126[] = "[|/\\\\]";
1024 static char __pyx_k_128[] = "^[ACGTN]+$";
1025 static char __pyx_k_130[] = "id numbertype number type description missingvalue";
1026 static char __pyx_k_132[] = "UNKNOWN_FORMAT_STRING:Unknown file format identifier";
1027 static char __pyx_k_133[] = "BADLY_FORMATTED_FORMAT_STRING:Formatting error in the format string";
1028 static char __pyx_k_134[] = "BADLY_FORMATTED_HEADING:Did not find 9 required headings (CHROM, POS, ..., FORMAT) %s";
1029 static char __pyx_k_135[] = "BAD_NUMBER_OF_COLUMNS:Wrong number of columns found (%s)";
1030 static char __pyx_k_136[] = "POS_NOT_NUMERICAL:Position column is not numerical";
1031 static char __pyx_k_137[] = "UNKNOWN_CHAR_IN_REF:Unknown character in reference field";
1032 static char __pyx_k_138[] = "V33_BAD_REF:Reference should be single-character in v3.3 VCF";
1033 static char __pyx_k_139[] = "V33_BAD_ALLELE:Cannot interpret allele for v3.3 VCF";
1034 static char __pyx_k_140[] = "POS_NOT_POSITIVE:Position field must be >0";
1035 static char __pyx_k_141[] = "QUAL_NOT_NUMERICAL:Quality field must be numerical, or '.'";
1036 static char __pyx_k_142[] = "ERROR_INFO_STRING:Error while parsing info field";
1037 static char __pyx_k_143[] = "ERROR_UNKNOWN_KEY:Unknown key (%s) found in formatted field (info; format; or filter)";
1038 static char __pyx_k_144[] = "ERROR_FORMAT_NOT_NUMERICAL:Expected integer or float in formatted field; got %s";
1039 static char __pyx_k_145[] = "ERROR_FORMAT_NOT_CHAR:Eexpected character in formatted field; got string";
1040 static char __pyx_k_146[] = "FILTER_NOT_DEFINED:Identifier (%s) in filter found which was not defined in header";
1041 static char __pyx_k_147[] = "FORMAT_NOT_DEFINED:Identifier (%s) in format found which was not defined in header";
1042 static char __pyx_k_148[] = "BAD_NUMBER_OF_VALUES:Found too many of values in sample column (%s)";
1043 static char __pyx_k_149[] = "BAD_NUMBER_OF_PARAMETERS:Found unexpected number of parameters (%s)";
1044 static char __pyx_k_150[] = "BAD_GENOTYPE:Cannot parse genotype (%s)";
1045 static char __pyx_k_151[] = "V40_BAD_ALLELE:Bad allele found for v4.0 VCF (%s)";
1046 static char __pyx_k_152[] = "MISSING_REF:Reference allele missing";
1047 static char __pyx_k_153[] = "V33_UNMATCHED_DELETION:Deleted sequence does not match reference (%s)";
1048 static char __pyx_k_154[] = "V40_MISSING_ANGLE_BRACKETS:Format definition is not deliminted by angular brackets";
1049 static char __pyx_k_155[] = "FORMAT_MISSING_QUOTES:Description field in format definition is not surrounded by quotes";
1050 static char __pyx_k_156[] = "V40_FORMAT_MUST_HAVE_NAMED_FIELDS:Fields in v4.0 VCF format definition must have named fields";
1051 static char __pyx_k_157[] = "HEADING_NOT_SEPARATED_BY_TABS:Heading line appears separated by spaces, not tabs";
1052 static char __pyx_k_158[] = "WRONG_REF:Wrong reference %s";
1053 static char __pyx_k_159[] = "ERROR_TRAILING_DATA:Numerical field ('%s') has semicolon-separated trailing data";
1054 static char __pyx_k_160[] = "BAD_CHR_TAG:Error calculating chr tag for %s";
1055 static char __pyx_k_161[] = "ZERO_LENGTH_ALLELE:Found zero-length allele";
1056 static char __pyx_k_162[] = "MISSING_INDEL_ALLELE_REF_BASE:Indel alleles must begin with single reference base";
1057 static char __pyx_k__DP[] = "DP";
1058 static char __pyx_k__FT[] = "FT";
1059 static char __pyx_k__GQ[] = "GQ";
1060 static char __pyx_k__GT[] = "GT";
1061 static char __pyx_k__HQ[] = "HQ";
1062 static char __pyx_k__ID[] = "ID";
1063 static char __pyx_k__fa[] = "fa";
1064 static char __pyx_k__id[] = "id";
1065 static char __pyx_k__re[] = "re";
1066 static char __pyx_k__ALT[] = "ALT";
1067 static char __pyx_k__POS[] = "POS";
1068 static char __pyx_k__REF[] = "REF";
1069 static char __pyx_k__VCF[] = "VCF";
1070 static char __pyx_k__add[] = "add";
1071 static char __pyx_k__alt[] = "alt";
1072 static char __pyx_k__end[] = "end";
1073 static char __pyx_k__fmt[] = "fmt";
1074 static char __pyx_k__get[] = "get";
1075 static char __pyx_k__key[] = "key";
1076 static char __pyx_k__len[] = "len";
1077 static char __pyx_k__map[] = "map";
1078 static char __pyx_k__min[] = "min";
1079 static char __pyx_k__opt[] = "opt";
1080 static char __pyx_k__pos[] = "pos";
1081 static char __pyx_k__ref[] = "ref";
1082 static char __pyx_k__sys[] = "sys";
1083 static char __pyx_k__vcf[] = "vcf";
1084 static char __pyx_k__zip[] = "zip";
1085 static char __pyx_k__Flag[] = "Flag";
1086 static char __pyx_k__INFO[] = "INFO";
1087 static char __pyx_k__PASS[] = "PASS";
1088 static char __pyx_k__QUAL[] = "QUAL";
1089 static char __pyx_k__Type[] = "Type";
1090 static char __pyx_k__alt1[] = "alt1";
1091 static char __pyx_k__alt2[] = "alt2";
1092 static char __pyx_k__copy[] = "copy";
1093 static char __pyx_k__cvcf[] = "cvcf";
1094 static char __pyx_k__data[] = "data";
1095 static char __pyx_k__find[] = "find";
1096 static char __pyx_k__info[] = "info";
1097 static char __pyx_k__join[] = "join";
1098 static char __pyx_k__keys[] = "keys";
1099 static char __pyx_k__line[] = "line";
1100 static char __pyx_k__pos1[] = "pos1";
1101 static char __pyx_k__pos2[] = "pos2";
1102 static char __pyx_k__qual[] = "qual";
1103 static char __pyx_k__ref1[] = "ref1";
1104 static char __pyx_k__ref2[] = "ref2";
1105 static char __pyx_k__self[] = "self";
1106 static char __pyx_k__type[] = "type";
1107 static char __pyx_k__ACGTN[] = "ACGTN";
1108 static char __pyx_k__CHROM[] = "CHROM";
1109 static char __pyx_k__Error[] = "Error";
1110 static char __pyx_k__Float[] = "Float";
1111 static char __pyx_k___copy[] = "_copy";
1112 static char __pyx_k___info[] = "_info";
1113 static char __pyx_k___line[] = "_line";
1114 static char __pyx_k__chrom[] = "chrom";
1115 static char __pyx_k__descr[] = "descr";
1116 static char __pyx_k__error[] = "error";
1117 static char __pyx_k__fetch[] = "fetch";
1118 static char __pyx_k__lines[] = "lines";
1119 static char __pyx_k__match[] = "match";
1120 static char __pyx_k__parse[] = "parse";
1121 static char __pyx_k__pysam[] = "pysam";
1122 static char __pyx_k__range[] = "range";
1123 static char __pyx_k__split[] = "split";
1124 static char __pyx_k__start[] = "start";
1125 static char __pyx_k__strip[] = "strip";
1126 static char __pyx_k__upper[] = "upper";
1127 static char __pyx_k__value[] = "value";
1128 static char __pyx_k__write[] = "write";
1129 static char __pyx_k__FILTER[] = "FILTER";
1130 static char __pyx_k__FORMAT[] = "FORMAT";
1131 static char __pyx_k__GTdata[] = "GTdata";
1132 static char __pyx_k__Number[] = "Number";
1133 static char __pyx_k__String[] = "String";
1134 static char __pyx_k___lines[] = "_lines";
1135 static char __pyx_k___parse[] = "_parse";
1136 static char __pyx_k__append[] = "append";
1137 static char __pyx_k__bisect[] = "bisect";
1138 static char __pyx_k__buffer[] = "buffer";
1139 static char __pyx_k__contig[] = "contig";
1140 static char __pyx_k__fields[] = "fields";
1141 static char __pyx_k__filter[] = "filter";
1142 static char __pyx_k__format[] = "format";
1143 static char __pyx_k__header[] = "header";
1144 static char __pyx_k__number[] = "number";
1145 static char __pyx_k__object[] = "object";
1146 static char __pyx_k__offset[] = "offset";
1147 static char __pyx_k__parser[] = "parser";
1148 static char __pyx_k__record[] = "record";
1149 static char __pyx_k__region[] = "region";
1150 static char __pyx_k__stderr[] = "stderr";
1151 static char __pyx_k__stream[] = "stream";
1152 static char __pyx_k__Integer[] = "Integer";
1153 static char __pyx_k__Warning[] = "Warning";
1154 static char __pyx_k____all__[] = "__all__";
1155 static char __pyx_k___errors[] = "_errors";
1156 static char __pyx_k___filter[] = "_filter";
1157 static char __pyx_k___format[] = "_format";
1158 static char __pyx_k___header[] = "_header";
1159 static char __pyx_k___lineno[] = "_lineno";
1160 static char __pyx_k__compile[] = "compile";
1161 static char __pyx_k__connect[] = "connect";
1162 static char __pyx_k__getinfo[] = "getinfo";
1163 static char __pyx_k__missing[] = "missing";
1164 static char __pyx_k__nfields[] = "nfields";
1165 static char __pyx_k__regions[] = "regions";
1166 static char __pyx_k__replace[] = "replace";
1167 static char __pyx_k__samples[] = "samples";
1168 static char __pyx_k__setinfo[] = "setinfo";
1169 static char __pyx_k__vcffile[] = "vcffile";
1170 static char __pyx_k__version[] = "version";
1171 static char __pyx_k__GTstring[] = "GTstring";
1172 static char __pyx_k__Genotype[] = "Genotype";
1173 static char __pyx_k__KeyError[] = "KeyError";
1174 static char __pyx_k____dict__[] = "__dict__";
1175 static char __pyx_k____init__[] = "__init__";
1176 static char __pyx_k____main__[] = "__main__";
1177 static char __pyx_k____test__[] = "__test__";
1178 static char __pyx_k___regions[] = "_regions";
1179 static char __pyx_k___samples[] = "_samples";
1180 static char __pyx_k___version[] = "_version";
1181 static char __pyx_k__deepcopy[] = "deepcopy";
1182 static char __pyx_k__endswith[] = "endswith";
1183 static char __pyx_k__filename[] = "filename";
1184 static char __pyx_k__gtsRegEx[] = "gtsRegEx";
1185 static char __pyx_k__inregion[] = "inregion";
1186 static char __pyx_k__operator[] = "operator";
1187 static char __pyx_k__validate[] = "validate";
1188 static char __pyx_k__Character[] = "Character";
1189 static char __pyx_k__NT_NUMBER[] = "NT_NUMBER";
1190 static char __pyx_k__Tabixfile[] = "Tabixfile";
1191 static char __pyx_k__VCFRecord[] = "VCFRecord";
1192 static char __pyx_k__WRONG_REF[] = "WRONG_REF";
1193 static char __pyx_k___required[] = "_required";
1194 static char __pyx_k__convertGT[] = "convertGT";
1195 static char __pyx_k__enumerate[] = "enumerate";
1196 static char __pyx_k__getfilter[] = "getfilter";
1197 static char __pyx_k__getformat[] = "getformat";
1198 static char __pyx_k__getheader[] = "getheader";
1199 static char __pyx_k__leftalign[] = "leftalign";
1200 static char __pyx_k__lineparse[] = "lineparse";
1201 static char __pyx_k__reference[] = "reference";
1202 static char __pyx_k__separator[] = "separator";
1203 static char __pyx_k__setfilter[] = "setfilter";
1204 static char __pyx_k__setformat[] = "setformat";
1205 static char __pyx_k__setheader[] = "setheader";
1206 static char __pyx_k__tabixfile[] = "tabixfile";
1207 static char __pyx_k__warnerror[] = "warnerror";
1208 static char __pyx_k__NT_ALLELES[] = "NT_ALLELES";
1209 static char __pyx_k__NT_UNKNOWN[] = "NT_UNKNOWN";
1210 static char __pyx_k__ValueError[] = "ValueError";
1211 static char __pyx_k___leftalign[] = "_leftalign";
1212 static char __pyx_k___reference[] = "_reference";
1213 static char __pyx_k__fileformat[] = "fileformat";
1214 static char __pyx_k__formatdict[] = "formatdict";
1215 static char __pyx_k__getsamples[] = "getsamples";
1216 static char __pyx_k__itemgetter[] = "itemgetter";
1217 static char __pyx_k__itervalues[] = "itervalues";
1218 static char __pyx_k__namedtuple[] = "namedtuple";
1219 static char __pyx_k__numbertype[] = "numbertype";
1220 static char __pyx_k__parse_data[] = "parse_data";
1221 static char __pyx_k__setregions[] = "setregions";
1222 static char __pyx_k__setsamples[] = "setsamples";
1223 static char __pyx_k__setversion[] = "setversion";
1224 static char __pyx_k__startswith[] = "startswith";
1225 static char __pyx_k__write_data[] = "write_data";
1226 static char __pyx_k__Description[] = "Description";
1227 static char __pyx_k__MISSING_REF[] = "MISSING_REF";
1228 static char __pyx_k__V33_BAD_REF[] = "V33_BAD_REF";
1229 static char __pyx_k__alleleRegEx[] = "alleleRegEx";
1230 static char __pyx_k__collections[] = "collections";
1231 static char __pyx_k__defaultdict[] = "defaultdict";
1232 static char __pyx_k__description[] = "description";
1233 static char __pyx_k__errorstring[] = "errorstring";
1234 static char __pyx_k__ignoreerror[] = "ignoreerror";
1235 static char __pyx_k__writeheader[] = "writeheader";
1236 static char __pyx_k__BAD_GENOTYPE[] = "BAD_GENOTYPE";
1237 static char __pyx_k__NT_GENOTYPES[] = "NT_GENOTYPES";
1238 static char __pyx_k___warn_errors[] = "_warn_errors";
1239 static char __pyx_k__get_expected[] = "get_expected";
1240 static char __pyx_k__get_sequence[] = "get_sequence";
1241 static char __pyx_k__missingvalue[] = "missingvalue";
1242 static char __pyx_k__parse_format[] = "parse_format";
1243 static char __pyx_k__parse_header[] = "parse_header";
1244 static char __pyx_k__setreference[] = "setreference";
1245 static char __pyx_k__write_header[] = "write_header";
1246 static char __pyx_k__NT_NR_ALLELES[] = "NT_NR_ALLELES";
1247 static char __pyx_k__StopIteration[] = "StopIteration";
1248 static char __pyx_k___parse_header[] = "_parse_header";
1249 static char __pyx_k__compare_calls[] = "compare_calls";
1250 static char __pyx_k__convertGTback[] = "convertGTback";
1251 static char __pyx_k__datagenerator[] = "datagenerator";
1252 static char __pyx_k__format_format[] = "format_format";
1253 static char __pyx_k__parse_heading[] = "parse_heading";
1254 static char __pyx_k__parse_regions[] = "parse_regions";
1255 static char __pyx_k__write_heading[] = "write_heading";
1256 static char __pyx_k__V33_BAD_ALLELE[] = "V33_BAD_ALLELE";
1257 static char __pyx_k__V40_BAD_ALLELE[] = "V40_BAD_ALLELE";
1258 static char __pyx_k___sample2column[] = "_sample2column";
1259 static char __pyx_k___add_definition[] = "_add_definition";
1260 static char __pyx_k___ignored_errors[] = "_ignored_errors";
1261 static char __pyx_k__POS_NOT_POSITIVE[] = "POS_NOT_POSITIVE";
1262 static char __pyx_k__parse_formatdata[] = "parse_formatdata";
1263 static char __pyx_k__ERROR_INFO_STRING[] = "ERROR_INFO_STRING";
1264 static char __pyx_k__ERROR_UNKNOWN_KEY[] = "ERROR_UNKNOWN_KEY";
1265 static char __pyx_k__POS_NOT_NUMERICAL[] = "POS_NOT_NUMERICAL";
1266 static char __pyx_k__format_formatdata[] = "format_formatdata";
1267 static char __pyx_k__FILTER_NOT_DEFINED[] = "FILTER_NOT_DEFINED";
1268 static char __pyx_k__FORMAT_NOT_DEFINED[] = "FORMAT_NOT_DEFINED";
1269 static char __pyx_k__QUAL_NOT_NUMERICAL[] = "QUAL_NOT_NUMERICAL";
1270 static char __pyx_k__ZERO_LENGTH_ALLELE[] = "ZERO_LENGTH_ALLELE";
1271 static char __pyx_k__ERROR_TRAILING_DATA[] = "ERROR_TRAILING_DATA";
1272 static char __pyx_k__NT_PHASED_GENOTYPES[] = "NT_PHASED_GENOTYPES";
1273 static char __pyx_k__NotImplementedError[] = "NotImplementedError";
1274 static char __pyx_k__UNKNOWN_CHAR_IN_REF[] = "UNKNOWN_CHAR_IN_REF";
1275 static PyObject *__pyx_kp_s_1;
1276 static PyObject *__pyx_n_s_101;
1277 static PyObject *__pyx_kp_s_102;
1278 static PyObject *__pyx_kp_s_103;
1279 static PyObject *__pyx_kp_s_11;
1280 static PyObject *__pyx_n_s_111;
1281 static PyObject *__pyx_kp_s_112;
1282 static PyObject *__pyx_n_s_113;
1283 static PyObject *__pyx_kp_s_115;
1284 static PyObject *__pyx_n_s_118;
1285 static PyObject *__pyx_kp_s_119;
1286 static PyObject *__pyx_kp_s_121;
1287 static PyObject *__pyx_kp_s_122;
1288 static PyObject *__pyx_kp_s_126;
1289 static PyObject *__pyx_kp_s_128;
1290 static PyObject *__pyx_kp_s_130;
1291 static PyObject *__pyx_kp_s_132;
1292 static PyObject *__pyx_kp_s_133;
1293 static PyObject *__pyx_kp_s_134;
1294 static PyObject *__pyx_kp_s_135;
1295 static PyObject *__pyx_kp_s_136;
1296 static PyObject *__pyx_kp_s_137;
1297 static PyObject *__pyx_kp_s_138;
1298 static PyObject *__pyx_kp_s_139;
1299 static PyObject *__pyx_kp_s_14;
1300 static PyObject *__pyx_kp_s_140;
1301 static PyObject *__pyx_kp_s_141;
1302 static PyObject *__pyx_kp_s_142;
1303 static PyObject *__pyx_kp_s_143;
1304 static PyObject *__pyx_kp_s_144;
1305 static PyObject *__pyx_kp_s_145;
1306 static PyObject *__pyx_kp_s_146;
1307 static PyObject *__pyx_kp_s_147;
1308 static PyObject *__pyx_kp_s_148;
1309 static PyObject *__pyx_kp_s_149;
1310 static PyObject *__pyx_kp_s_150;
1311 static PyObject *__pyx_kp_s_151;
1312 static PyObject *__pyx_kp_s_152;
1313 static PyObject *__pyx_kp_s_153;
1314 static PyObject *__pyx_kp_s_154;
1315 static PyObject *__pyx_kp_s_155;
1316 static PyObject *__pyx_kp_s_156;
1317 static PyObject *__pyx_kp_s_157;
1318 static PyObject *__pyx_kp_s_158;
1319 static PyObject *__pyx_kp_s_159;
1320 static PyObject *__pyx_kp_s_160;
1321 static PyObject *__pyx_kp_s_161;
1322 static PyObject *__pyx_kp_s_162;
1323 static PyObject *__pyx_n_s_18;
1324 static PyObject *__pyx_kp_s_19;
1325 static PyObject *__pyx_kp_s_2;
1326 static PyObject *__pyx_n_s_20;
1327 static PyObject *__pyx_kp_s_21;
1328 static PyObject *__pyx_kp_s_25;
1329 static PyObject *__pyx_kp_s_27;
1330 static PyObject *__pyx_n_s_29;
1331 static PyObject *__pyx_kp_s_30;
1332 static PyObject *__pyx_kp_s_34;
1333 static PyObject *__pyx_n_s_38;
1334 static PyObject *__pyx_n_s_39;
1335 static PyObject *__pyx_kp_s_4;
1336 static PyObject *__pyx_kp_s_40;
1337 static PyObject *__pyx_kp_s_41;
1338 static PyObject *__pyx_kp_s_42;
1339 static PyObject *__pyx_kp_s_43;
1340 static PyObject *__pyx_n_s_52;
1341 static PyObject *__pyx_kp_s_55;
1342 static PyObject *__pyx_kp_s_56;
1343 static PyObject *__pyx_kp_s_57;
1344 static PyObject *__pyx_kp_s_58;
1345 static PyObject *__pyx_kp_s_59;
1346 static PyObject *__pyx_kp_s_6;
1347 static PyObject *__pyx_kp_s_61;
1348 static PyObject *__pyx_kp_s_62;
1349 static PyObject *__pyx_kp_s_63;
1350 static PyObject *__pyx_kp_s_66;
1351 static PyObject *__pyx_kp_s_69;
1352 static PyObject *__pyx_kp_s_70;
1353 static PyObject *__pyx_kp_s_71;
1354 static PyObject *__pyx_kp_s_72;
1355 static PyObject *__pyx_kp_s_73;
1356 static PyObject *__pyx_kp_s_76;
1357 static PyObject *__pyx_kp_s_77;
1358 static PyObject *__pyx_kp_s_78;
1359 static PyObject *__pyx_n_s_79;
1360 static PyObject *__pyx_kp_s_8;
1361 static PyObject *__pyx_kp_s_80;
1362 static PyObject *__pyx_kp_s_81;
1363 static PyObject *__pyx_kp_s_82;
1364 static PyObject *__pyx_kp_s_85;
1365 static PyObject *__pyx_n_s_87;
1366 static PyObject *__pyx_kp_s_88;
1367 static PyObject *__pyx_kp_s_89;
1368 static PyObject *__pyx_kp_b_9;
1369 static PyObject *__pyx_kp_s_9;
1370 static PyObject *__pyx_n_s_90;
1371 static PyObject *__pyx_kp_s_91;
1372 static PyObject *__pyx_kp_s_92;
1373 static PyObject *__pyx_n_s_93;
1374 static PyObject *__pyx_n_s_97;
1375 static PyObject *__pyx_n_s_98;
1376 static PyObject *__pyx_kp_b__0;
1377 static PyObject *__pyx_kp_s__0;
1378 static PyObject *__pyx_n_s__ACGTN;
1379 static PyObject *__pyx_n_s__ALT;
1380 static PyObject *__pyx_n_s__BAD_GENOTYPE;
1381 static PyObject *__pyx_n_s__CHROM;
1382 static PyObject *__pyx_n_s__Character;
1383 static PyObject *__pyx_n_s__D;
1384 static PyObject *__pyx_n_s__DP;
1385 static PyObject *__pyx_n_s__Description;
1386 static PyObject *__pyx_n_s__ERROR_INFO_STRING;
1387 static PyObject *__pyx_n_s__ERROR_TRAILING_DATA;
1388 static PyObject *__pyx_n_s__ERROR_UNKNOWN_KEY;
1389 static PyObject *__pyx_n_s__Error;
1390 static PyObject *__pyx_n_s__FILTER;
1391 static PyObject *__pyx_n_s__FILTER_NOT_DEFINED;
1392 static PyObject *__pyx_n_s__FORMAT;
1393 static PyObject *__pyx_n_s__FORMAT_NOT_DEFINED;
1394 static PyObject *__pyx_n_s__FT;
1395 static PyObject *__pyx_n_s__Flag;
1396 static PyObject *__pyx_n_s__Float;
1397 static PyObject *__pyx_n_s__GQ;
1398 static PyObject *__pyx_n_s__GT;
1399 static PyObject *__pyx_n_s__GTdata;
1400 static PyObject *__pyx_n_s__GTstring;
1401 static PyObject *__pyx_n_s__Genotype;
1402 static PyObject *__pyx_n_s__HQ;
1403 static PyObject *__pyx_n_s__I;
1404 static PyObject *__pyx_n_s__ID;
1405 static PyObject *__pyx_n_s__INFO;
1406 static PyObject *__pyx_n_s__Integer;
1407 static PyObject *__pyx_n_s__KeyError;
1408 static PyObject *__pyx_n_s__MISSING_REF;
1409 static PyObject *__pyx_n_s__N;
1410 static PyObject *__pyx_n_s__NT_ALLELES;
1411 static PyObject *__pyx_n_s__NT_GENOTYPES;
1412 static PyObject *__pyx_n_s__NT_NR_ALLELES;
1413 static PyObject *__pyx_n_s__NT_NUMBER;
1414 static PyObject *__pyx_n_s__NT_PHASED_GENOTYPES;
1415 static PyObject *__pyx_n_s__NT_UNKNOWN;
1416 static PyObject *__pyx_n_s__NotImplementedError;
1417 static PyObject *__pyx_n_s__Number;
1418 static PyObject *__pyx_n_b__PASS;
1419 static PyObject *__pyx_n_s__PASS;
1420 static PyObject *__pyx_n_s__POS;
1421 static PyObject *__pyx_n_s__POS_NOT_NUMERICAL;
1422 static PyObject *__pyx_n_s__POS_NOT_POSITIVE;
1423 static PyObject *__pyx_n_s__QUAL;
1424 static PyObject *__pyx_n_s__QUAL_NOT_NUMERICAL;
1425 static PyObject *__pyx_n_s__REF;
1426 static PyObject *__pyx_n_s__StopIteration;
1427 static PyObject *__pyx_n_s__String;
1428 static PyObject *__pyx_n_s__Tabixfile;
1429 static PyObject *__pyx_n_s__Type;
1430 static PyObject *__pyx_n_s__UNKNOWN_CHAR_IN_REF;
1431 static PyObject *__pyx_n_s__V33_BAD_ALLELE;
1432 static PyObject *__pyx_n_s__V33_BAD_REF;
1433 static PyObject *__pyx_n_s__V40_BAD_ALLELE;
1434 static PyObject *__pyx_n_s__VCF;
1435 static PyObject *__pyx_n_s__VCFRecord;
1436 static PyObject *__pyx_n_s__ValueError;
1437 static PyObject *__pyx_n_s__WRONG_REF;
1438 static PyObject *__pyx_n_s__Warning;
1439 static PyObject *__pyx_n_s__ZERO_LENGTH_ALLELE;
1440 static PyObject *__pyx_n_s____all__;
1441 static PyObject *__pyx_n_s____dict__;
1442 static PyObject *__pyx_n_s____init__;
1443 static PyObject *__pyx_n_s____main__;
1444 static PyObject *__pyx_n_s____test__;
1445 static PyObject *__pyx_n_s___add_definition;
1446 static PyObject *__pyx_n_s___copy;
1447 static PyObject *__pyx_n_s___errors;
1448 static PyObject *__pyx_n_s___filter;
1449 static PyObject *__pyx_n_s___format;
1450 static PyObject *__pyx_n_s___header;
1451 static PyObject *__pyx_n_s___ignored_errors;
1452 static PyObject *__pyx_n_s___info;
1453 static PyObject *__pyx_n_s___leftalign;
1454 static PyObject *__pyx_n_s___line;
1455 static PyObject *__pyx_n_s___lineno;
1456 static PyObject *__pyx_n_s___lines;
1457 static PyObject *__pyx_n_s___parse;
1458 static PyObject *__pyx_n_s___parse_header;
1459 static PyObject *__pyx_n_s___reference;
1460 static PyObject *__pyx_n_s___regions;
1461 static PyObject *__pyx_n_s___required;
1462 static PyObject *__pyx_n_s___sample2column;
1463 static PyObject *__pyx_n_s___samples;
1464 static PyObject *__pyx_n_s___version;
1465 static PyObject *__pyx_n_s___warn_errors;
1466 static PyObject *__pyx_n_s__add;
1467 static PyObject *__pyx_n_s__alleleRegEx;
1468 static PyObject *__pyx_n_s__alt;
1469 static PyObject *__pyx_n_s__alt1;
1470 static PyObject *__pyx_n_s__alt2;
1471 static PyObject *__pyx_n_s__append;
1472 static PyObject *__pyx_n_s__bisect;
1473 static PyObject *__pyx_n_s__buffer;
1474 static PyObject *__pyx_n_s__chrom;
1475 static PyObject *__pyx_n_s__collections;
1476 static PyObject *__pyx_n_s__compare_calls;
1477 static PyObject *__pyx_n_s__compile;
1478 static PyObject *__pyx_n_s__connect;
1479 static PyObject *__pyx_n_s__contig;
1480 static PyObject *__pyx_n_s__convertGT;
1481 static PyObject *__pyx_n_s__convertGTback;
1482 static PyObject *__pyx_n_s__copy;
1483 static PyObject *__pyx_n_s__cvcf;
1484 static PyObject *__pyx_n_s__data;
1485 static PyObject *__pyx_n_s__datagenerator;
1486 static PyObject *__pyx_n_s__deepcopy;
1487 static PyObject *__pyx_n_s__defaultdict;
1488 static PyObject *__pyx_n_s__descr;
1489 static PyObject *__pyx_n_s__description;
1490 static PyObject *__pyx_n_s__end;
1491 static PyObject *__pyx_n_s__endswith;
1492 static PyObject *__pyx_n_s__enumerate;
1493 static PyObject *__pyx_n_s__error;
1494 static PyObject *__pyx_n_s__errorstring;
1495 static PyObject *__pyx_n_s__fa;
1496 static PyObject *__pyx_n_s__fetch;
1497 static PyObject *__pyx_n_s__fields;
1498 static PyObject *__pyx_n_s__fileformat;
1499 static PyObject *__pyx_n_s__filename;
1500 static PyObject *__pyx_n_s__filter;
1501 static PyObject *__pyx_n_s__find;
1502 static PyObject *__pyx_n_s__fmt;
1503 static PyObject *__pyx_n_s__format;
1504 static PyObject *__pyx_n_s__format_format;
1505 static PyObject *__pyx_n_s__format_formatdata;
1506 static PyObject *__pyx_n_s__formatdict;
1507 static PyObject *__pyx_n_s__get;
1508 static PyObject *__pyx_n_s__get_expected;
1509 static PyObject *__pyx_n_s__get_sequence;
1510 static PyObject *__pyx_n_s__getfilter;
1511 static PyObject *__pyx_n_s__getformat;
1512 static PyObject *__pyx_n_s__getheader;
1513 static PyObject *__pyx_n_s__getinfo;
1514 static PyObject *__pyx_n_s__getsamples;
1515 static PyObject *__pyx_n_s__gtsRegEx;
1516 static PyObject *__pyx_n_s__header;
1517 static PyObject *__pyx_n_s__id;
1518 static PyObject *__pyx_n_s__ignoreerror;
1519 static PyObject *__pyx_n_s__info;
1520 static PyObject *__pyx_n_s__inregion;
1521 static PyObject *__pyx_n_s__itemgetter;
1522 static PyObject *__pyx_n_s__itervalues;
1523 static PyObject *__pyx_n_s__join;
1524 static PyObject *__pyx_n_s__key;
1525 static PyObject *__pyx_n_s__keys;
1526 static PyObject *__pyx_n_s__leftalign;
1527 static PyObject *__pyx_n_s__len;
1528 static PyObject *__pyx_n_s__line;
1529 static PyObject *__pyx_n_s__lineparse;
1530 static PyObject *__pyx_n_s__lines;
1531 static PyObject *__pyx_n_s__map;
1532 static PyObject *__pyx_n_s__match;
1533 static PyObject *__pyx_n_s__min;
1534 static PyObject *__pyx_n_s__missing;
1535 static PyObject *__pyx_n_s__missingvalue;
1536 static PyObject *__pyx_n_s__namedtuple;
1537 static PyObject *__pyx_n_s__nfields;
1538 static PyObject *__pyx_n_s__number;
1539 static PyObject *__pyx_n_s__numbertype;
1540 static PyObject *__pyx_n_s__object;
1541 static PyObject *__pyx_n_s__offset;
1542 static PyObject *__pyx_n_s__operator;
1543 static PyObject *__pyx_n_s__opt;
1544 static PyObject *__pyx_n_s__parse;
1545 static PyObject *__pyx_n_s__parse_data;
1546 static PyObject *__pyx_n_s__parse_format;
1547 static PyObject *__pyx_n_s__parse_formatdata;
1548 static PyObject *__pyx_n_s__parse_header;
1549 static PyObject *__pyx_n_s__parse_heading;
1550 static PyObject *__pyx_n_s__parse_regions;
1551 static PyObject *__pyx_n_s__parser;
1552 static PyObject *__pyx_n_s__pos;
1553 static PyObject *__pyx_n_s__pos1;
1554 static PyObject *__pyx_n_s__pos2;
1555 static PyObject *__pyx_n_s__pysam;
1556 static PyObject *__pyx_n_s__qual;
1557 static PyObject *__pyx_n_s__range;
1558 static PyObject *__pyx_n_s__re;
1559 static PyObject *__pyx_n_s__record;
1560 static PyObject *__pyx_n_s__ref;
1561 static PyObject *__pyx_n_s__ref1;
1562 static PyObject *__pyx_n_s__ref2;
1563 static PyObject *__pyx_n_s__reference;
1564 static PyObject *__pyx_n_s__region;
1565 static PyObject *__pyx_n_s__regions;
1566 static PyObject *__pyx_n_s__replace;
1567 static PyObject *__pyx_n_s__samples;
1568 static PyObject *__pyx_n_s__self;
1569 static PyObject *__pyx_n_s__separator;
1570 static PyObject *__pyx_n_s__setfilter;
1571 static PyObject *__pyx_n_s__setformat;
1572 static PyObject *__pyx_n_s__setheader;
1573 static PyObject *__pyx_n_s__setinfo;
1574 static PyObject *__pyx_n_s__setreference;
1575 static PyObject *__pyx_n_s__setregions;
1576 static PyObject *__pyx_n_s__setsamples;
1577 static PyObject *__pyx_n_s__setversion;
1578 static PyObject *__pyx_n_s__split;
1579 static PyObject *__pyx_n_s__start;
1580 static PyObject *__pyx_n_s__startswith;
1581 static PyObject *__pyx_n_s__stderr;
1582 static PyObject *__pyx_n_s__stream;
1583 static PyObject *__pyx_n_s__strip;
1584 static PyObject *__pyx_n_s__sys;
1585 static PyObject *__pyx_n_s__tabixfile;
1586 static PyObject *__pyx_n_s__type;
1587 static PyObject *__pyx_n_s__upper;
1588 static PyObject *__pyx_n_s__validate;
1589 static PyObject *__pyx_n_s__value;
1590 static PyObject *__pyx_n_s__vcf;
1591 static PyObject *__pyx_n_s__vcffile;
1592 static PyObject *__pyx_n_s__version;
1593 static PyObject *__pyx_n_s__warnerror;
1594 static PyObject *__pyx_n_s__write;
1595 static PyObject *__pyx_n_s__write_data;
1596 static PyObject *__pyx_n_s__write_header;
1597 static PyObject *__pyx_n_s__write_heading;
1598 static PyObject *__pyx_n_s__writeheader;
1599 static PyObject *__pyx_n_s__zip;
1600 static PyObject *__pyx_int_0;
1601 static PyObject *__pyx_int_1;
1602 static PyObject *__pyx_int_2;
1603 static PyObject *__pyx_int_3;
1604 static PyObject *__pyx_int_4;
1605 static PyObject *__pyx_int_5;
1606 static PyObject *__pyx_int_6;
1607 static PyObject *__pyx_int_7;
1608 static PyObject *__pyx_int_8;
1609 static PyObject *__pyx_int_9;
1610 static PyObject *__pyx_int_neg_1;
1611 static PyObject *__pyx_int_10;
1612 static PyObject *__pyx_int_11;
1613 static PyObject *__pyx_int_12;
1614 static PyObject *__pyx_int_13;
1615 static PyObject *__pyx_int_14;
1616 static PyObject *__pyx_int_15;
1617 static PyObject *__pyx_int_16;
1618 static PyObject *__pyx_int_17;
1619 static PyObject *__pyx_int_18;
1620 static PyObject *__pyx_int_19;
1621 static PyObject *__pyx_int_20;
1622 static PyObject *__pyx_int_21;
1623 static PyObject *__pyx_int_22;
1624 static PyObject *__pyx_int_23;
1625 static PyObject *__pyx_int_24;
1626 static PyObject *__pyx_int_25;
1627 static PyObject *__pyx_int_26;
1628 static PyObject *__pyx_int_27;
1629 static PyObject *__pyx_int_28;
1630 static PyObject *__pyx_int_29;
1631 static PyObject *__pyx_int_30;
1632 static PyObject *__pyx_int_33;
1633 static PyObject *__pyx_int_40;
1634 static PyObject *__pyx_int_100;
1635 static PyObject *__pyx_int_3000000000;
1636 static PyObject *__pyx_k_22;
1637 static PyObject *__pyx_k_26;
1638 static PyObject *__pyx_k_60;
1639 static PyObject *__pyx_k_64;
1640 static PyObject *__pyx_k_65;
1641 static PyObject *__pyx_k_99;
1642 static PyObject *__pyx_k_tuple_3;
1643 static PyObject *__pyx_k_tuple_5;
1644 static PyObject *__pyx_k_tuple_7;
1645 static PyObject *__pyx_k_tuple_10;
1646 static PyObject *__pyx_k_tuple_12;
1647 static PyObject *__pyx_k_tuple_13;
1648 static PyObject *__pyx_k_tuple_15;
1649 static PyObject *__pyx_k_tuple_16;
1650 static PyObject *__pyx_k_tuple_17;
1651 static PyObject *__pyx_k_tuple_23;
1652 static PyObject *__pyx_k_tuple_24;
1653 static PyObject *__pyx_k_tuple_28;
1654 static PyObject *__pyx_k_tuple_31;
1655 static PyObject *__pyx_k_tuple_32;
1656 static PyObject *__pyx_k_tuple_33;
1657 static PyObject *__pyx_k_tuple_35;
1658 static PyObject *__pyx_k_tuple_36;
1659 static PyObject *__pyx_k_tuple_37;
1660 static PyObject *__pyx_k_tuple_44;
1661 static PyObject *__pyx_k_tuple_45;
1662 static PyObject *__pyx_k_tuple_46;
1663 static PyObject *__pyx_k_tuple_47;
1664 static PyObject *__pyx_k_tuple_48;
1665 static PyObject *__pyx_k_tuple_49;
1666 static PyObject *__pyx_k_tuple_50;
1667 static PyObject *__pyx_k_tuple_51;
1668 static PyObject *__pyx_k_tuple_53;
1669 static PyObject *__pyx_k_tuple_54;
1670 static PyObject *__pyx_k_tuple_67;
1671 static PyObject *__pyx_k_tuple_68;
1672 static PyObject *__pyx_k_tuple_74;
1673 static PyObject *__pyx_k_tuple_75;
1674 static PyObject *__pyx_k_tuple_83;
1675 static PyObject *__pyx_k_tuple_84;
1676 static PyObject *__pyx_k_tuple_86;
1677 static PyObject *__pyx_k_tuple_94;
1678 static PyObject *__pyx_k_tuple_95;
1679 static PyObject *__pyx_k_tuple_96;
1680 static PyObject *__pyx_k_tuple_100;
1681 static PyObject *__pyx_k_tuple_104;
1682 static PyObject *__pyx_k_tuple_105;
1683 static PyObject *__pyx_k_tuple_106;
1684 static PyObject *__pyx_k_tuple_107;
1685 static PyObject *__pyx_k_tuple_108;
1686 static PyObject *__pyx_k_tuple_109;
1687 static PyObject *__pyx_k_tuple_110;
1688 static PyObject *__pyx_k_tuple_114;
1689 static PyObject *__pyx_k_tuple_116;
1690 static PyObject *__pyx_k_tuple_117;
1691 static PyObject *__pyx_k_tuple_120;
1692 static PyObject *__pyx_k_tuple_123;
1693 static PyObject *__pyx_k_tuple_124;
1694 static PyObject *__pyx_k_tuple_125;
1695 static PyObject *__pyx_k_tuple_127;
1696 static PyObject *__pyx_k_tuple_129;
1697 static PyObject *__pyx_k_tuple_131;
1698
1699 /* "cvcf.pyx":58
1700  * 
1701  * # Utility function.  Uses 0-based coordinates
1702  * def get_sequence(chrom, start, end, fa):             # <<<<<<<<<<<<<<
1703  *     # obtain sequence from .fa file, without truncation
1704  *     if end<=start: return ""
1705  */
1706
1707 static PyObject *__pyx_pf_4cvcf_get_sequence(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1708 static PyMethodDef __pyx_mdef_4cvcf_get_sequence = {__Pyx_NAMESTR("get_sequence"), (PyCFunction)__pyx_pf_4cvcf_get_sequence, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
1709 static PyObject *__pyx_pf_4cvcf_get_sequence(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1710   PyObject *__pyx_v_chrom = 0;
1711   PyObject *__pyx_v_start = 0;
1712   PyObject *__pyx_v_end = 0;
1713   PyObject *__pyx_v_fa = 0;
1714   PyObject *__pyx_v_sequence;
1715   PyObject *__pyx_r = NULL;
1716   PyObject *__pyx_t_1 = NULL;
1717   int __pyx_t_2;
1718   int __pyx_t_3;
1719   PyObject *__pyx_t_4 = NULL;
1720   PyObject *__pyx_t_5 = NULL;
1721   PyObject *__pyx_t_6 = NULL;
1722   Py_ssize_t __pyx_t_7;
1723   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__chrom,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__fa,0};
1724   __Pyx_RefNannySetupContext("get_sequence");
1725   __pyx_self = __pyx_self;
1726   if (unlikely(__pyx_kwds)) {
1727     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
1728     PyObject* values[4] = {0,0,0,0};
1729     switch (PyTuple_GET_SIZE(__pyx_args)) {
1730       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1731       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1732       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1733       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1734       case  0: break;
1735       default: goto __pyx_L5_argtuple_error;
1736     }
1737     switch (PyTuple_GET_SIZE(__pyx_args)) {
1738       case  0:
1739       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom);
1740       if (likely(values[0])) kw_args--;
1741       else goto __pyx_L5_argtuple_error;
1742       case  1:
1743       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
1744       if (likely(values[1])) kw_args--;
1745       else {
1746         __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1747       }
1748       case  2:
1749       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
1750       if (likely(values[2])) kw_args--;
1751       else {
1752         __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1753       }
1754       case  3:
1755       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fa);
1756       if (likely(values[3])) kw_args--;
1757       else {
1758         __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1759       }
1760     }
1761     if (unlikely(kw_args > 0)) {
1762       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_sequence") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1763     }
1764     __pyx_v_chrom = values[0];
1765     __pyx_v_start = values[1];
1766     __pyx_v_end = values[2];
1767     __pyx_v_fa = values[3];
1768   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
1769     goto __pyx_L5_argtuple_error;
1770   } else {
1771     __pyx_v_chrom = PyTuple_GET_ITEM(__pyx_args, 0);
1772     __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
1773     __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 2);
1774     __pyx_v_fa = PyTuple_GET_ITEM(__pyx_args, 3);
1775   }
1776   goto __pyx_L4_argument_unpacking_done;
1777   __pyx_L5_argtuple_error:;
1778   __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1779   __pyx_L3_error:;
1780   __Pyx_AddTraceback("cvcf.get_sequence");
1781   __Pyx_RefNannyFinishContext();
1782   return NULL;
1783   __pyx_L4_argument_unpacking_done:;
1784   __pyx_v_sequence = Py_None; __Pyx_INCREF(Py_None);
1785
1786   /* "cvcf.pyx":60
1787  * def get_sequence(chrom, start, end, fa):
1788  *     # obtain sequence from .fa file, without truncation
1789  *     if end<=start: return ""             # <<<<<<<<<<<<<<
1790  *     if not fa: return "N"*(end-start)
1791  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
1792  */
1793   __pyx_t_1 = PyObject_RichCompare(__pyx_v_end, __pyx_v_start, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1794   __Pyx_GOTREF(__pyx_t_1);
1795   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1796   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1797   if (__pyx_t_2) {
1798     __Pyx_XDECREF(__pyx_r);
1799     __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
1800     __pyx_r = ((PyObject *)__pyx_kp_s_1);
1801     goto __pyx_L0;
1802     goto __pyx_L6;
1803   }
1804   __pyx_L6:;
1805
1806   /* "cvcf.pyx":61
1807  *     # obtain sequence from .fa file, without truncation
1808  *     if end<=start: return ""
1809  *     if not fa: return "N"*(end-start)             # <<<<<<<<<<<<<<
1810  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
1811  *     sequence = fa.fetch(chrom, start, end).upper()
1812  */
1813   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fa); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1814   __pyx_t_3 = (!__pyx_t_2);
1815   if (__pyx_t_3) {
1816     __Pyx_XDECREF(__pyx_r);
1817     __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1818     __Pyx_GOTREF(__pyx_t_1);
1819     __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_n_s__N), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1820     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
1821     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1822     __pyx_r = ((PyObject *)__pyx_t_4);
1823     __pyx_t_4 = 0;
1824     goto __pyx_L0;
1825     goto __pyx_L7;
1826   }
1827   __pyx_L7:;
1828
1829   /* "cvcf.pyx":62
1830  *     if end<=start: return ""
1831  *     if not fa: return "N"*(end-start)
1832  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()             # <<<<<<<<<<<<<<
1833  *     sequence = fa.fetch(chrom, start, end).upper()
1834  *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))
1835  */
1836   __pyx_t_4 = PyObject_RichCompare(__pyx_v_start, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1837   __Pyx_GOTREF(__pyx_t_4);
1838   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1839   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1840   if (__pyx_t_3) {
1841     __Pyx_XDECREF(__pyx_r);
1842     __pyx_t_4 = PyNumber_Negative(__pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1843     __Pyx_GOTREF(__pyx_t_4);
1844     __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_n_s__N), __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1845     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
1846     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1847     __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1848     __Pyx_GOTREF(__pyx_t_4);
1849     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1850     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
1851     __Pyx_INCREF(__pyx_v_chrom);
1852     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
1853     __Pyx_GIVEREF(__pyx_v_chrom);
1854     __Pyx_INCREF(__pyx_int_0);
1855     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
1856     __Pyx_GIVEREF(__pyx_int_0);
1857     __Pyx_INCREF(__pyx_v_end);
1858     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_end);
1859     __Pyx_GIVEREF(__pyx_v_end);
1860     __Pyx_INCREF(__pyx_v_fa);
1861     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_fa);
1862     __Pyx_GIVEREF(__pyx_v_fa);
1863     __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1864     __Pyx_GOTREF(__pyx_t_6);
1865     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1866     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
1867     __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__upper); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1868     __Pyx_GOTREF(__pyx_t_5);
1869     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1870     __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1871     __Pyx_GOTREF(__pyx_t_6);
1872     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1873     __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_1), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1874     __Pyx_GOTREF(__pyx_t_5);
1875     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
1876     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1877     __pyx_r = __pyx_t_5;
1878     __pyx_t_5 = 0;
1879     goto __pyx_L0;
1880     goto __pyx_L8;
1881   }
1882   __pyx_L8:;
1883
1884   /* "cvcf.pyx":63
1885  *     if not fa: return "N"*(end-start)
1886  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
1887  *     sequence = fa.fetch(chrom, start, end).upper()             # <<<<<<<<<<<<<<
1888  *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))
1889  *     return sequence
1890  */
1891   __pyx_t_5 = PyObject_GetAttr(__pyx_v_fa, __pyx_n_s__fetch); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1892   __Pyx_GOTREF(__pyx_t_5);
1893   __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1894   __Pyx_GOTREF(((PyObject *)__pyx_t_6));
1895   __Pyx_INCREF(__pyx_v_chrom);
1896   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_chrom);
1897   __Pyx_GIVEREF(__pyx_v_chrom);
1898   __Pyx_INCREF(__pyx_v_start);
1899   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_start);
1900   __Pyx_GIVEREF(__pyx_v_start);
1901   __Pyx_INCREF(__pyx_v_end);
1902   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_end);
1903   __Pyx_GIVEREF(__pyx_v_end);
1904   __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1905   __Pyx_GOTREF(__pyx_t_1);
1906   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1907   __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
1908   __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__upper); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1909   __Pyx_GOTREF(__pyx_t_6);
1910   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1911   __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1912   __Pyx_GOTREF(__pyx_t_1);
1913   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1914   __Pyx_DECREF(__pyx_v_sequence);
1915   __pyx_v_sequence = __pyx_t_1;
1916   __pyx_t_1 = 0;
1917
1918   /* "cvcf.pyx":64
1919  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
1920  *     sequence = fa.fetch(chrom, start, end).upper()
1921  *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))             # <<<<<<<<<<<<<<
1922  *     return sequence
1923  * 
1924  */
1925   __pyx_t_7 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1926   __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1927   __Pyx_GOTREF(__pyx_t_1);
1928   __pyx_t_6 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1929   __Pyx_GOTREF(__pyx_t_6);
1930   __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1931   __Pyx_GOTREF(__pyx_t_5);
1932   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1933   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1934   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1935   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1936   if (__pyx_t_3) {
1937     __pyx_t_5 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1938     __Pyx_GOTREF(__pyx_t_5);
1939     __pyx_t_7 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1940     __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1941     __Pyx_GOTREF(__pyx_t_6);
1942     __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1943     __Pyx_GOTREF(__pyx_t_1);
1944     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1945     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1946     __pyx_t_6 = PyNumber_Multiply(((PyObject *)__pyx_n_s__N), __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1947     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
1948     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1949     __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sequence, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1950     __Pyx_GOTREF(__pyx_t_1);
1951     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
1952     __Pyx_DECREF(__pyx_v_sequence);
1953     __pyx_v_sequence = __pyx_t_1;
1954     __pyx_t_1 = 0;
1955     goto __pyx_L9;
1956   }
1957   __pyx_L9:;
1958
1959   /* "cvcf.pyx":65
1960  *     sequence = fa.fetch(chrom, start, end).upper()
1961  *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))
1962  *     return sequence             # <<<<<<<<<<<<<<
1963  * 
1964  * # Utility function.  Parses a region string
1965  */
1966   __Pyx_XDECREF(__pyx_r);
1967   __Pyx_INCREF(__pyx_v_sequence);
1968   __pyx_r = __pyx_v_sequence;
1969   goto __pyx_L0;
1970
1971   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1972   goto __pyx_L0;
1973   __pyx_L1_error:;
1974   __Pyx_XDECREF(__pyx_t_1);
1975   __Pyx_XDECREF(__pyx_t_4);
1976   __Pyx_XDECREF(__pyx_t_5);
1977   __Pyx_XDECREF(__pyx_t_6);
1978   __Pyx_AddTraceback("cvcf.get_sequence");
1979   __pyx_r = NULL;
1980   __pyx_L0:;
1981   __Pyx_DECREF(__pyx_v_sequence);
1982   __Pyx_XGIVEREF(__pyx_r);
1983   __Pyx_RefNannyFinishContext();
1984   return __pyx_r;
1985 }
1986
1987 /* "cvcf.pyx":68
1988  * 
1989  * # Utility function.  Parses a region string
1990  * def parse_regions( string ):             # <<<<<<<<<<<<<<
1991  *     result = []
1992  *     for r in string.split(','):
1993  */
1994
1995 static PyObject *__pyx_pf_4cvcf_1parse_regions(PyObject *__pyx_self, PyObject *__pyx_v_string); /*proto*/
1996 static PyMethodDef __pyx_mdef_4cvcf_1parse_regions = {__Pyx_NAMESTR("parse_regions"), (PyCFunction)__pyx_pf_4cvcf_1parse_regions, METH_O, __Pyx_DOCSTR(0)};
1997 static PyObject *__pyx_pf_4cvcf_1parse_regions(PyObject *__pyx_self, PyObject *__pyx_v_string) {
1998   PyObject *__pyx_v_result;
1999   PyObject *__pyx_v_r;
2000   PyObject *__pyx_v_elts;
2001   PyObject *__pyx_v_chrom;
2002   PyObject *__pyx_v_start;
2003   PyObject *__pyx_v_end;
2004   PyObject *__pyx_v_ielts;
2005   PyObject *__pyx_r = NULL;
2006   PyObject *__pyx_t_1 = NULL;
2007   Py_ssize_t __pyx_t_2;
2008   PyObject *__pyx_t_3 = NULL;
2009   PyObject *__pyx_t_4 = NULL;
2010   PyObject *__pyx_t_5 = NULL;
2011   Py_ssize_t __pyx_t_6;
2012   int __pyx_t_7;
2013   PyObject *__pyx_t_8 = NULL;
2014   PyObject *__pyx_t_9 = NULL;
2015   int __pyx_t_10;
2016   __Pyx_RefNannySetupContext("parse_regions");
2017   __pyx_self = __pyx_self;
2018   __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
2019   __pyx_v_r = Py_None; __Pyx_INCREF(Py_None);
2020   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
2021   __pyx_v_chrom = Py_None; __Pyx_INCREF(Py_None);
2022   __pyx_v_start = Py_None; __Pyx_INCREF(Py_None);
2023   __pyx_v_end = Py_None; __Pyx_INCREF(Py_None);
2024   __pyx_v_ielts = Py_None; __Pyx_INCREF(Py_None);
2025
2026   /* "cvcf.pyx":69
2027  * # Utility function.  Parses a region string
2028  * def parse_regions( string ):
2029  *     result = []             # <<<<<<<<<<<<<<
2030  *     for r in string.split(','):
2031  *         elts = r.split(':')
2032  */
2033   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2034   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2035   __Pyx_DECREF(((PyObject *)__pyx_v_result));
2036   __pyx_v_result = __pyx_t_1;
2037   __pyx_t_1 = 0;
2038
2039   /* "cvcf.pyx":70
2040  * def parse_regions( string ):
2041  *     result = []
2042  *     for r in string.split(','):             # <<<<<<<<<<<<<<
2043  *         elts = r.split(':')
2044  *         chrom, start, end = elts[0], 0, 3000000000
2045  */
2046   __pyx_t_1 = PyObject_GetAttr(__pyx_v_string, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2047   __Pyx_GOTREF(__pyx_t_1);
2048   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2049   __Pyx_GOTREF(__pyx_t_3);
2050   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2051   if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
2052     __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
2053   } else {
2054     __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2055     __Pyx_GOTREF(__pyx_t_1);
2056   }
2057   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2058   for (;;) {
2059     if (likely(PyList_CheckExact(__pyx_t_1))) {
2060       if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
2061       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
2062     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
2063       if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
2064       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
2065     } else {
2066       __pyx_t_3 = PyIter_Next(__pyx_t_1);
2067       if (!__pyx_t_3) {
2068         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2069         break;
2070       }
2071       __Pyx_GOTREF(__pyx_t_3);
2072     }
2073     __Pyx_DECREF(__pyx_v_r);
2074     __pyx_v_r = __pyx_t_3;
2075     __pyx_t_3 = 0;
2076
2077     /* "cvcf.pyx":71
2078  *     result = []
2079  *     for r in string.split(','):
2080  *         elts = r.split(':')             # <<<<<<<<<<<<<<
2081  *         chrom, start, end = elts[0], 0, 3000000000
2082  *         if len(elts)==1: pass
2083  */
2084     __pyx_t_3 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2085     __Pyx_GOTREF(__pyx_t_3);
2086     __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2087     __Pyx_GOTREF(__pyx_t_4);
2088     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2089     __Pyx_DECREF(__pyx_v_elts);
2090     __pyx_v_elts = __pyx_t_4;
2091     __pyx_t_4 = 0;
2092
2093     /* "cvcf.pyx":72
2094  *     for r in string.split(','):
2095  *         elts = r.split(':')
2096  *         chrom, start, end = elts[0], 0, 3000000000             # <<<<<<<<<<<<<<
2097  *         if len(elts)==1: pass
2098  *         elif len(elts)==2:
2099  */
2100     __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2101     __Pyx_GOTREF(__pyx_t_4);
2102     __pyx_t_3 = __pyx_int_0;
2103     __Pyx_INCREF(__pyx_t_3);
2104     __pyx_t_5 = __pyx_int_3000000000;
2105     __Pyx_INCREF(__pyx_t_5);
2106     __Pyx_DECREF(__pyx_v_chrom);
2107     __pyx_v_chrom = __pyx_t_4;
2108     __pyx_t_4 = 0;
2109     __Pyx_DECREF(__pyx_v_start);
2110     __pyx_v_start = __pyx_t_3;
2111     __pyx_t_3 = 0;
2112     __Pyx_DECREF(__pyx_v_end);
2113     __pyx_v_end = __pyx_t_5;
2114     __pyx_t_5 = 0;
2115
2116     /* "cvcf.pyx":73
2117  *         elts = r.split(':')
2118  *         chrom, start, end = elts[0], 0, 3000000000
2119  *         if len(elts)==1: pass             # <<<<<<<<<<<<<<
2120  *         elif len(elts)==2:
2121  *             if len(elts[1])>0:
2122  */
2123     __pyx_t_6 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2124     __pyx_t_7 = (__pyx_t_6 == 1);
2125     if (__pyx_t_7) {
2126       goto __pyx_L7;
2127     }
2128
2129     /* "cvcf.pyx":74
2130  *         chrom, start, end = elts[0], 0, 3000000000
2131  *         if len(elts)==1: pass
2132  *         elif len(elts)==2:             # <<<<<<<<<<<<<<
2133  *             if len(elts[1])>0:
2134  *                 ielts = elts[1].split('-')
2135  */
2136     __pyx_t_6 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2137     __pyx_t_7 = (__pyx_t_6 == 2);
2138     if (__pyx_t_7) {
2139
2140       /* "cvcf.pyx":75
2141  *         if len(elts)==1: pass
2142  *         elif len(elts)==2:
2143  *             if len(elts[1])>0:             # <<<<<<<<<<<<<<
2144  *                 ielts = elts[1].split('-')
2145  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
2146  */
2147       __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2148       __Pyx_GOTREF(__pyx_t_5);
2149       __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2150       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2151       __pyx_t_7 = (__pyx_t_6 > 0);
2152       if (__pyx_t_7) {
2153
2154         /* "cvcf.pyx":76
2155  *         elif len(elts)==2:
2156  *             if len(elts[1])>0:
2157  *                 ielts = elts[1].split('-')             # <<<<<<<<<<<<<<
2158  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
2159  *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
2160  */
2161         __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2162         __Pyx_GOTREF(__pyx_t_5);
2163         __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2164         __Pyx_GOTREF(__pyx_t_3);
2165         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2166         __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2167         __Pyx_GOTREF(__pyx_t_5);
2168         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2169         __Pyx_DECREF(__pyx_v_ielts);
2170         __pyx_v_ielts = __pyx_t_5;
2171         __pyx_t_5 = 0;
2172
2173         /* "cvcf.pyx":77
2174  *             if len(elts[1])>0:
2175  *                 ielts = elts[1].split('-')
2176  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)             # <<<<<<<<<<<<<<
2177  *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
2178  *                 except: raise ValueError("Don't understand region string '%s'" % r)
2179  */
2180         __pyx_t_6 = PyObject_Length(__pyx_v_ielts); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2181         __pyx_t_7 = (__pyx_t_6 != 2);
2182         if (__pyx_t_7) {
2183           __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_v_r); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2184           __Pyx_GOTREF(((PyObject *)__pyx_t_5));
2185           __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2186           __Pyx_GOTREF(((PyObject *)__pyx_t_3));
2187           PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
2188           __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
2189           __pyx_t_5 = 0;
2190           __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2191           __Pyx_GOTREF(__pyx_t_5);
2192           __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
2193           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2194           goto __pyx_L9;
2195         }
2196         __pyx_L9:;
2197
2198         /* "cvcf.pyx":78
2199  *                 ielts = elts[1].split('-')
2200  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
2201  *                 try:    start, end = int(ielts[0])-1, int(ielts[1])             # <<<<<<<<<<<<<<
2202  *                 except: raise ValueError("Don't understand region string '%s'" % r)
2203  *         else:
2204  */
2205         {
2206           PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
2207           __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
2208           __Pyx_XGOTREF(__pyx_save_exc_type);
2209           __Pyx_XGOTREF(__pyx_save_exc_value);
2210           __Pyx_XGOTREF(__pyx_save_exc_tb);
2211           /*try:*/ {
2212             __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ielts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2213             __Pyx_GOTREF(__pyx_t_5);
2214             __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2215             __Pyx_GOTREF(((PyObject *)__pyx_t_3));
2216             PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
2217             __Pyx_GIVEREF(__pyx_t_5);
2218             __pyx_t_5 = 0;
2219             __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2220             __Pyx_GOTREF(__pyx_t_5);
2221             __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
2222             __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2223             __Pyx_GOTREF(__pyx_t_3);
2224             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2225             __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ielts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2226             __Pyx_GOTREF(__pyx_t_5);
2227             __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2228             __Pyx_GOTREF(((PyObject *)__pyx_t_4));
2229             PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
2230             __Pyx_GIVEREF(__pyx_t_5);
2231             __pyx_t_5 = 0;
2232             __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2233             __Pyx_GOTREF(__pyx_t_5);
2234             __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
2235             __Pyx_DECREF(__pyx_v_start);
2236             __pyx_v_start = __pyx_t_3;
2237             __pyx_t_3 = 0;
2238             __Pyx_DECREF(__pyx_v_end);
2239             __pyx_v_end = __pyx_t_5;
2240             __pyx_t_5 = 0;
2241           }
2242           __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
2243           __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
2244           __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
2245           goto __pyx_L17_try_end;
2246           __pyx_L10_error:;
2247           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2248           __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2249           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2250
2251           /* "cvcf.pyx":79
2252  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
2253  *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
2254  *                 except: raise ValueError("Don't understand region string '%s'" % r)             # <<<<<<<<<<<<<<
2255  *         else:
2256  *             raise ValueError("Don't understand region string '%s'" % r)
2257  */
2258           /*except:*/ {
2259             __Pyx_AddTraceback("cvcf.parse_regions");
2260             if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
2261             __Pyx_GOTREF(__pyx_t_5);
2262             __Pyx_GOTREF(__pyx_t_3);
2263             __Pyx_GOTREF(__pyx_t_4);
2264             __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_v_r); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
2265             __Pyx_GOTREF(((PyObject *)__pyx_t_8));
2266             __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
2267             __Pyx_GOTREF(((PyObject *)__pyx_t_9));
2268             PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8));
2269             __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
2270             __pyx_t_8 = 0;
2271             __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
2272             __Pyx_GOTREF(__pyx_t_8);
2273             __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
2274             __Pyx_Raise(__pyx_t_8, 0, 0);
2275             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2276             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
2277             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2278             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2279             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2280             goto __pyx_L11_exception_handled;
2281           }
2282           __pyx_L12_except_error:;
2283           __Pyx_XGIVEREF(__pyx_save_exc_type);
2284           __Pyx_XGIVEREF(__pyx_save_exc_value);
2285           __Pyx_XGIVEREF(__pyx_save_exc_tb);
2286           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
2287           goto __pyx_L1_error;
2288           __pyx_L11_exception_handled:;
2289           __Pyx_XGIVEREF(__pyx_save_exc_type);
2290           __Pyx_XGIVEREF(__pyx_save_exc_value);
2291           __Pyx_XGIVEREF(__pyx_save_exc_tb);
2292           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
2293           __pyx_L17_try_end:;
2294         }
2295         goto __pyx_L8;
2296       }
2297       __pyx_L8:;
2298       goto __pyx_L7;
2299     }
2300     /*else*/ {
2301
2302       /* "cvcf.pyx":81
2303  *                 except: raise ValueError("Don't understand region string '%s'" % r)
2304  *         else:
2305  *             raise ValueError("Don't understand region string '%s'" % r)             # <<<<<<<<<<<<<<
2306  *         result.append( (chrom,start,end) )
2307  *     return result
2308  */
2309       __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_v_r); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2310       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
2311       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2312       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
2313       PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
2314       __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
2315       __pyx_t_4 = 0;
2316       __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2317       __Pyx_GOTREF(__pyx_t_4);
2318       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
2319       __Pyx_Raise(__pyx_t_4, 0, 0);
2320       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2321       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2322     }
2323     __pyx_L7:;
2324
2325     /* "cvcf.pyx":82
2326  *         else:
2327  *             raise ValueError("Don't understand region string '%s'" % r)
2328  *         result.append( (chrom,start,end) )             # <<<<<<<<<<<<<<
2329  *     return result
2330  * 
2331  */
2332     if (unlikely(__pyx_v_result == Py_None)) {
2333       PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
2334     }
2335     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2336     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
2337     __Pyx_INCREF(__pyx_v_chrom);
2338     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
2339     __Pyx_GIVEREF(__pyx_v_chrom);
2340     __Pyx_INCREF(__pyx_v_start);
2341     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_start);
2342     __Pyx_GIVEREF(__pyx_v_start);
2343     __Pyx_INCREF(__pyx_v_end);
2344     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_end);
2345     __Pyx_GIVEREF(__pyx_v_end);
2346     __pyx_t_10 = PyList_Append(__pyx_v_result, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2347     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
2348   }
2349   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2350
2351   /* "cvcf.pyx":83
2352  *             raise ValueError("Don't understand region string '%s'" % r)
2353  *         result.append( (chrom,start,end) )
2354  *     return result             # <<<<<<<<<<<<<<
2355  * 
2356  * 
2357  */
2358   __Pyx_XDECREF(__pyx_r);
2359   __Pyx_INCREF(((PyObject *)__pyx_v_result));
2360   __pyx_r = ((PyObject *)__pyx_v_result);
2361   goto __pyx_L0;
2362
2363   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2364   goto __pyx_L0;
2365   __pyx_L1_error:;
2366   __Pyx_XDECREF(__pyx_t_1);
2367   __Pyx_XDECREF(__pyx_t_3);
2368   __Pyx_XDECREF(__pyx_t_4);
2369   __Pyx_XDECREF(__pyx_t_5);
2370   __Pyx_XDECREF(__pyx_t_8);
2371   __Pyx_XDECREF(__pyx_t_9);
2372   __Pyx_AddTraceback("cvcf.parse_regions");
2373   __pyx_r = NULL;
2374   __pyx_L0:;
2375   __Pyx_DECREF(__pyx_v_result);
2376   __Pyx_DECREF(__pyx_v_r);
2377   __Pyx_DECREF(__pyx_v_elts);
2378   __Pyx_DECREF(__pyx_v_chrom);
2379   __Pyx_DECREF(__pyx_v_start);
2380   __Pyx_DECREF(__pyx_v_end);
2381   __Pyx_DECREF(__pyx_v_ielts);
2382   __Pyx_XGIVEREF(__pyx_r);
2383   __Pyx_RefNannyFinishContext();
2384   return __pyx_r;
2385 }
2386
2387 /* "cvcf.pyx":104
2388  *     cdef uint32_t pos
2389  * 
2390  *     def __init__(self, vcf):             # <<<<<<<<<<<<<<
2391  *         self.vcf = vcf
2392  *         # if len(data) != len(self.vcf._samples):
2393  */
2394
2395 static int __pyx_pf_4cvcf_9VCFRecord___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2396 static int __pyx_pf_4cvcf_9VCFRecord___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2397   PyObject *__pyx_v_vcf = 0;
2398   int __pyx_r;
2399   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vcf,0};
2400   __Pyx_RefNannySetupContext("__init__");
2401   if (unlikely(__pyx_kwds)) {
2402     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2403     PyObject* values[1] = {0};
2404     switch (PyTuple_GET_SIZE(__pyx_args)) {
2405       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2406       case  0: break;
2407       default: goto __pyx_L5_argtuple_error;
2408     }
2409     switch (PyTuple_GET_SIZE(__pyx_args)) {
2410       case  0:
2411       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vcf);
2412       if (likely(values[0])) kw_args--;
2413       else goto __pyx_L5_argtuple_error;
2414     }
2415     if (unlikely(kw_args > 0)) {
2416       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2417     }
2418     __pyx_v_vcf = values[0];
2419   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2420     goto __pyx_L5_argtuple_error;
2421   } else {
2422     __pyx_v_vcf = PyTuple_GET_ITEM(__pyx_args, 0);
2423   }
2424   goto __pyx_L4_argument_unpacking_done;
2425   __pyx_L5_argtuple_error:;
2426   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2427   __pyx_L3_error:;
2428   __Pyx_AddTraceback("cvcf.VCFRecord.__init__");
2429   __Pyx_RefNannyFinishContext();
2430   return -1;
2431   __pyx_L4_argument_unpacking_done:;
2432
2433   /* "cvcf.pyx":105
2434  * 
2435  *     def __init__(self, vcf):
2436  *         self.vcf = vcf             # <<<<<<<<<<<<<<
2437  *         # if len(data) != len(self.vcf._samples):
2438  *         #     self.error(str(data),
2439  */
2440   __Pyx_INCREF(__pyx_v_vcf);
2441   __Pyx_GIVEREF(__pyx_v_vcf);
2442   __Pyx_GOTREF(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf);
2443   __Pyx_DECREF(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf);
2444   ((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf = __pyx_v_vcf;
2445
2446   __pyx_r = 0;
2447   __Pyx_RefNannyFinishContext();
2448   return __pyx_r;
2449 }
2450
2451 /* "cvcf.pyx":115
2452  *         #                     len(data)))
2453  * 
2454  *     def __cinit__(self, vcf ):             # <<<<<<<<<<<<<<
2455  *         # start indexed access at genotypes
2456  *         self.offset = 9
2457  */
2458
2459 static int __pyx_pf_4cvcf_9VCFRecord_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2460 static int __pyx_pf_4cvcf_9VCFRecord_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2461   PyObject *__pyx_v_vcf = 0;
2462   int __pyx_r;
2463   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vcf,0};
2464   __Pyx_RefNannySetupContext("__cinit__");
2465   if (unlikely(__pyx_kwds)) {
2466     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2467     PyObject* values[1] = {0};
2468     switch (PyTuple_GET_SIZE(__pyx_args)) {
2469       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2470       case  0: break;
2471       default: goto __pyx_L5_argtuple_error;
2472     }
2473     switch (PyTuple_GET_SIZE(__pyx_args)) {
2474       case  0:
2475       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vcf);
2476       if (likely(values[0])) kw_args--;
2477       else goto __pyx_L5_argtuple_error;
2478     }
2479     if (unlikely(kw_args > 0)) {
2480       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2481     }
2482     __pyx_v_vcf = values[0];
2483   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2484     goto __pyx_L5_argtuple_error;
2485   } else {
2486     __pyx_v_vcf = PyTuple_GET_ITEM(__pyx_args, 0);
2487   }
2488   goto __pyx_L4_argument_unpacking_done;
2489   __pyx_L5_argtuple_error:;
2490   __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2491   __pyx_L3_error:;
2492   __Pyx_AddTraceback("cvcf.VCFRecord.__cinit__");
2493   __Pyx_RefNannyFinishContext();
2494   return -1;
2495   __pyx_L4_argument_unpacking_done:;
2496
2497   /* "cvcf.pyx":117
2498  *     def __cinit__(self, vcf ):
2499  *         # start indexed access at genotypes
2500  *         self.offset = 9             # <<<<<<<<<<<<<<
2501  * 
2502  *         self.vcf = vcf
2503  */
2504   ((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.offset = 9;
2505
2506   /* "cvcf.pyx":119
2507  *         self.offset = 9
2508  * 
2509  *         self.vcf = vcf             # <<<<<<<<<<<<<<
2510  * 
2511  *     cdef update( self, char * buffer, size_t nbytes ):
2512  */
2513   __Pyx_INCREF(__pyx_v_vcf);
2514   __Pyx_GIVEREF(__pyx_v_vcf);
2515   __Pyx_GOTREF(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf);
2516   __Pyx_DECREF(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf);
2517   ((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf = __pyx_v_vcf;
2518
2519   __pyx_r = 0;
2520   __Pyx_RefNannyFinishContext();
2521   return __pyx_r;
2522 }
2523
2524 /* "cvcf.pyx":121
2525  *         self.vcf = vcf
2526  * 
2527  *     cdef update( self, char * buffer, size_t nbytes ):             # <<<<<<<<<<<<<<
2528  *         '''update internal data.
2529  * 
2530  */
2531
2532 static  PyObject *__pyx_f_4cvcf_9VCFRecord_update(struct __pyx_obj_4cvcf_VCFRecord *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
2533   PyObject *__pyx_r = NULL;
2534   PyObject *__pyx_t_1 = NULL;
2535   __Pyx_RefNannySetupContext("update");
2536
2537   /* "cvcf.pyx":126
2538  *         nbytes does not include the terminal '\0'.
2539  *         '''
2540  *         TabProxies.TupleProxy.update( self, buffer, nbytes )             # <<<<<<<<<<<<<<
2541  * 
2542  *         self.contig = self.fields[0]
2543  */
2544   __pyx_t_1 = __pyx_vtabptr_10TabProxies_TupleProxy->update(((struct __pyx_obj_10TabProxies_TupleProxy *)__pyx_v_self), __pyx_v_buffer, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2545   __Pyx_GOTREF(__pyx_t_1);
2546   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2547
2548   /* "cvcf.pyx":128
2549  *         TabProxies.TupleProxy.update( self, buffer, nbytes )
2550  * 
2551  *         self.contig = self.fields[0]             # <<<<<<<<<<<<<<
2552  *         # vcf counts from 1 - correct here
2553  *         self.pos = atoi( self.fields[1] ) - 1
2554  */
2555   __pyx_v_self->contig = (__pyx_v_self->__pyx_base.fields[0]);
2556
2557   /* "cvcf.pyx":130
2558  *         self.contig = self.fields[0]
2559  *         # vcf counts from 1 - correct here
2560  *         self.pos = atoi( self.fields[1] ) - 1             # <<<<<<<<<<<<<<
2561  * 
2562  *     def __len__(self):
2563  */
2564   __pyx_v_self->pos = (atoi((__pyx_v_self->__pyx_base.fields[1])) - 1);
2565
2566   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2567   goto __pyx_L0;
2568   __pyx_L1_error:;
2569   __Pyx_XDECREF(__pyx_t_1);
2570   __Pyx_AddTraceback("cvcf.VCFRecord.update");
2571   __pyx_r = 0;
2572   __pyx_L0:;
2573   __Pyx_XGIVEREF(__pyx_r);
2574   __Pyx_RefNannyFinishContext();
2575   return __pyx_r;
2576 }
2577
2578 /* "cvcf.pyx":132
2579  *         self.pos = atoi( self.fields[1] ) - 1
2580  * 
2581  *     def __len__(self):             # <<<<<<<<<<<<<<
2582  *         return max(0, self.nfields - 9)
2583  * 
2584  */
2585
2586 static Py_ssize_t __pyx_pf_4cvcf_9VCFRecord_2__len__(PyObject *__pyx_v_self); /*proto*/
2587 static Py_ssize_t __pyx_pf_4cvcf_9VCFRecord_2__len__(PyObject *__pyx_v_self) {
2588   Py_ssize_t __pyx_r;
2589   long __pyx_t_1;
2590   long __pyx_t_2;
2591   long __pyx_t_3;
2592   __Pyx_RefNannySetupContext("__len__");
2593
2594   /* "cvcf.pyx":133
2595  * 
2596  *     def __len__(self):
2597  *         return max(0, self.nfields - 9)             # <<<<<<<<<<<<<<
2598  * 
2599  *     property contig:
2600  */
2601   __pyx_t_1 = (((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.nfields - 9);
2602   __pyx_t_2 = 0;
2603   if ((__pyx_t_1 > __pyx_t_2)) {
2604     __pyx_t_3 = __pyx_t_1;
2605   } else {
2606     __pyx_t_3 = __pyx_t_2;
2607   }
2608   __pyx_r = __pyx_t_3;
2609   goto __pyx_L0;
2610
2611   __pyx_r = 0;
2612   __pyx_L0:;
2613   __Pyx_RefNannyFinishContext();
2614   return __pyx_r;
2615 }
2616
2617 /* "cvcf.pyx":136
2618  * 
2619  *     property contig:
2620  *         def __get__(self): return self.contig             # <<<<<<<<<<<<<<
2621  * 
2622  *     property pos:
2623  */
2624
2625 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6contig___get__(PyObject *__pyx_v_self); /*proto*/
2626 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6contig___get__(PyObject *__pyx_v_self) {
2627   PyObject *__pyx_r = NULL;
2628   PyObject *__pyx_t_1 = NULL;
2629   __Pyx_RefNannySetupContext("__get__");
2630   __Pyx_XDECREF(__pyx_r);
2631   __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->contig); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2632   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2633   __pyx_r = ((PyObject *)__pyx_t_1);
2634   __pyx_t_1 = 0;
2635   goto __pyx_L0;
2636
2637   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2638   goto __pyx_L0;
2639   __pyx_L1_error:;
2640   __Pyx_XDECREF(__pyx_t_1);
2641   __Pyx_AddTraceback("cvcf.VCFRecord.contig.__get__");
2642   __pyx_r = NULL;
2643   __pyx_L0:;
2644   __Pyx_XGIVEREF(__pyx_r);
2645   __Pyx_RefNannyFinishContext();
2646   return __pyx_r;
2647 }
2648
2649 /* "cvcf.pyx":139
2650  * 
2651  *     property pos:
2652  *         def __get__(self): return self.pos             # <<<<<<<<<<<<<<
2653  * 
2654  *     property id:
2655  */
2656
2657 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3pos___get__(PyObject *__pyx_v_self); /*proto*/
2658 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3pos___get__(PyObject *__pyx_v_self) {
2659   PyObject *__pyx_r = NULL;
2660   PyObject *__pyx_t_1 = NULL;
2661   __Pyx_RefNannySetupContext("__get__");
2662   __Pyx_XDECREF(__pyx_r);
2663   __pyx_t_1 = __Pyx_PyInt_to_py_uint32_t(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2664   __Pyx_GOTREF(__pyx_t_1);
2665   __pyx_r = __pyx_t_1;
2666   __pyx_t_1 = 0;
2667   goto __pyx_L0;
2668
2669   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2670   goto __pyx_L0;
2671   __pyx_L1_error:;
2672   __Pyx_XDECREF(__pyx_t_1);
2673   __Pyx_AddTraceback("cvcf.VCFRecord.pos.__get__");
2674   __pyx_r = NULL;
2675   __pyx_L0:;
2676   __Pyx_XGIVEREF(__pyx_r);
2677   __Pyx_RefNannyFinishContext();
2678   return __pyx_r;
2679 }
2680
2681 /* "cvcf.pyx":142
2682  * 
2683  *     property id:
2684  *         def __get__(self): return self.fields[2]             # <<<<<<<<<<<<<<
2685  * 
2686  *     property ref:
2687  */
2688
2689 static PyObject *__pyx_pf_4cvcf_9VCFRecord_2id___get__(PyObject *__pyx_v_self); /*proto*/
2690 static PyObject *__pyx_pf_4cvcf_9VCFRecord_2id___get__(PyObject *__pyx_v_self) {
2691   PyObject *__pyx_r = NULL;
2692   PyObject *__pyx_t_1 = NULL;
2693   __Pyx_RefNannySetupContext("__get__");
2694   __Pyx_XDECREF(__pyx_r);
2695   __pyx_t_1 = PyBytes_FromString((((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[2])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2696   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2697   __pyx_r = ((PyObject *)__pyx_t_1);
2698   __pyx_t_1 = 0;
2699   goto __pyx_L0;
2700
2701   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2702   goto __pyx_L0;
2703   __pyx_L1_error:;
2704   __Pyx_XDECREF(__pyx_t_1);
2705   __Pyx_AddTraceback("cvcf.VCFRecord.id.__get__");
2706   __pyx_r = NULL;
2707   __pyx_L0:;
2708   __Pyx_XGIVEREF(__pyx_r);
2709   __Pyx_RefNannyFinishContext();
2710   return __pyx_r;
2711 }
2712
2713 /* "cvcf.pyx":145
2714  * 
2715  *     property ref:
2716  *         def __get__(self): return self.fields[3]             # <<<<<<<<<<<<<<
2717  * 
2718  *     property alt:
2719  */
2720
2721 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3ref___get__(PyObject *__pyx_v_self); /*proto*/
2722 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3ref___get__(PyObject *__pyx_v_self) {
2723   PyObject *__pyx_r = NULL;
2724   PyObject *__pyx_t_1 = NULL;
2725   __Pyx_RefNannySetupContext("__get__");
2726   __Pyx_XDECREF(__pyx_r);
2727   __pyx_t_1 = PyBytes_FromString((((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[3])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2728   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2729   __pyx_r = ((PyObject *)__pyx_t_1);
2730   __pyx_t_1 = 0;
2731   goto __pyx_L0;
2732
2733   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2734   goto __pyx_L0;
2735   __pyx_L1_error:;
2736   __Pyx_XDECREF(__pyx_t_1);
2737   __Pyx_AddTraceback("cvcf.VCFRecord.ref.__get__");
2738   __pyx_r = NULL;
2739   __pyx_L0:;
2740   __Pyx_XGIVEREF(__pyx_r);
2741   __Pyx_RefNannyFinishContext();
2742   return __pyx_r;
2743 }
2744
2745 /* "cvcf.pyx":148
2746  * 
2747  *     property alt:
2748  *         def __get__(self):             # <<<<<<<<<<<<<<
2749  *             # convert v3.3 to v4.0 alleles below
2750  *             alt = self.fields[4]
2751  */
2752
2753 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3alt___get__(PyObject *__pyx_v_self); /*proto*/
2754 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3alt___get__(PyObject *__pyx_v_self) {
2755   PyObject *__pyx_v_alt;
2756   PyObject *__pyx_r = NULL;
2757   PyObject *__pyx_t_1 = NULL;
2758   int __pyx_t_2;
2759   PyObject *__pyx_t_3 = NULL;
2760   __Pyx_RefNannySetupContext("__get__");
2761   __pyx_v_alt = Py_None; __Pyx_INCREF(Py_None);
2762
2763   /* "cvcf.pyx":150
2764  *         def __get__(self):
2765  *             # convert v3.3 to v4.0 alleles below
2766  *             alt = self.fields[4]             # <<<<<<<<<<<<<<
2767  *             if alt == ".": alt = []
2768  *             else: alt = alt.upper().split(',')
2769  */
2770   __pyx_t_1 = PyBytes_FromString((((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[4])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2771   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2772   __Pyx_DECREF(__pyx_v_alt);
2773   __pyx_v_alt = ((PyObject *)__pyx_t_1);
2774   __pyx_t_1 = 0;
2775
2776   /* "cvcf.pyx":151
2777  *             # convert v3.3 to v4.0 alleles below
2778  *             alt = self.fields[4]
2779  *             if alt == ".": alt = []             # <<<<<<<<<<<<<<
2780  *             else: alt = alt.upper().split(',')
2781  *             return alt
2782  */
2783   __pyx_t_1 = PyObject_RichCompare(__pyx_v_alt, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2784   __Pyx_GOTREF(__pyx_t_1);
2785   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2786   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2787   if (__pyx_t_2) {
2788     __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2789     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2790     __Pyx_DECREF(__pyx_v_alt);
2791     __pyx_v_alt = ((PyObject *)__pyx_t_1);
2792     __pyx_t_1 = 0;
2793     goto __pyx_L5;
2794   }
2795   /*else*/ {
2796
2797     /* "cvcf.pyx":152
2798  *             alt = self.fields[4]
2799  *             if alt == ".": alt = []
2800  *             else: alt = alt.upper().split(',')             # <<<<<<<<<<<<<<
2801  *             return alt
2802  * 
2803  */
2804     __pyx_t_1 = PyObject_GetAttr(__pyx_v_alt, __pyx_n_s__upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2805     __Pyx_GOTREF(__pyx_t_1);
2806     __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2807     __Pyx_GOTREF(__pyx_t_3);
2808     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2809     __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2810     __Pyx_GOTREF(__pyx_t_1);
2811     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2812     __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2813     __Pyx_GOTREF(__pyx_t_3);
2814     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2815     __Pyx_DECREF(__pyx_v_alt);
2816     __pyx_v_alt = __pyx_t_3;
2817     __pyx_t_3 = 0;
2818   }
2819   __pyx_L5:;
2820
2821   /* "cvcf.pyx":153
2822  *             if alt == ".": alt = []
2823  *             else: alt = alt.upper().split(',')
2824  *             return alt             # <<<<<<<<<<<<<<
2825  * 
2826  *     property qual:
2827  */
2828   __Pyx_XDECREF(__pyx_r);
2829   __Pyx_INCREF(__pyx_v_alt);
2830   __pyx_r = __pyx_v_alt;
2831   goto __pyx_L0;
2832
2833   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2834   goto __pyx_L0;
2835   __pyx_L1_error:;
2836   __Pyx_XDECREF(__pyx_t_1);
2837   __Pyx_XDECREF(__pyx_t_3);
2838   __Pyx_AddTraceback("cvcf.VCFRecord.alt.__get__");
2839   __pyx_r = NULL;
2840   __pyx_L0:;
2841   __Pyx_DECREF(__pyx_v_alt);
2842   __Pyx_XGIVEREF(__pyx_r);
2843   __Pyx_RefNannyFinishContext();
2844   return __pyx_r;
2845 }
2846
2847 /* "cvcf.pyx":156
2848  * 
2849  *     property qual:
2850  *         def __get__(self):             # <<<<<<<<<<<<<<
2851  *             qual = self.fields[5]
2852  *             if qual == b".": qual = -1
2853  */
2854
2855 static PyObject *__pyx_pf_4cvcf_9VCFRecord_4qual___get__(PyObject *__pyx_v_self); /*proto*/
2856 static PyObject *__pyx_pf_4cvcf_9VCFRecord_4qual___get__(PyObject *__pyx_v_self) {
2857   PyObject *__pyx_v_qual;
2858   PyObject *__pyx_r = NULL;
2859   PyObject *__pyx_t_1 = NULL;
2860   int __pyx_t_2;
2861   double __pyx_t_3;
2862   PyObject *__pyx_t_4 = NULL;
2863   PyObject *__pyx_t_5 = NULL;
2864   PyObject *__pyx_t_6 = NULL;
2865   PyObject *__pyx_t_7 = NULL;
2866   PyObject *__pyx_t_8 = NULL;
2867   PyObject *__pyx_t_9 = NULL;
2868   __Pyx_RefNannySetupContext("__get__");
2869   __pyx_v_qual = Py_None; __Pyx_INCREF(Py_None);
2870
2871   /* "cvcf.pyx":157
2872  *     property qual:
2873  *         def __get__(self):
2874  *             qual = self.fields[5]             # <<<<<<<<<<<<<<
2875  *             if qual == b".": qual = -1
2876  *             else:
2877  */
2878   __pyx_t_1 = PyBytes_FromString((((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[5])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2879   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2880   __Pyx_DECREF(__pyx_v_qual);
2881   __pyx_v_qual = ((PyObject *)__pyx_t_1);
2882   __pyx_t_1 = 0;
2883
2884   /* "cvcf.pyx":158
2885  *         def __get__(self):
2886  *             qual = self.fields[5]
2887  *             if qual == b".": qual = -1             # <<<<<<<<<<<<<<
2888  *             else:
2889  *                 try:    qual = float(qual)
2890  */
2891   __pyx_t_1 = PyObject_RichCompare(__pyx_v_qual, ((PyObject *)__pyx_kp_b_9), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2892   __Pyx_GOTREF(__pyx_t_1);
2893   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2894   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2895   if (__pyx_t_2) {
2896     __Pyx_INCREF(__pyx_int_neg_1);
2897     __Pyx_DECREF(__pyx_v_qual);
2898     __pyx_v_qual = __pyx_int_neg_1;
2899     goto __pyx_L5;
2900   }
2901   /*else*/ {
2902
2903     /* "cvcf.pyx":160
2904  *             if qual == b".": qual = -1
2905  *             else:
2906  *                 try:    qual = float(qual)             # <<<<<<<<<<<<<<
2907  *                 except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL)
2908  * 
2909  */
2910     {
2911       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
2912       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
2913       __Pyx_XGOTREF(__pyx_save_exc_type);
2914       __Pyx_XGOTREF(__pyx_save_exc_value);
2915       __Pyx_XGOTREF(__pyx_save_exc_tb);
2916       /*try:*/ {
2917         __pyx_t_3 = __Pyx_PyObject_AsDouble(__pyx_v_qual); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
2918         __pyx_t_1 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
2919         __Pyx_GOTREF(__pyx_t_1);
2920         __Pyx_DECREF(__pyx_v_qual);
2921         __pyx_v_qual = __pyx_t_1;
2922         __pyx_t_1 = 0;
2923       }
2924       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
2925       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
2926       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
2927       goto __pyx_L13_try_end;
2928       __pyx_L6_error:;
2929       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2930
2931       /* "cvcf.pyx":161
2932  *             else:
2933  *                 try:    qual = float(qual)
2934  *                 except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL)             # <<<<<<<<<<<<<<
2935  * 
2936  *     property filter:
2937  */
2938       /*except:*/ {
2939         __Pyx_AddTraceback("cvcf.VCFRecord.qual.__get__");
2940         if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
2941         __Pyx_GOTREF(__pyx_t_1);
2942         __Pyx_GOTREF(__pyx_t_4);
2943         __Pyx_GOTREF(__pyx_t_5);
2944         __pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s__error); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
2945         __Pyx_GOTREF(__pyx_t_6);
2946         __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
2947         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
2948         __Pyx_INCREF(__pyx_v_self);
2949         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self);
2950         __Pyx_GIVEREF(__pyx_v_self);
2951         __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
2952         __Pyx_GOTREF(__pyx_t_8);
2953         __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
2954         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__QUAL_NOT_NUMERICAL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
2955         __Pyx_GOTREF(__pyx_t_7);
2956         __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
2957         __Pyx_GOTREF(((PyObject *)__pyx_t_9));
2958         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
2959         __Pyx_GIVEREF(__pyx_t_8);
2960         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
2961         __Pyx_GIVEREF(__pyx_t_7);
2962         __pyx_t_8 = 0;
2963         __pyx_t_7 = 0;
2964         __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
2965         __Pyx_GOTREF(__pyx_t_7);
2966         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2967         __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
2968         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2969         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2970         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2971         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2972         goto __pyx_L7_exception_handled;
2973       }
2974       __pyx_L8_except_error:;
2975       __Pyx_XGIVEREF(__pyx_save_exc_type);
2976       __Pyx_XGIVEREF(__pyx_save_exc_value);
2977       __Pyx_XGIVEREF(__pyx_save_exc_tb);
2978       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
2979       goto __pyx_L1_error;
2980       __pyx_L7_exception_handled:;
2981       __Pyx_XGIVEREF(__pyx_save_exc_type);
2982       __Pyx_XGIVEREF(__pyx_save_exc_value);
2983       __Pyx_XGIVEREF(__pyx_save_exc_tb);
2984       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
2985       __pyx_L13_try_end:;
2986     }
2987   }
2988   __pyx_L5:;
2989
2990   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2991   goto __pyx_L0;
2992   __pyx_L1_error:;
2993   __Pyx_XDECREF(__pyx_t_1);
2994   __Pyx_XDECREF(__pyx_t_4);
2995   __Pyx_XDECREF(__pyx_t_5);
2996   __Pyx_XDECREF(__pyx_t_6);
2997   __Pyx_XDECREF(__pyx_t_7);
2998   __Pyx_XDECREF(__pyx_t_8);
2999   __Pyx_XDECREF(__pyx_t_9);
3000   __Pyx_AddTraceback("cvcf.VCFRecord.qual.__get__");
3001   __pyx_r = NULL;
3002   __pyx_L0:;
3003   __Pyx_DECREF(__pyx_v_qual);
3004   __Pyx_XGIVEREF(__pyx_r);
3005   __Pyx_RefNannyFinishContext();
3006   return __pyx_r;
3007 }
3008
3009 /* "cvcf.pyx":164
3010  * 
3011  *     property filter:
3012  *         def __get__(self):             # <<<<<<<<<<<<<<
3013  *             f = self.fields[6]
3014  *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
3015  */
3016
3017 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6filter___get__(PyObject *__pyx_v_self); /*proto*/
3018 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6filter___get__(PyObject *__pyx_v_self) {
3019   char *__pyx_v_f;
3020   PyObject *__pyx_r = NULL;
3021   PyObject *__pyx_t_1 = NULL;
3022   PyObject *__pyx_t_2 = NULL;
3023   int __pyx_t_3;
3024   int __pyx_t_4;
3025   int __pyx_t_5;
3026   int __pyx_t_6;
3027   __Pyx_RefNannySetupContext("__get__");
3028
3029   /* "cvcf.pyx":165
3030  *     property filter:
3031  *         def __get__(self):
3032  *             f = self.fields[6]             # <<<<<<<<<<<<<<
3033  *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
3034  *             if f == b"." or f == b"PASS" or f == b"0": return []
3035  */
3036   __pyx_v_f = (((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[6]);
3037
3038   /* "cvcf.pyx":167
3039  *             f = self.fields[6]
3040  *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
3041  *             if f == b"." or f == b"PASS" or f == b"0": return []             # <<<<<<<<<<<<<<
3042  *             else: return f.split(';')
3043  * 
3044  */
3045   __pyx_t_1 = PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3046   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3047   __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_kp_b_9), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3048   __Pyx_GOTREF(__pyx_t_2);
3049   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3050   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3051   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3052   if (!__pyx_t_3) {
3053     __pyx_t_2 = PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3054     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3055     __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_n_b__PASS), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3056     __Pyx_GOTREF(__pyx_t_1);
3057     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3058     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3059     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3060     if (!__pyx_t_4) {
3061       __pyx_t_1 = PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3062       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3063       __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_kp_b__0), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3064       __Pyx_GOTREF(__pyx_t_2);
3065       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3066       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3067       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3068       __pyx_t_6 = __pyx_t_5;
3069     } else {
3070       __pyx_t_6 = __pyx_t_4;
3071     }
3072     __pyx_t_4 = __pyx_t_6;
3073   } else {
3074     __pyx_t_4 = __pyx_t_3;
3075   }
3076   if (__pyx_t_4) {
3077     __Pyx_XDECREF(__pyx_r);
3078     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3079     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3080     __pyx_r = ((PyObject *)__pyx_t_2);
3081     __pyx_t_2 = 0;
3082     goto __pyx_L0;
3083     goto __pyx_L5;
3084   }
3085   /*else*/ {
3086
3087     /* "cvcf.pyx":168
3088  *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
3089  *             if f == b"." or f == b"PASS" or f == b"0": return []
3090  *             else: return f.split(';')             # <<<<<<<<<<<<<<
3091  * 
3092  *     property info:
3093  */
3094     __Pyx_XDECREF(__pyx_r);
3095     __pyx_t_2 = PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3096     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3097     __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_t_2), __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3098     __Pyx_GOTREF(__pyx_t_1);
3099     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3100     __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3101     __Pyx_GOTREF(__pyx_t_2);
3102     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3103     __pyx_r = __pyx_t_2;
3104     __pyx_t_2 = 0;
3105     goto __pyx_L0;
3106   }
3107   __pyx_L5:;
3108
3109   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3110   goto __pyx_L0;
3111   __pyx_L1_error:;
3112   __Pyx_XDECREF(__pyx_t_1);
3113   __Pyx_XDECREF(__pyx_t_2);
3114   __Pyx_AddTraceback("cvcf.VCFRecord.filter.__get__");
3115   __pyx_r = NULL;
3116   __pyx_L0:;
3117   __Pyx_XGIVEREF(__pyx_r);
3118   __Pyx_RefNannyFinishContext();
3119   return __pyx_r;
3120 }
3121
3122 /* "cvcf.pyx":171
3123  * 
3124  *     property info:
3125  *         def __get__(self):             # <<<<<<<<<<<<<<
3126  *             col = self.fields[7]
3127  *             # dictionary of keys, and list of values
3128  */
3129
3130 static PyObject *__pyx_pf_4cvcf_9VCFRecord_4info___get__(PyObject *__pyx_v_self); /*proto*/
3131 static PyObject *__pyx_pf_4cvcf_9VCFRecord_4info___get__(PyObject *__pyx_v_self) {
3132   char *__pyx_v_col;
3133   PyObject *__pyx_v_info;
3134   PyObject *__pyx_v_blurp;
3135   PyObject *__pyx_v_elts;
3136   PyObject *__pyx_v_v;
3137   PyObject *__pyx_r = NULL;
3138   PyObject *__pyx_t_1 = NULL;
3139   PyObject *__pyx_t_2 = NULL;
3140   int __pyx_t_3;
3141   Py_ssize_t __pyx_t_4;
3142   PyObject *__pyx_t_5 = NULL;
3143   Py_ssize_t __pyx_t_6;
3144   PyObject *__pyx_t_7 = NULL;
3145   PyObject *__pyx_t_8 = NULL;
3146   PyObject *__pyx_t_9 = NULL;
3147   __Pyx_RefNannySetupContext("__get__");
3148   __pyx_v_info = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
3149   __pyx_v_blurp = Py_None; __Pyx_INCREF(Py_None);
3150   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
3151   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
3152
3153   /* "cvcf.pyx":172
3154  *     property info:
3155  *         def __get__(self):
3156  *             col = self.fields[7]             # <<<<<<<<<<<<<<
3157  *             # dictionary of keys, and list of values
3158  *             info = {}
3159  */
3160   __pyx_v_col = (((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[7]);
3161
3162   /* "cvcf.pyx":174
3163  *             col = self.fields[7]
3164  *             # dictionary of keys, and list of values
3165  *             info = {}             # <<<<<<<<<<<<<<
3166  *             if col != b".":
3167  *                 for blurp in col.split(';'):
3168  */
3169   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3170   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3171   __Pyx_DECREF(((PyObject *)__pyx_v_info));
3172   __pyx_v_info = __pyx_t_1;
3173   __pyx_t_1 = 0;
3174
3175   /* "cvcf.pyx":175
3176  *             # dictionary of keys, and list of values
3177  *             info = {}
3178  *             if col != b".":             # <<<<<<<<<<<<<<
3179  *                 for blurp in col.split(';'):
3180  *                     elts = blurp.split('=')
3181  */
3182   __pyx_t_1 = PyBytes_FromString(__pyx_v_col); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3183   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3184   __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_kp_b_9), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3185   __Pyx_GOTREF(__pyx_t_2);
3186   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3187   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3188   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3189   if (__pyx_t_3) {
3190
3191     /* "cvcf.pyx":176
3192  *             info = {}
3193  *             if col != b".":
3194  *                 for blurp in col.split(';'):             # <<<<<<<<<<<<<<
3195  *                     elts = blurp.split('=')
3196  *                     if len(elts) == 1: v = None
3197  */
3198     __pyx_t_2 = PyBytes_FromString(__pyx_v_col); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3199     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3200     __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_t_2), __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3201     __Pyx_GOTREF(__pyx_t_1);
3202     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3203     __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3204     __Pyx_GOTREF(__pyx_t_2);
3205     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3206     if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
3207       __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
3208     } else {
3209       __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3210       __Pyx_GOTREF(__pyx_t_1);
3211     }
3212     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3213     for (;;) {
3214       if (likely(PyList_CheckExact(__pyx_t_1))) {
3215         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
3216         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
3217       } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
3218         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
3219         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
3220       } else {
3221         __pyx_t_2 = PyIter_Next(__pyx_t_1);
3222         if (!__pyx_t_2) {
3223           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3224           break;
3225         }
3226         __Pyx_GOTREF(__pyx_t_2);
3227       }
3228       __Pyx_DECREF(__pyx_v_blurp);
3229       __pyx_v_blurp = __pyx_t_2;
3230       __pyx_t_2 = 0;
3231
3232       /* "cvcf.pyx":177
3233  *             if col != b".":
3234  *                 for blurp in col.split(';'):
3235  *                     elts = blurp.split('=')             # <<<<<<<<<<<<<<
3236  *                     if len(elts) == 1: v = None
3237  *                     elif len(elts) == 2: v = elts[1]
3238  */
3239       __pyx_t_2 = PyObject_GetAttr(__pyx_v_blurp, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3240       __Pyx_GOTREF(__pyx_t_2);
3241       __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3242       __Pyx_GOTREF(__pyx_t_5);
3243       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3244       __Pyx_DECREF(__pyx_v_elts);
3245       __pyx_v_elts = __pyx_t_5;
3246       __pyx_t_5 = 0;
3247
3248       /* "cvcf.pyx":178
3249  *                 for blurp in col.split(';'):
3250  *                     elts = blurp.split('=')
3251  *                     if len(elts) == 1: v = None             # <<<<<<<<<<<<<<
3252  *                     elif len(elts) == 2: v = elts[1]
3253  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
3254  */
3255       __pyx_t_6 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3256       __pyx_t_3 = (__pyx_t_6 == 1);
3257       if (__pyx_t_3) {
3258         __Pyx_INCREF(Py_None);
3259         __Pyx_DECREF(__pyx_v_v);
3260         __pyx_v_v = Py_None;
3261         goto __pyx_L8;
3262       }
3263
3264       /* "cvcf.pyx":179
3265  *                     elts = blurp.split('=')
3266  *                     if len(elts) == 1: v = None
3267  *                     elif len(elts) == 2: v = elts[1]             # <<<<<<<<<<<<<<
3268  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
3269  *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))
3270  */
3271       __pyx_t_6 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3272       __pyx_t_3 = (__pyx_t_6 == 2);
3273       if (__pyx_t_3) {
3274         __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3275         __Pyx_GOTREF(__pyx_t_5);
3276         __Pyx_DECREF(__pyx_v_v);
3277         __pyx_v_v = __pyx_t_5;
3278         __pyx_t_5 = 0;
3279         goto __pyx_L8;
3280       }
3281       /*else*/ {
3282
3283         /* "cvcf.pyx":180
3284  *                     if len(elts) == 1: v = None
3285  *                     elif len(elts) == 2: v = elts[1]
3286  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)             # <<<<<<<<<<<<<<
3287  *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))
3288  *             return info
3289  */
3290         __pyx_t_5 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s__error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3291         __Pyx_GOTREF(__pyx_t_5);
3292         __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3293         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3294         __Pyx_INCREF(__pyx_v_self);
3295         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
3296         __Pyx_GIVEREF(__pyx_v_self);
3297         __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3298         __Pyx_GOTREF(__pyx_t_7);
3299         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3300         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ERROR_INFO_STRING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3301         __Pyx_GOTREF(__pyx_t_2);
3302         __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3303         __Pyx_GOTREF(((PyObject *)__pyx_t_8));
3304         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
3305         __Pyx_GIVEREF(__pyx_t_7);
3306         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
3307         __Pyx_GIVEREF(__pyx_t_2);
3308         __pyx_t_7 = 0;
3309         __pyx_t_2 = 0;
3310         __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3311         __Pyx_GOTREF(__pyx_t_2);
3312         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3313         __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
3314         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3315       }
3316       __pyx_L8:;
3317
3318       /* "cvcf.pyx":181
3319  *                     elif len(elts) == 2: v = elts[1]
3320  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
3321  *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))             # <<<<<<<<<<<<<<
3322  *             return info
3323  * 
3324  */
3325       __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s__parse_formatdata); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3326       __Pyx_GOTREF(__pyx_t_2);
3327       __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3328       __Pyx_GOTREF(__pyx_t_8);
3329       __pyx_t_5 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s___info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3330       __Pyx_GOTREF(__pyx_t_5);
3331       __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3332       __Pyx_GOTREF(((PyObject *)__pyx_t_7));
3333       __Pyx_INCREF(__pyx_v_self);
3334       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self);
3335       __Pyx_GIVEREF(__pyx_v_self);
3336       __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3337       __Pyx_GOTREF(__pyx_t_9);
3338       __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3339       __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3340       __Pyx_GOTREF(((PyObject *)__pyx_t_7));
3341       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
3342       __Pyx_GIVEREF(__pyx_t_8);
3343       __Pyx_INCREF(__pyx_v_v);
3344       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_v);
3345       __Pyx_GIVEREF(__pyx_v_v);
3346       PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
3347       __Pyx_GIVEREF(__pyx_t_5);
3348       PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_9);
3349       __Pyx_GIVEREF(__pyx_t_9);
3350       __pyx_t_8 = 0;
3351       __pyx_t_5 = 0;
3352       __pyx_t_9 = 0;
3353       __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3354       __Pyx_GOTREF(__pyx_t_9);
3355       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3356       __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3357       __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3358       __Pyx_GOTREF(__pyx_t_7);
3359       if (PyDict_SetItem(((PyObject *)__pyx_v_info), __pyx_t_7, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3360       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3361       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3362     }
3363     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3364     goto __pyx_L5;
3365   }
3366   __pyx_L5:;
3367
3368   /* "cvcf.pyx":182
3369  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
3370  *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))
3371  *             return info             # <<<<<<<<<<<<<<
3372  * 
3373  *     property format:
3374  */
3375   __Pyx_XDECREF(__pyx_r);
3376   __Pyx_INCREF(((PyObject *)__pyx_v_info));
3377   __pyx_r = ((PyObject *)__pyx_v_info);
3378   goto __pyx_L0;
3379
3380   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3381   goto __pyx_L0;
3382   __pyx_L1_error:;
3383   __Pyx_XDECREF(__pyx_t_1);
3384   __Pyx_XDECREF(__pyx_t_2);
3385   __Pyx_XDECREF(__pyx_t_5);
3386   __Pyx_XDECREF(__pyx_t_7);
3387   __Pyx_XDECREF(__pyx_t_8);
3388   __Pyx_XDECREF(__pyx_t_9);
3389   __Pyx_AddTraceback("cvcf.VCFRecord.info.__get__");
3390   __pyx_r = NULL;
3391   __pyx_L0:;
3392   __Pyx_DECREF(__pyx_v_info);
3393   __Pyx_DECREF(__pyx_v_blurp);
3394   __Pyx_DECREF(__pyx_v_elts);
3395   __Pyx_DECREF(__pyx_v_v);
3396   __Pyx_XGIVEREF(__pyx_r);
3397   __Pyx_RefNannyFinishContext();
3398   return __pyx_r;
3399 }
3400
3401 /* "cvcf.pyx":185
3402  * 
3403  *     property format:
3404  *          def __get__(self):             # <<<<<<<<<<<<<<
3405  *              return self.fields[8].split(':')
3406  * 
3407  */
3408
3409 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6format___get__(PyObject *__pyx_v_self); /*proto*/
3410 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6format___get__(PyObject *__pyx_v_self) {
3411   PyObject *__pyx_r = NULL;
3412   PyObject *__pyx_t_1 = NULL;
3413   PyObject *__pyx_t_2 = NULL;
3414   __Pyx_RefNannySetupContext("__get__");
3415
3416   /* "cvcf.pyx":186
3417  *     property format:
3418  *          def __get__(self):
3419  *              return self.fields[8].split(':')             # <<<<<<<<<<<<<<
3420  * 
3421  *     property samples:
3422  */
3423   __Pyx_XDECREF(__pyx_r);
3424   __pyx_t_1 = PyBytes_FromString((((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[8])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3425   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3426   __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_t_1), __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3427   __Pyx_GOTREF(__pyx_t_2);
3428   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3429   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3430   __Pyx_GOTREF(__pyx_t_1);
3431   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3432   __pyx_r = __pyx_t_1;
3433   __pyx_t_1 = 0;
3434   goto __pyx_L0;
3435
3436   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3437   goto __pyx_L0;
3438   __pyx_L1_error:;
3439   __Pyx_XDECREF(__pyx_t_1);
3440   __Pyx_XDECREF(__pyx_t_2);
3441   __Pyx_AddTraceback("cvcf.VCFRecord.format.__get__");
3442   __pyx_r = NULL;
3443   __pyx_L0:;
3444   __Pyx_XGIVEREF(__pyx_r);
3445   __Pyx_RefNannyFinishContext();
3446   return __pyx_r;
3447 }
3448
3449 /* "cvcf.pyx":189
3450  * 
3451  *     property samples:
3452  *         def __get__(self):             # <<<<<<<<<<<<<<
3453  *             return self.vcf._samples
3454  * 
3455  */
3456
3457 static PyObject *__pyx_pf_4cvcf_9VCFRecord_7samples___get__(PyObject *__pyx_v_self); /*proto*/
3458 static PyObject *__pyx_pf_4cvcf_9VCFRecord_7samples___get__(PyObject *__pyx_v_self) {
3459   PyObject *__pyx_r = NULL;
3460   PyObject *__pyx_t_1 = NULL;
3461   __Pyx_RefNannySetupContext("__get__");
3462
3463   /* "cvcf.pyx":190
3464  *     property samples:
3465  *         def __get__(self):
3466  *             return self.vcf._samples             # <<<<<<<<<<<<<<
3467  * 
3468  *     def __getitem__(self, key):
3469  */
3470   __Pyx_XDECREF(__pyx_r);
3471   __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s___samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3472   __Pyx_GOTREF(__pyx_t_1);
3473   __pyx_r = __pyx_t_1;
3474   __pyx_t_1 = 0;
3475   goto __pyx_L0;
3476
3477   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3478   goto __pyx_L0;
3479   __pyx_L1_error:;
3480   __Pyx_XDECREF(__pyx_t_1);
3481   __Pyx_AddTraceback("cvcf.VCFRecord.samples.__get__");
3482   __pyx_r = NULL;
3483   __pyx_L0:;
3484   __Pyx_XGIVEREF(__pyx_r);
3485   __Pyx_RefNannyFinishContext();
3486   return __pyx_r;
3487 }
3488
3489 /* "cvcf.pyx":192
3490  *             return self.vcf._samples
3491  * 
3492  *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
3493  * 
3494  *         # parse sample columns
3495  */
3496
3497 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
3498 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
3499   PyObject *__pyx_v_values;
3500   PyObject *__pyx_v_alt;
3501   PyObject *__pyx_v_format;
3502   PyObject *__pyx_v_result;
3503   Py_ssize_t __pyx_v_idx;
3504   PyObject *__pyx_v_expected;
3505   PyObject *__pyx_v_value;
3506   PyObject *__pyx_r = NULL;
3507   PyObject *__pyx_t_1 = NULL;
3508   PyObject *__pyx_t_2 = NULL;
3509   Py_ssize_t __pyx_t_3;
3510   Py_ssize_t __pyx_t_4;
3511   int __pyx_t_5;
3512   PyObject *__pyx_t_6 = NULL;
3513   PyObject *__pyx_t_7 = NULL;
3514   PyObject *__pyx_t_8 = NULL;
3515   PyObject *__pyx_t_9 = NULL;
3516   Py_ssize_t __pyx_t_10;
3517   int __pyx_t_11;
3518   int __pyx_t_12;
3519   __Pyx_RefNannySetupContext("__getitem__");
3520   __pyx_v_values = Py_None; __Pyx_INCREF(Py_None);
3521   __pyx_v_alt = Py_None; __Pyx_INCREF(Py_None);
3522   __pyx_v_format = Py_None; __Pyx_INCREF(Py_None);
3523   __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
3524   __pyx_v_expected = Py_None; __Pyx_INCREF(Py_None);
3525   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
3526
3527   /* "cvcf.pyx":195
3528  * 
3529  *         # parse sample columns
3530  *         values = self.fields[self.vcf._sample2column[key]].split(':')             # <<<<<<<<<<<<<<
3531  *         alt = self.alt
3532  *         format = self.format
3533  */
3534   __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s___sample2column); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3535   __Pyx_GOTREF(__pyx_t_1);
3536   __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3537   __Pyx_GOTREF(__pyx_t_2);
3538   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3539   __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3540   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3541   __pyx_t_2 = PyBytes_FromString((((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[__pyx_t_3])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3542   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3543   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_t_2), __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3544   __Pyx_GOTREF(__pyx_t_1);
3545   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3546   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3547   __Pyx_GOTREF(__pyx_t_2);
3548   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3549   __Pyx_DECREF(__pyx_v_values);
3550   __pyx_v_values = __pyx_t_2;
3551   __pyx_t_2 = 0;
3552
3553   /* "cvcf.pyx":196
3554  *         # parse sample columns
3555  *         values = self.fields[self.vcf._sample2column[key]].split(':')
3556  *         alt = self.alt             # <<<<<<<<<<<<<<
3557  *         format = self.format
3558  * 
3559  */
3560   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3561   __Pyx_GOTREF(__pyx_t_2);
3562   __Pyx_DECREF(__pyx_v_alt);
3563   __pyx_v_alt = __pyx_t_2;
3564   __pyx_t_2 = 0;
3565
3566   /* "cvcf.pyx":197
3567  *         values = self.fields[self.vcf._sample2column[key]].split(':')
3568  *         alt = self.alt
3569  *         format = self.format             # <<<<<<<<<<<<<<
3570  * 
3571  *         if len(values) > len(format):
3572  */
3573   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3574   __Pyx_GOTREF(__pyx_t_2);
3575   __Pyx_DECREF(__pyx_v_format);
3576   __pyx_v_format = __pyx_t_2;
3577   __pyx_t_2 = 0;
3578
3579   /* "cvcf.pyx":199
3580  *         format = self.format
3581  * 
3582  *         if len(values) > len(format):             # <<<<<<<<<<<<<<
3583  *             self.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\
3584  *                            (len(values),key,len(format)))
3585  */
3586   __pyx_t_3 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3587   __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3588   __pyx_t_5 = (__pyx_t_3 > __pyx_t_4);
3589   if (__pyx_t_5) {
3590
3591     /* "cvcf.pyx":200
3592  * 
3593  *         if len(values) > len(format):
3594  *             self.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\             # <<<<<<<<<<<<<<
3595  *                            (len(values),key,len(format)))
3596  * 
3597  */
3598     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3599     __Pyx_GOTREF(__pyx_t_2);
3600     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3601     __Pyx_GOTREF(__pyx_t_1);
3602     __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3603     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3604     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
3605     __Pyx_GIVEREF(__pyx_t_1);
3606     __pyx_t_1 = 0;
3607     __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3608     __Pyx_GOTREF(__pyx_t_1);
3609     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3610     __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_18); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3611     __Pyx_GOTREF(__pyx_t_6);
3612
3613     /* "cvcf.pyx":201
3614  *         if len(values) > len(format):
3615  *             self.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\
3616  *                            (len(values),key,len(format)))             # <<<<<<<<<<<<<<
3617  * 
3618  *         result = {}
3619  */
3620     __pyx_t_4 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3621     __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3622     __Pyx_GOTREF(__pyx_t_7);
3623     __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3624     __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3625     __Pyx_GOTREF(__pyx_t_8);
3626     __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3627     __Pyx_GOTREF(((PyObject *)__pyx_t_9));
3628     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
3629     __Pyx_GIVEREF(__pyx_t_7);
3630     __Pyx_INCREF(__pyx_v_key);
3631     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_key);
3632     __Pyx_GIVEREF(__pyx_v_key);
3633     PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
3634     __Pyx_GIVEREF(__pyx_t_8);
3635     __pyx_t_7 = 0;
3636     __pyx_t_8 = 0;
3637     __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_19), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3638     __Pyx_GOTREF(((PyObject *)__pyx_t_8));
3639     __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
3640     __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3641     __Pyx_GOTREF(((PyObject *)__pyx_t_9));
3642     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
3643     __Pyx_GIVEREF(__pyx_t_1);
3644     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
3645     __Pyx_GIVEREF(__pyx_t_6);
3646     PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_t_8));
3647     __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
3648     __pyx_t_1 = 0;
3649     __pyx_t_6 = 0;
3650     __pyx_t_8 = 0;
3651     __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3652     __Pyx_GOTREF(__pyx_t_8);
3653     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3654     __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
3655     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3656     goto __pyx_L5;
3657   }
3658   __pyx_L5:;
3659
3660   /* "cvcf.pyx":203
3661  *                            (len(values),key,len(format)))
3662  * 
3663  *         result = {}             # <<<<<<<<<<<<<<
3664  *         for idx in range(len(format)):
3665  *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)
3666  */
3667   __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3668   __Pyx_GOTREF(((PyObject *)__pyx_t_8));
3669   __Pyx_DECREF(((PyObject *)__pyx_v_result));
3670   __pyx_v_result = __pyx_t_8;
3671   __pyx_t_8 = 0;
3672
3673   /* "cvcf.pyx":204
3674  * 
3675  *         result = {}
3676  *         for idx in range(len(format)):             # <<<<<<<<<<<<<<
3677  *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)
3678  *             if idx < len(values): value = values[idx]
3679  */
3680   __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3681   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_4; __pyx_t_3+=1) {
3682     __pyx_v_idx = __pyx_t_3;
3683
3684     /* "cvcf.pyx":205
3685  *         result = {}
3686  *         for idx in range(len(format)):
3687  *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)             # <<<<<<<<<<<<<<
3688  *             if idx < len(values): value = values[idx]
3689  *             else:
3690  */
3691     __pyx_t_8 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s__get_expected); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3692     __Pyx_GOTREF(__pyx_t_8);
3693     __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3694     __Pyx_GOTREF(__pyx_t_9);
3695     __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s___format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3696     __Pyx_GOTREF(__pyx_t_2);
3697     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3698     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3699     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9);
3700     __Pyx_GIVEREF(__pyx_t_9);
3701     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
3702     __Pyx_GIVEREF(__pyx_t_2);
3703     __Pyx_INCREF(__pyx_v_alt);
3704     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_alt);
3705     __Pyx_GIVEREF(__pyx_v_alt);
3706     __pyx_t_9 = 0;
3707     __pyx_t_2 = 0;
3708     __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3709     __Pyx_GOTREF(__pyx_t_2);
3710     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3711     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3712     __Pyx_DECREF(__pyx_v_expected);
3713     __pyx_v_expected = __pyx_t_2;
3714     __pyx_t_2 = 0;
3715
3716     /* "cvcf.pyx":206
3717  *         for idx in range(len(format)):
3718  *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)
3719  *             if idx < len(values): value = values[idx]             # <<<<<<<<<<<<<<
3720  *             else:
3721  *                 if expected == -1: value = "."
3722  */
3723     __pyx_t_10 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3724     __pyx_t_5 = (__pyx_v_idx < __pyx_t_10);
3725     if (__pyx_t_5) {
3726       __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3727       __Pyx_GOTREF(__pyx_t_2);
3728       __Pyx_DECREF(__pyx_v_value);
3729       __pyx_v_value = __pyx_t_2;
3730       __pyx_t_2 = 0;
3731       goto __pyx_L8;
3732     }
3733     /*else*/ {
3734
3735       /* "cvcf.pyx":208
3736  *             if idx < len(values): value = values[idx]
3737  *             else:
3738  *                 if expected == -1: value = "."             # <<<<<<<<<<<<<<
3739  *                 else: value = ",".join(["."]*expected)
3740  * 
3741  */
3742       __pyx_t_2 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3743       __Pyx_GOTREF(__pyx_t_2);
3744       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3745       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3746       if (__pyx_t_5) {
3747         __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
3748         __Pyx_DECREF(__pyx_v_value);
3749         __pyx_v_value = ((PyObject *)__pyx_kp_s_9);
3750         goto __pyx_L9;
3751       }
3752       /*else*/ {
3753
3754         /* "cvcf.pyx":209
3755  *             else:
3756  *                 if expected == -1: value = "."
3757  *                 else: value = ",".join(["."]*expected)             # <<<<<<<<<<<<<<
3758  * 
3759  *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
3760  */
3761         __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3762         __Pyx_GOTREF(__pyx_t_2);
3763         __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3764         __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3765         __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
3766         PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_9));
3767         __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
3768         __pyx_t_8 = PyNumber_Multiply(((PyObject *)__pyx_t_6), __pyx_v_expected); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3769         __Pyx_GOTREF(__pyx_t_8);
3770         __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3771         __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3772         __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3773         PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
3774         __Pyx_GIVEREF(__pyx_t_8);
3775         __pyx_t_8 = 0;
3776         __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3777         __Pyx_GOTREF(__pyx_t_8);
3778         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3779         __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3780         __Pyx_DECREF(__pyx_v_value);
3781         __pyx_v_value = __pyx_t_8;
3782         __pyx_t_8 = 0;
3783       }
3784       __pyx_L9:;
3785     }
3786     __pyx_L8:;
3787
3788     /* "cvcf.pyx":211
3789  *                 else: value = ",".join(["."]*expected)
3790  * 
3791  *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))             # <<<<<<<<<<<<<<
3792  *             if expected != -1 and len(result[format[idx]]) != expected:
3793  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
3794  */
3795     __pyx_t_8 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s__parse_formatdata); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3796     __Pyx_GOTREF(__pyx_t_8);
3797     __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3798     __Pyx_GOTREF(__pyx_t_6);
3799     __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s___format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3800     __Pyx_GOTREF(__pyx_t_2);
3801     __pyx_t_9 = PyBytes_FromString(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.data); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3802     __Pyx_GOTREF(((PyObject *)__pyx_t_9));
3803     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3804     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3805     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_9));
3806     __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
3807     __pyx_t_9 = 0;
3808     __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3809     __Pyx_GOTREF(__pyx_t_9);
3810     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3811     __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3812     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3813     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
3814     __Pyx_GIVEREF(__pyx_t_6);
3815     __Pyx_INCREF(__pyx_v_value);
3816     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
3817     __Pyx_GIVEREF(__pyx_v_value);
3818     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
3819     __Pyx_GIVEREF(__pyx_t_2);
3820     PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9);
3821     __Pyx_GIVEREF(__pyx_t_9);
3822     __pyx_t_6 = 0;
3823     __pyx_t_2 = 0;
3824     __pyx_t_9 = 0;
3825     __pyx_t_9 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3826     __Pyx_GOTREF(__pyx_t_9);
3827     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3828     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3829     __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3830     __Pyx_GOTREF(__pyx_t_1);
3831     if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_t_1, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3832     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3833     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3834
3835     /* "cvcf.pyx":212
3836  * 
3837  *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
3838  *             if expected != -1 and len(result[format[idx]]) != expected:             # <<<<<<<<<<<<<<
3839  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
3840  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
3841  */
3842     __pyx_t_9 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3843     __Pyx_GOTREF(__pyx_t_9);
3844     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3845     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3846     if (__pyx_t_5) {
3847       __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3848       __Pyx_GOTREF(__pyx_t_9);
3849       __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_9); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3850       __Pyx_GOTREF(__pyx_t_1);
3851       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3852       __pyx_t_10 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3853       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3854       __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3855       __Pyx_GOTREF(__pyx_t_1);
3856       __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_v_expected, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3857       __Pyx_GOTREF(__pyx_t_9);
3858       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3859       __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3860       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3861       __pyx_t_12 = __pyx_t_11;
3862     } else {
3863       __pyx_t_12 = __pyx_t_5;
3864     }
3865     if (__pyx_t_12) {
3866
3867       /* "cvcf.pyx":213
3868  *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
3869  *             if expected != -1 and len(result[format[idx]]) != expected:
3870  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,             # <<<<<<<<<<<<<<
3871  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
3872  *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
3873  */
3874       __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3875       __Pyx_GOTREF(__pyx_t_9);
3876       __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3877       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3878       __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3879       __Pyx_GOTREF(((PyObject *)__pyx_t_8));
3880       PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_1));
3881       __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
3882       __pyx_t_1 = 0;
3883       __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3884       __Pyx_GOTREF(__pyx_t_1);
3885       __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
3886       __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_20); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3887       __Pyx_GOTREF(__pyx_t_8);
3888
3889       /* "cvcf.pyx":214
3890  *             if expected != -1 and len(result[format[idx]]) != expected:
3891  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
3892  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))             # <<<<<<<<<<<<<<
3893  *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
3894  *                 result[format[idx]] = result[format[idx]][:expected]
3895  */
3896       __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3897       __Pyx_GOTREF(__pyx_t_2);
3898       __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3899       __Pyx_GOTREF(__pyx_t_6);
3900       __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_6); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3901       __Pyx_GOTREF(__pyx_t_7);
3902       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3903       __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3904       __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3905       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
3906       __Pyx_GIVEREF(__pyx_t_2);
3907       __Pyx_INCREF(__pyx_v_expected);
3908       PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_expected);
3909       __Pyx_GIVEREF(__pyx_v_expected);
3910       PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7);
3911       __Pyx_GIVEREF(__pyx_t_7);
3912       __pyx_t_2 = 0;
3913       __pyx_t_7 = 0;
3914       __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3915       __Pyx_GOTREF(((PyObject *)__pyx_t_7));
3916       __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3917       __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3918       __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3919       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
3920       __Pyx_GIVEREF(__pyx_t_1);
3921       PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8);
3922       __Pyx_GIVEREF(__pyx_t_8);
3923       PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_t_7));
3924       __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
3925       __pyx_t_1 = 0;
3926       __pyx_t_8 = 0;
3927       __pyx_t_7 = 0;
3928       __pyx_t_7 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3929       __Pyx_GOTREF(__pyx_t_7);
3930       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3931       __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3932       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3933
3934       /* "cvcf.pyx":215
3935  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
3936  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
3937  *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))             # <<<<<<<<<<<<<<
3938  *                 result[format[idx]] = result[format[idx]][:expected]
3939  * 
3940  */
3941       __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3942       __Pyx_GOTREF(__pyx_t_7);
3943       __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_7); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3944       __Pyx_GOTREF(__pyx_t_6);
3945       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3946       __pyx_t_10 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3947       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3948       __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3949       __Pyx_GOTREF(__pyx_t_6);
3950       __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_v_expected, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3951       __Pyx_GOTREF(__pyx_t_7);
3952       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3953       __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3954       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3955       if (__pyx_t_12) {
3956         __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3957         __Pyx_GOTREF(__pyx_t_7);
3958         __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_7); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3959         __Pyx_GOTREF(__pyx_t_6);
3960         __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3961         __Pyx_GOTREF(__pyx_t_9);
3962         __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_9); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3963         __Pyx_GOTREF(__pyx_t_8);
3964         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3965         __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3966         __Pyx_GOTREF(__pyx_t_9);
3967         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3968         __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3969         __Pyx_GOTREF(((PyObject *)__pyx_t_8));
3970         PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
3971         __Pyx_GIVEREF(__pyx_t_9);
3972         __pyx_t_9 = 0;
3973         __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3974         __Pyx_GOTREF(__pyx_t_9);
3975         __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_9); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3976         __Pyx_GOTREF(__pyx_t_1);
3977         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3978         __pyx_t_10 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3979         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3980         __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3981         __Pyx_GOTREF(__pyx_t_1);
3982         __pyx_t_9 = PyNumber_Subtract(__pyx_v_expected, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3983         __Pyx_GOTREF(__pyx_t_9);
3984         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3985         __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_t_8), __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3986         __Pyx_GOTREF(__pyx_t_1);
3987         __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
3988         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3989         __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3990         __Pyx_GOTREF(__pyx_t_9);
3991         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3992         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3993         if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_t_7, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3994         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3995         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3996         goto __pyx_L11;
3997       }
3998       __pyx_L11:;
3999
4000       /* "cvcf.pyx":216
4001  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
4002  *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
4003  *                 result[format[idx]] = result[format[idx]][:expected]             # <<<<<<<<<<<<<<
4004  * 
4005  *         return result
4006  */
4007       __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4008       __Pyx_GOTREF(__pyx_t_7);
4009       __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_7); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4010       __Pyx_GOTREF(__pyx_t_9);
4011       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4012       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_expected); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4013       __pyx_t_7 = __Pyx_PySequence_GetSlice(__pyx_t_9, 0, __pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4014       __Pyx_GOTREF(__pyx_t_7);
4015       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4016       __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4017       __Pyx_GOTREF(__pyx_t_9);
4018       if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_t_9, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4019       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4020       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4021       goto __pyx_L10;
4022     }
4023     __pyx_L10:;
4024   }
4025
4026   /* "cvcf.pyx":218
4027  *                 result[format[idx]] = result[format[idx]][:expected]
4028  * 
4029  *         return result             # <<<<<<<<<<<<<<
4030  * 
4031  * 
4032  */
4033   __Pyx_XDECREF(__pyx_r);
4034   __Pyx_INCREF(((PyObject *)__pyx_v_result));
4035   __pyx_r = ((PyObject *)__pyx_v_result);
4036   goto __pyx_L0;
4037
4038   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4039   goto __pyx_L0;
4040   __pyx_L1_error:;
4041   __Pyx_XDECREF(__pyx_t_1);
4042   __Pyx_XDECREF(__pyx_t_2);
4043   __Pyx_XDECREF(__pyx_t_6);
4044   __Pyx_XDECREF(__pyx_t_7);
4045   __Pyx_XDECREF(__pyx_t_8);
4046   __Pyx_XDECREF(__pyx_t_9);
4047   __Pyx_AddTraceback("cvcf.VCFRecord.__getitem__");
4048   __pyx_r = NULL;
4049   __pyx_L0:;
4050   __Pyx_DECREF(__pyx_v_values);
4051   __Pyx_DECREF(__pyx_v_alt);
4052   __Pyx_DECREF(__pyx_v_format);
4053   __Pyx_DECREF(__pyx_v_result);
4054   __Pyx_DECREF(__pyx_v_expected);
4055   __Pyx_DECREF(__pyx_v_value);
4056   __Pyx_XGIVEREF(__pyx_r);
4057   __Pyx_RefNannyFinishContext();
4058   return __pyx_r;
4059 }
4060
4061 /* "cvcf.pyx":224
4062  *     '''converts a :term:`tabix row` into a VCF record.'''
4063  *     cdef vcffile
4064  *     def __init__(self, vcffile ):             # <<<<<<<<<<<<<<
4065  *         self.vcffile = vcffile
4066  *     def __call__(self, char * buffer, int len ):
4067  */
4068
4069 static int __pyx_pf_4cvcf_11asVCFRecord___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4070 static int __pyx_pf_4cvcf_11asVCFRecord___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4071   PyObject *__pyx_v_vcffile = 0;
4072   int __pyx_r;
4073   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vcffile,0};
4074   __Pyx_RefNannySetupContext("__init__");
4075   if (unlikely(__pyx_kwds)) {
4076     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4077     PyObject* values[1] = {0};
4078     switch (PyTuple_GET_SIZE(__pyx_args)) {
4079       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4080       case  0: break;
4081       default: goto __pyx_L5_argtuple_error;
4082     }
4083     switch (PyTuple_GET_SIZE(__pyx_args)) {
4084       case  0:
4085       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vcffile);
4086       if (likely(values[0])) kw_args--;
4087       else goto __pyx_L5_argtuple_error;
4088     }
4089     if (unlikely(kw_args > 0)) {
4090       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4091     }
4092     __pyx_v_vcffile = values[0];
4093   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
4094     goto __pyx_L5_argtuple_error;
4095   } else {
4096     __pyx_v_vcffile = PyTuple_GET_ITEM(__pyx_args, 0);
4097   }
4098   goto __pyx_L4_argument_unpacking_done;
4099   __pyx_L5_argtuple_error:;
4100   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4101   __pyx_L3_error:;
4102   __Pyx_AddTraceback("cvcf.asVCFRecord.__init__");
4103   __Pyx_RefNannyFinishContext();
4104   return -1;
4105   __pyx_L4_argument_unpacking_done:;
4106
4107   /* "cvcf.pyx":225
4108  *     cdef vcffile
4109  *     def __init__(self, vcffile ):
4110  *         self.vcffile = vcffile             # <<<<<<<<<<<<<<
4111  *     def __call__(self, char * buffer, int len ):
4112  *         cdef VCFRecord r
4113  */
4114   __Pyx_INCREF(__pyx_v_vcffile);
4115   __Pyx_GIVEREF(__pyx_v_vcffile);
4116   __Pyx_GOTREF(((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4117   __Pyx_DECREF(((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4118   ((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile = __pyx_v_vcffile;
4119
4120   __pyx_r = 0;
4121   __Pyx_RefNannyFinishContext();
4122   return __pyx_r;
4123 }
4124
4125 /* "cvcf.pyx":226
4126  *     def __init__(self, vcffile ):
4127  *         self.vcffile = vcffile
4128  *     def __call__(self, char * buffer, int len ):             # <<<<<<<<<<<<<<
4129  *         cdef VCFRecord r
4130  *         r = VCFRecord( self.vcffile )
4131  */
4132
4133 static PyObject *__pyx_pf_4cvcf_11asVCFRecord_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4134 static PyObject *__pyx_pf_4cvcf_11asVCFRecord_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4135   char *__pyx_v_buffer;
4136   int __pyx_v_len;
4137   struct __pyx_obj_4cvcf_VCFRecord *__pyx_v_r;
4138   PyObject *__pyx_r = NULL;
4139   PyObject *__pyx_t_1 = NULL;
4140   PyObject *__pyx_t_2 = NULL;
4141   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__buffer,&__pyx_n_s__len,0};
4142   __Pyx_RefNannySetupContext("__call__");
4143   if (unlikely(__pyx_kwds)) {
4144     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4145     PyObject* values[2] = {0,0};
4146     switch (PyTuple_GET_SIZE(__pyx_args)) {
4147       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4148       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4149       case  0: break;
4150       default: goto __pyx_L5_argtuple_error;
4151     }
4152     switch (PyTuple_GET_SIZE(__pyx_args)) {
4153       case  0:
4154       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buffer);
4155       if (likely(values[0])) kw_args--;
4156       else goto __pyx_L5_argtuple_error;
4157       case  1:
4158       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__len);
4159       if (likely(values[1])) kw_args--;
4160       else {
4161         __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4162       }
4163     }
4164     if (unlikely(kw_args > 0)) {
4165       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4166     }
4167     __pyx_v_buffer = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4168     __pyx_v_len = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4169   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4170     goto __pyx_L5_argtuple_error;
4171   } else {
4172     __pyx_v_buffer = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4173     __pyx_v_len = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4174   }
4175   goto __pyx_L4_argument_unpacking_done;
4176   __pyx_L5_argtuple_error:;
4177   __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4178   __pyx_L3_error:;
4179   __Pyx_AddTraceback("cvcf.asVCFRecord.__call__");
4180   __Pyx_RefNannyFinishContext();
4181   return NULL;
4182   __pyx_L4_argument_unpacking_done:;
4183   __pyx_v_r = ((struct __pyx_obj_4cvcf_VCFRecord *)Py_None); __Pyx_INCREF(Py_None);
4184
4185   /* "cvcf.pyx":228
4186  *     def __call__(self, char * buffer, int len ):
4187  *         cdef VCFRecord r
4188  *         r = VCFRecord( self.vcffile )             # <<<<<<<<<<<<<<
4189  *         r.copy( buffer, len )
4190  *         return r
4191  */
4192   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4193   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
4194   __Pyx_INCREF(((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4195   PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4196   __Pyx_GIVEREF(((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4197   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cvcf_VCFRecord)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4198   __Pyx_GOTREF(__pyx_t_2);
4199   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
4200   __Pyx_DECREF(((PyObject *)__pyx_v_r));
4201   __pyx_v_r = ((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_t_2);
4202   __pyx_t_2 = 0;
4203
4204   /* "cvcf.pyx":229
4205  *         cdef VCFRecord r
4206  *         r = VCFRecord( self.vcffile )
4207  *         r.copy( buffer, len )             # <<<<<<<<<<<<<<
4208  *         return r
4209  * 
4210  */
4211   __pyx_t_2 = ((struct __pyx_vtabstruct_4cvcf_VCFRecord *)__pyx_v_r->__pyx_base.__pyx_vtab)->__pyx_base.copy(((struct __pyx_obj_10TabProxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4212   __Pyx_GOTREF(__pyx_t_2);
4213   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4214
4215   /* "cvcf.pyx":230
4216  *         r = VCFRecord( self.vcffile )
4217  *         r.copy( buffer, len )
4218  *         return r             # <<<<<<<<<<<<<<
4219  * 
4220  * class VCF(object):
4221  */
4222   __Pyx_XDECREF(__pyx_r);
4223   __Pyx_INCREF(((PyObject *)__pyx_v_r));
4224   __pyx_r = ((PyObject *)__pyx_v_r);
4225   goto __pyx_L0;
4226
4227   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4228   goto __pyx_L0;
4229   __pyx_L1_error:;
4230   __Pyx_XDECREF(__pyx_t_1);
4231   __Pyx_XDECREF(__pyx_t_2);
4232   __Pyx_AddTraceback("cvcf.asVCFRecord.__call__");
4233   __pyx_r = NULL;
4234   __pyx_L0:;
4235   __Pyx_DECREF((PyObject *)__pyx_v_r);
4236   __Pyx_XGIVEREF(__pyx_r);
4237   __Pyx_RefNannyFinishContext();
4238   return __pyx_r;
4239 }
4240
4241 /* "cvcf.pyx":306
4242  *     _lines = None
4243  * 
4244  *     def __init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False):             # <<<<<<<<<<<<<<
4245  *         # make error identifiers accessible by name
4246  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id
4247  */
4248
4249 static PyObject *__pyx_pf_4cvcf_3VCF___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4250 static PyMethodDef __pyx_mdef_4cvcf_3VCF___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_4cvcf_3VCF___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
4251 static PyObject *__pyx_pf_4cvcf_3VCF___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4252   PyObject *__pyx_v_self = 0;
4253   PyObject *__pyx_v__copy = 0;
4254   PyObject *__pyx_v_reference = 0;
4255   PyObject *__pyx_v_regions = 0;
4256   PyObject *__pyx_v_lines = 0;
4257   PyObject *__pyx_v_leftalign = 0;
4258   PyObject *__pyx_v_id;
4259   PyObject *__pyx_r = NULL;
4260   Py_ssize_t __pyx_t_1;
4261   PyObject *__pyx_t_2 = NULL;
4262   PyObject *__pyx_t_3 = NULL;
4263   PyObject *__pyx_t_4 = NULL;
4264   PyObject *__pyx_t_5 = NULL;
4265   int __pyx_t_6;
4266   static 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};
4267   __Pyx_RefNannySetupContext("__init__");
4268   __pyx_self = __pyx_self;
4269   if (unlikely(__pyx_kwds)) {
4270     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4271     PyObject* values[6] = {0,0,0,0,0,0};
4272     values[1] = ((PyObject *)Py_None);
4273     values[2] = ((PyObject *)Py_None);
4274     values[3] = ((PyObject *)Py_None);
4275     values[4] = ((PyObject *)Py_None);
4276     values[5] = __pyx_k_22;
4277     switch (PyTuple_GET_SIZE(__pyx_args)) {
4278       case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4279       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4280       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4281       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4282       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4283       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4284       case  0: break;
4285       default: goto __pyx_L5_argtuple_error;
4286     }
4287     switch (PyTuple_GET_SIZE(__pyx_args)) {
4288       case  0:
4289       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
4290       if (likely(values[0])) kw_args--;
4291       else goto __pyx_L5_argtuple_error;
4292       case  1:
4293       if (kw_args > 0) {
4294         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s___copy);
4295         if (value) { values[1] = value; kw_args--; }
4296       }
4297       case  2:
4298       if (kw_args > 0) {
4299         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
4300         if (value) { values[2] = value; kw_args--; }
4301       }
4302       case  3:
4303       if (kw_args > 0) {
4304         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__regions);
4305         if (value) { values[3] = value; kw_args--; }
4306       }
4307       case  4:
4308       if (kw_args > 0) {
4309         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines);
4310         if (value) { values[4] = value; kw_args--; }
4311       }
4312       case  5:
4313       if (kw_args > 0) {
4314         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__leftalign);
4315         if (value) { values[5] = value; kw_args--; }
4316       }
4317     }
4318     if (unlikely(kw_args > 0)) {
4319       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4320     }
4321     __pyx_v_self = values[0];
4322     __pyx_v__copy = values[1];
4323     __pyx_v_reference = values[2];
4324     __pyx_v_regions = values[3];
4325     __pyx_v_lines = values[4];
4326     __pyx_v_leftalign = values[5];
4327   } else {
4328     __pyx_v__copy = ((PyObject *)Py_None);
4329     __pyx_v_reference = ((PyObject *)Py_None);
4330     __pyx_v_regions = ((PyObject *)Py_None);
4331     __pyx_v_lines = ((PyObject *)Py_None);
4332     __pyx_v_leftalign = __pyx_k_22;
4333     switch (PyTuple_GET_SIZE(__pyx_args)) {
4334       case  6: __pyx_v_leftalign = PyTuple_GET_ITEM(__pyx_args, 5);
4335       case  5: __pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 4);
4336       case  4: __pyx_v_regions = PyTuple_GET_ITEM(__pyx_args, 3);
4337       case  3: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 2);
4338       case  2: __pyx_v__copy = PyTuple_GET_ITEM(__pyx_args, 1);
4339       case  1: __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
4340       break;
4341       default: goto __pyx_L5_argtuple_error;
4342     }
4343   }
4344   goto __pyx_L4_argument_unpacking_done;
4345   __pyx_L5_argtuple_error:;
4346   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4347   __pyx_L3_error:;
4348   __Pyx_AddTraceback("cvcf.VCF.__init__");
4349   __Pyx_RefNannyFinishContext();
4350   return NULL;
4351   __pyx_L4_argument_unpacking_done:;
4352   __pyx_v_id = Py_None; __Pyx_INCREF(Py_None);
4353
4354   /* "cvcf.pyx":308
4355  *     def __init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False):
4356  *         # make error identifiers accessible by name
4357  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id             # <<<<<<<<<<<<<<
4358  *         if _copy != None:
4359  *             self._leftalign = _copy._leftalign
4360  */
4361   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___errors); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4362   __Pyx_GOTREF(__pyx_t_2);
4363   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4364   __Pyx_GOTREF(__pyx_t_3);
4365   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4366   __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4367   __Pyx_GOTREF(__pyx_t_2);
4368   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4369   if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
4370     __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
4371   } else {
4372     __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4373     __Pyx_GOTREF(__pyx_t_3);
4374   }
4375   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4376   for (;;) {
4377     if (likely(PyList_CheckExact(__pyx_t_3))) {
4378       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
4379       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++;
4380     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
4381       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
4382       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++;
4383     } else {
4384       __pyx_t_2 = PyIter_Next(__pyx_t_3);
4385       if (!__pyx_t_2) {
4386         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4387         break;
4388       }
4389       __Pyx_GOTREF(__pyx_t_2);
4390     }
4391     __Pyx_DECREF(__pyx_v_id);
4392     __pyx_v_id = __pyx_t_2;
4393     __pyx_t_2 = 0;
4394     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____dict__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4395     __Pyx_GOTREF(__pyx_t_2);
4396     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___errors); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4397     __Pyx_GOTREF(__pyx_t_4);
4398     __pyx_t_5 = PyObject_GetItem(__pyx_t_4, __pyx_v_id); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4399     __Pyx_GOTREF(__pyx_t_5);
4400     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4401     __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4402     __Pyx_GOTREF(__pyx_t_4);
4403     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4404     __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4405     __Pyx_GOTREF(__pyx_t_5);
4406     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4407     __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4408     __Pyx_GOTREF(__pyx_t_4);
4409     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4410     if (PyObject_SetItem(__pyx_t_2, __pyx_t_4, __pyx_v_id) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4411     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4412     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4413   }
4414   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4415
4416   /* "cvcf.pyx":309
4417  *         # make error identifiers accessible by name
4418  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id
4419  *         if _copy != None:             # <<<<<<<<<<<<<<
4420  *             self._leftalign = _copy._leftalign
4421  *             self._header = _copy._header[:]
4422  */
4423   __pyx_t_3 = PyObject_RichCompare(__pyx_v__copy, Py_None, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4424   __Pyx_GOTREF(__pyx_t_3);
4425   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4426   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4427   if (__pyx_t_6) {
4428
4429     /* "cvcf.pyx":310
4430  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id
4431  *         if _copy != None:
4432  *             self._leftalign = _copy._leftalign             # <<<<<<<<<<<<<<
4433  *             self._header = _copy._header[:]
4434  *             self._version = _copy._version
4435  */
4436     __pyx_t_3 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___leftalign); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4437     __Pyx_GOTREF(__pyx_t_3);
4438     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___leftalign, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4439     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4440
4441     /* "cvcf.pyx":311
4442  *         if _copy != None:
4443  *             self._leftalign = _copy._leftalign
4444  *             self._header = _copy._header[:]             # <<<<<<<<<<<<<<
4445  *             self._version = _copy._version
4446  *             self._info = copy.deepcopy(_copy._info)
4447  */
4448     __pyx_t_3 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4449     __Pyx_GOTREF(__pyx_t_3);
4450     __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_t_3, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4451     __Pyx_GOTREF(__pyx_t_4);
4452     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4453     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___header, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4454     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4455
4456     /* "cvcf.pyx":312
4457  *             self._leftalign = _copy._leftalign
4458  *             self._header = _copy._header[:]
4459  *             self._version = _copy._version             # <<<<<<<<<<<<<<
4460  *             self._info = copy.deepcopy(_copy._info)
4461  *             self._filter = copy.deepcopy(_copy._filter)
4462  */
4463     __pyx_t_4 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___version); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4464     __Pyx_GOTREF(__pyx_t_4);
4465     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___version, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4466     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4467
4468     /* "cvcf.pyx":313
4469  *             self._header = _copy._header[:]
4470  *             self._version = _copy._version
4471  *             self._info = copy.deepcopy(_copy._info)             # <<<<<<<<<<<<<<
4472  *             self._filter = copy.deepcopy(_copy._filter)
4473  *             self._format = copy.deepcopy(_copy._format)
4474  */
4475     __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4476     __Pyx_GOTREF(__pyx_t_4);
4477     __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4478     __Pyx_GOTREF(__pyx_t_3);
4479     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4480     __pyx_t_4 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4481     __Pyx_GOTREF(__pyx_t_4);
4482     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4483     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4484     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
4485     __Pyx_GIVEREF(__pyx_t_4);
4486     __pyx_t_4 = 0;
4487     __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4488     __Pyx_GOTREF(__pyx_t_4);
4489     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4490     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
4491     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___info, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4492     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4493
4494     /* "cvcf.pyx":314
4495  *             self._version = _copy._version
4496  *             self._info = copy.deepcopy(_copy._info)
4497  *             self._filter = copy.deepcopy(_copy._filter)             # <<<<<<<<<<<<<<
4498  *             self._format = copy.deepcopy(_copy._format)
4499  *             self._samples = _copy._samples[:]
4500  */
4501     __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4502     __Pyx_GOTREF(__pyx_t_4);
4503     __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4504     __Pyx_GOTREF(__pyx_t_2);
4505     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4506     __pyx_t_4 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___filter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4507     __Pyx_GOTREF(__pyx_t_4);
4508     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4509     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
4510     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
4511     __Pyx_GIVEREF(__pyx_t_4);
4512     __pyx_t_4 = 0;
4513     __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4514     __Pyx_GOTREF(__pyx_t_4);
4515     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4516     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
4517     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___filter, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4518     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4519
4520     /* "cvcf.pyx":315
4521  *             self._info = copy.deepcopy(_copy._info)
4522  *             self._filter = copy.deepcopy(_copy._filter)
4523  *             self._format = copy.deepcopy(_copy._format)             # <<<<<<<<<<<<<<
4524  *             self._samples = _copy._samples[:]
4525  *             self._sample2column = copy.deepcopy(_copy._sample2column)
4526  */
4527     __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4528     __Pyx_GOTREF(__pyx_t_4);
4529     __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4530     __Pyx_GOTREF(__pyx_t_3);
4531     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4532     __pyx_t_4 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4533     __Pyx_GOTREF(__pyx_t_4);
4534     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4535     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4536     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
4537     __Pyx_GIVEREF(__pyx_t_4);
4538     __pyx_t_4 = 0;
4539     __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4540     __Pyx_GOTREF(__pyx_t_4);
4541     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4542     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
4543     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___format, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4544     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4545
4546     /* "cvcf.pyx":316
4547  *             self._filter = copy.deepcopy(_copy._filter)
4548  *             self._format = copy.deepcopy(_copy._format)
4549  *             self._samples = _copy._samples[:]             # <<<<<<<<<<<<<<
4550  *             self._sample2column = copy.deepcopy(_copy._sample2column)
4551  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
4552  */
4553     __pyx_t_4 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___samples); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4554     __Pyx_GOTREF(__pyx_t_4);
4555     __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_t_4, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4556     __Pyx_GOTREF(__pyx_t_2);
4557     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4558     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___samples, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4559     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4560
4561     /* "cvcf.pyx":317
4562  *             self._format = copy.deepcopy(_copy._format)
4563  *             self._samples = _copy._samples[:]
4564  *             self._sample2column = copy.deepcopy(_copy._sample2column)             # <<<<<<<<<<<<<<
4565  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
4566  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
4567  */
4568     __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4569     __Pyx_GOTREF(__pyx_t_2);
4570     __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4571     __Pyx_GOTREF(__pyx_t_4);
4572     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4573     __pyx_t_2 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___sample2column); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4574     __Pyx_GOTREF(__pyx_t_2);
4575     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4576     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
4577     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
4578     __Pyx_GIVEREF(__pyx_t_2);
4579     __pyx_t_2 = 0;
4580     __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4581     __Pyx_GOTREF(__pyx_t_2);
4582     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4583     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
4584     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___sample2column, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4585     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4586
4587     /* "cvcf.pyx":318
4588  *             self._samples = _copy._samples[:]
4589  *             self._sample2column = copy.deepcopy(_copy._sample2column)
4590  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)             # <<<<<<<<<<<<<<
4591  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
4592  *             self._reference = _copy._reference
4593  */
4594     __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4595     __Pyx_GOTREF(__pyx_t_2);
4596     __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4597     __Pyx_GOTREF(__pyx_t_3);
4598     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4599     __pyx_t_2 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___ignored_errors); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4600     __Pyx_GOTREF(__pyx_t_2);
4601     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4602     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
4603     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
4604     __Pyx_GIVEREF(__pyx_t_2);
4605     __pyx_t_2 = 0;
4606     __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4607     __Pyx_GOTREF(__pyx_t_2);
4608     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4609     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
4610     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___ignored_errors, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4611     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4612
4613     /* "cvcf.pyx":319
4614  *             self._sample2column = copy.deepcopy(_copy._sample2column)
4615  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
4616  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)             # <<<<<<<<<<<<<<
4617  *             self._reference = _copy._reference
4618  *             self._regions = _copy._regions
4619  */
4620     __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4621     __Pyx_GOTREF(__pyx_t_2);
4622     __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4623     __Pyx_GOTREF(__pyx_t_4);
4624     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4625     __pyx_t_2 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___warn_errors); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4626     __Pyx_GOTREF(__pyx_t_2);
4627     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4628     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
4629     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
4630     __Pyx_GIVEREF(__pyx_t_2);
4631     __pyx_t_2 = 0;
4632     __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4633     __Pyx_GOTREF(__pyx_t_2);
4634     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4635     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
4636     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___warn_errors, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4637     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4638
4639     /* "cvcf.pyx":320
4640  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
4641  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
4642  *             self._reference = _copy._reference             # <<<<<<<<<<<<<<
4643  *             self._regions = _copy._regions
4644  *         if reference: self._reference = reference
4645  */
4646     __pyx_t_2 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4647     __Pyx_GOTREF(__pyx_t_2);
4648     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___reference, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4649     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4650
4651     /* "cvcf.pyx":321
4652  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
4653  *             self._reference = _copy._reference
4654  *             self._regions = _copy._regions             # <<<<<<<<<<<<<<
4655  *         if reference: self._reference = reference
4656  *         if regions: self._regions = regions
4657  */
4658     __pyx_t_2 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___regions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4659     __Pyx_GOTREF(__pyx_t_2);
4660     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___regions, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4661     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4662     goto __pyx_L8;
4663   }
4664   __pyx_L8:;
4665
4666   /* "cvcf.pyx":322
4667  *             self._reference = _copy._reference
4668  *             self._regions = _copy._regions
4669  *         if reference: self._reference = reference             # <<<<<<<<<<<<<<
4670  *         if regions: self._regions = regions
4671  *         if leftalign: self._leftalign = leftalign
4672  */
4673   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_reference); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4674   if (__pyx_t_6) {
4675     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___reference, __pyx_v_reference) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4676     goto __pyx_L9;
4677   }
4678   __pyx_L9:;
4679
4680   /* "cvcf.pyx":323
4681  *             self._regions = _copy._regions
4682  *         if reference: self._reference = reference
4683  *         if regions: self._regions = regions             # <<<<<<<<<<<<<<
4684  *         if leftalign: self._leftalign = leftalign
4685  *         self._lines = lines
4686  */
4687   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_regions); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4688   if (__pyx_t_6) {
4689     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___regions, __pyx_v_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4690     goto __pyx_L10;
4691   }
4692   __pyx_L10:;
4693
4694   /* "cvcf.pyx":324
4695  *         if reference: self._reference = reference
4696  *         if regions: self._regions = regions
4697  *         if leftalign: self._leftalign = leftalign             # <<<<<<<<<<<<<<
4698  *         self._lines = lines
4699  * 
4700  */
4701   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_leftalign); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4702   if (__pyx_t_6) {
4703     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___leftalign, __pyx_v_leftalign) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4704     goto __pyx_L11;
4705   }
4706   __pyx_L11:;
4707
4708   /* "cvcf.pyx":325
4709  *         if regions: self._regions = regions
4710  *         if leftalign: self._leftalign = leftalign
4711  *         self._lines = lines             # <<<<<<<<<<<<<<
4712  * 
4713  *     def error(self,line,error,opt=None):
4714  */
4715   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___lines, __pyx_v_lines) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4716
4717   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4718   goto __pyx_L0;
4719   __pyx_L1_error:;
4720   __Pyx_XDECREF(__pyx_t_2);
4721   __Pyx_XDECREF(__pyx_t_3);
4722   __Pyx_XDECREF(__pyx_t_4);
4723   __Pyx_XDECREF(__pyx_t_5);
4724   __Pyx_AddTraceback("cvcf.VCF.__init__");
4725   __pyx_r = NULL;
4726   __pyx_L0:;
4727   __Pyx_DECREF(__pyx_v_id);
4728   __Pyx_XGIVEREF(__pyx_r);
4729   __Pyx_RefNannyFinishContext();
4730   return __pyx_r;
4731 }
4732
4733 /* "cvcf.pyx":327
4734  *         self._lines = lines
4735  * 
4736  *     def error(self,line,error,opt=None):             # <<<<<<<<<<<<<<
4737  *         if error in self._ignored_errors: return
4738  *         errorlabel, errorstring = self._errors[error].split(':')
4739  */
4740
4741 static PyObject *__pyx_pf_4cvcf_3VCF_1error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4742 static PyMethodDef __pyx_mdef_4cvcf_3VCF_1error = {__Pyx_NAMESTR("error"), (PyCFunction)__pyx_pf_4cvcf_3VCF_1error, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
4743 static PyObject *__pyx_pf_4cvcf_3VCF_1error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4744   PyObject *__pyx_v_self = 0;
4745   PyObject *__pyx_v_line = 0;
4746   PyObject *__pyx_v_error = 0;
4747   PyObject *__pyx_v_opt = 0;
4748   PyObject *__pyx_v_errorlabel;
4749   PyObject *__pyx_v_errorstring;
4750   PyObject *__pyx_v_errwarn;
4751   PyObject *__pyx_r = NULL;
4752   PyObject *__pyx_t_1 = NULL;
4753   int __pyx_t_2;
4754   PyObject *__pyx_t_3 = NULL;
4755   PyObject *__pyx_t_4 = NULL;
4756   PyObject *__pyx_t_5 = NULL;
4757   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,&__pyx_n_s__error,&__pyx_n_s__opt,0};
4758   __Pyx_RefNannySetupContext("error");
4759   __pyx_self = __pyx_self;
4760   if (unlikely(__pyx_kwds)) {
4761     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4762     PyObject* values[4] = {0,0,0,0};
4763     values[3] = ((PyObject *)Py_None);
4764     switch (PyTuple_GET_SIZE(__pyx_args)) {
4765       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4766       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4767       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4768       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4769       case  0: break;
4770       default: goto __pyx_L5_argtuple_error;
4771     }
4772     switch (PyTuple_GET_SIZE(__pyx_args)) {
4773       case  0:
4774       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
4775       if (likely(values[0])) kw_args--;
4776       else goto __pyx_L5_argtuple_error;
4777       case  1:
4778       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
4779       if (likely(values[1])) kw_args--;
4780       else {
4781         __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4782       }
4783       case  2:
4784       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__error);
4785       if (likely(values[2])) kw_args--;
4786       else {
4787         __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4788       }
4789       case  3:
4790       if (kw_args > 0) {
4791         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__opt);
4792         if (value) { values[3] = value; kw_args--; }
4793       }
4794     }
4795     if (unlikely(kw_args > 0)) {
4796       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "error") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4797     }
4798     __pyx_v_self = values[0];
4799     __pyx_v_line = values[1];
4800     __pyx_v_error = values[2];
4801     __pyx_v_opt = values[3];
4802   } else {
4803     __pyx_v_opt = ((PyObject *)Py_None);
4804     switch (PyTuple_GET_SIZE(__pyx_args)) {
4805       case  4:
4806       __pyx_v_opt = PyTuple_GET_ITEM(__pyx_args, 3);
4807       case  3:
4808       __pyx_v_error = PyTuple_GET_ITEM(__pyx_args, 2);
4809       __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
4810       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
4811       break;
4812       default: goto __pyx_L5_argtuple_error;
4813     }
4814   }
4815   goto __pyx_L4_argument_unpacking_done;
4816   __pyx_L5_argtuple_error:;
4817   __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4818   __pyx_L3_error:;
4819   __Pyx_AddTraceback("cvcf.VCF.error");
4820   __Pyx_RefNannyFinishContext();
4821   return NULL;
4822   __pyx_L4_argument_unpacking_done:;
4823   __pyx_v_errorlabel = Py_None; __Pyx_INCREF(Py_None);
4824   __pyx_v_errorstring = Py_None; __Pyx_INCREF(Py_None);
4825   __pyx_v_errwarn = Py_None; __Pyx_INCREF(Py_None);
4826
4827   /* "cvcf.pyx":328
4828  * 
4829  *     def error(self,line,error,opt=None):
4830  *         if error in self._ignored_errors: return             # <<<<<<<<<<<<<<
4831  *         errorlabel, errorstring = self._errors[error].split(':')
4832  *         if opt: errorstring = errorstring % opt
4833  */
4834   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___ignored_errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4835   __Pyx_GOTREF(__pyx_t_1);
4836   __pyx_t_2 = ((PySequence_Contains(__pyx_t_1, __pyx_v_error))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4837   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4838   if (__pyx_t_2) {
4839     __Pyx_XDECREF(__pyx_r);
4840     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4841     goto __pyx_L0;
4842     goto __pyx_L6;
4843   }
4844   __pyx_L6:;
4845
4846   /* "cvcf.pyx":329
4847  *     def error(self,line,error,opt=None):
4848  *         if error in self._ignored_errors: return
4849  *         errorlabel, errorstring = self._errors[error].split(':')             # <<<<<<<<<<<<<<
4850  *         if opt: errorstring = errorstring % opt
4851  *         errwarn = ["Error","Warning"][error in self._warn_errors]
4852  */
4853   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4854   __Pyx_GOTREF(__pyx_t_1);
4855   __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_v_error); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4856   __Pyx_GOTREF(__pyx_t_3);
4857   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4858   __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4859   __Pyx_GOTREF(__pyx_t_1);
4860   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4861   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4862   __Pyx_GOTREF(__pyx_t_3);
4863   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4864   if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
4865     PyObject* tuple = __pyx_t_3;
4866     __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
4867     __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
4868     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4869     __Pyx_DECREF(__pyx_v_errorlabel);
4870     __pyx_v_errorlabel = __pyx_t_1;
4871     __pyx_t_1 = 0;
4872     __Pyx_DECREF(__pyx_v_errorstring);
4873     __pyx_v_errorstring = __pyx_t_4;
4874     __pyx_t_4 = 0;
4875   } else {
4876     __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4877     __Pyx_GOTREF(__pyx_t_5);
4878     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4879     __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4880     __Pyx_GOTREF(__pyx_t_1);
4881     __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4882     __Pyx_GOTREF(__pyx_t_4);
4883     if (__Pyx_EndUnpack(__pyx_t_5, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4884     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4885     __Pyx_DECREF(__pyx_v_errorlabel);
4886     __pyx_v_errorlabel = __pyx_t_1;
4887     __pyx_t_1 = 0;
4888     __Pyx_DECREF(__pyx_v_errorstring);
4889     __pyx_v_errorstring = __pyx_t_4;
4890     __pyx_t_4 = 0;
4891   }
4892
4893   /* "cvcf.pyx":330
4894  *         if error in self._ignored_errors: return
4895  *         errorlabel, errorstring = self._errors[error].split(':')
4896  *         if opt: errorstring = errorstring % opt             # <<<<<<<<<<<<<<
4897  *         errwarn = ["Error","Warning"][error in self._warn_errors]
4898  *         sys.stderr.write("Line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring))
4899  */
4900   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opt); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4901   if (__pyx_t_2) {
4902     __pyx_t_3 = PyNumber_Remainder(__pyx_v_errorstring, __pyx_v_opt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4903     __Pyx_GOTREF(__pyx_t_3);
4904     __Pyx_DECREF(__pyx_v_errorstring);
4905     __pyx_v_errorstring = __pyx_t_3;
4906     __pyx_t_3 = 0;
4907     goto __pyx_L7;
4908   }
4909   __pyx_L7:;
4910
4911   /* "cvcf.pyx":331
4912  *         errorlabel, errorstring = self._errors[error].split(':')
4913  *         if opt: errorstring = errorstring % opt
4914  *         errwarn = ["Error","Warning"][error in self._warn_errors]             # <<<<<<<<<<<<<<
4915  *         sys.stderr.write("Line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring))
4916  *         if error in self._warn_errors: return
4917  */
4918   __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4919   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
4920   __Pyx_INCREF(((PyObject *)__pyx_n_s__Error));
4921   PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__Error));
4922   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Error));
4923   __Pyx_INCREF(((PyObject *)__pyx_n_s__Warning));
4924   PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__Warning));
4925   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Warning));
4926   __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___warn_errors); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4927   __Pyx_GOTREF(__pyx_t_4);
4928   __pyx_t_2 = ((PySequence_Contains(__pyx_t_4, __pyx_v_error))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4929   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4930   __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_t_3), __pyx_t_2, sizeof(int), __Pyx_PyBool_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4931   __Pyx_GOTREF(__pyx_t_4);
4932   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
4933   __Pyx_DECREF(__pyx_v_errwarn);
4934   __pyx_v_errwarn = __pyx_t_4;
4935   __pyx_t_4 = 0;
4936
4937   /* "cvcf.pyx":332
4938  *         if opt: errorstring = errorstring % opt
4939  *         errwarn = ["Error","Warning"][error in self._warn_errors]
4940  *         sys.stderr.write("Line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring))             # <<<<<<<<<<<<<<
4941  *         if error in self._warn_errors: return
4942  *         raise ValueError(errorstring)
4943  */
4944   __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4945   __Pyx_GOTREF(__pyx_t_4);
4946   __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__stderr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4947   __Pyx_GOTREF(__pyx_t_3);
4948   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4949   __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4950   __Pyx_GOTREF(__pyx_t_4);
4951   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4952   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___lineno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4953   __Pyx_GOTREF(__pyx_t_3);
4954   __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4955   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
4956   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
4957   __Pyx_GIVEREF(__pyx_t_3);
4958   __Pyx_INCREF(__pyx_v_line);
4959   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_line);
4960   __Pyx_GIVEREF(__pyx_v_line);
4961   __Pyx_INCREF(__pyx_v_errwarn);
4962   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_errwarn);
4963   __Pyx_GIVEREF(__pyx_v_errwarn);
4964   __Pyx_INCREF(__pyx_v_errorlabel);
4965   PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_errorlabel);
4966   __Pyx_GIVEREF(__pyx_v_errorlabel);
4967   __Pyx_INCREF(__pyx_v_errorstring);
4968   PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_errorstring);
4969   __Pyx_GIVEREF(__pyx_v_errorstring);
4970   __pyx_t_3 = 0;
4971   __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4972   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
4973   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
4974   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4975   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
4976   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
4977   __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
4978   __pyx_t_3 = 0;
4979   __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4980   __Pyx_GOTREF(__pyx_t_3);
4981   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4982   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
4983   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4984
4985   /* "cvcf.pyx":333
4986  *         errwarn = ["Error","Warning"][error in self._warn_errors]
4987  *         sys.stderr.write("Line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring))
4988  *         if error in self._warn_errors: return             # <<<<<<<<<<<<<<
4989  *         raise ValueError(errorstring)
4990  * 
4991  */
4992   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___warn_errors); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4993   __Pyx_GOTREF(__pyx_t_3);
4994   __pyx_t_2 = ((PySequence_Contains(__pyx_t_3, __pyx_v_error))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4995   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4996   if (__pyx_t_2) {
4997     __Pyx_XDECREF(__pyx_r);
4998     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4999     goto __pyx_L0;
5000     goto __pyx_L8;
5001   }
5002   __pyx_L8:;
5003
5004   /* "cvcf.pyx":334
5005  *         sys.stderr.write("Line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring))
5006  *         if error in self._warn_errors: return
5007  *         raise ValueError(errorstring)             # <<<<<<<<<<<<<<
5008  * 
5009  *     def parse_format(self,line,format,filter=False):
5010  */
5011   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5012   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
5013   __Pyx_INCREF(__pyx_v_errorstring);
5014   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_errorstring);
5015   __Pyx_GIVEREF(__pyx_v_errorstring);
5016   __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5017   __Pyx_GOTREF(__pyx_t_1);
5018   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
5019   __Pyx_Raise(__pyx_t_1, 0, 0);
5020   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5021   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5022
5023   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5024   goto __pyx_L0;
5025   __pyx_L1_error:;
5026   __Pyx_XDECREF(__pyx_t_1);
5027   __Pyx_XDECREF(__pyx_t_3);
5028   __Pyx_XDECREF(__pyx_t_4);
5029   __Pyx_XDECREF(__pyx_t_5);
5030   __Pyx_AddTraceback("cvcf.VCF.error");
5031   __pyx_r = NULL;
5032   __pyx_L0:;
5033   __Pyx_DECREF(__pyx_v_errorlabel);
5034   __Pyx_DECREF(__pyx_v_errorstring);
5035   __Pyx_DECREF(__pyx_v_errwarn);
5036   __Pyx_XGIVEREF(__pyx_r);
5037   __Pyx_RefNannyFinishContext();
5038   return __pyx_r;
5039 }
5040
5041 /* "cvcf.pyx":336
5042  *         raise ValueError(errorstring)
5043  * 
5044  *     def parse_format(self,line,format,filter=False):             # <<<<<<<<<<<<<<
5045  *         if self._version == 40:
5046  *             if not format.startswith('<'):
5047  */
5048
5049 static PyObject *__pyx_pf_4cvcf_3VCF_2parse_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5050 static PyMethodDef __pyx_mdef_4cvcf_3VCF_2parse_format = {__Pyx_NAMESTR("parse_format"), (PyCFunction)__pyx_pf_4cvcf_3VCF_2parse_format, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
5051 static PyObject *__pyx_pf_4cvcf_3VCF_2parse_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5052   PyObject *__pyx_v_self = 0;
5053   PyObject *__pyx_v_line = 0;
5054   PyObject *__pyx_v_format = 0;
5055   PyObject *__pyx_v_filter = 0;
5056   PyObject *__pyx_v_data;
5057   PyObject *__pyx_v_idx;
5058   PyObject *__pyx_v_elts;
5059   PyObject *__pyx_v_first;
5060   PyObject *__pyx_v_rest;
5061   PyObject *__pyx_v_n;
5062   PyObject *__pyx_v_t;
5063   PyObject *__pyx_r = NULL;
5064   PyObject *__pyx_t_1 = NULL;
5065   PyObject *__pyx_t_2 = NULL;
5066   int __pyx_t_3;
5067   int __pyx_t_4;
5068   PyObject *__pyx_t_5 = NULL;
5069   Py_ssize_t __pyx_t_6;
5070   PyObject *__pyx_t_7 = NULL;
5071   int __pyx_t_8;
5072   int __pyx_t_9;
5073   PyObject *__pyx_t_10 = NULL;
5074   int __pyx_t_11;
5075   PyObject *__pyx_t_12 = NULL;
5076   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,&__pyx_n_s__format,&__pyx_n_s__filter,0};
5077   __Pyx_RefNannySetupContext("parse_format");
5078   __pyx_self = __pyx_self;
5079   if (unlikely(__pyx_kwds)) {
5080     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
5081     PyObject* values[4] = {0,0,0,0};
5082     values[3] = __pyx_k_26;
5083     switch (PyTuple_GET_SIZE(__pyx_args)) {
5084       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5085       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5086       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5087       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5088       case  0: break;
5089       default: goto __pyx_L5_argtuple_error;
5090     }
5091     switch (PyTuple_GET_SIZE(__pyx_args)) {
5092       case  0:
5093       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
5094       if (likely(values[0])) kw_args--;
5095       else goto __pyx_L5_argtuple_error;
5096       case  1:
5097       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
5098       if (likely(values[1])) kw_args--;
5099       else {
5100         __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5101       }
5102       case  2:
5103       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
5104       if (likely(values[2])) kw_args--;
5105       else {
5106         __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5107       }
5108       case  3:
5109       if (kw_args > 0) {
5110         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
5111         if (value) { values[3] = value; kw_args--; }
5112       }
5113     }
5114     if (unlikely(kw_args > 0)) {
5115       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parse_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5116     }
5117     __pyx_v_self = values[0];
5118     __pyx_v_line = values[1];
5119     __pyx_v_format = values[2];
5120     __pyx_v_filter = values[3];
5121   } else {
5122     __pyx_v_filter = __pyx_k_26;
5123     switch (PyTuple_GET_SIZE(__pyx_args)) {
5124       case  4:
5125       __pyx_v_filter = PyTuple_GET_ITEM(__pyx_args, 3);
5126       case  3:
5127       __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 2);
5128       __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
5129       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
5130       break;
5131       default: goto __pyx_L5_argtuple_error;
5132     }
5133   }
5134   goto __pyx_L4_argument_unpacking_done;
5135   __pyx_L5_argtuple_error:;
5136   __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5137   __pyx_L3_error:;
5138   __Pyx_AddTraceback("cvcf.VCF.parse_format");
5139   __Pyx_RefNannyFinishContext();
5140   return NULL;
5141   __pyx_L4_argument_unpacking_done:;
5142   __Pyx_INCREF(__pyx_v_format);
5143   __pyx_v_data = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
5144   __pyx_v_idx = Py_None; __Pyx_INCREF(Py_None);
5145   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
5146   __pyx_v_first = Py_None; __Pyx_INCREF(Py_None);
5147   __pyx_v_rest = Py_None; __Pyx_INCREF(Py_None);
5148   __pyx_v_n = Py_None; __Pyx_INCREF(Py_None);
5149   __pyx_v_t = Py_None; __Pyx_INCREF(Py_None);
5150
5151   /* "cvcf.pyx":337
5152  * 
5153  *     def parse_format(self,line,format,filter=False):
5154  *         if self._version == 40:             # <<<<<<<<<<<<<<
5155  *             if not format.startswith('<'):
5156  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5157  */
5158   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5159   __Pyx_GOTREF(__pyx_t_1);
5160   __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_40, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5161   __Pyx_GOTREF(__pyx_t_2);
5162   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5163   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5164   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5165   if (__pyx_t_3) {
5166
5167     /* "cvcf.pyx":338
5168  *     def parse_format(self,line,format,filter=False):
5169  *         if self._version == 40:
5170  *             if not format.startswith('<'):             # <<<<<<<<<<<<<<
5171  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5172  *                 format = "<"+format
5173  */
5174     __pyx_t_2 = PyObject_GetAttr(__pyx_v_format, __pyx_n_s__startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5175     __Pyx_GOTREF(__pyx_t_2);
5176     __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5177     __Pyx_GOTREF(__pyx_t_1);
5178     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5179     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5180     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5181     __pyx_t_4 = (!__pyx_t_3);
5182     if (__pyx_t_4) {
5183
5184       /* "cvcf.pyx":339
5185  *         if self._version == 40:
5186  *             if not format.startswith('<'):
5187  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)             # <<<<<<<<<<<<<<
5188  *                 format = "<"+format
5189  *             if not format.endswith('>'):
5190  */
5191       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5192       __Pyx_GOTREF(__pyx_t_1);
5193       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_29); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5194       __Pyx_GOTREF(__pyx_t_2);
5195       __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5196       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
5197       __Pyx_INCREF(__pyx_v_line);
5198       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
5199       __Pyx_GIVEREF(__pyx_v_line);
5200       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
5201       __Pyx_GIVEREF(__pyx_t_2);
5202       __pyx_t_2 = 0;
5203       __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5204       __Pyx_GOTREF(__pyx_t_2);
5205       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5206       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
5207       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5208
5209       /* "cvcf.pyx":340
5210  *             if not format.startswith('<'):
5211  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5212  *                 format = "<"+format             # <<<<<<<<<<<<<<
5213  *             if not format.endswith('>'):
5214  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5215  */
5216       __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_27), __pyx_v_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5217       __Pyx_GOTREF(__pyx_t_2);
5218       __Pyx_DECREF(__pyx_v_format);
5219       __pyx_v_format = __pyx_t_2;
5220       __pyx_t_2 = 0;
5221       goto __pyx_L7;
5222     }
5223     __pyx_L7:;
5224
5225     /* "cvcf.pyx":341
5226  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5227  *                 format = "<"+format
5228  *             if not format.endswith('>'):             # <<<<<<<<<<<<<<
5229  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5230  *                 format += ">"
5231  */
5232     __pyx_t_2 = PyObject_GetAttr(__pyx_v_format, __pyx_n_s__endswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5233     __Pyx_GOTREF(__pyx_t_2);
5234     __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5235     __Pyx_GOTREF(__pyx_t_5);
5236     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5237     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5238     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5239     __pyx_t_3 = (!__pyx_t_4);
5240     if (__pyx_t_3) {
5241
5242       /* "cvcf.pyx":342
5243  *                 format = "<"+format
5244  *             if not format.endswith('>'):
5245  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)             # <<<<<<<<<<<<<<
5246  *                 format += ">"
5247  *             format = format[1:-1]
5248  */
5249       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5250       __Pyx_GOTREF(__pyx_t_5);
5251       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_29); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5252       __Pyx_GOTREF(__pyx_t_2);
5253       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5254       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5255       __Pyx_INCREF(__pyx_v_line);
5256       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
5257       __Pyx_GIVEREF(__pyx_v_line);
5258       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
5259       __Pyx_GIVEREF(__pyx_t_2);
5260       __pyx_t_2 = 0;
5261       __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5262       __Pyx_GOTREF(__pyx_t_2);
5263       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5264       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
5265       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5266
5267       /* "cvcf.pyx":343
5268  *             if not format.endswith('>'):
5269  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5270  *                 format += ">"             # <<<<<<<<<<<<<<
5271  *             format = format[1:-1]
5272  *         data = {'id':None,'number':None,'type':None,'descr':None}
5273  */
5274       __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_format, ((PyObject *)__pyx_kp_s_30)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5275       __Pyx_GOTREF(__pyx_t_2);
5276       __Pyx_DECREF(__pyx_v_format);
5277       __pyx_v_format = __pyx_t_2;
5278       __pyx_t_2 = 0;
5279       goto __pyx_L8;
5280     }
5281     __pyx_L8:;
5282
5283     /* "cvcf.pyx":344
5284  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5285  *                 format += ">"
5286  *             format = format[1:-1]             # <<<<<<<<<<<<<<
5287  *         data = {'id':None,'number':None,'type':None,'descr':None}
5288  *         idx = 0
5289  */
5290     __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_format, 1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5291     __Pyx_GOTREF(__pyx_t_2);
5292     __Pyx_DECREF(__pyx_v_format);
5293     __pyx_v_format = __pyx_t_2;
5294     __pyx_t_2 = 0;
5295     goto __pyx_L6;
5296   }
5297   __pyx_L6:;
5298
5299   /* "cvcf.pyx":345
5300  *                 format += ">"
5301  *             format = format[1:-1]
5302  *         data = {'id':None,'number':None,'type':None,'descr':None}             # <<<<<<<<<<<<<<
5303  *         idx = 0
5304  *         while len(format.strip())>0:
5305  */
5306   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5307   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5308   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__id), Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5309   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__number), Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5310   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__type), Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5311   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__descr), Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5312   __Pyx_DECREF(((PyObject *)__pyx_v_data));
5313   __pyx_v_data = __pyx_t_2;
5314   __pyx_t_2 = 0;
5315
5316   /* "cvcf.pyx":346
5317  *             format = format[1:-1]
5318  *         data = {'id':None,'number':None,'type':None,'descr':None}
5319  *         idx = 0             # <<<<<<<<<<<<<<
5320  *         while len(format.strip())>0:
5321  *             elts = format.strip().split(',')
5322  */
5323   __Pyx_INCREF(__pyx_int_0);
5324   __Pyx_DECREF(__pyx_v_idx);
5325   __pyx_v_idx = __pyx_int_0;
5326
5327   /* "cvcf.pyx":347
5328  *         data = {'id':None,'number':None,'type':None,'descr':None}
5329  *         idx = 0
5330  *         while len(format.strip())>0:             # <<<<<<<<<<<<<<
5331  *             elts = format.strip().split(',')
5332  *             first, rest = elts[0], ','.join(elts[1:])
5333  */
5334   while (1) {
5335     __pyx_t_2 = PyObject_GetAttr(__pyx_v_format, __pyx_n_s__strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5336     __Pyx_GOTREF(__pyx_t_2);
5337     __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5338     __Pyx_GOTREF(__pyx_t_1);
5339     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5340     __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5341     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5342     __pyx_t_3 = (__pyx_t_6 > 0);
5343     if (!__pyx_t_3) break;
5344
5345     /* "cvcf.pyx":348
5346  *         idx = 0
5347  *         while len(format.strip())>0:
5348  *             elts = format.strip().split(',')             # <<<<<<<<<<<<<<
5349  *             first, rest = elts[0], ','.join(elts[1:])
5350  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
5351  */
5352     __pyx_t_1 = PyObject_GetAttr(__pyx_v_format, __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5353     __Pyx_GOTREF(__pyx_t_1);
5354     __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5355     __Pyx_GOTREF(__pyx_t_2);
5356     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5357     __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5358     __Pyx_GOTREF(__pyx_t_1);
5359     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5360     __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_32), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5361     __Pyx_GOTREF(__pyx_t_2);
5362     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5363     __Pyx_DECREF(__pyx_v_elts);
5364     __pyx_v_elts = __pyx_t_2;
5365     __pyx_t_2 = 0;
5366
5367     /* "cvcf.pyx":349
5368  *         while len(format.strip())>0:
5369  *             elts = format.strip().split(',')
5370  *             first, rest = elts[0], ','.join(elts[1:])             # <<<<<<<<<<<<<<
5371  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
5372  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
5373  */
5374     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5375     __Pyx_GOTREF(__pyx_t_2);
5376     __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5377     __Pyx_GOTREF(__pyx_t_1);
5378     __pyx_t_5 = __Pyx_PySequence_GetSlice(__pyx_v_elts, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5379     __Pyx_GOTREF(__pyx_t_5);
5380     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5381     __Pyx_GOTREF(((PyObject *)__pyx_t_7));
5382     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
5383     __Pyx_GIVEREF(__pyx_t_5);
5384     __pyx_t_5 = 0;
5385     __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5386     __Pyx_GOTREF(__pyx_t_5);
5387     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5388     __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
5389     __Pyx_DECREF(__pyx_v_first);
5390     __pyx_v_first = __pyx_t_2;
5391     __pyx_t_2 = 0;
5392     __Pyx_DECREF(__pyx_v_rest);
5393     __pyx_v_rest = __pyx_t_5;
5394     __pyx_t_5 = 0;
5395
5396     /* "cvcf.pyx":350
5397  *             elts = format.strip().split(',')
5398  *             first, rest = elts[0], ','.join(elts[1:])
5399  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):             # <<<<<<<<<<<<<<
5400  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
5401  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5402  */
5403     __pyx_t_5 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5404     __Pyx_GOTREF(__pyx_t_5);
5405     __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_33), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5406     __Pyx_GOTREF(__pyx_t_2);
5407     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5408     __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5409     __Pyx_GOTREF(__pyx_t_5);
5410     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5411     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5412     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5413     if (!__pyx_t_3) {
5414       __pyx_t_5 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5415       __Pyx_GOTREF(__pyx_t_5);
5416       __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5417       __Pyx_GOTREF(__pyx_t_2);
5418       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5419       __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5420       __Pyx_GOTREF(__pyx_t_5);
5421       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5422       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5423       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5424       if (__pyx_t_4) {
5425         __pyx_t_5 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5426         __Pyx_GOTREF(__pyx_t_5);
5427         __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5428         __Pyx_GOTREF(__pyx_t_2);
5429         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5430         __pyx_t_5 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5431         __Pyx_GOTREF(__pyx_t_5);
5432         __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5433         __Pyx_GOTREF(__pyx_t_7);
5434         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5435         __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_GT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5436         __Pyx_GOTREF(__pyx_t_5);
5437         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5438         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5439         __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5440         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5441         __pyx_t_9 = __pyx_t_8;
5442       } else {
5443         __pyx_t_9 = __pyx_t_4;
5444       }
5445       __pyx_t_4 = __pyx_t_9;
5446     } else {
5447       __pyx_t_4 = __pyx_t_3;
5448     }
5449     if (__pyx_t_4) {
5450
5451       /* "cvcf.pyx":351
5452  *             first, rest = elts[0], ','.join(elts[1:])
5453  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
5454  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)             # <<<<<<<<<<<<<<
5455  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5456  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
5457  */
5458       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5459       __Pyx_GOTREF(__pyx_t_5);
5460       __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_int_40, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5461       __Pyx_GOTREF(__pyx_t_7);
5462       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5463       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5464       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5465       if (__pyx_t_4) {
5466         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5467         __Pyx_GOTREF(__pyx_t_7);
5468         __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_38); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5469         __Pyx_GOTREF(__pyx_t_5);
5470         __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5471         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5472         __Pyx_INCREF(__pyx_v_line);
5473         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
5474         __Pyx_GIVEREF(__pyx_v_line);
5475         PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
5476         __Pyx_GIVEREF(__pyx_t_5);
5477         __pyx_t_5 = 0;
5478         __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5479         __Pyx_GOTREF(__pyx_t_5);
5480         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5481         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
5482         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5483         goto __pyx_L12;
5484       }
5485       __pyx_L12:;
5486
5487       /* "cvcf.pyx":352
5488  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
5489  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
5490  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
5491  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
5492  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
5493  */
5494       __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5495       __Pyx_GOTREF(__pyx_t_5);
5496       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5497       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5498       if (__pyx_t_4) {
5499         __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5500         __Pyx_GOTREF(__pyx_t_5);
5501         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_39); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5502         __Pyx_GOTREF(__pyx_t_2);
5503         __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5504         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
5505         __Pyx_INCREF(__pyx_v_line);
5506         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_line);
5507         __Pyx_GIVEREF(__pyx_v_line);
5508         PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
5509         __Pyx_GIVEREF(__pyx_t_2);
5510         __pyx_t_2 = 0;
5511         __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5512         __Pyx_GOTREF(__pyx_t_2);
5513         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5514         __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
5515         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5516         goto __pyx_L13;
5517       }
5518       __pyx_L13:;
5519
5520       /* "cvcf.pyx":353
5521  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
5522  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5523  *                 first = ["ID=","Number=","Type=","Description="][idx] + first             # <<<<<<<<<<<<<<
5524  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
5525  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
5526  */
5527       __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5528       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5529       __Pyx_INCREF(((PyObject *)__pyx_kp_s_40));
5530       PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_40));
5531       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40));
5532       __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
5533       PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_s_41));
5534       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41));
5535       __Pyx_INCREF(((PyObject *)__pyx_kp_s_42));
5536       PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_kp_s_42));
5537       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42));
5538       __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
5539       PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_kp_s_43));
5540       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
5541       __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_t_2), __pyx_v_idx); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5542       __Pyx_GOTREF(__pyx_t_7);
5543       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
5544       __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_first); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5545       __Pyx_GOTREF(__pyx_t_2);
5546       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5547       __Pyx_DECREF(__pyx_v_first);
5548       __pyx_v_first = __pyx_t_2;
5549       __pyx_t_2 = 0;
5550       goto __pyx_L11;
5551     }
5552     __pyx_L11:;
5553
5554     /* "cvcf.pyx":354
5555  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5556  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
5557  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]             # <<<<<<<<<<<<<<
5558  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
5559  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
5560  */
5561     __pyx_t_2 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5562     __Pyx_GOTREF(__pyx_t_2);
5563     __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5564     __Pyx_GOTREF(__pyx_t_7);
5565     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5566     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5567     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5568     if (__pyx_t_4) {
5569       __pyx_t_7 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5570       __Pyx_GOTREF(__pyx_t_7);
5571       __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5572       __Pyx_GOTREF(__pyx_t_2);
5573       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5574       __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5575       __Pyx_GOTREF(__pyx_t_7);
5576       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5577       if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__id), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5578       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5579       goto __pyx_L14;
5580     }
5581
5582     /* "cvcf.pyx":355
5583  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
5584  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
5585  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]             # <<<<<<<<<<<<<<
5586  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
5587  *             elif first.startswith('Description='):
5588  */
5589     __pyx_t_7 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__startswith); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5590     __Pyx_GOTREF(__pyx_t_7);
5591     __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_46), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5592     __Pyx_GOTREF(__pyx_t_2);
5593     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5594     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5595     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5596     if (__pyx_t_4) {
5597       __pyx_t_2 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5598       __Pyx_GOTREF(__pyx_t_2);
5599       __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5600       __Pyx_GOTREF(__pyx_t_7);
5601       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5602       __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_7, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5603       __Pyx_GOTREF(__pyx_t_2);
5604       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5605       if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5606       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5607       goto __pyx_L14;
5608     }
5609
5610     /* "cvcf.pyx":356
5611  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
5612  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
5613  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]             # <<<<<<<<<<<<<<
5614  *             elif first.startswith('Description='):
5615  *                 elts = format.split('"')
5616  */
5617     __pyx_t_2 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5618     __Pyx_GOTREF(__pyx_t_2);
5619     __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_48), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5620     __Pyx_GOTREF(__pyx_t_7);
5621     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5622     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5623     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5624     if (__pyx_t_4) {
5625       __pyx_t_7 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5626       __Pyx_GOTREF(__pyx_t_7);
5627       __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5628       __Pyx_GOTREF(__pyx_t_2);
5629       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5630       __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5631       __Pyx_GOTREF(__pyx_t_7);
5632       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5633       if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__type), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5634       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5635       goto __pyx_L14;
5636     }
5637
5638     /* "cvcf.pyx":357
5639  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
5640  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
5641  *             elif first.startswith('Description='):             # <<<<<<<<<<<<<<
5642  *                 elts = format.split('"')
5643  *                 if len(elts)<3:
5644  */
5645     __pyx_t_7 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__startswith); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5646     __Pyx_GOTREF(__pyx_t_7);
5647     __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5648     __Pyx_GOTREF(__pyx_t_2);
5649     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5650     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5651     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5652     if (__pyx_t_4) {
5653
5654       /* "cvcf.pyx":358
5655  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
5656  *             elif first.startswith('Description='):
5657  *                 elts = format.split('"')             # <<<<<<<<<<<<<<
5658  *                 if len(elts)<3:
5659  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
5660  */
5661       __pyx_t_2 = PyObject_GetAttr(__pyx_v_format, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5662       __Pyx_GOTREF(__pyx_t_2);
5663       __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5664       __Pyx_GOTREF(__pyx_t_7);
5665       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5666       __Pyx_DECREF(__pyx_v_elts);
5667       __pyx_v_elts = __pyx_t_7;
5668       __pyx_t_7 = 0;
5669
5670       /* "cvcf.pyx":359
5671  *             elif first.startswith('Description='):
5672  *                 elts = format.split('"')
5673  *                 if len(elts)<3:             # <<<<<<<<<<<<<<
5674  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
5675  *                     elts = first.split('=') + [rest]
5676  */
5677       __pyx_t_6 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5678       __pyx_t_4 = (__pyx_t_6 < 3);
5679       if (__pyx_t_4) {
5680
5681         /* "cvcf.pyx":360
5682  *                 elts = format.split('"')
5683  *                 if len(elts)<3:
5684  *                     self.error(line,self.FORMAT_MISSING_QUOTES)             # <<<<<<<<<<<<<<
5685  *                     elts = first.split('=') + [rest]
5686  *                 data['descr'] = elts[1]
5687  */
5688         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5689         __Pyx_GOTREF(__pyx_t_7);
5690         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_52); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5691         __Pyx_GOTREF(__pyx_t_2);
5692         __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5693         __Pyx_GOTREF(((PyObject *)__pyx_t_5));
5694         __Pyx_INCREF(__pyx_v_line);
5695         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
5696         __Pyx_GIVEREF(__pyx_v_line);
5697         PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
5698         __Pyx_GIVEREF(__pyx_t_2);
5699         __pyx_t_2 = 0;
5700         __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5701         __Pyx_GOTREF(__pyx_t_2);
5702         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5703         __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
5704         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5705
5706         /* "cvcf.pyx":361
5707  *                 if len(elts)<3:
5708  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
5709  *                     elts = first.split('=') + [rest]             # <<<<<<<<<<<<<<
5710  *                 data['descr'] = elts[1]
5711  *                 rest = '"'.join(elts[2:])
5712  */
5713         __pyx_t_2 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5714         __Pyx_GOTREF(__pyx_t_2);
5715         __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5716         __Pyx_GOTREF(__pyx_t_5);
5717         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5718         __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5719         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5720         __Pyx_INCREF(__pyx_v_rest);
5721         PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_rest);
5722         __Pyx_GIVEREF(__pyx_v_rest);
5723         __pyx_t_7 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5724         __Pyx_GOTREF(__pyx_t_7);
5725         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5726         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
5727         __Pyx_DECREF(__pyx_v_elts);
5728         __pyx_v_elts = __pyx_t_7;
5729         __pyx_t_7 = 0;
5730         goto __pyx_L15;
5731       }
5732       __pyx_L15:;
5733
5734       /* "cvcf.pyx":362
5735  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
5736  *                     elts = first.split('=') + [rest]
5737  *                 data['descr'] = elts[1]             # <<<<<<<<<<<<<<
5738  *                 rest = '"'.join(elts[2:])
5739  *                 if rest.startswith(','): rest = rest[1:]
5740  */
5741       __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5742       __Pyx_GOTREF(__pyx_t_7);
5743       if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__descr), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5744       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5745
5746       /* "cvcf.pyx":363
5747  *                     elts = first.split('=') + [rest]
5748  *                 data['descr'] = elts[1]
5749  *                 rest = '"'.join(elts[2:])             # <<<<<<<<<<<<<<
5750  *                 if rest.startswith(','): rest = rest[1:]
5751  *             else:
5752  */
5753       __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_34), __pyx_n_s__join); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5754       __Pyx_GOTREF(__pyx_t_7);
5755       __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_elts, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5756       __Pyx_GOTREF(__pyx_t_2);
5757       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5758       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
5759       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
5760       __Pyx_GIVEREF(__pyx_t_2);
5761       __pyx_t_2 = 0;
5762       __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5763       __Pyx_GOTREF(__pyx_t_2);
5764       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5765       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
5766       __Pyx_DECREF(__pyx_v_rest);
5767       __pyx_v_rest = __pyx_t_2;
5768       __pyx_t_2 = 0;
5769
5770       /* "cvcf.pyx":364
5771  *                 data['descr'] = elts[1]
5772  *                 rest = '"'.join(elts[2:])
5773  *                 if rest.startswith(','): rest = rest[1:]             # <<<<<<<<<<<<<<
5774  *             else:
5775  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5776  */
5777       __pyx_t_2 = PyObject_GetAttr(__pyx_v_rest, __pyx_n_s__startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5778       __Pyx_GOTREF(__pyx_t_2);
5779       __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5780       __Pyx_GOTREF(__pyx_t_5);
5781       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5782       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5783       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5784       if (__pyx_t_4) {
5785         __pyx_t_5 = __Pyx_PySequence_GetSlice(__pyx_v_rest, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5786         __Pyx_GOTREF(__pyx_t_5);
5787         __Pyx_DECREF(__pyx_v_rest);
5788         __pyx_v_rest = __pyx_t_5;
5789         __pyx_t_5 = 0;
5790         goto __pyx_L16;
5791       }
5792       __pyx_L16:;
5793       goto __pyx_L14;
5794     }
5795     /*else*/ {
5796
5797       /* "cvcf.pyx":366
5798  *                 if rest.startswith(','): rest = rest[1:]
5799  *             else:
5800  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
5801  *             format = rest
5802  *             idx += 1
5803  */
5804       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5805       __Pyx_GOTREF(__pyx_t_5);
5806       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_39); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5807       __Pyx_GOTREF(__pyx_t_2);
5808       __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5809       __Pyx_GOTREF(((PyObject *)__pyx_t_7));
5810       __Pyx_INCREF(__pyx_v_line);
5811       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_line);
5812       __Pyx_GIVEREF(__pyx_v_line);
5813       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
5814       __Pyx_GIVEREF(__pyx_t_2);
5815       __pyx_t_2 = 0;
5816       __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5817       __Pyx_GOTREF(__pyx_t_2);
5818       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5819       __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
5820       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5821     }
5822     __pyx_L14:;
5823
5824     /* "cvcf.pyx":367
5825  *             else:
5826  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5827  *             format = rest             # <<<<<<<<<<<<<<
5828  *             idx += 1
5829  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
5830  */
5831     __Pyx_INCREF(__pyx_v_rest);
5832     __Pyx_DECREF(__pyx_v_format);
5833     __pyx_v_format = __pyx_v_rest;
5834
5835     /* "cvcf.pyx":368
5836  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5837  *             format = rest
5838  *             idx += 1             # <<<<<<<<<<<<<<
5839  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
5840  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5841  */
5842     __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5843     __Pyx_GOTREF(__pyx_t_2);
5844     __Pyx_DECREF(__pyx_v_idx);
5845     __pyx_v_idx = __pyx_t_2;
5846     __pyx_t_2 = 0;
5847
5848     /* "cvcf.pyx":369
5849  *             format = rest
5850  *             idx += 1
5851  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings             # <<<<<<<<<<<<<<
5852  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5853  *         if not data['descr']:
5854  */
5855     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5856     if (__pyx_t_4) {
5857       __pyx_t_2 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5858       __Pyx_GOTREF(__pyx_t_2);
5859       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5860       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5861       __pyx_t_9 = __pyx_t_3;
5862     } else {
5863       __pyx_t_9 = __pyx_t_4;
5864     }
5865     if (__pyx_t_9) {
5866       __Pyx_INCREF(__pyx_int_3);
5867       __Pyx_DECREF(__pyx_v_idx);
5868       __pyx_v_idx = __pyx_int_3;
5869       goto __pyx_L17;
5870     }
5871     __pyx_L17:;
5872   }
5873
5874   /* "cvcf.pyx":370
5875  *             idx += 1
5876  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
5877  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
5878  *         if not data['descr']:
5879  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5880  */
5881   __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__id)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5882   __Pyx_GOTREF(__pyx_t_2);
5883   __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5884   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5885   __pyx_t_4 = (!__pyx_t_9);
5886   if (__pyx_t_4) {
5887     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5888     __Pyx_GOTREF(__pyx_t_2);
5889     __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_39); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5890     __Pyx_GOTREF(__pyx_t_7);
5891     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5892     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
5893     __Pyx_INCREF(__pyx_v_line);
5894     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
5895     __Pyx_GIVEREF(__pyx_v_line);
5896     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
5897     __Pyx_GIVEREF(__pyx_t_7);
5898     __pyx_t_7 = 0;
5899     __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5900     __Pyx_GOTREF(__pyx_t_7);
5901     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5902     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
5903     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5904     goto __pyx_L18;
5905   }
5906   __pyx_L18:;
5907
5908   /* "cvcf.pyx":371
5909  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
5910  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5911  *         if not data['descr']:             # <<<<<<<<<<<<<<
5912  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5913  *             data['descr'] = '<none>'
5914  */
5915   __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__descr)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5916   __Pyx_GOTREF(__pyx_t_7);
5917   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5918   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5919   __pyx_t_9 = (!__pyx_t_4);
5920   if (__pyx_t_9) {
5921
5922     /* "cvcf.pyx":372
5923  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5924  *         if not data['descr']:
5925  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
5926  *             data['descr'] = '<none>'
5927  *         if not data['type'] and not data['number']:
5928  */
5929     __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5930     __Pyx_GOTREF(__pyx_t_7);
5931     __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_39); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5932     __Pyx_GOTREF(__pyx_t_5);
5933     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5934     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5935     __Pyx_INCREF(__pyx_v_line);
5936     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
5937     __Pyx_GIVEREF(__pyx_v_line);
5938     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
5939     __Pyx_GIVEREF(__pyx_t_5);
5940     __pyx_t_5 = 0;
5941     __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5942     __Pyx_GOTREF(__pyx_t_5);
5943     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5944     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
5945     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5946
5947     /* "cvcf.pyx":373
5948  *         if not data['descr']:
5949  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5950  *             data['descr'] = '<none>'             # <<<<<<<<<<<<<<
5951  *         if not data['type'] and not data['number']:
5952  *             # fine, ##filter format
5953  */
5954     if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__descr), ((PyObject *)__pyx_kp_s_55)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5955     goto __pyx_L19;
5956   }
5957   __pyx_L19:;
5958
5959   /* "cvcf.pyx":374
5960  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5961  *             data['descr'] = '<none>'
5962  *         if not data['type'] and not data['number']:             # <<<<<<<<<<<<<<
5963  *             # fine, ##filter format
5964  *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')
5965  */
5966   __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__type)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5967   __Pyx_GOTREF(__pyx_t_5);
5968   __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5969   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5970   __pyx_t_4 = (!__pyx_t_9);
5971   if (__pyx_t_4) {
5972     __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5973     __Pyx_GOTREF(__pyx_t_5);
5974     __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5975     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5976     __pyx_t_3 = (!__pyx_t_9);
5977     __pyx_t_9 = __pyx_t_3;
5978   } else {
5979     __pyx_t_9 = __pyx_t_4;
5980   }
5981   if (__pyx_t_9) {
5982
5983     /* "cvcf.pyx":376
5984  *         if not data['type'] and not data['number']:
5985  *             # fine, ##filter format
5986  *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')             # <<<<<<<<<<<<<<
5987  *         if not data['type'] in ["Integer","Float","Character","String","Flag"]:
5988  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5989  */
5990     __Pyx_XDECREF(__pyx_r);
5991     __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5992     __Pyx_GOTREF(__pyx_t_5);
5993     __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__id)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5994     __Pyx_GOTREF(__pyx_t_2);
5995     __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NUMBER); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5996     __Pyx_GOTREF(__pyx_t_7);
5997     __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__descr)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5998     __Pyx_GOTREF(__pyx_t_1);
5999     __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6000     __Pyx_GOTREF(((PyObject *)__pyx_t_10));
6001     PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
6002     __Pyx_GIVEREF(__pyx_t_2);
6003     PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
6004     __Pyx_GIVEREF(__pyx_t_7);
6005     __Pyx_INCREF(__pyx_int_0);
6006     PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_0);
6007     __Pyx_GIVEREF(__pyx_int_0);
6008     __Pyx_INCREF(((PyObject *)__pyx_n_s__Flag));
6009     PyTuple_SET_ITEM(__pyx_t_10, 3, ((PyObject *)__pyx_n_s__Flag));
6010     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Flag));
6011     PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_1);
6012     __Pyx_GIVEREF(__pyx_t_1);
6013     __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
6014     PyTuple_SET_ITEM(__pyx_t_10, 5, ((PyObject *)__pyx_kp_s_9));
6015     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
6016     __pyx_t_2 = 0;
6017     __pyx_t_7 = 0;
6018     __pyx_t_1 = 0;
6019     __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6020     __Pyx_GOTREF(__pyx_t_1);
6021     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6022     __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6023     __pyx_r = __pyx_t_1;
6024     __pyx_t_1 = 0;
6025     goto __pyx_L0;
6026     goto __pyx_L20;
6027   }
6028   __pyx_L20:;
6029
6030   /* "cvcf.pyx":377
6031  *             # fine, ##filter format
6032  *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')
6033  *         if not data['type'] in ["Integer","Float","Character","String","Flag"]:             # <<<<<<<<<<<<<<
6034  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6035  *         # I would like a missing-value field, but it isn't there
6036  */
6037   __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__type)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6038   __Pyx_GOTREF(__pyx_t_1);
6039   __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__Integer), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6040   __Pyx_GOTREF(__pyx_t_10);
6041   __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6042   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6043   __pyx_t_4 = __pyx_t_9;
6044   if (!__pyx_t_4) {
6045     __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__Float), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6046     __Pyx_GOTREF(__pyx_t_10);
6047     __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6048     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6049     __pyx_t_3 = __pyx_t_9;
6050     __pyx_t_9 = __pyx_t_3;
6051   } else {
6052     __pyx_t_9 = __pyx_t_4;
6053   }
6054   if (!__pyx_t_9) {
6055     __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__Character), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6056     __Pyx_GOTREF(__pyx_t_10);
6057     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6058     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6059     __pyx_t_3 = __pyx_t_4;
6060     __pyx_t_4 = __pyx_t_3;
6061   } else {
6062     __pyx_t_4 = __pyx_t_9;
6063   }
6064   if (!__pyx_t_4) {
6065     __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__String), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6066     __Pyx_GOTREF(__pyx_t_10);
6067     __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6068     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6069     __pyx_t_3 = __pyx_t_9;
6070     __pyx_t_9 = __pyx_t_3;
6071   } else {
6072     __pyx_t_9 = __pyx_t_4;
6073   }
6074   if (!__pyx_t_9) {
6075     __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__Flag), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6076     __Pyx_GOTREF(__pyx_t_10);
6077     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6078     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6079     __pyx_t_3 = __pyx_t_4;
6080     __pyx_t_4 = __pyx_t_3;
6081   } else {
6082     __pyx_t_4 = __pyx_t_9;
6083   }
6084   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6085   __pyx_t_9 = (!__pyx_t_4);
6086   if (__pyx_t_9) {
6087
6088     /* "cvcf.pyx":378
6089  *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')
6090  *         if not data['type'] in ["Integer","Float","Character","String","Flag"]:
6091  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
6092  *         # I would like a missing-value field, but it isn't there
6093  *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value
6094  */
6095     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6096     __Pyx_GOTREF(__pyx_t_1);
6097     __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_39); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6098     __Pyx_GOTREF(__pyx_t_10);
6099     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6100     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
6101     __Pyx_INCREF(__pyx_v_line);
6102     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
6103     __Pyx_GIVEREF(__pyx_v_line);
6104     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10);
6105     __Pyx_GIVEREF(__pyx_t_10);
6106     __pyx_t_10 = 0;
6107     __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6108     __Pyx_GOTREF(__pyx_t_10);
6109     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6110     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
6111     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6112     goto __pyx_L21;
6113   }
6114   __pyx_L21:;
6115
6116   /* "cvcf.pyx":380
6117  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6118  *         # I would like a missing-value field, but it isn't there
6119  *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value             # <<<<<<<<<<<<<<
6120  *         else:                                   data['missing'] = '.'
6121  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6122  */
6123   __pyx_t_10 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__type)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6124   __Pyx_GOTREF(__pyx_t_10);
6125   __pyx_t_5 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_n_s__Integer), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6126   __Pyx_GOTREF(__pyx_t_5);
6127   __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6128   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6129   __pyx_t_4 = __pyx_t_9;
6130   if (!__pyx_t_4) {
6131     __pyx_t_5 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_n_s__Float), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6132     __Pyx_GOTREF(__pyx_t_5);
6133     __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6134     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6135     __pyx_t_3 = __pyx_t_9;
6136     __pyx_t_9 = __pyx_t_3;
6137   } else {
6138     __pyx_t_9 = __pyx_t_4;
6139   }
6140   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6141   __pyx_t_4 = __pyx_t_9;
6142   if (__pyx_t_4) {
6143     if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__missing), Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6144     goto __pyx_L22;
6145   }
6146   /*else*/ {
6147
6148     /* "cvcf.pyx":381
6149  *         # I would like a missing-value field, but it isn't there
6150  *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value
6151  *         else:                                   data['missing'] = '.'             # <<<<<<<<<<<<<<
6152  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6153  *         try:
6154  */
6155     if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__missing), ((PyObject *)__pyx_kp_s_9)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6156   }
6157   __pyx_L22:;
6158
6159   /* "cvcf.pyx":382
6160  *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value
6161  *         else:                                   data['missing'] = '.'
6162  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
6163  *         try:
6164  *             n = int(data['number'])
6165  */
6166   __pyx_t_10 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6167   __Pyx_GOTREF(__pyx_t_10);
6168   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6169   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6170   __pyx_t_9 = (!__pyx_t_4);
6171   if (__pyx_t_9) {
6172     __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6173     __Pyx_GOTREF(__pyx_t_10);
6174     __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_39); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6175     __Pyx_GOTREF(__pyx_t_5);
6176     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6177     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6178     __Pyx_INCREF(__pyx_v_line);
6179     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
6180     __Pyx_GIVEREF(__pyx_v_line);
6181     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
6182     __Pyx_GIVEREF(__pyx_t_5);
6183     __pyx_t_5 = 0;
6184     __pyx_t_5 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6185     __Pyx_GOTREF(__pyx_t_5);
6186     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6187     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
6188     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6189     goto __pyx_L23;
6190   }
6191   __pyx_L23:;
6192
6193   /* "cvcf.pyx":383
6194  *         else:                                   data['missing'] = '.'
6195  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6196  *         try:             # <<<<<<<<<<<<<<
6197  *             n = int(data['number'])
6198  *             t = self.NT_NUMBER
6199  */
6200   {
6201     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
6202     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
6203     __Pyx_XGOTREF(__pyx_save_exc_type);
6204     __Pyx_XGOTREF(__pyx_save_exc_value);
6205     __Pyx_XGOTREF(__pyx_save_exc_tb);
6206     /*try:*/ {
6207
6208       /* "cvcf.pyx":384
6209  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6210  *         try:
6211  *             n = int(data['number'])             # <<<<<<<<<<<<<<
6212  *             t = self.NT_NUMBER
6213  *         except ValueError:
6214  */
6215       __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
6216       __Pyx_GOTREF(__pyx_t_5);
6217       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
6218       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6219       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
6220       __Pyx_GIVEREF(__pyx_t_5);
6221       __pyx_t_5 = 0;
6222       __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
6223       __Pyx_GOTREF(__pyx_t_5);
6224       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
6225       __Pyx_DECREF(__pyx_v_n);
6226       __pyx_v_n = __pyx_t_5;
6227       __pyx_t_5 = 0;
6228
6229       /* "cvcf.pyx":385
6230  *         try:
6231  *             n = int(data['number'])
6232  *             t = self.NT_NUMBER             # <<<<<<<<<<<<<<
6233  *         except ValueError:
6234  *             n = -1
6235  */
6236       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NUMBER); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
6237       __Pyx_GOTREF(__pyx_t_5);
6238       __Pyx_DECREF(__pyx_v_t);
6239       __pyx_v_t = __pyx_t_5;
6240       __pyx_t_5 = 0;
6241     }
6242     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
6243     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
6244     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
6245     goto __pyx_L31_try_end;
6246     __pyx_L24_error:;
6247     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6248     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6249     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6250     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6251     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6252
6253     /* "cvcf.pyx":386
6254  *             n = int(data['number'])
6255  *             t = self.NT_NUMBER
6256  *         except ValueError:             # <<<<<<<<<<<<<<
6257  *             n = -1
6258  *             if data['number'] == '.':                   t = self.NT_UNKNOWN
6259  */
6260     __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
6261     if (__pyx_t_11) {
6262       __Pyx_AddTraceback("cvcf.VCF.parse_format");
6263       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6264       __Pyx_GOTREF(__pyx_t_5);
6265       __Pyx_GOTREF(__pyx_t_1);
6266       __Pyx_GOTREF(__pyx_t_10);
6267
6268       /* "cvcf.pyx":387
6269  *             t = self.NT_NUMBER
6270  *         except ValueError:
6271  *             n = -1             # <<<<<<<<<<<<<<
6272  *             if data['number'] == '.':                   t = self.NT_UNKNOWN
6273  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
6274  */
6275       __Pyx_INCREF(__pyx_int_neg_1);
6276       __Pyx_DECREF(__pyx_v_n);
6277       __pyx_v_n = __pyx_int_neg_1;
6278
6279       /* "cvcf.pyx":388
6280  *         except ValueError:
6281  *             n = -1
6282  *             if data['number'] == '.':                   t = self.NT_UNKNOWN             # <<<<<<<<<<<<<<
6283  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
6284  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
6285  */
6286       __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6287       __Pyx_GOTREF(__pyx_t_7);
6288       __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6289       __Pyx_GOTREF(__pyx_t_2);
6290       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6291       __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6292       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6293       if (__pyx_t_9) {
6294         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_UNKNOWN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6295         __Pyx_GOTREF(__pyx_t_2);
6296         __Pyx_DECREF(__pyx_v_t);
6297         __pyx_v_t = __pyx_t_2;
6298         __pyx_t_2 = 0;
6299         goto __pyx_L34;
6300       }
6301
6302       /* "cvcf.pyx":389
6303  *             n = -1
6304  *             if data['number'] == '.':                   t = self.NT_UNKNOWN
6305  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES             # <<<<<<<<<<<<<<
6306  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
6307  *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
6308  */
6309       __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6310       __Pyx_GOTREF(__pyx_t_2);
6311       __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_s_56), Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6312       __Pyx_GOTREF(__pyx_t_7);
6313       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6314       __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6315       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6316       if (__pyx_t_9) {
6317         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_ALLELES); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6318         __Pyx_GOTREF(__pyx_t_7);
6319         __Pyx_DECREF(__pyx_v_t);
6320         __pyx_v_t = __pyx_t_7;
6321         __pyx_t_7 = 0;
6322         goto __pyx_L34;
6323       }
6324
6325       /* "cvcf.pyx":390
6326  *             if data['number'] == '.':                   t = self.NT_UNKNOWN
6327  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
6328  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES             # <<<<<<<<<<<<<<
6329  *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
6330  *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
6331  */
6332       __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6333       __Pyx_GOTREF(__pyx_t_7);
6334       __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_kp_s_57), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6335       __Pyx_GOTREF(__pyx_t_2);
6336       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6337       __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6338       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6339       if (__pyx_t_9) {
6340         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NR_ALLELES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6341         __Pyx_GOTREF(__pyx_t_2);
6342         __Pyx_DECREF(__pyx_v_t);
6343         __pyx_v_t = __pyx_t_2;
6344         __pyx_t_2 = 0;
6345         goto __pyx_L34;
6346       }
6347
6348       /* "cvcf.pyx":391
6349  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
6350  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
6351  *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES             # <<<<<<<<<<<<<<
6352  *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
6353  *             else:
6354  */
6355       __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6356       __Pyx_GOTREF(__pyx_t_2);
6357       __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_s_58), Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6358       __Pyx_GOTREF(__pyx_t_7);
6359       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6360       __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6361       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6362       if (__pyx_t_9) {
6363         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_GENOTYPES); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6364         __Pyx_GOTREF(__pyx_t_7);
6365         __Pyx_DECREF(__pyx_v_t);
6366         __pyx_v_t = __pyx_t_7;
6367         __pyx_t_7 = 0;
6368         goto __pyx_L34;
6369       }
6370
6371       /* "cvcf.pyx":392
6372  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
6373  *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
6374  *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES             # <<<<<<<<<<<<<<
6375  *             else:
6376  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6377  */
6378       __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6379       __Pyx_GOTREF(__pyx_t_7);
6380       __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_kp_s_59), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6381       __Pyx_GOTREF(__pyx_t_2);
6382       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6383       __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6384       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6385       if (__pyx_t_9) {
6386         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6387         __Pyx_GOTREF(__pyx_t_2);
6388         __Pyx_DECREF(__pyx_v_t);
6389         __pyx_v_t = __pyx_t_2;
6390         __pyx_t_2 = 0;
6391         goto __pyx_L34;
6392       }
6393       /*else*/ {
6394
6395         /* "cvcf.pyx":394
6396  *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
6397  *             else:
6398  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
6399  *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])
6400  * 
6401  */
6402         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6403         __Pyx_GOTREF(__pyx_t_2);
6404         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_39); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6405         __Pyx_GOTREF(__pyx_t_7);
6406         __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6407         __Pyx_GOTREF(((PyObject *)__pyx_t_12));
6408         __Pyx_INCREF(__pyx_v_line);
6409         PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
6410         __Pyx_GIVEREF(__pyx_v_line);
6411         PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7);
6412         __Pyx_GIVEREF(__pyx_t_7);
6413         __pyx_t_7 = 0;
6414         __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6415         __Pyx_GOTREF(__pyx_t_7);
6416         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6417         __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
6418         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6419       }
6420       __pyx_L34:;
6421       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6422       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6423       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6424       goto __pyx_L25_exception_handled;
6425     }
6426     __pyx_L26_except_error:;
6427     __Pyx_XGIVEREF(__pyx_save_exc_type);
6428     __Pyx_XGIVEREF(__pyx_save_exc_value);
6429     __Pyx_XGIVEREF(__pyx_save_exc_tb);
6430     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
6431     goto __pyx_L1_error;
6432     __pyx_L25_exception_handled:;
6433     __Pyx_XGIVEREF(__pyx_save_exc_type);
6434     __Pyx_XGIVEREF(__pyx_save_exc_value);
6435     __Pyx_XGIVEREF(__pyx_save_exc_tb);
6436     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
6437     __pyx_L31_try_end:;
6438   }
6439
6440   /* "cvcf.pyx":395
6441  *             else:
6442  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6443  *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])             # <<<<<<<<<<<<<<
6444  * 
6445  * 
6446  */
6447   __Pyx_XDECREF(__pyx_r);
6448   __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6449   __Pyx_GOTREF(__pyx_t_10);
6450   __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__id)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6451   __Pyx_GOTREF(__pyx_t_1);
6452   __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__type)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6453   __Pyx_GOTREF(__pyx_t_5);
6454   __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__descr)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6455   __Pyx_GOTREF(__pyx_t_7);
6456   __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__missing)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6457   __Pyx_GOTREF(__pyx_t_12);
6458   __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6459   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6460   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
6461   __Pyx_GIVEREF(__pyx_t_1);
6462   __Pyx_INCREF(__pyx_v_t);
6463   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_t);
6464   __Pyx_GIVEREF(__pyx_v_t);
6465   __Pyx_INCREF(__pyx_v_n);
6466   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_n);
6467   __Pyx_GIVEREF(__pyx_v_n);
6468   PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
6469   __Pyx_GIVEREF(__pyx_t_5);
6470   PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
6471   __Pyx_GIVEREF(__pyx_t_7);
6472   PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_12);
6473   __Pyx_GIVEREF(__pyx_t_12);
6474   __pyx_t_1 = 0;
6475   __pyx_t_5 = 0;
6476   __pyx_t_7 = 0;
6477   __pyx_t_12 = 0;
6478   __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6479   __Pyx_GOTREF(__pyx_t_12);
6480   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6481   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
6482   __pyx_r = __pyx_t_12;
6483   __pyx_t_12 = 0;
6484   goto __pyx_L0;
6485
6486   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6487   goto __pyx_L0;
6488   __pyx_L1_error:;
6489   __Pyx_XDECREF(__pyx_t_1);
6490   __Pyx_XDECREF(__pyx_t_2);
6491   __Pyx_XDECREF(__pyx_t_5);
6492   __Pyx_XDECREF(__pyx_t_7);
6493   __Pyx_XDECREF(__pyx_t_10);
6494   __Pyx_XDECREF(__pyx_t_12);
6495   __Pyx_AddTraceback("cvcf.VCF.parse_format");
6496   __pyx_r = NULL;
6497   __pyx_L0:;
6498   __Pyx_DECREF(__pyx_v_data);
6499   __Pyx_DECREF(__pyx_v_idx);
6500   __Pyx_DECREF(__pyx_v_elts);
6501   __Pyx_DECREF(__pyx_v_first);
6502   __Pyx_DECREF(__pyx_v_rest);
6503   __Pyx_DECREF(__pyx_v_n);
6504   __Pyx_DECREF(__pyx_v_t);
6505   __Pyx_DECREF(__pyx_v_format);
6506   __Pyx_XGIVEREF(__pyx_r);
6507   __Pyx_RefNannyFinishContext();
6508   return __pyx_r;
6509 }
6510
6511 /* "cvcf.pyx":398
6512  * 
6513  * 
6514  *     def format_format( self, fmt, filter=False ):             # <<<<<<<<<<<<<<
6515  *         values = [('ID',fmt.id)]
6516  *         if fmt.number != None and not filter:
6517  */
6518
6519 static PyObject *__pyx_pf_4cvcf_3VCF_3format_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6520 static PyMethodDef __pyx_mdef_4cvcf_3VCF_3format_format = {__Pyx_NAMESTR("format_format"), (PyCFunction)__pyx_pf_4cvcf_3VCF_3format_format, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
6521 static PyObject *__pyx_pf_4cvcf_3VCF_3format_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6522   PyObject *__pyx_v_self = 0;
6523   PyObject *__pyx_v_fmt = 0;
6524   PyObject *__pyx_v_filter = 0;
6525   PyObject *__pyx_v_values;
6526   PyObject *__pyx_v_nmb;
6527   PyObject *__pyx_v_format;
6528   PyObject *__pyx_v_k;
6529   PyObject *__pyx_v_v;
6530   PyObject *__pyx_r = NULL;
6531   PyObject *__pyx_t_1 = NULL;
6532   PyObject *__pyx_t_2 = NULL;
6533   int __pyx_t_3;
6534   int __pyx_t_4;
6535   int __pyx_t_5;
6536   PyObject *__pyx_t_6 = NULL;
6537   int __pyx_t_7;
6538   Py_ssize_t __pyx_t_8;
6539   PyObject *__pyx_t_9 = NULL;
6540   PyObject *__pyx_t_10 = NULL;
6541   PyObject *__pyx_t_11 = NULL;
6542   PyObject *__pyx_t_12 = NULL;
6543   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__fmt,&__pyx_n_s__filter,0};
6544   __Pyx_RefNannySetupContext("format_format");
6545   __pyx_self = __pyx_self;
6546   if (unlikely(__pyx_kwds)) {
6547     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
6548     PyObject* values[3] = {0,0,0};
6549     values[2] = __pyx_k_60;
6550     switch (PyTuple_GET_SIZE(__pyx_args)) {
6551       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6552       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6553       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6554       case  0: break;
6555       default: goto __pyx_L5_argtuple_error;
6556     }
6557     switch (PyTuple_GET_SIZE(__pyx_args)) {
6558       case  0:
6559       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
6560       if (likely(values[0])) kw_args--;
6561       else goto __pyx_L5_argtuple_error;
6562       case  1:
6563       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmt);
6564       if (likely(values[1])) kw_args--;
6565       else {
6566         __Pyx_RaiseArgtupleInvalid("format_format", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6567       }
6568       case  2:
6569       if (kw_args > 0) {
6570         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
6571         if (value) { values[2] = value; kw_args--; }
6572       }
6573     }
6574     if (unlikely(kw_args > 0)) {
6575       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "format_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6576     }
6577     __pyx_v_self = values[0];
6578     __pyx_v_fmt = values[1];
6579     __pyx_v_filter = values[2];
6580   } else {
6581     __pyx_v_filter = __pyx_k_60;
6582     switch (PyTuple_GET_SIZE(__pyx_args)) {
6583       case  3:
6584       __pyx_v_filter = PyTuple_GET_ITEM(__pyx_args, 2);
6585       case  2:
6586       __pyx_v_fmt = PyTuple_GET_ITEM(__pyx_args, 1);
6587       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
6588       break;
6589       default: goto __pyx_L5_argtuple_error;
6590     }
6591   }
6592   goto __pyx_L4_argument_unpacking_done;
6593   __pyx_L5_argtuple_error:;
6594   __Pyx_RaiseArgtupleInvalid("format_format", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6595   __pyx_L3_error:;
6596   __Pyx_AddTraceback("cvcf.VCF.format_format");
6597   __Pyx_RefNannyFinishContext();
6598   return NULL;
6599   __pyx_L4_argument_unpacking_done:;
6600   __pyx_v_values = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
6601   __pyx_v_nmb = Py_None; __Pyx_INCREF(Py_None);
6602   __pyx_v_format = Py_None; __Pyx_INCREF(Py_None);
6603   __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
6604   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
6605
6606   /* "cvcf.pyx":399
6607  * 
6608  *     def format_format( self, fmt, filter=False ):
6609  *         values = [('ID',fmt.id)]             # <<<<<<<<<<<<<<
6610  *         if fmt.number != None and not filter:
6611  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
6612  */
6613   __pyx_t_1 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6614   __Pyx_GOTREF(__pyx_t_1);
6615   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6616   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6617   __Pyx_INCREF(((PyObject *)__pyx_n_s__ID));
6618   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__ID));
6619   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ID));
6620   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
6621   __Pyx_GIVEREF(__pyx_t_1);
6622   __pyx_t_1 = 0;
6623   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6624   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6625   PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
6626   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6627   __pyx_t_2 = 0;
6628   __Pyx_DECREF(((PyObject *)__pyx_v_values));
6629   __pyx_v_values = __pyx_t_1;
6630   __pyx_t_1 = 0;
6631
6632   /* "cvcf.pyx":400
6633  *     def format_format( self, fmt, filter=False ):
6634  *         values = [('ID',fmt.id)]
6635  *         if fmt.number != None and not filter:             # <<<<<<<<<<<<<<
6636  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
6637  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
6638  */
6639   __pyx_t_1 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__number); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6640   __Pyx_GOTREF(__pyx_t_1);
6641   __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6642   __Pyx_GOTREF(__pyx_t_2);
6643   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6644   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6645   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6646   if (__pyx_t_3) {
6647     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6648     __pyx_t_5 = (!__pyx_t_4);
6649     __pyx_t_4 = __pyx_t_5;
6650   } else {
6651     __pyx_t_4 = __pyx_t_3;
6652   }
6653   if (__pyx_t_4) {
6654
6655     /* "cvcf.pyx":401
6656  *         values = [('ID',fmt.id)]
6657  *         if fmt.number != None and not filter:
6658  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."             # <<<<<<<<<<<<<<
6659  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
6660  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
6661  */
6662     __pyx_t_2 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6663     __Pyx_GOTREF(__pyx_t_2);
6664     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_UNKNOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6665     __Pyx_GOTREF(__pyx_t_1);
6666     __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6667     __Pyx_GOTREF(__pyx_t_6);
6668     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6669     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6670     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6671     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6672     if (__pyx_t_4) {
6673       __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
6674       __Pyx_DECREF(__pyx_v_nmb);
6675       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_9);
6676       goto __pyx_L7;
6677     }
6678
6679     /* "cvcf.pyx":402
6680  *         if fmt.number != None and not filter:
6681  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
6682  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)             # <<<<<<<<<<<<<<
6683  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
6684  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
6685  */
6686     __pyx_t_6 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6687     __Pyx_GOTREF(__pyx_t_6);
6688     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NUMBER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6689     __Pyx_GOTREF(__pyx_t_1);
6690     __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6691     __Pyx_GOTREF(__pyx_t_2);
6692     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6693     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6694     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6695     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6696     if (__pyx_t_4) {
6697       __pyx_t_2 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__number); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6698       __Pyx_GOTREF(__pyx_t_2);
6699       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6700       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6701       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
6702       __Pyx_GIVEREF(__pyx_t_2);
6703       __pyx_t_2 = 0;
6704       __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6705       __Pyx_GOTREF(__pyx_t_2);
6706       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
6707       __Pyx_DECREF(__pyx_v_nmb);
6708       __pyx_v_nmb = __pyx_t_2;
6709       __pyx_t_2 = 0;
6710       goto __pyx_L7;
6711     }
6712
6713     /* "cvcf.pyx":403
6714  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
6715  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
6716  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"             # <<<<<<<<<<<<<<
6717  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
6718  *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"
6719  */
6720     __pyx_t_2 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6721     __Pyx_GOTREF(__pyx_t_2);
6722     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_ALLELES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6723     __Pyx_GOTREF(__pyx_t_1);
6724     __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6725     __Pyx_GOTREF(__pyx_t_6);
6726     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6727     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6728     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6729     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6730     if (__pyx_t_4) {
6731       __Pyx_INCREF(((PyObject *)__pyx_kp_s_56));
6732       __Pyx_DECREF(__pyx_v_nmb);
6733       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_56);
6734       goto __pyx_L7;
6735     }
6736
6737     /* "cvcf.pyx":404
6738  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
6739  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
6740  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"             # <<<<<<<<<<<<<<
6741  *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"
6742  *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"
6743  */
6744     __pyx_t_6 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6745     __Pyx_GOTREF(__pyx_t_6);
6746     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NR_ALLELES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6747     __Pyx_GOTREF(__pyx_t_1);
6748     __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6749     __Pyx_GOTREF(__pyx_t_2);
6750     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6751     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6752     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6753     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6754     if (__pyx_t_4) {
6755       __Pyx_INCREF(((PyObject *)__pyx_kp_s_57));
6756       __Pyx_DECREF(__pyx_v_nmb);
6757       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_57);
6758       goto __pyx_L7;
6759     }
6760
6761     /* "cvcf.pyx":405
6762  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
6763  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
6764  *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"             # <<<<<<<<<<<<<<
6765  *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"
6766  *             else:
6767  */
6768     __pyx_t_2 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6769     __Pyx_GOTREF(__pyx_t_2);
6770     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_GENOTYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6771     __Pyx_GOTREF(__pyx_t_1);
6772     __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6773     __Pyx_GOTREF(__pyx_t_6);
6774     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6775     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6776     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6777     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6778     if (__pyx_t_4) {
6779       __Pyx_INCREF(((PyObject *)__pyx_kp_s_58));
6780       __Pyx_DECREF(__pyx_v_nmb);
6781       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_58);
6782       goto __pyx_L7;
6783     }
6784
6785     /* "cvcf.pyx":406
6786  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
6787  *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"
6788  *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"             # <<<<<<<<<<<<<<
6789  *             else:
6790  *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)
6791  */
6792     __pyx_t_6 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6793     __Pyx_GOTREF(__pyx_t_6);
6794     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6795     __Pyx_GOTREF(__pyx_t_1);
6796     __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6797     __Pyx_GOTREF(__pyx_t_2);
6798     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6799     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6800     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6801     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6802     if (__pyx_t_4) {
6803       __Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
6804       __Pyx_DECREF(__pyx_v_nmb);
6805       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_59);
6806       goto __pyx_L7;
6807     }
6808     /*else*/ {
6809
6810       /* "cvcf.pyx":408
6811  *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"
6812  *             else:
6813  *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)             # <<<<<<<<<<<<<<
6814  *             values.append( ('Number',nmb) )
6815  *             values.append( ('Type', fmt.type) )
6816  */
6817       __pyx_t_2 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6818       __Pyx_GOTREF(__pyx_t_2);
6819       __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6820       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6821       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6822       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6823       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6824       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
6825       __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
6826       __pyx_t_1 = 0;
6827       __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6828       __Pyx_GOTREF(__pyx_t_1);
6829       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
6830       __Pyx_Raise(__pyx_t_1, 0, 0);
6831       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6832       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6833     }
6834     __pyx_L7:;
6835
6836     /* "cvcf.pyx":409
6837  *             else:
6838  *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)
6839  *             values.append( ('Number',nmb) )             # <<<<<<<<<<<<<<
6840  *             values.append( ('Type', fmt.type) )
6841  *         values.append( ('Description', '"' + fmt.description + '"') )
6842  */
6843     if (unlikely(__pyx_v_values == Py_None)) {
6844       PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
6845     }
6846     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6847     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6848     __Pyx_INCREF(((PyObject *)__pyx_n_s__Number));
6849     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Number));
6850     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Number));
6851     __Pyx_INCREF(__pyx_v_nmb);
6852     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nmb);
6853     __Pyx_GIVEREF(__pyx_v_nmb);
6854     __pyx_t_7 = PyList_Append(__pyx_v_values, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6855     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
6856
6857     /* "cvcf.pyx":410
6858  *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)
6859  *             values.append( ('Number',nmb) )
6860  *             values.append( ('Type', fmt.type) )             # <<<<<<<<<<<<<<
6861  *         values.append( ('Description', '"' + fmt.description + '"') )
6862  *         if self._version == 33:
6863  */
6864     if (unlikely(__pyx_v_values == Py_None)) {
6865       PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
6866     }
6867     __pyx_t_1 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6868     __Pyx_GOTREF(__pyx_t_1);
6869     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6870     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6871     __Pyx_INCREF(((PyObject *)__pyx_n_s__Type));
6872     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__Type));
6873     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Type));
6874     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
6875     __Pyx_GIVEREF(__pyx_t_1);
6876     __pyx_t_1 = 0;
6877     __pyx_t_7 = PyList_Append(__pyx_v_values, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6878     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
6879     goto __pyx_L6;
6880   }
6881   __pyx_L6:;
6882
6883   /* "cvcf.pyx":411
6884  *             values.append( ('Number',nmb) )
6885  *             values.append( ('Type', fmt.type) )
6886  *         values.append( ('Description', '"' + fmt.description + '"') )             # <<<<<<<<<<<<<<
6887  *         if self._version == 33:
6888  *             format = ",".join([v for k,v in values])
6889  */
6890   if (unlikely(__pyx_v_values == Py_None)) {
6891     PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
6892   }
6893   __pyx_t_2 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__description); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6894   __Pyx_GOTREF(__pyx_t_2);
6895   __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_34), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6896   __Pyx_GOTREF(__pyx_t_1);
6897   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6898   __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_34)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6899   __Pyx_GOTREF(__pyx_t_2);
6900   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6901   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6902   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6903   __Pyx_INCREF(((PyObject *)__pyx_n_s__Description));
6904   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Description));
6905   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Description));
6906   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
6907   __Pyx_GIVEREF(__pyx_t_2);
6908   __pyx_t_2 = 0;
6909   __pyx_t_7 = PyList_Append(__pyx_v_values, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6910   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
6911
6912   /* "cvcf.pyx":412
6913  *             values.append( ('Type', fmt.type) )
6914  *         values.append( ('Description', '"' + fmt.description + '"') )
6915  *         if self._version == 33:             # <<<<<<<<<<<<<<
6916  *             format = ",".join([v for k,v in values])
6917  *         else:
6918  */
6919   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6920   __Pyx_GOTREF(__pyx_t_1);
6921   __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_33, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6922   __Pyx_GOTREF(__pyx_t_2);
6923   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6924   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6925   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6926   if (__pyx_t_4) {
6927
6928     /* "cvcf.pyx":413
6929  *         values.append( ('Description', '"' + fmt.description + '"') )
6930  *         if self._version == 33:
6931  *             format = ",".join([v for k,v in values])             # <<<<<<<<<<<<<<
6932  *         else:
6933  *             format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">"
6934  */
6935     __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6936     __Pyx_GOTREF(__pyx_t_2);
6937     __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6938     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6939     if (unlikely(__pyx_v_values == Py_None)) {
6940       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
6941     }
6942     __pyx_t_8 = 0; __pyx_t_6 = ((PyObject *)__pyx_v_values); __Pyx_INCREF(__pyx_t_6);
6943     for (;;) {
6944       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
6945       __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++;
6946       if (PyTuple_CheckExact(__pyx_t_9) && likely(PyTuple_GET_SIZE(__pyx_t_9) == 2)) {
6947         PyObject* tuple = __pyx_t_9;
6948         __pyx_t_10 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_10);
6949         __pyx_t_11 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_11);
6950         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6951         __Pyx_DECREF(__pyx_v_k);
6952         __pyx_v_k = __pyx_t_10;
6953         __pyx_t_10 = 0;
6954         __Pyx_DECREF(__pyx_v_v);
6955         __pyx_v_v = __pyx_t_11;
6956         __pyx_t_11 = 0;
6957       } else {
6958         __pyx_t_12 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6959         __Pyx_GOTREF(__pyx_t_12);
6960         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6961         __pyx_t_10 = __Pyx_UnpackItem(__pyx_t_12, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6962         __Pyx_GOTREF(__pyx_t_10);
6963         __pyx_t_11 = __Pyx_UnpackItem(__pyx_t_12, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6964         __Pyx_GOTREF(__pyx_t_11);
6965         if (__Pyx_EndUnpack(__pyx_t_12, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6966         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6967         __Pyx_DECREF(__pyx_v_k);
6968         __pyx_v_k = __pyx_t_10;
6969         __pyx_t_10 = 0;
6970         __Pyx_DECREF(__pyx_v_v);
6971         __pyx_v_v = __pyx_t_11;
6972         __pyx_t_11 = 0;
6973       }
6974       if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6975     }
6976     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6977     __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6978     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
6979     __Pyx_INCREF(((PyObject *)__pyx_t_1));
6980     PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
6981     __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
6982     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
6983     __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6984     __Pyx_GOTREF(__pyx_t_1);
6985     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6986     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
6987     __Pyx_DECREF(__pyx_v_format);
6988     __pyx_v_format = __pyx_t_1;
6989     __pyx_t_1 = 0;
6990     goto __pyx_L8;
6991   }
6992   /*else*/ {
6993
6994     /* "cvcf.pyx":415
6995  *             format = ",".join([v for k,v in values])
6996  *         else:
6997  *             format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">"             # <<<<<<<<<<<<<<
6998  *         return format
6999  * 
7000  */
7001     __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7002     __Pyx_GOTREF(__pyx_t_1);
7003     __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7004     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
7005     if (unlikely(__pyx_v_values == Py_None)) {
7006       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
7007     }
7008     __pyx_t_8 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_values); __Pyx_INCREF(__pyx_t_2);
7009     for (;;) {
7010       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
7011       __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++;
7012       if (PyTuple_CheckExact(__pyx_t_9) && likely(PyTuple_GET_SIZE(__pyx_t_9) == 2)) {
7013         PyObject* tuple = __pyx_t_9;
7014         __pyx_t_11 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_11);
7015         __pyx_t_10 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_10);
7016         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7017         __Pyx_DECREF(__pyx_v_k);
7018         __pyx_v_k = __pyx_t_11;
7019         __pyx_t_11 = 0;
7020         __Pyx_DECREF(__pyx_v_v);
7021         __pyx_v_v = __pyx_t_10;
7022         __pyx_t_10 = 0;
7023       } else {
7024         __pyx_t_12 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7025         __Pyx_GOTREF(__pyx_t_12);
7026         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7027         __pyx_t_11 = __Pyx_UnpackItem(__pyx_t_12, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7028         __Pyx_GOTREF(__pyx_t_11);
7029         __pyx_t_10 = __Pyx_UnpackItem(__pyx_t_12, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7030         __Pyx_GOTREF(__pyx_t_10);
7031         if (__Pyx_EndUnpack(__pyx_t_12, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7032         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7033         __Pyx_DECREF(__pyx_v_k);
7034         __pyx_v_k = __pyx_t_11;
7035         __pyx_t_11 = 0;
7036         __Pyx_DECREF(__pyx_v_v);
7037         __pyx_v_v = __pyx_t_10;
7038         __pyx_t_10 = 0;
7039       }
7040       __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7041       __Pyx_GOTREF(((PyObject *)__pyx_t_9));
7042       __Pyx_INCREF(__pyx_v_k);
7043       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_k);
7044       __Pyx_GIVEREF(__pyx_v_k);
7045       __Pyx_INCREF(__pyx_v_v);
7046       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_v);
7047       __Pyx_GIVEREF(__pyx_v_v);
7048       __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7049       __Pyx_GOTREF(((PyObject *)__pyx_t_10));
7050       __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
7051       if (unlikely(PyList_Append(__pyx_t_6, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7052       __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
7053     }
7054     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7055     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7056     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
7057     __Pyx_INCREF(((PyObject *)__pyx_t_6));
7058     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
7059     __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
7060     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
7061     __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7062     __Pyx_GOTREF(__pyx_t_6);
7063     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7064     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
7065     __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_27), __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7066     __Pyx_GOTREF(__pyx_t_2);
7067     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7068     __pyx_t_6 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_kp_s_30)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7069     __Pyx_GOTREF(__pyx_t_6);
7070     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7071     __Pyx_DECREF(__pyx_v_format);
7072     __pyx_v_format = __pyx_t_6;
7073     __pyx_t_6 = 0;
7074   }
7075   __pyx_L8:;
7076
7077   /* "cvcf.pyx":416
7078  *         else:
7079  *             format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">"
7080  *         return format             # <<<<<<<<<<<<<<
7081  * 
7082  *     def get_expected(self, format, formatdict, alt):
7083  */
7084   __Pyx_XDECREF(__pyx_r);
7085   __Pyx_INCREF(__pyx_v_format);
7086   __pyx_r = __pyx_v_format;
7087   goto __pyx_L0;
7088
7089   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7090   goto __pyx_L0;
7091   __pyx_L1_error:;
7092   __Pyx_XDECREF(__pyx_t_1);
7093   __Pyx_XDECREF(__pyx_t_2);
7094   __Pyx_XDECREF(__pyx_t_6);
7095   __Pyx_XDECREF(__pyx_t_9);
7096   __Pyx_XDECREF(__pyx_t_10);
7097   __Pyx_XDECREF(__pyx_t_11);
7098   __Pyx_XDECREF(__pyx_t_12);
7099   __Pyx_AddTraceback("cvcf.VCF.format_format");
7100   __pyx_r = NULL;
7101   __pyx_L0:;
7102   __Pyx_DECREF(__pyx_v_values);
7103   __Pyx_DECREF(__pyx_v_nmb);
7104   __Pyx_DECREF(__pyx_v_format);
7105   __Pyx_DECREF(__pyx_v_k);
7106   __Pyx_DECREF(__pyx_v_v);
7107   __Pyx_XGIVEREF(__pyx_r);
7108   __Pyx_RefNannyFinishContext();
7109   return __pyx_r;
7110 }
7111
7112 /* "cvcf.pyx":418
7113  *         return format
7114  * 
7115  *     def get_expected(self, format, formatdict, alt):             # <<<<<<<<<<<<<<
7116  *         fmt = formatdict[format]
7117  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
7118  */
7119
7120 static PyObject *__pyx_pf_4cvcf_3VCF_4get_expected(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7121 static PyMethodDef __pyx_mdef_4cvcf_3VCF_4get_expected = {__Pyx_NAMESTR("get_expected"), (PyCFunction)__pyx_pf_4cvcf_3VCF_4get_expected, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
7122 static PyObject *__pyx_pf_4cvcf_3VCF_4get_expected(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7123   PyObject *__pyx_v_self = 0;
7124   PyObject *__pyx_v_format = 0;
7125   PyObject *__pyx_v_formatdict = 0;
7126   PyObject *__pyx_v_alt = 0;
7127   PyObject *__pyx_v_fmt;
7128   PyObject *__pyx_r = NULL;
7129   PyObject *__pyx_t_1 = NULL;
7130   PyObject *__pyx_t_2 = NULL;
7131   PyObject *__pyx_t_3 = NULL;
7132   int __pyx_t_4;
7133   Py_ssize_t __pyx_t_5;
7134   Py_ssize_t __pyx_t_6;
7135   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__format,&__pyx_n_s__formatdict,&__pyx_n_s__alt,0};
7136   __Pyx_RefNannySetupContext("get_expected");
7137   __pyx_self = __pyx_self;
7138   if (unlikely(__pyx_kwds)) {
7139     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7140     PyObject* values[4] = {0,0,0,0};
7141     switch (PyTuple_GET_SIZE(__pyx_args)) {
7142       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7143       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7144       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7145       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7146       case  0: break;
7147       default: goto __pyx_L5_argtuple_error;
7148     }
7149     switch (PyTuple_GET_SIZE(__pyx_args)) {
7150       case  0:
7151       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7152       if (likely(values[0])) kw_args--;
7153       else goto __pyx_L5_argtuple_error;
7154       case  1:
7155       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
7156       if (likely(values[1])) kw_args--;
7157       else {
7158         __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7159       }
7160       case  2:
7161       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__formatdict);
7162       if (likely(values[2])) kw_args--;
7163       else {
7164         __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7165       }
7166       case  3:
7167       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alt);
7168       if (likely(values[3])) kw_args--;
7169       else {
7170         __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7171       }
7172     }
7173     if (unlikely(kw_args > 0)) {
7174       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_expected") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7175     }
7176     __pyx_v_self = values[0];
7177     __pyx_v_format = values[1];
7178     __pyx_v_formatdict = values[2];
7179     __pyx_v_alt = values[3];
7180   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
7181     goto __pyx_L5_argtuple_error;
7182   } else {
7183     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
7184     __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 1);
7185     __pyx_v_formatdict = PyTuple_GET_ITEM(__pyx_args, 2);
7186     __pyx_v_alt = PyTuple_GET_ITEM(__pyx_args, 3);
7187   }
7188   goto __pyx_L4_argument_unpacking_done;
7189   __pyx_L5_argtuple_error:;
7190   __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7191   __pyx_L3_error:;
7192   __Pyx_AddTraceback("cvcf.VCF.get_expected");
7193   __Pyx_RefNannyFinishContext();
7194   return NULL;
7195   __pyx_L4_argument_unpacking_done:;
7196   __pyx_v_fmt = Py_None; __Pyx_INCREF(Py_None);
7197
7198   /* "cvcf.pyx":419
7199  * 
7200  *     def get_expected(self, format, formatdict, alt):
7201  *         fmt = formatdict[format]             # <<<<<<<<<<<<<<
7202  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
7203  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
7204  */
7205   __pyx_t_1 = PyObject_GetItem(__pyx_v_formatdict, __pyx_v_format); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7206   __Pyx_GOTREF(__pyx_t_1);
7207   __Pyx_DECREF(__pyx_v_fmt);
7208   __pyx_v_fmt = __pyx_t_1;
7209   __pyx_t_1 = 0;
7210
7211   /* "cvcf.pyx":420
7212  *     def get_expected(self, format, formatdict, alt):
7213  *         fmt = formatdict[format]
7214  *         if fmt.numbertype == self.NT_UNKNOWN: return -1             # <<<<<<<<<<<<<<
7215  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
7216  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
7217  */
7218   __pyx_t_1 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7219   __Pyx_GOTREF(__pyx_t_1);
7220   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_UNKNOWN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7221   __Pyx_GOTREF(__pyx_t_2);
7222   __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7223   __Pyx_GOTREF(__pyx_t_3);
7224   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7225   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7226   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7227   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7228   if (__pyx_t_4) {
7229     __Pyx_XDECREF(__pyx_r);
7230     __Pyx_INCREF(__pyx_int_neg_1);
7231     __pyx_r = __pyx_int_neg_1;
7232     goto __pyx_L0;
7233     goto __pyx_L6;
7234   }
7235   __pyx_L6:;
7236
7237   /* "cvcf.pyx":421
7238  *         fmt = formatdict[format]
7239  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
7240  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number             # <<<<<<<<<<<<<<
7241  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
7242  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
7243  */
7244   __pyx_t_3 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7245   __Pyx_GOTREF(__pyx_t_3);
7246   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NUMBER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7247   __Pyx_GOTREF(__pyx_t_2);
7248   __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7249   __Pyx_GOTREF(__pyx_t_1);
7250   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7251   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7252   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7253   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7254   if (__pyx_t_4) {
7255     __Pyx_XDECREF(__pyx_r);
7256     __pyx_t_1 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__number); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7257     __Pyx_GOTREF(__pyx_t_1);
7258     __pyx_r = __pyx_t_1;
7259     __pyx_t_1 = 0;
7260     goto __pyx_L0;
7261     goto __pyx_L7;
7262   }
7263   __pyx_L7:;
7264
7265   /* "cvcf.pyx":422
7266  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
7267  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
7268  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1             # <<<<<<<<<<<<<<
7269  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
7270  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
7271  */
7272   __pyx_t_1 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7273   __Pyx_GOTREF(__pyx_t_1);
7274   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_ALLELES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7275   __Pyx_GOTREF(__pyx_t_2);
7276   __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7277   __Pyx_GOTREF(__pyx_t_3);
7278   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7279   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7280   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7281   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7282   if (__pyx_t_4) {
7283     __Pyx_XDECREF(__pyx_r);
7284     __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7285     __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_5 + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7286     __Pyx_GOTREF(__pyx_t_3);
7287     __pyx_r = __pyx_t_3;
7288     __pyx_t_3 = 0;
7289     goto __pyx_L0;
7290     goto __pyx_L8;
7291   }
7292   __pyx_L8:;
7293
7294   /* "cvcf.pyx":423
7295  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
7296  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
7297  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)             # <<<<<<<<<<<<<<
7298  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
7299  *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)
7300  */
7301   __pyx_t_3 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7302   __Pyx_GOTREF(__pyx_t_3);
7303   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NR_ALLELES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7304   __Pyx_GOTREF(__pyx_t_2);
7305   __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7306   __Pyx_GOTREF(__pyx_t_1);
7307   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7308   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7309   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7310   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7311   if (__pyx_t_4) {
7312     __Pyx_XDECREF(__pyx_r);
7313     __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7314     __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7315     __Pyx_GOTREF(__pyx_t_1);
7316     __pyx_r = __pyx_t_1;
7317     __pyx_t_1 = 0;
7318     goto __pyx_L0;
7319     goto __pyx_L9;
7320   }
7321   __pyx_L9:;
7322
7323   /* "cvcf.pyx":424
7324  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
7325  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
7326  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2             # <<<<<<<<<<<<<<
7327  *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)
7328  *         return 0
7329  */
7330   __pyx_t_1 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7331   __Pyx_GOTREF(__pyx_t_1);
7332   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_GENOTYPES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7333   __Pyx_GOTREF(__pyx_t_2);
7334   __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7335   __Pyx_GOTREF(__pyx_t_3);
7336   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7337   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7338   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7339   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7340   if (__pyx_t_4) {
7341     __Pyx_XDECREF(__pyx_r);
7342     __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7343     __pyx_t_6 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7344     __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_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7345     __Pyx_GOTREF(__pyx_t_3);
7346     __pyx_r = __pyx_t_3;
7347     __pyx_t_3 = 0;
7348     goto __pyx_L0;
7349     goto __pyx_L10;
7350   }
7351   __pyx_L10:;
7352
7353   /* "cvcf.pyx":425
7354  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
7355  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
7356  *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)             # <<<<<<<<<<<<<<
7357  *         return 0
7358  * 
7359  */
7360   __pyx_t_3 = PyObject_GetAttr(__pyx_v_fmt, __pyx_n_s__numbertype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7361   __Pyx_GOTREF(__pyx_t_3);
7362   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7363   __Pyx_GOTREF(__pyx_t_2);
7364   __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7365   __Pyx_GOTREF(__pyx_t_1);
7366   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7367   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7368   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7369   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7370   if (__pyx_t_4) {
7371     __Pyx_XDECREF(__pyx_r);
7372     __pyx_t_6 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7373     __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7374     __pyx_t_1 = PyInt_FromSsize_t(((__pyx_t_6 + 1) * (__pyx_t_5 + 1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7375     __Pyx_GOTREF(__pyx_t_1);
7376     __pyx_r = __pyx_t_1;
7377     __pyx_t_1 = 0;
7378     goto __pyx_L0;
7379     goto __pyx_L11;
7380   }
7381   __pyx_L11:;
7382
7383   /* "cvcf.pyx":426
7384  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
7385  *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)
7386  *         return 0             # <<<<<<<<<<<<<<
7387  * 
7388  * 
7389  */
7390   __Pyx_XDECREF(__pyx_r);
7391   __Pyx_INCREF(__pyx_int_0);
7392   __pyx_r = __pyx_int_0;
7393   goto __pyx_L0;
7394
7395   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7396   goto __pyx_L0;
7397   __pyx_L1_error:;
7398   __Pyx_XDECREF(__pyx_t_1);
7399   __Pyx_XDECREF(__pyx_t_2);
7400   __Pyx_XDECREF(__pyx_t_3);
7401   __Pyx_AddTraceback("cvcf.VCF.get_expected");
7402   __pyx_r = NULL;
7403   __pyx_L0:;
7404   __Pyx_DECREF(__pyx_v_fmt);
7405   __Pyx_XGIVEREF(__pyx_r);
7406   __Pyx_RefNannyFinishContext();
7407   return __pyx_r;
7408 }
7409
7410 /* "cvcf.pyx":429
7411  * 
7412  * 
7413  *     def _add_definition(self, formatdict, key, data, line ):             # <<<<<<<<<<<<<<
7414  *         if key in formatdict: return
7415  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
7416  */
7417
7418 static PyObject *__pyx_pf_4cvcf_3VCF_5_add_definition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7419 static PyMethodDef __pyx_mdef_4cvcf_3VCF_5_add_definition = {__Pyx_NAMESTR("_add_definition"), (PyCFunction)__pyx_pf_4cvcf_3VCF_5_add_definition, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
7420 static PyObject *__pyx_pf_4cvcf_3VCF_5_add_definition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7421   PyObject *__pyx_v_self = 0;
7422   PyObject *__pyx_v_formatdict = 0;
7423   PyObject *__pyx_v_key = 0;
7424   PyObject *__pyx_v_data = 0;
7425   PyObject *__pyx_v_line = 0;
7426   PyObject *__pyx_r = NULL;
7427   int __pyx_t_1;
7428   PyObject *__pyx_t_2 = NULL;
7429   PyObject *__pyx_t_3 = NULL;
7430   PyObject *__pyx_t_4 = NULL;
7431   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__formatdict,&__pyx_n_s__key,&__pyx_n_s__data,&__pyx_n_s__line,0};
7432   __Pyx_RefNannySetupContext("_add_definition");
7433   __pyx_self = __pyx_self;
7434   if (unlikely(__pyx_kwds)) {
7435     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7436     PyObject* values[5] = {0,0,0,0,0};
7437     switch (PyTuple_GET_SIZE(__pyx_args)) {
7438       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7439       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7440       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7441       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7442       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7443       case  0: break;
7444       default: goto __pyx_L5_argtuple_error;
7445     }
7446     switch (PyTuple_GET_SIZE(__pyx_args)) {
7447       case  0:
7448       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7449       if (likely(values[0])) kw_args--;
7450       else goto __pyx_L5_argtuple_error;
7451       case  1:
7452       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__formatdict);
7453       if (likely(values[1])) kw_args--;
7454       else {
7455         __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7456       }
7457       case  2:
7458       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
7459       if (likely(values[2])) kw_args--;
7460       else {
7461         __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7462       }
7463       case  3:
7464       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
7465       if (likely(values[3])) kw_args--;
7466       else {
7467         __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7468       }
7469       case  4:
7470       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
7471       if (likely(values[4])) kw_args--;
7472       else {
7473         __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7474       }
7475     }
7476     if (unlikely(kw_args > 0)) {
7477       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_add_definition") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7478     }
7479     __pyx_v_self = values[0];
7480     __pyx_v_formatdict = values[1];
7481     __pyx_v_key = values[2];
7482     __pyx_v_data = values[3];
7483     __pyx_v_line = values[4];
7484   } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
7485     goto __pyx_L5_argtuple_error;
7486   } else {
7487     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
7488     __pyx_v_formatdict = PyTuple_GET_ITEM(__pyx_args, 1);
7489     __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 2);
7490     __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 3);
7491     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 4);
7492   }
7493   goto __pyx_L4_argument_unpacking_done;
7494   __pyx_L5_argtuple_error:;
7495   __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7496   __pyx_L3_error:;
7497   __Pyx_AddTraceback("cvcf.VCF._add_definition");
7498   __Pyx_RefNannyFinishContext();
7499   return NULL;
7500   __pyx_L4_argument_unpacking_done:;
7501   __Pyx_INCREF(__pyx_v_data);
7502
7503   /* "cvcf.pyx":430
7504  * 
7505  *     def _add_definition(self, formatdict, key, data, line ):
7506  *         if key in formatdict: return             # <<<<<<<<<<<<<<
7507  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
7508  *         if data == None:
7509  */
7510   __pyx_t_1 = ((PySequence_Contains(__pyx_v_formatdict, __pyx_v_key))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7511   if (__pyx_t_1) {
7512     __Pyx_XDECREF(__pyx_r);
7513     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7514     goto __pyx_L0;
7515     goto __pyx_L6;
7516   }
7517   __pyx_L6:;
7518
7519   /* "cvcf.pyx":431
7520  *     def _add_definition(self, formatdict, key, data, line ):
7521  *         if key in formatdict: return
7522  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)             # <<<<<<<<<<<<<<
7523  *         if data == None:
7524  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
7525  */
7526   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7527   __Pyx_GOTREF(__pyx_t_2);
7528   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ERROR_UNKNOWN_KEY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7529   __Pyx_GOTREF(__pyx_t_3);
7530   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7531   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
7532   __Pyx_INCREF(__pyx_v_line);
7533   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_line);
7534   __Pyx_GIVEREF(__pyx_v_line);
7535   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
7536   __Pyx_GIVEREF(__pyx_t_3);
7537   __Pyx_INCREF(__pyx_v_key);
7538   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_key);
7539   __Pyx_GIVEREF(__pyx_v_key);
7540   __pyx_t_3 = 0;
7541   __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7542   __Pyx_GOTREF(__pyx_t_3);
7543   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7544   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
7545   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7546
7547   /* "cvcf.pyx":432
7548  *         if key in formatdict: return
7549  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
7550  *         if data == None:             # <<<<<<<<<<<<<<
7551  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
7552  *             return
7553  */
7554   __pyx_t_3 = PyObject_RichCompare(__pyx_v_data, Py_None, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7555   __Pyx_GOTREF(__pyx_t_3);
7556   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7557   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7558   if (__pyx_t_1) {
7559
7560     /* "cvcf.pyx":433
7561  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
7562  *         if data == None:
7563  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")             # <<<<<<<<<<<<<<
7564  *             return
7565  *         if data == []: data = [""]             # unsure what type -- say string
7566  */
7567     __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7568     __Pyx_GOTREF(__pyx_t_3);
7569     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NUMBER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7570     __Pyx_GOTREF(__pyx_t_4);
7571     __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7572     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
7573     __Pyx_INCREF(__pyx_v_key);
7574     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
7575     __Pyx_GIVEREF(__pyx_v_key);
7576     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
7577     __Pyx_GIVEREF(__pyx_t_4);
7578     __Pyx_INCREF(__pyx_int_0);
7579     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0);
7580     __Pyx_GIVEREF(__pyx_int_0);
7581     __Pyx_INCREF(((PyObject *)__pyx_n_s__Flag));
7582     PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s__Flag));
7583     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Flag));
7584     __Pyx_INCREF(((PyObject *)__pyx_kp_s_63));
7585     PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_kp_s_63));
7586     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_63));
7587     __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
7588     PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_kp_s_9));
7589     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
7590     __pyx_t_4 = 0;
7591     __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7592     __Pyx_GOTREF(__pyx_t_4);
7593     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7594     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
7595     if (PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7596     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7597
7598     /* "cvcf.pyx":434
7599  *         if data == None:
7600  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
7601  *             return             # <<<<<<<<<<<<<<
7602  *         if data == []: data = [""]             # unsure what type -- say string
7603  *         if type(data[0]) == type(0.0):
7604  */
7605     __Pyx_XDECREF(__pyx_r);
7606     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7607     goto __pyx_L0;
7608     goto __pyx_L7;
7609   }
7610   __pyx_L7:;
7611
7612   /* "cvcf.pyx":435
7613  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
7614  *             return
7615  *         if data == []: data = [""]             # unsure what type -- say string             # <<<<<<<<<<<<<<
7616  *         if type(data[0]) == type(0.0):
7617  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
7618  */
7619   __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7620   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
7621   __pyx_t_2 = PyObject_RichCompare(__pyx_v_data, ((PyObject *)__pyx_t_4), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7622   __Pyx_GOTREF(__pyx_t_2);
7623   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
7624   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7625   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7626   if (__pyx_t_1) {
7627     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7628     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
7629     __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
7630     PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_1));
7631     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
7632     __Pyx_DECREF(__pyx_v_data);
7633     __pyx_v_data = ((PyObject *)__pyx_t_2);
7634     __pyx_t_2 = 0;
7635     goto __pyx_L8;
7636   }
7637   __pyx_L8:;
7638
7639   /* "cvcf.pyx":436
7640  *             return
7641  *         if data == []: data = [""]             # unsure what type -- say string
7642  *         if type(data[0]) == type(0.0):             # <<<<<<<<<<<<<<
7643  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
7644  *             return
7645  */
7646   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7647   __Pyx_GOTREF(__pyx_t_2);
7648   __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7649   __Pyx_GOTREF(__pyx_t_4);
7650   __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_2)), ((PyObject *)Py_TYPE(__pyx_t_4)), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7651   __Pyx_GOTREF(__pyx_t_3);
7652   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7653   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7654   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7655   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7656   if (__pyx_t_1) {
7657
7658     /* "cvcf.pyx":437
7659  *         if data == []: data = [""]             # unsure what type -- say string
7660  *         if type(data[0]) == type(0.0):
7661  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)             # <<<<<<<<<<<<<<
7662  *             return
7663  *         if type(data[0]) == type(0):
7664  */
7665     __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7666     __Pyx_GOTREF(__pyx_t_3);
7667     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_UNKNOWN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7668     __Pyx_GOTREF(__pyx_t_4);
7669     __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7670     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
7671     __Pyx_INCREF(__pyx_v_key);
7672     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
7673     __Pyx_GIVEREF(__pyx_v_key);
7674     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
7675     __Pyx_GIVEREF(__pyx_t_4);
7676     __Pyx_INCREF(__pyx_int_neg_1);
7677     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_neg_1);
7678     __Pyx_GIVEREF(__pyx_int_neg_1);
7679     __Pyx_INCREF(((PyObject *)__pyx_n_s__Float));
7680     PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s__Float));
7681     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Float));
7682     __Pyx_INCREF(((PyObject *)__pyx_kp_s_63));
7683     PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_kp_s_63));
7684     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_63));
7685     __Pyx_INCREF(Py_None);
7686     PyTuple_SET_ITEM(__pyx_t_2, 5, Py_None);
7687     __Pyx_GIVEREF(Py_None);
7688     __pyx_t_4 = 0;
7689     __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7690     __Pyx_GOTREF(__pyx_t_4);
7691     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7692     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
7693     if (PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7694     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7695
7696     /* "cvcf.pyx":438
7697  *         if type(data[0]) == type(0.0):
7698  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
7699  *             return             # <<<<<<<<<<<<<<
7700  *         if type(data[0]) == type(0):
7701  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
7702  */
7703     __Pyx_XDECREF(__pyx_r);
7704     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7705     goto __pyx_L0;
7706     goto __pyx_L9;
7707   }
7708   __pyx_L9:;
7709
7710   /* "cvcf.pyx":439
7711  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
7712  *             return
7713  *         if type(data[0]) == type(0):             # <<<<<<<<<<<<<<
7714  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
7715  *             return
7716  */
7717   __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_data, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7718   __Pyx_GOTREF(__pyx_t_4);
7719   __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_4)), ((PyObject *)Py_TYPE(__pyx_int_0)), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7720   __Pyx_GOTREF(__pyx_t_2);
7721   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7722   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7723   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7724   if (__pyx_t_1) {
7725
7726     /* "cvcf.pyx":440
7727  *             return
7728  *         if type(data[0]) == type(0):
7729  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)             # <<<<<<<<<<<<<<
7730  *             return
7731  *         formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".")
7732  */
7733     __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7734     __Pyx_GOTREF(__pyx_t_2);
7735     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_UNKNOWN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7736     __Pyx_GOTREF(__pyx_t_4);
7737     __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7738     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
7739     __Pyx_INCREF(__pyx_v_key);
7740     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
7741     __Pyx_GIVEREF(__pyx_v_key);
7742     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
7743     __Pyx_GIVEREF(__pyx_t_4);
7744     __Pyx_INCREF(__pyx_int_neg_1);
7745     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_neg_1);
7746     __Pyx_GIVEREF(__pyx_int_neg_1);
7747     __Pyx_INCREF(((PyObject *)__pyx_n_s__Integer));
7748     PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_n_s__Integer));
7749     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Integer));
7750     __Pyx_INCREF(((PyObject *)__pyx_kp_s_63));
7751     PyTuple_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_kp_s_63));
7752     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_63));
7753     __Pyx_INCREF(Py_None);
7754     PyTuple_SET_ITEM(__pyx_t_3, 5, Py_None);
7755     __Pyx_GIVEREF(Py_None);
7756     __pyx_t_4 = 0;
7757     __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7758     __Pyx_GOTREF(__pyx_t_4);
7759     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7760     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
7761     if (PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7762     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7763
7764     /* "cvcf.pyx":441
7765  *         if type(data[0]) == type(0):
7766  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
7767  *             return             # <<<<<<<<<<<<<<
7768  *         formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".")
7769  * 
7770  */
7771     __Pyx_XDECREF(__pyx_r);
7772     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7773     goto __pyx_L0;
7774     goto __pyx_L10;
7775   }
7776   __pyx_L10:;
7777
7778   /* "cvcf.pyx":442
7779  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
7780  *             return
7781  *         formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".")             # <<<<<<<<<<<<<<
7782  * 
7783  * 
7784  */
7785   __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7786   __Pyx_GOTREF(__pyx_t_4);
7787   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_UNKNOWN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7788   __Pyx_GOTREF(__pyx_t_3);
7789   __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7790   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
7791   __Pyx_INCREF(__pyx_v_key);
7792   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
7793   __Pyx_GIVEREF(__pyx_v_key);
7794   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
7795   __Pyx_GIVEREF(__pyx_t_3);
7796   __Pyx_INCREF(__pyx_int_neg_1);
7797   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_neg_1);
7798   __Pyx_GIVEREF(__pyx_int_neg_1);
7799   __Pyx_INCREF(((PyObject *)__pyx_n_s__String));
7800   PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s__String));
7801   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__String));
7802   __Pyx_INCREF(((PyObject *)__pyx_kp_s_63));
7803   PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_kp_s_63));
7804   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_63));
7805   __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
7806   PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_kp_s_9));
7807   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
7808   __pyx_t_3 = 0;
7809   __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7810   __Pyx_GOTREF(__pyx_t_3);
7811   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7812   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
7813   if (PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7814   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7815
7816   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7817   goto __pyx_L0;
7818   __pyx_L1_error:;
7819   __Pyx_XDECREF(__pyx_t_2);
7820   __Pyx_XDECREF(__pyx_t_3);
7821   __Pyx_XDECREF(__pyx_t_4);
7822   __Pyx_AddTraceback("cvcf.VCF._add_definition");
7823   __pyx_r = NULL;
7824   __pyx_L0:;
7825   __Pyx_DECREF(__pyx_v_data);
7826   __Pyx_XGIVEREF(__pyx_r);
7827   __Pyx_RefNannyFinishContext();
7828   return __pyx_r;
7829 }
7830
7831 /* "cvcf.pyx":446
7832  * 
7833  *     # todo: trim trailing missing values
7834  *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):             # <<<<<<<<<<<<<<
7835  *         output, sdata = [], []
7836  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
7837  */
7838
7839 static PyObject *__pyx_pf_4cvcf_3VCF_6format_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7840 static PyMethodDef __pyx_mdef_4cvcf_3VCF_6format_formatdata = {__Pyx_NAMESTR("format_formatdata"), (PyCFunction)__pyx_pf_4cvcf_3VCF_6format_formatdata, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
7841 static PyObject *__pyx_pf_4cvcf_3VCF_6format_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7842   PyObject *__pyx_v_self = 0;
7843   PyObject *__pyx_v_data = 0;
7844   PyObject *__pyx_v_format = 0;
7845   PyObject *__pyx_v_key = 0;
7846   PyObject *__pyx_v_value = 0;
7847   PyObject *__pyx_v_separator = 0;
7848   PyObject *__pyx_v_output;
7849   PyObject *__pyx_v_sdata;
7850   PyObject *__pyx_v_d;
7851   PyObject *__pyx_v_k;
7852   PyObject *__pyx_v_idx;
7853   PyObject *__pyx_v_v;
7854   PyObject *__pyx_v_last;
7855   PyObject *__pyx_r = NULL;
7856   PyObject *__pyx_t_1 = NULL;
7857   PyObject *__pyx_t_2 = NULL;
7858   int __pyx_t_3;
7859   Py_ssize_t __pyx_t_4;
7860   PyObject *__pyx_t_5 = NULL;
7861   PyObject *__pyx_t_6 = NULL;
7862   Py_ssize_t __pyx_t_7;
7863   PyObject *__pyx_t_8 = NULL;
7864   int __pyx_t_9;
7865   int __pyx_t_10;
7866   int __pyx_t_11;
7867   static 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};
7868   __Pyx_RefNannySetupContext("format_formatdata");
7869   __pyx_self = __pyx_self;
7870   if (unlikely(__pyx_kwds)) {
7871     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7872     PyObject* values[6] = {0,0,0,0,0,0};
7873     values[3] = __pyx_k_64;
7874     values[4] = __pyx_k_65;
7875     values[5] = ((PyObject *)__pyx_kp_s_4);
7876     switch (PyTuple_GET_SIZE(__pyx_args)) {
7877       case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7878       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7879       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7880       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7881       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7882       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7883       case  0: break;
7884       default: goto __pyx_L5_argtuple_error;
7885     }
7886     switch (PyTuple_GET_SIZE(__pyx_args)) {
7887       case  0:
7888       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7889       if (likely(values[0])) kw_args--;
7890       else goto __pyx_L5_argtuple_error;
7891       case  1:
7892       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
7893       if (likely(values[1])) kw_args--;
7894       else {
7895         __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7896       }
7897       case  2:
7898       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
7899       if (likely(values[2])) kw_args--;
7900       else {
7901         __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7902       }
7903       case  3:
7904       if (kw_args > 0) {
7905         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
7906         if (value) { values[3] = value; kw_args--; }
7907       }
7908       case  4:
7909       if (kw_args > 0) {
7910         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
7911         if (value) { values[4] = value; kw_args--; }
7912       }
7913       case  5:
7914       if (kw_args > 0) {
7915         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__separator);
7916         if (value) { values[5] = value; kw_args--; }
7917       }
7918     }
7919     if (unlikely(kw_args > 0)) {
7920       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "format_formatdata") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7921     }
7922     __pyx_v_self = values[0];
7923     __pyx_v_data = values[1];
7924     __pyx_v_format = values[2];
7925     __pyx_v_key = values[3];
7926     __pyx_v_value = values[4];
7927     __pyx_v_separator = values[5];
7928   } else {
7929     __pyx_v_key = __pyx_k_64;
7930     __pyx_v_value = __pyx_k_65;
7931     __pyx_v_separator = ((PyObject *)__pyx_kp_s_4);
7932     switch (PyTuple_GET_SIZE(__pyx_args)) {
7933       case  6:
7934       __pyx_v_separator = PyTuple_GET_ITEM(__pyx_args, 5);
7935       case  5:
7936       __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 4);
7937       case  4:
7938       __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 3);
7939       case  3:
7940       __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 2);
7941       __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 1);
7942       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
7943       break;
7944       default: goto __pyx_L5_argtuple_error;
7945     }
7946   }
7947   goto __pyx_L4_argument_unpacking_done;
7948   __pyx_L5_argtuple_error:;
7949   __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7950   __pyx_L3_error:;
7951   __Pyx_AddTraceback("cvcf.VCF.format_formatdata");
7952   __Pyx_RefNannyFinishContext();
7953   return NULL;
7954   __pyx_L4_argument_unpacking_done:;
7955   __Pyx_INCREF(__pyx_v_data);
7956   __pyx_v_output = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
7957   __pyx_v_sdata = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
7958   __pyx_v_d = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
7959   __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
7960   __pyx_v_idx = Py_None; __Pyx_INCREF(Py_None);
7961   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
7962   __pyx_v_last = Py_None; __Pyx_INCREF(Py_None);
7963
7964   /* "cvcf.pyx":447
7965  *     # todo: trim trailing missing values
7966  *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):
7967  *         output, sdata = [], []             # <<<<<<<<<<<<<<
7968  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
7969  *             d = {}
7970  */
7971   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7972   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
7973   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7974   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
7975   __Pyx_DECREF(((PyObject *)__pyx_v_output));
7976   __pyx_v_output = __pyx_t_1;
7977   __pyx_t_1 = 0;
7978   __Pyx_DECREF(((PyObject *)__pyx_v_sdata));
7979   __pyx_v_sdata = __pyx_t_2;
7980   __pyx_t_2 = 0;
7981
7982   /* "cvcf.pyx":448
7983  *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):
7984  *         output, sdata = [], []
7985  *         if type(data) == type([]): # for FORMAT field, make data with dummy values             # <<<<<<<<<<<<<<
7986  *             d = {}
7987  *             for k in data: d[k] = []
7988  */
7989   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7990   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
7991   __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(((PyObject *)__pyx_t_2))), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7992   __Pyx_GOTREF(__pyx_t_1);
7993   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
7994   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7995   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7996   if (__pyx_t_3) {
7997
7998     /* "cvcf.pyx":449
7999  *         output, sdata = [], []
8000  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
8001  *             d = {}             # <<<<<<<<<<<<<<
8002  *             for k in data: d[k] = []
8003  *             data = d
8004  */
8005     __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8006     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
8007     __Pyx_DECREF(((PyObject *)__pyx_v_d));
8008     __pyx_v_d = __pyx_t_1;
8009     __pyx_t_1 = 0;
8010
8011     /* "cvcf.pyx":450
8012  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
8013  *             d = {}
8014  *             for k in data: d[k] = []             # <<<<<<<<<<<<<<
8015  *             data = d
8016  *         # convert missing values; and silently add definitions if required
8017  */
8018     if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
8019       __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1);
8020     } else {
8021       __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8022       __Pyx_GOTREF(__pyx_t_1);
8023     }
8024     for (;;) {
8025       if (likely(PyList_CheckExact(__pyx_t_1))) {
8026         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
8027         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8028       } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
8029         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8030         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8031       } else {
8032         __pyx_t_2 = PyIter_Next(__pyx_t_1);
8033         if (!__pyx_t_2) {
8034           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8035           break;
8036         }
8037         __Pyx_GOTREF(__pyx_t_2);
8038       }
8039       __Pyx_DECREF(__pyx_v_k);
8040       __pyx_v_k = __pyx_t_2;
8041       __pyx_t_2 = 0;
8042       __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8043       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8044       if (PyDict_SetItem(((PyObject *)__pyx_v_d), __pyx_v_k, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8045       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
8046     }
8047     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8048
8049     /* "cvcf.pyx":451
8050  *             d = {}
8051  *             for k in data: d[k] = []
8052  *             data = d             # <<<<<<<<<<<<<<
8053  *         # convert missing values; and silently add definitions if required
8054  *         for k in data:
8055  */
8056     __Pyx_INCREF(((PyObject *)__pyx_v_d));
8057     __Pyx_DECREF(__pyx_v_data);
8058     __pyx_v_data = ((PyObject *)__pyx_v_d);
8059     goto __pyx_L6;
8060   }
8061   __pyx_L6:;
8062
8063   /* "cvcf.pyx":453
8064  *             data = d
8065  *         # convert missing values; and silently add definitions if required
8066  *         for k in data:             # <<<<<<<<<<<<<<
8067  *             self._add_definition( format, k, data[k], "(output)" )
8068  *             for idx,v in enumerate(data[k]):
8069  */
8070   if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
8071     __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1);
8072   } else {
8073     __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8074     __Pyx_GOTREF(__pyx_t_1);
8075   }
8076   for (;;) {
8077     if (likely(PyList_CheckExact(__pyx_t_1))) {
8078       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
8079       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8080     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
8081       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8082       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8083     } else {
8084       __pyx_t_2 = PyIter_Next(__pyx_t_1);
8085       if (!__pyx_t_2) {
8086         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8087         break;
8088       }
8089       __Pyx_GOTREF(__pyx_t_2);
8090     }
8091     __Pyx_DECREF(__pyx_v_k);
8092     __pyx_v_k = __pyx_t_2;
8093     __pyx_t_2 = 0;
8094
8095     /* "cvcf.pyx":454
8096  *         # convert missing values; and silently add definitions if required
8097  *         for k in data:
8098  *             self._add_definition( format, k, data[k], "(output)" )             # <<<<<<<<<<<<<<
8099  *             for idx,v in enumerate(data[k]):
8100  *                 if v == format[k].missingvalue: data[k][idx] = "."
8101  */
8102     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___add_definition); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8103     __Pyx_GOTREF(__pyx_t_2);
8104     __pyx_t_5 = PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8105     __Pyx_GOTREF(__pyx_t_5);
8106     __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8107     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
8108     __Pyx_INCREF(__pyx_v_format);
8109     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_format);
8110     __Pyx_GIVEREF(__pyx_v_format);
8111     __Pyx_INCREF(__pyx_v_k);
8112     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_k);
8113     __Pyx_GIVEREF(__pyx_v_k);
8114     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
8115     __Pyx_GIVEREF(__pyx_t_5);
8116     __Pyx_INCREF(((PyObject *)__pyx_kp_s_66));
8117     PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_kp_s_66));
8118     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_66));
8119     __pyx_t_5 = 0;
8120     __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8121     __Pyx_GOTREF(__pyx_t_5);
8122     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8123     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
8124     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8125
8126     /* "cvcf.pyx":455
8127  *         for k in data:
8128  *             self._add_definition( format, k, data[k], "(output)" )
8129  *             for idx,v in enumerate(data[k]):             # <<<<<<<<<<<<<<
8130  *                 if v == format[k].missingvalue: data[k][idx] = "."
8131  *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
8132  */
8133     __Pyx_INCREF(__pyx_int_0);
8134     __pyx_t_5 = __pyx_int_0;
8135     __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8136     __Pyx_GOTREF(__pyx_t_6);
8137     if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
8138       __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2);
8139     } else {
8140       __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8141       __Pyx_GOTREF(__pyx_t_2);
8142     }
8143     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8144     for (;;) {
8145       if (likely(PyList_CheckExact(__pyx_t_2))) {
8146         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
8147         __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++;
8148       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
8149         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
8150         __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++;
8151       } else {
8152         __pyx_t_6 = PyIter_Next(__pyx_t_2);
8153         if (!__pyx_t_6) {
8154           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8155           break;
8156         }
8157         __Pyx_GOTREF(__pyx_t_6);
8158       }
8159       __Pyx_DECREF(__pyx_v_v);
8160       __pyx_v_v = __pyx_t_6;
8161       __pyx_t_6 = 0;
8162       __Pyx_INCREF(__pyx_t_5);
8163       __Pyx_DECREF(__pyx_v_idx);
8164       __pyx_v_idx = __pyx_t_5;
8165       __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8166       __Pyx_GOTREF(__pyx_t_6);
8167       __Pyx_DECREF(__pyx_t_5);
8168       __pyx_t_5 = __pyx_t_6;
8169       __pyx_t_6 = 0;
8170
8171       /* "cvcf.pyx":456
8172  *             self._add_definition( format, k, data[k], "(output)" )
8173  *             for idx,v in enumerate(data[k]):
8174  *                 if v == format[k].missingvalue: data[k][idx] = "."             # <<<<<<<<<<<<<<
8175  *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
8176  *         for k in data:
8177  */
8178       __pyx_t_6 = PyObject_GetItem(__pyx_v_format, __pyx_v_k); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8179       __Pyx_GOTREF(__pyx_t_6);
8180       __pyx_t_8 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__missingvalue); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8181       __Pyx_GOTREF(__pyx_t_8);
8182       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8183       __pyx_t_6 = PyObject_RichCompare(__pyx_v_v, __pyx_t_8, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8184       __Pyx_GOTREF(__pyx_t_6);
8185       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8186       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8187       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8188       if (__pyx_t_3) {
8189         __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8190         __Pyx_GOTREF(__pyx_t_6);
8191         if (PyObject_SetItem(__pyx_t_6, __pyx_v_idx, ((PyObject *)__pyx_kp_s_9)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8192         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8193         goto __pyx_L13;
8194       }
8195       __pyx_L13:;
8196     }
8197     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8198     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8199   }
8200   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8201
8202   /* "cvcf.pyx":458
8203  *                 if v == format[k].missingvalue: data[k][idx] = "."
8204  *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
8205  *         for k in data:             # <<<<<<<<<<<<<<
8206  *             if k != 'GT': sdata.append( (k,data[k]) )
8207  *         sdata.sort()
8208  */
8209   if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
8210     __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1);
8211   } else {
8212     __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8213     __Pyx_GOTREF(__pyx_t_1);
8214   }
8215   for (;;) {
8216     if (likely(PyList_CheckExact(__pyx_t_1))) {
8217       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
8218       __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
8219     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
8220       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8221       __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
8222     } else {
8223       __pyx_t_5 = PyIter_Next(__pyx_t_1);
8224       if (!__pyx_t_5) {
8225         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8226         break;
8227       }
8228       __Pyx_GOTREF(__pyx_t_5);
8229     }
8230     __Pyx_DECREF(__pyx_v_k);
8231     __pyx_v_k = __pyx_t_5;
8232     __pyx_t_5 = 0;
8233
8234     /* "cvcf.pyx":459
8235  *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
8236  *         for k in data:
8237  *             if k != 'GT': sdata.append( (k,data[k]) )             # <<<<<<<<<<<<<<
8238  *         sdata.sort()
8239  *         if 'GT' in data:
8240  */
8241     __pyx_t_5 = PyObject_RichCompare(__pyx_v_k, ((PyObject *)__pyx_n_s__GT), Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8242     __Pyx_GOTREF(__pyx_t_5);
8243     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8244     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8245     if (__pyx_t_3) {
8246       if (unlikely(__pyx_v_sdata == Py_None)) {
8247         PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
8248       }
8249       __pyx_t_5 = PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8250       __Pyx_GOTREF(__pyx_t_5);
8251       __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8252       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8253       __Pyx_INCREF(__pyx_v_k);
8254       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k);
8255       __Pyx_GIVEREF(__pyx_v_k);
8256       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
8257       __Pyx_GIVEREF(__pyx_t_5);
8258       __pyx_t_5 = 0;
8259       __pyx_t_9 = PyList_Append(__pyx_v_sdata, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8260       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
8261       goto __pyx_L16;
8262     }
8263     __pyx_L16:;
8264   }
8265   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8266
8267   /* "cvcf.pyx":460
8268  *         for k in data:
8269  *             if k != 'GT': sdata.append( (k,data[k]) )
8270  *         sdata.sort()             # <<<<<<<<<<<<<<
8271  *         if 'GT' in data:
8272  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
8273  */
8274   if (unlikely(__pyx_v_sdata == Py_None)) {
8275     PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'sort'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
8276   }
8277   __pyx_t_9 = PyList_Sort(((PyObject *)__pyx_v_sdata)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8278
8279   /* "cvcf.pyx":461
8280  *             if k != 'GT': sdata.append( (k,data[k]) )
8281  *         sdata.sort()
8282  *         if 'GT' in data:             # <<<<<<<<<<<<<<
8283  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
8284  *         for k,v in sdata:
8285  */
8286   __pyx_t_3 = ((PySequence_Contains(__pyx_v_data, ((PyObject *)__pyx_n_s__GT)))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8287   if (__pyx_t_3) {
8288
8289     /* "cvcf.pyx":462
8290  *         sdata.sort()
8291  *         if 'GT' in data:
8292  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata             # <<<<<<<<<<<<<<
8293  *         for k,v in sdata:
8294  *             if v == []: v = None
8295  */
8296     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__convertGTback); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8297     __Pyx_GOTREF(__pyx_t_1);
8298     __pyx_t_2 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__GT)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8299     __Pyx_GOTREF(__pyx_t_2);
8300     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8301     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
8302     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
8303     __Pyx_GIVEREF(__pyx_t_1);
8304     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8305     __Pyx_GIVEREF(__pyx_t_2);
8306     __pyx_t_1 = 0;
8307     __pyx_t_2 = 0;
8308     __pyx_t_2 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8309     __Pyx_GOTREF(__pyx_t_2);
8310     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
8311     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8312     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
8313     __Pyx_INCREF(((PyObject *)__pyx_n_s__GT));
8314     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__GT));
8315     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__GT));
8316     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8317     __Pyx_GIVEREF(__pyx_t_2);
8318     __pyx_t_2 = 0;
8319     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8320     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8321     PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_5));
8322     __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
8323     __pyx_t_5 = 0;
8324     __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_v_sdata)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8325     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
8326     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
8327     __Pyx_DECREF(((PyObject *)__pyx_v_sdata));
8328     __pyx_v_sdata = __pyx_t_5;
8329     __pyx_t_5 = 0;
8330     goto __pyx_L17;
8331   }
8332   __pyx_L17:;
8333
8334   /* "cvcf.pyx":463
8335  *         if 'GT' in data:
8336  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
8337  *         for k,v in sdata:             # <<<<<<<<<<<<<<
8338  *             if v == []: v = None
8339  *             if key and value:
8340  */
8341   if (unlikely(__pyx_v_sdata == Py_None)) {
8342     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
8343   }
8344   __pyx_t_4 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_sdata); __Pyx_INCREF(__pyx_t_5);
8345   for (;;) {
8346     if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
8347     __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8348     if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
8349       PyObject* tuple = __pyx_t_2;
8350       __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
8351       __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
8352       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8353       __Pyx_DECREF(__pyx_v_k);
8354       __pyx_v_k = __pyx_t_1;
8355       __pyx_t_1 = 0;
8356       __Pyx_DECREF(__pyx_v_v);
8357       __pyx_v_v = __pyx_t_6;
8358       __pyx_t_6 = 0;
8359     } else {
8360       __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8361       __Pyx_GOTREF(__pyx_t_8);
8362       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8363       __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8364       __Pyx_GOTREF(__pyx_t_1);
8365       __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8366       __Pyx_GOTREF(__pyx_t_6);
8367       if (__Pyx_EndUnpack(__pyx_t_8, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8368       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8369       __Pyx_DECREF(__pyx_v_k);
8370       __pyx_v_k = __pyx_t_1;
8371       __pyx_t_1 = 0;
8372       __Pyx_DECREF(__pyx_v_v);
8373       __pyx_v_v = __pyx_t_6;
8374       __pyx_t_6 = 0;
8375     }
8376
8377     /* "cvcf.pyx":464
8378  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
8379  *         for k,v in sdata:
8380  *             if v == []: v = None             # <<<<<<<<<<<<<<
8381  *             if key and value:
8382  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
8383  */
8384     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8385     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8386     __pyx_t_6 = PyObject_RichCompare(__pyx_v_v, ((PyObject *)__pyx_t_2), Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8387     __Pyx_GOTREF(__pyx_t_6);
8388     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
8389     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8390     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8391     if (__pyx_t_3) {
8392       __Pyx_INCREF(Py_None);
8393       __Pyx_DECREF(__pyx_v_v);
8394       __pyx_v_v = Py_None;
8395       goto __pyx_L20;
8396     }
8397     __pyx_L20:;
8398
8399     /* "cvcf.pyx":465
8400  *         for k,v in sdata:
8401  *             if v == []: v = None
8402  *             if key and value:             # <<<<<<<<<<<<<<
8403  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
8404  *                 else: output.append( k )
8405  */
8406     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8407     if (__pyx_t_3) {
8408       __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8409       __pyx_t_11 = __pyx_t_10;
8410     } else {
8411       __pyx_t_11 = __pyx_t_3;
8412     }
8413     if (__pyx_t_11) {
8414
8415       /* "cvcf.pyx":466
8416  *             if v == []: v = None
8417  *             if key and value:
8418  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )             # <<<<<<<<<<<<<<
8419  *                 else: output.append( k )
8420  *             elif key: output.append(k)
8421  */
8422       __pyx_t_6 = PyObject_RichCompare(__pyx_v_v, Py_None, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8423       __Pyx_GOTREF(__pyx_t_6);
8424       __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8425       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8426       if (__pyx_t_11) {
8427         if (unlikely(__pyx_v_output == Py_None)) {
8428           PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
8429         }
8430         __pyx_t_6 = PyNumber_Add(__pyx_v_k, ((PyObject *)__pyx_kp_s_14)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8431         __Pyx_GOTREF(__pyx_t_6);
8432         __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8433         __Pyx_GOTREF(__pyx_t_2);
8434         __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8435         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
8436         __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
8437         PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
8438         __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
8439         __Pyx_INCREF(__pyx_v_v);
8440         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_v);
8441         __Pyx_GIVEREF(__pyx_v_v);
8442         __pyx_t_8 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8443         __Pyx_GOTREF(__pyx_t_8);
8444         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
8445         __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8446         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
8447         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
8448         __Pyx_GIVEREF(__pyx_t_8);
8449         __pyx_t_8 = 0;
8450         __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8451         __Pyx_GOTREF(__pyx_t_8);
8452         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8453         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
8454         __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8455         __Pyx_GOTREF(__pyx_t_1);
8456         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8457         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8458         __pyx_t_9 = PyList_Append(__pyx_v_output, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8459         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8460         goto __pyx_L22;
8461       }
8462       /*else*/ {
8463
8464         /* "cvcf.pyx":467
8465  *             if key and value:
8466  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
8467  *                 else: output.append( k )             # <<<<<<<<<<<<<<
8468  *             elif key: output.append(k)
8469  *             elif value:
8470  */
8471         if (unlikely(__pyx_v_output == Py_None)) {
8472           PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
8473         }
8474         __pyx_t_9 = PyList_Append(__pyx_v_output, __pyx_v_k); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8475       }
8476       __pyx_L22:;
8477       goto __pyx_L21;
8478     }
8479
8480     /* "cvcf.pyx":468
8481  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
8482  *                 else: output.append( k )
8483  *             elif key: output.append(k)             # <<<<<<<<<<<<<<
8484  *             elif value:
8485  *                 if v != None: output.append( ','.join(map(str,v)) )
8486  */
8487     __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8488     if (__pyx_t_11) {
8489       if (unlikely(__pyx_v_output == Py_None)) {
8490         PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
8491       }
8492       __pyx_t_9 = PyList_Append(__pyx_v_output, __pyx_v_k); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8493       goto __pyx_L21;
8494     }
8495
8496     /* "cvcf.pyx":469
8497  *                 else: output.append( k )
8498  *             elif key: output.append(k)
8499  *             elif value:             # <<<<<<<<<<<<<<
8500  *                 if v != None: output.append( ','.join(map(str,v)) )
8501  *                 else: output.append( "." )                    # should not happen
8502  */
8503     __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8504     if (__pyx_t_11) {
8505
8506       /* "cvcf.pyx":470
8507  *             elif key: output.append(k)
8508  *             elif value:
8509  *                 if v != None: output.append( ','.join(map(str,v)) )             # <<<<<<<<<<<<<<
8510  *                 else: output.append( "." )                    # should not happen
8511  *         # snip off trailing missing data
8512  */
8513       __pyx_t_1 = PyObject_RichCompare(__pyx_v_v, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8514       __Pyx_GOTREF(__pyx_t_1);
8515       __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8516       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8517       if (__pyx_t_11) {
8518         if (unlikely(__pyx_v_output == Py_None)) {
8519           PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
8520         }
8521         __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8522         __Pyx_GOTREF(__pyx_t_1);
8523         __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8524         __Pyx_GOTREF(((PyObject *)__pyx_t_8));
8525         __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
8526         PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
8527         __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
8528         __Pyx_INCREF(__pyx_v_v);
8529         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_v);
8530         __Pyx_GIVEREF(__pyx_v_v);
8531         __pyx_t_6 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8532         __Pyx_GOTREF(__pyx_t_6);
8533         __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
8534         __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8535         __Pyx_GOTREF(((PyObject *)__pyx_t_8));
8536         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
8537         __Pyx_GIVEREF(__pyx_t_6);
8538         __pyx_t_6 = 0;
8539         __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8540         __Pyx_GOTREF(__pyx_t_6);
8541         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8542         __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
8543         __pyx_t_9 = PyList_Append(__pyx_v_output, __pyx_t_6); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8544         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8545         goto __pyx_L23;
8546       }
8547       /*else*/ {
8548
8549         /* "cvcf.pyx":471
8550  *             elif value:
8551  *                 if v != None: output.append( ','.join(map(str,v)) )
8552  *                 else: output.append( "." )                    # should not happen             # <<<<<<<<<<<<<<
8553  *         # snip off trailing missing data
8554  *         while len(output) > 1:
8555  */
8556         if (unlikely(__pyx_v_output == Py_None)) {
8557           PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
8558         }
8559         __pyx_t_9 = PyList_Append(__pyx_v_output, ((PyObject *)__pyx_kp_s_9)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8560       }
8561       __pyx_L23:;
8562       goto __pyx_L21;
8563     }
8564     __pyx_L21:;
8565   }
8566   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8567
8568   /* "cvcf.pyx":473
8569  *                 else: output.append( "." )                    # should not happen
8570  *         # snip off trailing missing data
8571  *         while len(output) > 1:             # <<<<<<<<<<<<<<
8572  *             last = output[-1].replace(',','').replace('.','')
8573  *             if len(last)>0: break
8574  */
8575   while (1) {
8576     if (unlikely(__pyx_v_output == Py_None)) {
8577       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
8578     }
8579     __pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_output)); 
8580     __pyx_t_11 = (__pyx_t_4 > 1);
8581     if (!__pyx_t_11) break;
8582
8583     /* "cvcf.pyx":474
8584  *         # snip off trailing missing data
8585  *         while len(output) > 1:
8586  *             last = output[-1].replace(',','').replace('.','')             # <<<<<<<<<<<<<<
8587  *             if len(last)>0: break
8588  *             output = output[:-1]
8589  */
8590     __pyx_t_5 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_output), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8591     __Pyx_GOTREF(__pyx_t_5);
8592     __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__replace); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8593     __Pyx_GOTREF(__pyx_t_6);
8594     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8595     __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_67), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8596     __Pyx_GOTREF(__pyx_t_5);
8597     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8598     __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__replace); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8599     __Pyx_GOTREF(__pyx_t_6);
8600     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8601     __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_68), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8602     __Pyx_GOTREF(__pyx_t_5);
8603     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8604     __Pyx_DECREF(__pyx_v_last);
8605     __pyx_v_last = __pyx_t_5;
8606     __pyx_t_5 = 0;
8607
8608     /* "cvcf.pyx":475
8609  *         while len(output) > 1:
8610  *             last = output[-1].replace(',','').replace('.','')
8611  *             if len(last)>0: break             # <<<<<<<<<<<<<<
8612  *             output = output[:-1]
8613  *         return separator.join(output)
8614  */
8615     __pyx_t_4 = PyObject_Length(__pyx_v_last); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8616     __pyx_t_11 = (__pyx_t_4 > 0);
8617     if (__pyx_t_11) {
8618       goto __pyx_L25_break;
8619       goto __pyx_L26;
8620     }
8621     __pyx_L26:;
8622
8623     /* "cvcf.pyx":476
8624  *             last = output[-1].replace(',','').replace('.','')
8625  *             if len(last)>0: break
8626  *             output = output[:-1]             # <<<<<<<<<<<<<<
8627  *         return separator.join(output)
8628  * 
8629  */
8630     __pyx_t_5 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_output), 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8631     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
8632     __Pyx_DECREF(((PyObject *)__pyx_v_output));
8633     __pyx_v_output = __pyx_t_5;
8634     __pyx_t_5 = 0;
8635   }
8636   __pyx_L25_break:;
8637
8638   /* "cvcf.pyx":477
8639  *             if len(last)>0: break
8640  *             output = output[:-1]
8641  *         return separator.join(output)             # <<<<<<<<<<<<<<
8642  * 
8643  * 
8644  */
8645   __Pyx_XDECREF(__pyx_r);
8646   __pyx_t_5 = PyObject_GetAttr(__pyx_v_separator, __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8647   __Pyx_GOTREF(__pyx_t_5);
8648   __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8649   __Pyx_GOTREF(((PyObject *)__pyx_t_6));
8650   __Pyx_INCREF(((PyObject *)__pyx_v_output));
8651   PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_output));
8652   __Pyx_GIVEREF(((PyObject *)__pyx_v_output));
8653   __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8654   __Pyx_GOTREF(__pyx_t_8);
8655   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8656   __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
8657   __pyx_r = __pyx_t_8;
8658   __pyx_t_8 = 0;
8659   goto __pyx_L0;
8660
8661   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8662   goto __pyx_L0;
8663   __pyx_L1_error:;
8664   __Pyx_XDECREF(__pyx_t_1);
8665   __Pyx_XDECREF(__pyx_t_2);
8666   __Pyx_XDECREF(__pyx_t_5);
8667   __Pyx_XDECREF(__pyx_t_6);
8668   __Pyx_XDECREF(__pyx_t_8);
8669   __Pyx_AddTraceback("cvcf.VCF.format_formatdata");
8670   __pyx_r = NULL;
8671   __pyx_L0:;
8672   __Pyx_DECREF(__pyx_v_output);
8673   __Pyx_DECREF(__pyx_v_sdata);
8674   __Pyx_DECREF(__pyx_v_d);
8675   __Pyx_DECREF(__pyx_v_k);
8676   __Pyx_DECREF(__pyx_v_idx);
8677   __Pyx_DECREF(__pyx_v_v);
8678   __Pyx_DECREF(__pyx_v_last);
8679   __Pyx_DECREF(__pyx_v_data);
8680   __Pyx_XGIVEREF(__pyx_r);
8681   __Pyx_RefNannyFinishContext();
8682   return __pyx_r;
8683 }
8684
8685 /* "cvcf.pyx":480
8686  * 
8687  * 
8688  *     def enter_default_format(self):             # <<<<<<<<<<<<<<
8689  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
8690  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
8691  */
8692
8693 static PyObject *__pyx_pf_4cvcf_3VCF_7enter_default_format(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
8694 static PyMethodDef __pyx_mdef_4cvcf_3VCF_7enter_default_format = {__Pyx_NAMESTR("enter_default_format"), (PyCFunction)__pyx_pf_4cvcf_3VCF_7enter_default_format, METH_O, __Pyx_DOCSTR(0)};
8695 static PyObject *__pyx_pf_4cvcf_3VCF_7enter_default_format(PyObject *__pyx_self, PyObject *__pyx_v_self) {
8696   PyObject *__pyx_v_f;
8697   PyObject *__pyx_r = NULL;
8698   Py_ssize_t __pyx_t_1;
8699   PyObject *__pyx_t_2 = NULL;
8700   PyObject *__pyx_t_3 = NULL;
8701   PyObject *__pyx_t_4 = NULL;
8702   PyObject *__pyx_t_5 = NULL;
8703   PyObject *__pyx_t_6 = NULL;
8704   PyObject *__pyx_t_7 = NULL;
8705   PyObject *__pyx_t_8 = NULL;
8706   int __pyx_t_9;
8707   __Pyx_RefNannySetupContext("enter_default_format");
8708   __pyx_self = __pyx_self;
8709   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
8710
8711   /* "cvcf.pyx":481
8712  * 
8713  *     def enter_default_format(self):
8714  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),             # <<<<<<<<<<<<<<
8715  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
8716  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
8717  */
8718   __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8719   __Pyx_GOTREF(__pyx_t_2);
8720   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NUMBER); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8721   __Pyx_GOTREF(__pyx_t_3);
8722   __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8723   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
8724   __Pyx_INCREF(((PyObject *)__pyx_n_s__GT));
8725   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__GT));
8726   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__GT));
8727   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
8728   __Pyx_GIVEREF(__pyx_t_3);
8729   __Pyx_INCREF(__pyx_int_1);
8730   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1);
8731   __Pyx_GIVEREF(__pyx_int_1);
8732   __Pyx_INCREF(((PyObject *)__pyx_n_s__String));
8733   PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_n_s__String));
8734   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__String));
8735   __Pyx_INCREF(((PyObject *)__pyx_n_s__Genotype));
8736   PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_n_s__Genotype));
8737   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Genotype));
8738   __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
8739   PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_kp_s_9));
8740   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
8741   __pyx_t_3 = 0;
8742   __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8743   __Pyx_GOTREF(__pyx_t_3);
8744   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8745   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
8746
8747   /* "cvcf.pyx":482
8748  *     def enter_default_format(self):
8749  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
8750  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),             # <<<<<<<<<<<<<<
8751  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
8752  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
8753  */
8754   __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8755   __Pyx_GOTREF(__pyx_t_4);
8756   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NUMBER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8757   __Pyx_GOTREF(__pyx_t_2);
8758   __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8759   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
8760   __Pyx_INCREF(((PyObject *)__pyx_n_s__GQ));
8761   PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__GQ));
8762   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__GQ));
8763   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8764   __Pyx_GIVEREF(__pyx_t_2);
8765   __Pyx_INCREF(__pyx_int_1);
8766   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_1);
8767   __Pyx_GIVEREF(__pyx_int_1);
8768   __Pyx_INCREF(((PyObject *)__pyx_n_s__Integer));
8769   PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_n_s__Integer));
8770   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Integer));
8771   __Pyx_INCREF(((PyObject *)__pyx_kp_s_69));
8772   PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_kp_s_69));
8773   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_69));
8774   __Pyx_INCREF(__pyx_int_neg_1);
8775   PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_int_neg_1);
8776   __Pyx_GIVEREF(__pyx_int_neg_1);
8777   __pyx_t_2 = 0;
8778   __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8779   __Pyx_GOTREF(__pyx_t_2);
8780   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8781   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
8782
8783   /* "cvcf.pyx":483
8784  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
8785  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
8786  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),             # <<<<<<<<<<<<<<
8787  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
8788  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:
8789  */
8790   __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8791   __Pyx_GOTREF(__pyx_t_5);
8792   __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NUMBER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8793   __Pyx_GOTREF(__pyx_t_4);
8794   __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8795   __Pyx_GOTREF(((PyObject *)__pyx_t_6));
8796   __Pyx_INCREF(((PyObject *)__pyx_n_s__DP));
8797   PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__DP));
8798   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__DP));
8799   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
8800   __Pyx_GIVEREF(__pyx_t_4);
8801   __Pyx_INCREF(__pyx_int_1);
8802   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_1);
8803   __Pyx_GIVEREF(__pyx_int_1);
8804   __Pyx_INCREF(((PyObject *)__pyx_n_s__Integer));
8805   PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_n_s__Integer));
8806   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Integer));
8807   __Pyx_INCREF(((PyObject *)__pyx_kp_s_70));
8808   PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_kp_s_70));
8809   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_70));
8810   __Pyx_INCREF(__pyx_int_neg_1);
8811   PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_neg_1);
8812   __Pyx_GIVEREF(__pyx_int_neg_1);
8813   __pyx_t_4 = 0;
8814   __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8815   __Pyx_GOTREF(__pyx_t_4);
8816   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8817   __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
8818
8819   /* "cvcf.pyx":484
8820  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
8821  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
8822  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid             # <<<<<<<<<<<<<<
8823  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:
8824  *             if f.id not in self._format:
8825  */
8826   __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8827   __Pyx_GOTREF(__pyx_t_6);
8828   __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_UNKNOWN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8829   __Pyx_GOTREF(__pyx_t_5);
8830   __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8831   __Pyx_GOTREF(((PyObject *)__pyx_t_7));
8832   __Pyx_INCREF(((PyObject *)__pyx_n_s__HQ));
8833   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__HQ));
8834   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__HQ));
8835   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
8836   __Pyx_GIVEREF(__pyx_t_5);
8837   __Pyx_INCREF(__pyx_int_neg_1);
8838   PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_neg_1);
8839   __Pyx_GIVEREF(__pyx_int_neg_1);
8840   __Pyx_INCREF(((PyObject *)__pyx_n_s__Integer));
8841   PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_n_s__Integer));
8842   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Integer));
8843   __Pyx_INCREF(((PyObject *)__pyx_kp_s_71));
8844   PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_kp_s_71));
8845   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_71));
8846   __Pyx_INCREF(__pyx_int_neg_1);
8847   PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_int_neg_1);
8848   __Pyx_GIVEREF(__pyx_int_neg_1);
8849   __pyx_t_5 = 0;
8850   __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8851   __Pyx_GOTREF(__pyx_t_5);
8852   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8853   __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
8854
8855   /* "cvcf.pyx":485
8856  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
8857  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
8858  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:             # <<<<<<<<<<<<<<
8859  *             if f.id not in self._format:
8860  *                 self._format[f.id] = f
8861  */
8862   __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8863   __Pyx_GOTREF(__pyx_t_7);
8864   __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__NT_NUMBER); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8865   __Pyx_GOTREF(__pyx_t_6);
8866   __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8867   __Pyx_GOTREF(((PyObject *)__pyx_t_8));
8868   __Pyx_INCREF(((PyObject *)__pyx_n_s__FT));
8869   PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_n_s__FT));
8870   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FT));
8871   PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
8872   __Pyx_GIVEREF(__pyx_t_6);
8873   __Pyx_INCREF(__pyx_int_1);
8874   PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_1);
8875   __Pyx_GIVEREF(__pyx_int_1);
8876   __Pyx_INCREF(((PyObject *)__pyx_n_s__String));
8877   PyTuple_SET_ITEM(__pyx_t_8, 3, ((PyObject *)__pyx_n_s__String));
8878   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__String));
8879   __Pyx_INCREF(((PyObject *)__pyx_kp_s_72));
8880   PyTuple_SET_ITEM(__pyx_t_8, 4, ((PyObject *)__pyx_kp_s_72));
8881   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_72));
8882   __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
8883   PyTuple_SET_ITEM(__pyx_t_8, 5, ((PyObject *)__pyx_kp_s_9));
8884   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
8885   __pyx_t_6 = 0;
8886   __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8887   __Pyx_GOTREF(__pyx_t_6);
8888   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8889   __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
8890   __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8891   __Pyx_GOTREF(((PyObject *)__pyx_t_8));
8892   PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
8893   __Pyx_GIVEREF(__pyx_t_3);
8894   PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
8895   __Pyx_GIVEREF(__pyx_t_2);
8896   PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_4);
8897   __Pyx_GIVEREF(__pyx_t_4);
8898   PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_5);
8899   __Pyx_GIVEREF(__pyx_t_5);
8900   PyList_SET_ITEM(__pyx_t_8, 4, __pyx_t_6);
8901   __Pyx_GIVEREF(__pyx_t_6);
8902   __pyx_t_3 = 0;
8903   __pyx_t_2 = 0;
8904   __pyx_t_4 = 0;
8905   __pyx_t_5 = 0;
8906   __pyx_t_6 = 0;
8907   __pyx_t_1 = 0; __pyx_t_6 = ((PyObject *)__pyx_t_8); __Pyx_INCREF(__pyx_t_6);
8908   __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
8909   for (;;) {
8910
8911     /* "cvcf.pyx":481
8912  * 
8913  *     def enter_default_format(self):
8914  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),             # <<<<<<<<<<<<<<
8915  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
8916  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
8917  */
8918     if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_6)) break;
8919     __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++;
8920     __Pyx_DECREF(__pyx_v_f);
8921     __pyx_v_f = __pyx_t_8;
8922     __pyx_t_8 = 0;
8923
8924     /* "cvcf.pyx":486
8925  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
8926  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:
8927  *             if f.id not in self._format:             # <<<<<<<<<<<<<<
8928  *                 self._format[f.id] = f
8929  * 
8930  */
8931     __pyx_t_8 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__id); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8932     __Pyx_GOTREF(__pyx_t_8);
8933     __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8934     __Pyx_GOTREF(__pyx_t_5);
8935     __pyx_t_9 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_5, __pyx_t_8))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8936     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8937     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8938     if (__pyx_t_9) {
8939
8940       /* "cvcf.pyx":487
8941  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:
8942  *             if f.id not in self._format:
8943  *                 self._format[f.id] = f             # <<<<<<<<<<<<<<
8944  * 
8945  *     def parse_header( self, line ):
8946  */
8947       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8948       __Pyx_GOTREF(__pyx_t_5);
8949       __pyx_t_8 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__id); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8950       __Pyx_GOTREF(__pyx_t_8);
8951       if (PyObject_SetItem(__pyx_t_5, __pyx_t_8, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8952       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8953       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8954       goto __pyx_L7;
8955     }
8956     __pyx_L7:;
8957   }
8958   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8959
8960   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8961   goto __pyx_L0;
8962   __pyx_L1_error:;
8963   __Pyx_XDECREF(__pyx_t_2);
8964   __Pyx_XDECREF(__pyx_t_3);
8965   __Pyx_XDECREF(__pyx_t_4);
8966   __Pyx_XDECREF(__pyx_t_5);
8967   __Pyx_XDECREF(__pyx_t_6);
8968   __Pyx_XDECREF(__pyx_t_7);
8969   __Pyx_XDECREF(__pyx_t_8);
8970   __Pyx_AddTraceback("cvcf.VCF.enter_default_format");
8971   __pyx_r = NULL;
8972   __pyx_L0:;
8973   __Pyx_DECREF(__pyx_v_f);
8974   __Pyx_XGIVEREF(__pyx_r);
8975   __Pyx_RefNannyFinishContext();
8976   return __pyx_r;
8977 }
8978
8979 /* "cvcf.pyx":489
8980  *                 self._format[f.id] = f
8981  * 
8982  *     def parse_header( self, line ):             # <<<<<<<<<<<<<<
8983  *         assert line.startswith('##')
8984  *         elts = line[2:].split('=')
8985  */
8986
8987 static PyObject *__pyx_pf_4cvcf_3VCF_8parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8988 static PyMethodDef __pyx_mdef_4cvcf_3VCF_8parse_header = {__Pyx_NAMESTR("parse_header"), (PyCFunction)__pyx_pf_4cvcf_3VCF_8parse_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
8989 static PyObject *__pyx_pf_4cvcf_3VCF_8parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8990   PyObject *__pyx_v_self = 0;
8991   PyObject *__pyx_v_line = 0;
8992   PyObject *__pyx_v_elts;
8993   PyObject *__pyx_v_key;
8994   PyObject *__pyx_v_value;
8995   PyObject *__pyx_v_f;
8996   PyObject *__pyx_r = NULL;
8997   PyObject *__pyx_t_1 = NULL;
8998   PyObject *__pyx_t_2 = NULL;
8999   int __pyx_t_3;
9000   PyObject *__pyx_t_4 = NULL;
9001   PyObject *__pyx_t_5 = NULL;
9002   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,0};
9003   __Pyx_RefNannySetupContext("parse_header");
9004   __pyx_self = __pyx_self;
9005   if (unlikely(__pyx_kwds)) {
9006     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
9007     PyObject* values[2] = {0,0};
9008     switch (PyTuple_GET_SIZE(__pyx_args)) {
9009       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9010       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9011       case  0: break;
9012       default: goto __pyx_L5_argtuple_error;
9013     }
9014     switch (PyTuple_GET_SIZE(__pyx_args)) {
9015       case  0:
9016       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
9017       if (likely(values[0])) kw_args--;
9018       else goto __pyx_L5_argtuple_error;
9019       case  1:
9020       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
9021       if (likely(values[1])) kw_args--;
9022       else {
9023         __Pyx_RaiseArgtupleInvalid("parse_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9024       }
9025     }
9026     if (unlikely(kw_args > 0)) {
9027       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parse_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9028     }
9029     __pyx_v_self = values[0];
9030     __pyx_v_line = values[1];
9031   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
9032     goto __pyx_L5_argtuple_error;
9033   } else {
9034     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
9035     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
9036   }
9037   goto __pyx_L4_argument_unpacking_done;
9038   __pyx_L5_argtuple_error:;
9039   __Pyx_RaiseArgtupleInvalid("parse_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9040   __pyx_L3_error:;
9041   __Pyx_AddTraceback("cvcf.VCF.parse_header");
9042   __Pyx_RefNannyFinishContext();
9043   return NULL;
9044   __pyx_L4_argument_unpacking_done:;
9045   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
9046   __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
9047   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
9048   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
9049
9050   /* "cvcf.pyx":490
9051  * 
9052  *     def parse_header( self, line ):
9053  *         assert line.startswith('##')             # <<<<<<<<<<<<<<
9054  *         elts = line[2:].split('=')
9055  *         key = elts[0].strip()
9056  */
9057   #ifndef CYTHON_WITHOUT_ASSERTIONS
9058   __pyx_t_1 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9059   __Pyx_GOTREF(__pyx_t_1);
9060   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_74), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9061   __Pyx_GOTREF(__pyx_t_2);
9062   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9063   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9064   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9065   if (unlikely(!__pyx_t_3)) {
9066     PyErr_SetNone(PyExc_AssertionError);
9067     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9068   }
9069   #endif
9070
9071   /* "cvcf.pyx":491
9072  *     def parse_header( self, line ):
9073  *         assert line.startswith('##')
9074  *         elts = line[2:].split('=')             # <<<<<<<<<<<<<<
9075  *         key = elts[0].strip()
9076  *         value = '='.join(elts[1:]).strip()
9077  */
9078   __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_line, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9079   __Pyx_GOTREF(__pyx_t_2);
9080   __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9081   __Pyx_GOTREF(__pyx_t_1);
9082   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9083   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9084   __Pyx_GOTREF(__pyx_t_2);
9085   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9086   __Pyx_DECREF(__pyx_v_elts);
9087   __pyx_v_elts = __pyx_t_2;
9088   __pyx_t_2 = 0;
9089
9090   /* "cvcf.pyx":492
9091  *         assert line.startswith('##')
9092  *         elts = line[2:].split('=')
9093  *         key = elts[0].strip()             # <<<<<<<<<<<<<<
9094  *         value = '='.join(elts[1:]).strip()
9095  *         if key == "fileformat":
9096  */
9097   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9098   __Pyx_GOTREF(__pyx_t_2);
9099   __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9100   __Pyx_GOTREF(__pyx_t_1);
9101   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9102   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9103   __Pyx_GOTREF(__pyx_t_2);
9104   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9105   __Pyx_DECREF(__pyx_v_key);
9106   __pyx_v_key = __pyx_t_2;
9107   __pyx_t_2 = 0;
9108
9109   /* "cvcf.pyx":493
9110  *         elts = line[2:].split('=')
9111  *         key = elts[0].strip()
9112  *         value = '='.join(elts[1:]).strip()             # <<<<<<<<<<<<<<
9113  *         if key == "fileformat":
9114  *             if value == "VCFv3.3":
9115  */
9116   __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_14), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9117   __Pyx_GOTREF(__pyx_t_2);
9118   __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_elts, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9119   __Pyx_GOTREF(__pyx_t_1);
9120   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9121   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
9122   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9123   __Pyx_GIVEREF(__pyx_t_1);
9124   __pyx_t_1 = 0;
9125   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9126   __Pyx_GOTREF(__pyx_t_1);
9127   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9128   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
9129   __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__strip); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9130   __Pyx_GOTREF(__pyx_t_4);
9131   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9132   __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9133   __Pyx_GOTREF(__pyx_t_1);
9134   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9135   __Pyx_DECREF(__pyx_v_value);
9136   __pyx_v_value = __pyx_t_1;
9137   __pyx_t_1 = 0;
9138
9139   /* "cvcf.pyx":494
9140  *         key = elts[0].strip()
9141  *         value = '='.join(elts[1:]).strip()
9142  *         if key == "fileformat":             # <<<<<<<<<<<<<<
9143  *             if value == "VCFv3.3":
9144  *                 self._version = 33
9145  */
9146   __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__fileformat), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9147   __Pyx_GOTREF(__pyx_t_1);
9148   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9149   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9150   if (__pyx_t_3) {
9151
9152     /* "cvcf.pyx":495
9153  *         value = '='.join(elts[1:]).strip()
9154  *         if key == "fileformat":
9155  *             if value == "VCFv3.3":             # <<<<<<<<<<<<<<
9156  *                 self._version = 33
9157  *             elif value == "VCFv4.0":
9158  */
9159     __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, ((PyObject *)__pyx_kp_s_76), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9160     __Pyx_GOTREF(__pyx_t_1);
9161     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9162     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9163     if (__pyx_t_3) {
9164
9165       /* "cvcf.pyx":496
9166  *         if key == "fileformat":
9167  *             if value == "VCFv3.3":
9168  *                 self._version = 33             # <<<<<<<<<<<<<<
9169  *             elif value == "VCFv4.0":
9170  *                 self._version = 40
9171  */
9172       if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___version, __pyx_int_33) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9173       goto __pyx_L7;
9174     }
9175
9176     /* "cvcf.pyx":497
9177  *             if value == "VCFv3.3":
9178  *                 self._version = 33
9179  *             elif value == "VCFv4.0":             # <<<<<<<<<<<<<<
9180  *                 self._version = 40
9181  *             elif value == "VCFv4.1":
9182  */
9183     __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, ((PyObject *)__pyx_kp_s_77), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9184     __Pyx_GOTREF(__pyx_t_1);
9185     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9186     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9187     if (__pyx_t_3) {
9188
9189       /* "cvcf.pyx":498
9190  *                 self._version = 33
9191  *             elif value == "VCFv4.0":
9192  *                 self._version = 40             # <<<<<<<<<<<<<<
9193  *             elif value == "VCFv4.1":
9194  *                 # AH - for testing
9195  */
9196       if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___version, __pyx_int_40) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9197       goto __pyx_L7;
9198     }
9199
9200     /* "cvcf.pyx":499
9201  *             elif value == "VCFv4.0":
9202  *                 self._version = 40
9203  *             elif value == "VCFv4.1":             # <<<<<<<<<<<<<<
9204  *                 # AH - for testing
9205  *                 self._version = 40
9206  */
9207     __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, ((PyObject *)__pyx_kp_s_78), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9208     __Pyx_GOTREF(__pyx_t_1);
9209     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9210     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9211     if (__pyx_t_3) {
9212
9213       /* "cvcf.pyx":501
9214  *             elif value == "VCFv4.1":
9215  *                 # AH - for testing
9216  *                 self._version = 40             # <<<<<<<<<<<<<<
9217  *             else:
9218  *                 self.error(line,self.UNKNOWN_FORMAT_STRING)
9219  */
9220       if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___version, __pyx_int_40) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9221       goto __pyx_L7;
9222     }
9223     /*else*/ {
9224
9225       /* "cvcf.pyx":503
9226  *                 self._version = 40
9227  *             else:
9228  *                 self.error(line,self.UNKNOWN_FORMAT_STRING)             # <<<<<<<<<<<<<<
9229  *         elif key == "INFO":
9230  *             f = self.parse_format(line, value)
9231  */
9232       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9233       __Pyx_GOTREF(__pyx_t_1);
9234       __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_79); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9235       __Pyx_GOTREF(__pyx_t_4);
9236       __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9237       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
9238       __Pyx_INCREF(__pyx_v_line);
9239       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
9240       __Pyx_GIVEREF(__pyx_v_line);
9241       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9242       __Pyx_GIVEREF(__pyx_t_4);
9243       __pyx_t_4 = 0;
9244       __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9245       __Pyx_GOTREF(__pyx_t_4);
9246       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9247       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
9248       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9249     }
9250     __pyx_L7:;
9251     goto __pyx_L6;
9252   }
9253
9254   /* "cvcf.pyx":504
9255  *             else:
9256  *                 self.error(line,self.UNKNOWN_FORMAT_STRING)
9257  *         elif key == "INFO":             # <<<<<<<<<<<<<<
9258  *             f = self.parse_format(line, value)
9259  *             self._info[ f.id ] = f
9260  */
9261   __pyx_t_4 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__INFO), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9262   __Pyx_GOTREF(__pyx_t_4);
9263   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9264   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9265   if (__pyx_t_3) {
9266
9267     /* "cvcf.pyx":505
9268  *                 self.error(line,self.UNKNOWN_FORMAT_STRING)
9269  *         elif key == "INFO":
9270  *             f = self.parse_format(line, value)             # <<<<<<<<<<<<<<
9271  *             self._info[ f.id ] = f
9272  *         elif key == "FILTER":
9273  */
9274     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9275     __Pyx_GOTREF(__pyx_t_4);
9276     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9277     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
9278     __Pyx_INCREF(__pyx_v_line);
9279     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
9280     __Pyx_GIVEREF(__pyx_v_line);
9281     __Pyx_INCREF(__pyx_v_value);
9282     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
9283     __Pyx_GIVEREF(__pyx_v_value);
9284     __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9285     __Pyx_GOTREF(__pyx_t_1);
9286     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9287     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
9288     __Pyx_DECREF(__pyx_v_f);
9289     __pyx_v_f = __pyx_t_1;
9290     __pyx_t_1 = 0;
9291
9292     /* "cvcf.pyx":506
9293  *         elif key == "INFO":
9294  *             f = self.parse_format(line, value)
9295  *             self._info[ f.id ] = f             # <<<<<<<<<<<<<<
9296  *         elif key == "FILTER":
9297  *             f = self.parse_format(line, value, filter=True)
9298  */
9299     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9300     __Pyx_GOTREF(__pyx_t_1);
9301     __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9302     __Pyx_GOTREF(__pyx_t_2);
9303     if (PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9304     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9305     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9306     goto __pyx_L6;
9307   }
9308
9309   /* "cvcf.pyx":507
9310  *             f = self.parse_format(line, value)
9311  *             self._info[ f.id ] = f
9312  *         elif key == "FILTER":             # <<<<<<<<<<<<<<
9313  *             f = self.parse_format(line, value, filter=True)
9314  *             self._filter[ f.id ] = f
9315  */
9316   __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__FILTER), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9317   __Pyx_GOTREF(__pyx_t_2);
9318   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9319   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9320   if (__pyx_t_3) {
9321
9322     /* "cvcf.pyx":508
9323  *             self._info[ f.id ] = f
9324  *         elif key == "FILTER":
9325  *             f = self.parse_format(line, value, filter=True)             # <<<<<<<<<<<<<<
9326  *             self._filter[ f.id ] = f
9327  *         elif key == "FORMAT":
9328  */
9329     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9330     __Pyx_GOTREF(__pyx_t_2);
9331     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9332     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
9333     __Pyx_INCREF(__pyx_v_line);
9334     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
9335     __Pyx_GIVEREF(__pyx_v_line);
9336     __Pyx_INCREF(__pyx_v_value);
9337     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
9338     __Pyx_GIVEREF(__pyx_v_value);
9339     __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9340     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
9341     __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9342     __Pyx_GOTREF(__pyx_t_5);
9343     if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__filter), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9344     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9345     __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9346     __Pyx_GOTREF(__pyx_t_5);
9347     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9348     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
9349     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
9350     __Pyx_DECREF(__pyx_v_f);
9351     __pyx_v_f = __pyx_t_5;
9352     __pyx_t_5 = 0;
9353
9354     /* "cvcf.pyx":509
9355  *         elif key == "FILTER":
9356  *             f = self.parse_format(line, value, filter=True)
9357  *             self._filter[ f.id ] = f             # <<<<<<<<<<<<<<
9358  *         elif key == "FORMAT":
9359  *             f = self.parse_format(line, value)
9360  */
9361     __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___filter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9362     __Pyx_GOTREF(__pyx_t_5);
9363     __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9364     __Pyx_GOTREF(__pyx_t_4);
9365     if (PyObject_SetItem(__pyx_t_5, __pyx_t_4, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9366     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9367     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9368     goto __pyx_L6;
9369   }
9370
9371   /* "cvcf.pyx":510
9372  *             f = self.parse_format(line, value, filter=True)
9373  *             self._filter[ f.id ] = f
9374  *         elif key == "FORMAT":             # <<<<<<<<<<<<<<
9375  *             f = self.parse_format(line, value)
9376  *             self._format[ f.id ] = f
9377  */
9378   __pyx_t_4 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__FORMAT), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9379   __Pyx_GOTREF(__pyx_t_4);
9380   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9381   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9382   if (__pyx_t_3) {
9383
9384     /* "cvcf.pyx":511
9385  *             self._filter[ f.id ] = f
9386  *         elif key == "FORMAT":
9387  *             f = self.parse_format(line, value)             # <<<<<<<<<<<<<<
9388  *             self._format[ f.id ] = f
9389  *         else:
9390  */
9391     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9392     __Pyx_GOTREF(__pyx_t_4);
9393     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9394     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
9395     __Pyx_INCREF(__pyx_v_line);
9396     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
9397     __Pyx_GIVEREF(__pyx_v_line);
9398     __Pyx_INCREF(__pyx_v_value);
9399     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_value);
9400     __Pyx_GIVEREF(__pyx_v_value);
9401     __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9402     __Pyx_GOTREF(__pyx_t_1);
9403     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9404     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
9405     __Pyx_DECREF(__pyx_v_f);
9406     __pyx_v_f = __pyx_t_1;
9407     __pyx_t_1 = 0;
9408
9409     /* "cvcf.pyx":512
9410  *         elif key == "FORMAT":
9411  *             f = self.parse_format(line, value)
9412  *             self._format[ f.id ] = f             # <<<<<<<<<<<<<<
9413  *         else:
9414  *             # keep other keys in the header field
9415  */
9416     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9417     __Pyx_GOTREF(__pyx_t_1);
9418     __pyx_t_5 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__id); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9419     __Pyx_GOTREF(__pyx_t_5);
9420     if (PyObject_SetItem(__pyx_t_1, __pyx_t_5, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9421     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9422     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9423     goto __pyx_L6;
9424   }
9425   /*else*/ {
9426
9427     /* "cvcf.pyx":515
9428  *         else:
9429  *             # keep other keys in the header field
9430  *             self._header.append( (key,value) )             # <<<<<<<<<<<<<<
9431  * 
9432  * 
9433  */
9434     __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___header); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9435     __Pyx_GOTREF(__pyx_t_5);
9436     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9437     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
9438     __Pyx_INCREF(__pyx_v_key);
9439     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
9440     __Pyx_GIVEREF(__pyx_v_key);
9441     __Pyx_INCREF(__pyx_v_value);
9442     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
9443     __Pyx_GIVEREF(__pyx_v_value);
9444     __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_5, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9445     __Pyx_GOTREF(__pyx_t_4);
9446     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9447     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
9448     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9449   }
9450   __pyx_L6:;
9451
9452   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9453   goto __pyx_L0;
9454   __pyx_L1_error:;
9455   __Pyx_XDECREF(__pyx_t_1);
9456   __Pyx_XDECREF(__pyx_t_2);
9457   __Pyx_XDECREF(__pyx_t_4);
9458   __Pyx_XDECREF(__pyx_t_5);
9459   __Pyx_AddTraceback("cvcf.VCF.parse_header");
9460   __pyx_r = NULL;
9461   __pyx_L0:;
9462   __Pyx_DECREF(__pyx_v_elts);
9463   __Pyx_DECREF(__pyx_v_key);
9464   __Pyx_DECREF(__pyx_v_value);
9465   __Pyx_DECREF(__pyx_v_f);
9466   __Pyx_XGIVEREF(__pyx_r);
9467   __Pyx_RefNannyFinishContext();
9468   return __pyx_r;
9469 }
9470
9471 /* "cvcf.pyx":518
9472  * 
9473  * 
9474  *     def write_header( self, stream ):             # <<<<<<<<<<<<<<
9475  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
9476  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
9477  */
9478
9479 static PyObject *__pyx_pf_4cvcf_3VCF_9write_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9480 static PyMethodDef __pyx_mdef_4cvcf_3VCF_9write_header = {__Pyx_NAMESTR("write_header"), (PyCFunction)__pyx_pf_4cvcf_3VCF_9write_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
9481 static PyObject *__pyx_pf_4cvcf_3VCF_9write_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9482   PyObject *__pyx_v_self = 0;
9483   PyObject *__pyx_v_stream = 0;
9484   PyObject *__pyx_v_key;
9485   PyObject *__pyx_v_value;
9486   PyObject *__pyx_v_var;
9487   PyObject *__pyx_v_label;
9488   PyObject *__pyx_v_f;
9489   PyObject *__pyx_r = NULL;
9490   PyObject *__pyx_t_1 = NULL;
9491   PyObject *__pyx_t_2 = NULL;
9492   PyObject *__pyx_t_3 = NULL;
9493   PyObject *__pyx_t_4 = NULL;
9494   Py_ssize_t __pyx_t_5;
9495   PyObject *__pyx_t_6 = NULL;
9496   Py_ssize_t __pyx_t_7;
9497   PyObject *__pyx_t_8 = NULL;
9498   PyObject *__pyx_t_9 = NULL;
9499   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
9500   __Pyx_RefNannySetupContext("write_header");
9501   __pyx_self = __pyx_self;
9502   if (unlikely(__pyx_kwds)) {
9503     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
9504     PyObject* values[2] = {0,0};
9505     switch (PyTuple_GET_SIZE(__pyx_args)) {
9506       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9507       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9508       case  0: break;
9509       default: goto __pyx_L5_argtuple_error;
9510     }
9511     switch (PyTuple_GET_SIZE(__pyx_args)) {
9512       case  0:
9513       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
9514       if (likely(values[0])) kw_args--;
9515       else goto __pyx_L5_argtuple_error;
9516       case  1:
9517       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
9518       if (likely(values[1])) kw_args--;
9519       else {
9520         __Pyx_RaiseArgtupleInvalid("write_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9521       }
9522     }
9523     if (unlikely(kw_args > 0)) {
9524       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "write_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9525     }
9526     __pyx_v_self = values[0];
9527     __pyx_v_stream = values[1];
9528   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
9529     goto __pyx_L5_argtuple_error;
9530   } else {
9531     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
9532     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
9533   }
9534   goto __pyx_L4_argument_unpacking_done;
9535   __pyx_L5_argtuple_error:;
9536   __Pyx_RaiseArgtupleInvalid("write_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9537   __pyx_L3_error:;
9538   __Pyx_AddTraceback("cvcf.VCF.write_header");
9539   __Pyx_RefNannyFinishContext();
9540   return NULL;
9541   __pyx_L4_argument_unpacking_done:;
9542   __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
9543   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
9544   __pyx_v_var = Py_None; __Pyx_INCREF(Py_None);
9545   __pyx_v_label = Py_None; __Pyx_INCREF(Py_None);
9546   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
9547
9548   /* "cvcf.pyx":519
9549  * 
9550  *     def write_header( self, stream ):
9551  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))             # <<<<<<<<<<<<<<
9552  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
9553  *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:
9554  */
9555   __pyx_t_1 = PyObject_GetAttr(__pyx_v_stream, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9556   __Pyx_GOTREF(__pyx_t_1);
9557   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9558   __Pyx_GOTREF(__pyx_t_2);
9559   __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_2, __pyx_int_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9560   __Pyx_GOTREF(__pyx_t_3);
9561   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9562   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9563   __Pyx_GOTREF(__pyx_t_2);
9564   __pyx_t_4 = PyNumber_Remainder(__pyx_t_2, __pyx_int_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9565   __Pyx_GOTREF(__pyx_t_4);
9566   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9567   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9568   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
9569   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
9570   __Pyx_GIVEREF(__pyx_t_3);
9571   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9572   __Pyx_GIVEREF(__pyx_t_4);
9573   __pyx_t_3 = 0;
9574   __pyx_t_4 = 0;
9575   __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_80), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9576   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
9577   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
9578   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9579   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
9580   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
9581   __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
9582   __pyx_t_4 = 0;
9583   __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9584   __Pyx_GOTREF(__pyx_t_4);
9585   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9586   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
9587   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9588
9589   /* "cvcf.pyx":520
9590  *     def write_header( self, stream ):
9591  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
9592  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))             # <<<<<<<<<<<<<<
9593  *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:
9594  *             for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER"))))
9595  */
9596   __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___header); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9597   __Pyx_GOTREF(__pyx_t_4);
9598   if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
9599     __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2);
9600   } else {
9601     __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9602     __Pyx_GOTREF(__pyx_t_2);
9603   }
9604   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9605   for (;;) {
9606     if (likely(PyList_CheckExact(__pyx_t_2))) {
9607       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
9608       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
9609     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
9610       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9611       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
9612     } else {
9613       __pyx_t_4 = PyIter_Next(__pyx_t_2);
9614       if (!__pyx_t_4) {
9615         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9616         break;
9617       }
9618       __Pyx_GOTREF(__pyx_t_4);
9619     }
9620     if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
9621       PyObject* tuple = __pyx_t_4;
9622       __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
9623       __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
9624       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9625       __Pyx_DECREF(__pyx_v_key);
9626       __pyx_v_key = __pyx_t_1;
9627       __pyx_t_1 = 0;
9628       __Pyx_DECREF(__pyx_v_value);
9629       __pyx_v_value = __pyx_t_3;
9630       __pyx_t_3 = 0;
9631     } else {
9632       __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9633       __Pyx_GOTREF(__pyx_t_6);
9634       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9635       __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9636       __Pyx_GOTREF(__pyx_t_1);
9637       __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9638       __Pyx_GOTREF(__pyx_t_3);
9639       if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9640       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9641       __Pyx_DECREF(__pyx_v_key);
9642       __pyx_v_key = __pyx_t_1;
9643       __pyx_t_1 = 0;
9644       __Pyx_DECREF(__pyx_v_value);
9645       __pyx_v_value = __pyx_t_3;
9646       __pyx_t_3 = 0;
9647     }
9648     __pyx_t_4 = PyObject_GetAttr(__pyx_v_stream, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9649     __Pyx_GOTREF(__pyx_t_4);
9650     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9651     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
9652     __Pyx_INCREF(__pyx_v_key);
9653     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
9654     __Pyx_GIVEREF(__pyx_v_key);
9655     __Pyx_INCREF(__pyx_v_value);
9656     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
9657     __Pyx_GIVEREF(__pyx_v_value);
9658     __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9659     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
9660     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
9661     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9662     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
9663     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
9664     __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
9665     __pyx_t_1 = 0;
9666     __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9667     __Pyx_GOTREF(__pyx_t_1);
9668     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9669     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
9670     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9671   }
9672   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9673
9674   /* "cvcf.pyx":521
9675  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
9676  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
9677  *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:             # <<<<<<<<<<<<<<
9678  *             for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER"))))
9679  * 
9680  */
9681   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9682   __Pyx_GOTREF(__pyx_t_2);
9683   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9684   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
9685   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
9686   __Pyx_GIVEREF(__pyx_t_2);
9687   __Pyx_INCREF(((PyObject *)__pyx_n_s__INFO));
9688   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__INFO));
9689   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__INFO));
9690   __pyx_t_2 = 0;
9691   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9692   __Pyx_GOTREF(__pyx_t_2);
9693   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9694   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
9695   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
9696   __Pyx_GIVEREF(__pyx_t_2);
9697   __Pyx_INCREF(((PyObject *)__pyx_n_s__FILTER));
9698   PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__FILTER));
9699   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FILTER));
9700   __pyx_t_2 = 0;
9701   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9702   __Pyx_GOTREF(__pyx_t_2);
9703   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9704   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
9705   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
9706   __Pyx_GIVEREF(__pyx_t_2);
9707   __Pyx_INCREF(((PyObject *)__pyx_n_s__FORMAT));
9708   PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__FORMAT));
9709   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FORMAT));
9710   __pyx_t_2 = 0;
9711   __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9712   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
9713   PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
9714   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
9715   PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_3));
9716   __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
9717   PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_4));
9718   __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
9719   __pyx_t_1 = 0;
9720   __pyx_t_3 = 0;
9721   __pyx_t_4 = 0;
9722   __pyx_t_5 = 0; __pyx_t_4 = ((PyObject *)__pyx_t_2); __Pyx_INCREF(__pyx_t_4);
9723   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
9724   for (;;) {
9725     if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
9726     __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
9727     if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
9728       PyObject* tuple = __pyx_t_2;
9729       __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
9730       __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
9731       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9732       __Pyx_DECREF(__pyx_v_var);
9733       __pyx_v_var = __pyx_t_3;
9734       __pyx_t_3 = 0;
9735       __Pyx_DECREF(__pyx_v_label);
9736       __pyx_v_label = __pyx_t_1;
9737       __pyx_t_1 = 0;
9738     } else {
9739       __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9740       __Pyx_GOTREF(__pyx_t_6);
9741       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9742       __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9743       __Pyx_GOTREF(__pyx_t_3);
9744       __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9745       __Pyx_GOTREF(__pyx_t_1);
9746       if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9747       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9748       __Pyx_DECREF(__pyx_v_var);
9749       __pyx_v_var = __pyx_t_3;
9750       __pyx_t_3 = 0;
9751       __Pyx_DECREF(__pyx_v_label);
9752       __pyx_v_label = __pyx_t_1;
9753       __pyx_t_1 = 0;
9754     }
9755
9756     /* "cvcf.pyx":522
9757  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
9758  *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:
9759  *             for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER"))))             # <<<<<<<<<<<<<<
9760  * 
9761  * 
9762  */
9763     __pyx_t_2 = PyObject_GetAttr(__pyx_v_var, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9764     __Pyx_GOTREF(__pyx_t_2);
9765     __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9766     __Pyx_GOTREF(__pyx_t_1);
9767     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9768     if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
9769       __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
9770     } else {
9771       __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9772       __Pyx_GOTREF(__pyx_t_2);
9773     }
9774     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9775     for (;;) {
9776       if (likely(PyList_CheckExact(__pyx_t_2))) {
9777         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
9778         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
9779       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
9780         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9781         __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
9782       } else {
9783         __pyx_t_1 = PyIter_Next(__pyx_t_2);
9784         if (!__pyx_t_1) {
9785           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9786           break;
9787         }
9788         __Pyx_GOTREF(__pyx_t_1);
9789       }
9790       __Pyx_DECREF(__pyx_v_f);
9791       __pyx_v_f = __pyx_t_1;
9792       __pyx_t_1 = 0;
9793       __pyx_t_1 = PyObject_GetAttr(__pyx_v_stream, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9794       __Pyx_GOTREF(__pyx_t_1);
9795       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__format_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9796       __Pyx_GOTREF(__pyx_t_3);
9797       __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9798       __Pyx_GOTREF(((PyObject *)__pyx_t_6));
9799       __Pyx_INCREF(__pyx_v_f);
9800       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_f);
9801       __Pyx_GIVEREF(__pyx_v_f);
9802       __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9803       __Pyx_GOTREF(((PyObject *)__pyx_t_8));
9804       __pyx_t_9 = PyObject_RichCompare(__pyx_v_label, ((PyObject *)__pyx_n_s__FILTER), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9805       __Pyx_GOTREF(__pyx_t_9);
9806       if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__filter), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9807       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9808       __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9809       __Pyx_GOTREF(__pyx_t_9);
9810       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9811       __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
9812       __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
9813       __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9814       __Pyx_GOTREF(((PyObject *)__pyx_t_8));
9815       __Pyx_INCREF(__pyx_v_label);
9816       PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_label);
9817       __Pyx_GIVEREF(__pyx_v_label);
9818       PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
9819       __Pyx_GIVEREF(__pyx_t_9);
9820       __pyx_t_9 = 0;
9821       __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9822       __Pyx_GOTREF(((PyObject *)__pyx_t_9));
9823       __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
9824       __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9825       __Pyx_GOTREF(((PyObject *)__pyx_t_8));
9826       PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_9));
9827       __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
9828       __pyx_t_9 = 0;
9829       __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9830       __Pyx_GOTREF(__pyx_t_9);
9831       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9832       __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
9833       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9834     }
9835     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9836   }
9837   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9838
9839   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9840   goto __pyx_L0;
9841   __pyx_L1_error:;
9842   __Pyx_XDECREF(__pyx_t_1);
9843   __Pyx_XDECREF(__pyx_t_2);
9844   __Pyx_XDECREF(__pyx_t_3);
9845   __Pyx_XDECREF(__pyx_t_4);
9846   __Pyx_XDECREF(__pyx_t_6);
9847   __Pyx_XDECREF(__pyx_t_8);
9848   __Pyx_XDECREF(__pyx_t_9);
9849   __Pyx_AddTraceback("cvcf.VCF.write_header");
9850   __pyx_r = NULL;
9851   __pyx_L0:;
9852   __Pyx_DECREF(__pyx_v_key);
9853   __Pyx_DECREF(__pyx_v_value);
9854   __Pyx_DECREF(__pyx_v_var);
9855   __Pyx_DECREF(__pyx_v_label);
9856   __Pyx_DECREF(__pyx_v_f);
9857   __Pyx_XGIVEREF(__pyx_r);
9858   __Pyx_RefNannyFinishContext();
9859   return __pyx_r;
9860 }
9861
9862 /* "cvcf.pyx":525
9863  * 
9864  * 
9865  *     def parse_heading( self, line ):             # <<<<<<<<<<<<<<
9866  *         assert line.startswith('#')
9867  *         assert not line.startswith('##')
9868  */
9869
9870 static PyObject *__pyx_pf_4cvcf_3VCF_10parse_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9871 static PyMethodDef __pyx_mdef_4cvcf_3VCF_10parse_heading = {__Pyx_NAMESTR("parse_heading"), (PyCFunction)__pyx_pf_4cvcf_3VCF_10parse_heading, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
9872 static PyObject *__pyx_pf_4cvcf_3VCF_10parse_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9873   PyObject *__pyx_v_self = 0;
9874   PyObject *__pyx_v_line = 0;
9875   PyObject *__pyx_v_headings;
9876   PyObject *__pyx_v_i;
9877   PyObject *__pyx_v_s;
9878   PyObject *__pyx_v_err;
9879   PyObject *__pyx_v_x;
9880   PyObject *__pyx_v_y;
9881   PyObject *__pyx_r = NULL;
9882   PyObject *__pyx_t_1 = NULL;
9883   PyObject *__pyx_t_2 = NULL;
9884   int __pyx_t_3;
9885   Py_ssize_t __pyx_t_4;
9886   int __pyx_t_5;
9887   int __pyx_t_6;
9888   PyObject *__pyx_t_7 = NULL;
9889   Py_ssize_t __pyx_t_8;
9890   PyObject *__pyx_t_9 = NULL;
9891   PyObject *__pyx_t_10 = NULL;
9892   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,0};
9893   __Pyx_RefNannySetupContext("parse_heading");
9894   __pyx_self = __pyx_self;
9895   if (unlikely(__pyx_kwds)) {
9896     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
9897     PyObject* values[2] = {0,0};
9898     switch (PyTuple_GET_SIZE(__pyx_args)) {
9899       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9900       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9901       case  0: break;
9902       default: goto __pyx_L5_argtuple_error;
9903     }
9904     switch (PyTuple_GET_SIZE(__pyx_args)) {
9905       case  0:
9906       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
9907       if (likely(values[0])) kw_args--;
9908       else goto __pyx_L5_argtuple_error;
9909       case  1:
9910       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
9911       if (likely(values[1])) kw_args--;
9912       else {
9913         __Pyx_RaiseArgtupleInvalid("parse_heading", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9914       }
9915     }
9916     if (unlikely(kw_args > 0)) {
9917       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parse_heading") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9918     }
9919     __pyx_v_self = values[0];
9920     __pyx_v_line = values[1];
9921   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
9922     goto __pyx_L5_argtuple_error;
9923   } else {
9924     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
9925     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
9926   }
9927   goto __pyx_L4_argument_unpacking_done;
9928   __pyx_L5_argtuple_error:;
9929   __Pyx_RaiseArgtupleInvalid("parse_heading", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9930   __pyx_L3_error:;
9931   __Pyx_AddTraceback("cvcf.VCF.parse_heading");
9932   __Pyx_RefNannyFinishContext();
9933   return NULL;
9934   __pyx_L4_argument_unpacking_done:;
9935   __pyx_v_headings = Py_None; __Pyx_INCREF(Py_None);
9936   __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
9937   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
9938   __pyx_v_err = Py_None; __Pyx_INCREF(Py_None);
9939   __pyx_v_x = Py_None; __Pyx_INCREF(Py_None);
9940   __pyx_v_y = Py_None; __Pyx_INCREF(Py_None);
9941
9942   /* "cvcf.pyx":526
9943  * 
9944  *     def parse_heading( self, line ):
9945  *         assert line.startswith('#')             # <<<<<<<<<<<<<<
9946  *         assert not line.startswith('##')
9947  *         headings = line[1:].split('\t')
9948  */
9949   #ifndef CYTHON_WITHOUT_ASSERTIONS
9950   __pyx_t_1 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9951   __Pyx_GOTREF(__pyx_t_1);
9952   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9953   __Pyx_GOTREF(__pyx_t_2);
9954   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9955   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9956   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9957   if (unlikely(!__pyx_t_3)) {
9958     PyErr_SetNone(PyExc_AssertionError);
9959     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9960   }
9961   #endif
9962
9963   /* "cvcf.pyx":527
9964  *     def parse_heading( self, line ):
9965  *         assert line.startswith('#')
9966  *         assert not line.startswith('##')             # <<<<<<<<<<<<<<
9967  *         headings = line[1:].split('\t')
9968  *         if len(headings)==1 and len(line[1:].split()) >= 9:
9969  */
9970   #ifndef CYTHON_WITHOUT_ASSERTIONS
9971   __pyx_t_2 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9972   __Pyx_GOTREF(__pyx_t_2);
9973   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9974   __Pyx_GOTREF(__pyx_t_1);
9975   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9976   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9977   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9978   if (unlikely(!(!__pyx_t_3))) {
9979     PyErr_SetNone(PyExc_AssertionError);
9980     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9981   }
9982   #endif
9983
9984   /* "cvcf.pyx":528
9985  *         assert line.startswith('#')
9986  *         assert not line.startswith('##')
9987  *         headings = line[1:].split('\t')             # <<<<<<<<<<<<<<
9988  *         if len(headings)==1 and len(line[1:].split()) >= 9:
9989  *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
9990  */
9991   __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_line, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9992   __Pyx_GOTREF(__pyx_t_1);
9993   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9994   __Pyx_GOTREF(__pyx_t_2);
9995   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9996   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_86), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9997   __Pyx_GOTREF(__pyx_t_1);
9998   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9999   __Pyx_DECREF(__pyx_v_headings);
10000   __pyx_v_headings = __pyx_t_1;
10001   __pyx_t_1 = 0;
10002
10003   /* "cvcf.pyx":529
10004  *         assert not line.startswith('##')
10005  *         headings = line[1:].split('\t')
10006  *         if len(headings)==1 and len(line[1:].split()) >= 9:             # <<<<<<<<<<<<<<
10007  *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
10008  *             headings = line[1:].split()
10009  */
10010   __pyx_t_4 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10011   __pyx_t_3 = (__pyx_t_4 == 1);
10012   if (__pyx_t_3) {
10013     __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_line, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10014     __Pyx_GOTREF(__pyx_t_1);
10015     __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10016     __Pyx_GOTREF(__pyx_t_2);
10017     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10018     __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10019     __Pyx_GOTREF(__pyx_t_1);
10020     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10021     __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10022     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10023     __pyx_t_5 = (__pyx_t_4 >= 9);
10024     __pyx_t_6 = __pyx_t_5;
10025   } else {
10026     __pyx_t_6 = __pyx_t_3;
10027   }
10028   if (__pyx_t_6) {
10029
10030     /* "cvcf.pyx":530
10031  *         headings = line[1:].split('\t')
10032  *         if len(headings)==1 and len(line[1:].split()) >= 9:
10033  *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)             # <<<<<<<<<<<<<<
10034  *             headings = line[1:].split()
10035  * 
10036  */
10037     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10038     __Pyx_GOTREF(__pyx_t_1);
10039     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_87); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10040     __Pyx_GOTREF(__pyx_t_2);
10041     __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10042     __Pyx_GOTREF(((PyObject *)__pyx_t_7));
10043     __Pyx_INCREF(__pyx_v_line);
10044     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_line);
10045     __Pyx_GIVEREF(__pyx_v_line);
10046     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
10047     __Pyx_GIVEREF(__pyx_t_2);
10048     __pyx_t_2 = 0;
10049     __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10050     __Pyx_GOTREF(__pyx_t_2);
10051     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10052     __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
10053     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10054
10055     /* "cvcf.pyx":531
10056  *         if len(headings)==1 and len(line[1:].split()) >= 9:
10057  *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
10058  *             headings = line[1:].split()             # <<<<<<<<<<<<<<
10059  * 
10060  *         for i,s in enumerate(self._required):
10061  */
10062     __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_line, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10063     __Pyx_GOTREF(__pyx_t_2);
10064     __pyx_t_7 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10065     __Pyx_GOTREF(__pyx_t_7);
10066     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10067     __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10068     __Pyx_GOTREF(__pyx_t_2);
10069     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10070     __Pyx_DECREF(__pyx_v_headings);
10071     __pyx_v_headings = __pyx_t_2;
10072     __pyx_t_2 = 0;
10073     goto __pyx_L6;
10074   }
10075   __pyx_L6:;
10076
10077   /* "cvcf.pyx":533
10078  *             headings = line[1:].split()
10079  * 
10080  *         for i,s in enumerate(self._required):             # <<<<<<<<<<<<<<
10081  * 
10082  *             if len(headings)<=i or headings[i] != s:
10083  */
10084   __Pyx_INCREF(__pyx_int_0);
10085   __pyx_t_2 = __pyx_int_0;
10086   __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___required); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10087   __Pyx_GOTREF(__pyx_t_7);
10088   if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
10089     __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1);
10090   } else {
10091     __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10092     __Pyx_GOTREF(__pyx_t_1);
10093   }
10094   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10095   for (;;) {
10096     if (likely(PyList_CheckExact(__pyx_t_1))) {
10097       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
10098       __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++;
10099     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
10100       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
10101       __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++;
10102     } else {
10103       __pyx_t_7 = PyIter_Next(__pyx_t_1);
10104       if (!__pyx_t_7) {
10105         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10106         break;
10107       }
10108       __Pyx_GOTREF(__pyx_t_7);
10109     }
10110     __Pyx_DECREF(__pyx_v_s);
10111     __pyx_v_s = __pyx_t_7;
10112     __pyx_t_7 = 0;
10113     __Pyx_INCREF(__pyx_t_2);
10114     __Pyx_DECREF(__pyx_v_i);
10115     __pyx_v_i = __pyx_t_2;
10116     __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10117     __Pyx_GOTREF(__pyx_t_7);
10118     __Pyx_DECREF(__pyx_t_2);
10119     __pyx_t_2 = __pyx_t_7;
10120     __pyx_t_7 = 0;
10121
10122     /* "cvcf.pyx":535
10123  *         for i,s in enumerate(self._required):
10124  * 
10125  *             if len(headings)<=i or headings[i] != s:             # <<<<<<<<<<<<<<
10126  * 
10127  *                 if len(headings) <= i:
10128  */
10129     __pyx_t_8 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10130     __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10131     __Pyx_GOTREF(__pyx_t_7);
10132     __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10133     __Pyx_GOTREF(__pyx_t_9);
10134     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10135     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10136     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10137     if (!__pyx_t_6) {
10138       __pyx_t_9 = PyObject_GetItem(__pyx_v_headings, __pyx_v_i); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10139       __Pyx_GOTREF(__pyx_t_9);
10140       __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_v_s, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10141       __Pyx_GOTREF(__pyx_t_7);
10142       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10143       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10144       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10145       __pyx_t_5 = __pyx_t_3;
10146     } else {
10147       __pyx_t_5 = __pyx_t_6;
10148     }
10149     if (__pyx_t_5) {
10150
10151       /* "cvcf.pyx":537
10152  *             if len(headings)<=i or headings[i] != s:
10153  * 
10154  *                 if len(headings) <= i:             # <<<<<<<<<<<<<<
10155  *                     err = "(%sth entry not found)" % (i+1)
10156  *                 else:
10157  */
10158       __pyx_t_8 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10159       __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10160       __Pyx_GOTREF(__pyx_t_7);
10161       __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10162       __Pyx_GOTREF(__pyx_t_9);
10163       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10164       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10165       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10166       if (__pyx_t_5) {
10167
10168         /* "cvcf.pyx":538
10169  * 
10170  *                 if len(headings) <= i:
10171  *                     err = "(%sth entry not found)" % (i+1)             # <<<<<<<<<<<<<<
10172  *                 else:
10173  *                     err = "(found %s, expected %s)" % (headings[i],s)
10174  */
10175         __pyx_t_9 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10176         __Pyx_GOTREF(__pyx_t_9);
10177         __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_88), __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10178         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
10179         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10180         __Pyx_DECREF(__pyx_v_err);
10181         __pyx_v_err = ((PyObject *)__pyx_t_7);
10182         __pyx_t_7 = 0;
10183         goto __pyx_L10;
10184       }
10185       /*else*/ {
10186
10187         /* "cvcf.pyx":540
10188  *                     err = "(%sth entry not found)" % (i+1)
10189  *                 else:
10190  *                     err = "(found %s, expected %s)" % (headings[i],s)             # <<<<<<<<<<<<<<
10191  * 
10192  *                 #self.error(line,self.BADLY_FORMATTED_HEADING,err)
10193  */
10194         __pyx_t_7 = PyObject_GetItem(__pyx_v_headings, __pyx_v_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10195         __Pyx_GOTREF(__pyx_t_7);
10196         __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10197         __Pyx_GOTREF(((PyObject *)__pyx_t_9));
10198         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
10199         __Pyx_GIVEREF(__pyx_t_7);
10200         __Pyx_INCREF(__pyx_v_s);
10201         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_s);
10202         __Pyx_GIVEREF(__pyx_v_s);
10203         __pyx_t_7 = 0;
10204         __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_89), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10205         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
10206         __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
10207         __Pyx_DECREF(__pyx_v_err);
10208         __pyx_v_err = ((PyObject *)__pyx_t_7);
10209         __pyx_t_7 = 0;
10210       }
10211       __pyx_L10:;
10212
10213       /* "cvcf.pyx":545
10214  * 
10215  *                 # allow FORMAT column to be absent
10216  *                 if len(headings) == 8:             # <<<<<<<<<<<<<<
10217  *                     headings.append("FORMAT")
10218  *                 else:
10219  */
10220       __pyx_t_8 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10221       __pyx_t_5 = (__pyx_t_8 == 8);
10222       if (__pyx_t_5) {
10223
10224         /* "cvcf.pyx":546
10225  *                 # allow FORMAT column to be absent
10226  *                 if len(headings) == 8:
10227  *                     headings.append("FORMAT")             # <<<<<<<<<<<<<<
10228  *                 else:
10229  *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)
10230  */
10231         __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_headings, ((PyObject *)__pyx_n_s__FORMAT)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10232         __Pyx_GOTREF(__pyx_t_7);
10233         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10234         goto __pyx_L11;
10235       }
10236       /*else*/ {
10237
10238         /* "cvcf.pyx":548
10239  *                     headings.append("FORMAT")
10240  *                 else:
10241  *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)             # <<<<<<<<<<<<<<
10242  * 
10243  *         self._samples = headings[9:]
10244  */
10245         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10246         __Pyx_GOTREF(__pyx_t_7);
10247         __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_90); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10248         __Pyx_GOTREF(__pyx_t_9);
10249         __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10250         __Pyx_GOTREF(((PyObject *)__pyx_t_10));
10251         __Pyx_INCREF(__pyx_v_line);
10252         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
10253         __Pyx_GIVEREF(__pyx_v_line);
10254         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
10255         __Pyx_GIVEREF(__pyx_t_9);
10256         __Pyx_INCREF(__pyx_v_err);
10257         PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_err);
10258         __Pyx_GIVEREF(__pyx_v_err);
10259         __pyx_t_9 = 0;
10260         __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10261         __Pyx_GOTREF(__pyx_t_9);
10262         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10263         __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
10264         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10265       }
10266       __pyx_L11:;
10267       goto __pyx_L9;
10268     }
10269     __pyx_L9:;
10270   }
10271   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10272   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10273
10274   /* "cvcf.pyx":550
10275  *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)
10276  * 
10277  *         self._samples = headings[9:]             # <<<<<<<<<<<<<<
10278  *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
10279  * 
10280  */
10281   __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_headings, 9, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10282   __Pyx_GOTREF(__pyx_t_2);
10283   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___samples, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10284   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10285
10286   /* "cvcf.pyx":551
10287  * 
10288  *         self._samples = headings[9:]
10289  *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )             # <<<<<<<<<<<<<<
10290  * 
10291  *     def write_heading( self, stream ):
10292  */
10293   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10294   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
10295   __Pyx_INCREF(__pyx_int_0);
10296   __pyx_t_1 = __pyx_int_0;
10297   __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10298   __Pyx_GOTREF(__pyx_t_9);
10299   if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
10300     __pyx_t_4 = 0; __pyx_t_10 = __pyx_t_9; __Pyx_INCREF(__pyx_t_10);
10301   } else {
10302     __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10303     __Pyx_GOTREF(__pyx_t_10);
10304   }
10305   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10306   for (;;) {
10307     if (likely(PyList_CheckExact(__pyx_t_10))) {
10308       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_10)) break;
10309       __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++;
10310     } else if (likely(PyTuple_CheckExact(__pyx_t_10))) {
10311       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
10312       __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++;
10313     } else {
10314       __pyx_t_9 = PyIter_Next(__pyx_t_10);
10315       if (!__pyx_t_9) {
10316         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10317         break;
10318       }
10319       __Pyx_GOTREF(__pyx_t_9);
10320     }
10321     __Pyx_DECREF(__pyx_v_y);
10322     __pyx_v_y = __pyx_t_9;
10323     __pyx_t_9 = 0;
10324     __Pyx_INCREF(__pyx_t_1);
10325     __Pyx_DECREF(__pyx_v_x);
10326     __pyx_v_x = __pyx_t_1;
10327     __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10328     __Pyx_GOTREF(__pyx_t_9);
10329     __Pyx_DECREF(__pyx_t_1);
10330     __pyx_t_1 = __pyx_t_9;
10331     __pyx_t_9 = 0;
10332     __pyx_t_9 = PyNumber_Add(__pyx_v_x, __pyx_int_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10333     __Pyx_GOTREF(__pyx_t_9);
10334     __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10335     __Pyx_GOTREF(((PyObject *)__pyx_t_7));
10336     __Pyx_INCREF(__pyx_v_y);
10337     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_y);
10338     __Pyx_GIVEREF(__pyx_v_y);
10339     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
10340     __Pyx_GIVEREF(__pyx_t_9);
10341     __pyx_t_9 = 0;
10342     if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10343     __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
10344   }
10345   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10346   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10347   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10348   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10349   __Pyx_INCREF(((PyObject *)__pyx_t_2));
10350   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
10351   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
10352   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
10353   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10354   __Pyx_GOTREF(__pyx_t_2);
10355   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
10356   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___sample2column, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10357   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10358
10359   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10360   goto __pyx_L0;
10361   __pyx_L1_error:;
10362   __Pyx_XDECREF(__pyx_t_1);
10363   __Pyx_XDECREF(__pyx_t_2);
10364   __Pyx_XDECREF(__pyx_t_7);
10365   __Pyx_XDECREF(__pyx_t_9);
10366   __Pyx_XDECREF(__pyx_t_10);
10367   __Pyx_AddTraceback("cvcf.VCF.parse_heading");
10368   __pyx_r = NULL;
10369   __pyx_L0:;
10370   __Pyx_DECREF(__pyx_v_headings);
10371   __Pyx_DECREF(__pyx_v_i);
10372   __Pyx_DECREF(__pyx_v_s);
10373   __Pyx_DECREF(__pyx_v_err);
10374   __Pyx_DECREF(__pyx_v_x);
10375   __Pyx_DECREF(__pyx_v_y);
10376   __Pyx_XGIVEREF(__pyx_r);
10377   __Pyx_RefNannyFinishContext();
10378   return __pyx_r;
10379 }
10380
10381 /* "cvcf.pyx":553
10382  *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
10383  * 
10384  *     def write_heading( self, stream ):             # <<<<<<<<<<<<<<
10385  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
10386  * 
10387  */
10388
10389 static PyObject *__pyx_pf_4cvcf_3VCF_11write_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10390 static PyMethodDef __pyx_mdef_4cvcf_3VCF_11write_heading = {__Pyx_NAMESTR("write_heading"), (PyCFunction)__pyx_pf_4cvcf_3VCF_11write_heading, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
10391 static PyObject *__pyx_pf_4cvcf_3VCF_11write_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10392   PyObject *__pyx_v_self = 0;
10393   PyObject *__pyx_v_stream = 0;
10394   PyObject *__pyx_r = NULL;
10395   PyObject *__pyx_t_1 = NULL;
10396   PyObject *__pyx_t_2 = NULL;
10397   PyObject *__pyx_t_3 = NULL;
10398   PyObject *__pyx_t_4 = NULL;
10399   PyObject *__pyx_t_5 = NULL;
10400   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
10401   __Pyx_RefNannySetupContext("write_heading");
10402   __pyx_self = __pyx_self;
10403   if (unlikely(__pyx_kwds)) {
10404     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
10405     PyObject* values[2] = {0,0};
10406     switch (PyTuple_GET_SIZE(__pyx_args)) {
10407       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10408       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10409       case  0: break;
10410       default: goto __pyx_L5_argtuple_error;
10411     }
10412     switch (PyTuple_GET_SIZE(__pyx_args)) {
10413       case  0:
10414       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
10415       if (likely(values[0])) kw_args--;
10416       else goto __pyx_L5_argtuple_error;
10417       case  1:
10418       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
10419       if (likely(values[1])) kw_args--;
10420       else {
10421         __Pyx_RaiseArgtupleInvalid("write_heading", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10422       }
10423     }
10424     if (unlikely(kw_args > 0)) {
10425       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "write_heading") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10426     }
10427     __pyx_v_self = values[0];
10428     __pyx_v_stream = values[1];
10429   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10430     goto __pyx_L5_argtuple_error;
10431   } else {
10432     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
10433     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
10434   }
10435   goto __pyx_L4_argument_unpacking_done;
10436   __pyx_L5_argtuple_error:;
10437   __Pyx_RaiseArgtupleInvalid("write_heading", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10438   __pyx_L3_error:;
10439   __Pyx_AddTraceback("cvcf.VCF.write_heading");
10440   __Pyx_RefNannyFinishContext();
10441   return NULL;
10442   __pyx_L4_argument_unpacking_done:;
10443
10444   /* "cvcf.pyx":554
10445  * 
10446  *     def write_heading( self, stream ):
10447  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")             # <<<<<<<<<<<<<<
10448  * 
10449  *     def convertGT(self, GTstring):
10450  */
10451   __pyx_t_1 = PyObject_GetAttr(__pyx_v_stream, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10452   __Pyx_GOTREF(__pyx_t_1);
10453   __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_85), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10454   __Pyx_GOTREF(__pyx_t_2);
10455   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___required); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10456   __Pyx_GOTREF(__pyx_t_3);
10457   __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10458   __Pyx_GOTREF(__pyx_t_4);
10459   __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10460   __Pyx_GOTREF(__pyx_t_5);
10461   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10462   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10463   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10464   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
10465   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10466   __Pyx_GIVEREF(__pyx_t_5);
10467   __pyx_t_5 = 0;
10468   __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10469   __Pyx_GOTREF(__pyx_t_5);
10470   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10471   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
10472   __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_82), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10473   __Pyx_GOTREF(__pyx_t_4);
10474   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10475   __pyx_t_5 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_91)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10476   __Pyx_GOTREF(__pyx_t_5);
10477   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10478   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10479   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
10480   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10481   __Pyx_GIVEREF(__pyx_t_5);
10482   __pyx_t_5 = 0;
10483   __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10484   __Pyx_GOTREF(__pyx_t_5);
10485   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10486   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
10487   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10488
10489   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10490   goto __pyx_L0;
10491   __pyx_L1_error:;
10492   __Pyx_XDECREF(__pyx_t_1);
10493   __Pyx_XDECREF(__pyx_t_2);
10494   __Pyx_XDECREF(__pyx_t_3);
10495   __Pyx_XDECREF(__pyx_t_4);
10496   __Pyx_XDECREF(__pyx_t_5);
10497   __Pyx_AddTraceback("cvcf.VCF.write_heading");
10498   __pyx_r = NULL;
10499   __pyx_L0:;
10500   __Pyx_XGIVEREF(__pyx_r);
10501   __Pyx_RefNannyFinishContext();
10502   return __pyx_r;
10503 }
10504
10505 /* "cvcf.pyx":556
10506  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
10507  * 
10508  *     def convertGT(self, GTstring):             # <<<<<<<<<<<<<<
10509  *         if GTstring == ".": return ["."]
10510  *         try:
10511  */
10512
10513 static PyObject *__pyx_pf_4cvcf_3VCF_12convertGT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10514 static PyMethodDef __pyx_mdef_4cvcf_3VCF_12convertGT = {__Pyx_NAMESTR("convertGT"), (PyCFunction)__pyx_pf_4cvcf_3VCF_12convertGT, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
10515 static PyObject *__pyx_pf_4cvcf_3VCF_12convertGT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10516   PyObject *__pyx_v_self = 0;
10517   PyObject *__pyx_v_GTstring = 0;
10518   PyObject *__pyx_v_gts;
10519   PyObject *__pyx_r = NULL;
10520   PyObject *__pyx_t_1 = NULL;
10521   int __pyx_t_2;
10522   PyObject *__pyx_t_3 = NULL;
10523   PyObject *__pyx_t_4 = NULL;
10524   Py_ssize_t __pyx_t_5;
10525   int __pyx_t_6;
10526   int __pyx_t_7;
10527   Py_ssize_t __pyx_t_8;
10528   PyObject *__pyx_t_9 = NULL;
10529   int __pyx_t_10;
10530   PyObject *__pyx_t_11 = NULL;
10531   PyObject *__pyx_t_12 = NULL;
10532   PyObject *__pyx_t_13 = NULL;
10533   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__GTstring,0};
10534   __Pyx_RefNannySetupContext("convertGT");
10535   __pyx_self = __pyx_self;
10536   if (unlikely(__pyx_kwds)) {
10537     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
10538     PyObject* values[2] = {0,0};
10539     switch (PyTuple_GET_SIZE(__pyx_args)) {
10540       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10541       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10542       case  0: break;
10543       default: goto __pyx_L5_argtuple_error;
10544     }
10545     switch (PyTuple_GET_SIZE(__pyx_args)) {
10546       case  0:
10547       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
10548       if (likely(values[0])) kw_args--;
10549       else goto __pyx_L5_argtuple_error;
10550       case  1:
10551       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__GTstring);
10552       if (likely(values[1])) kw_args--;
10553       else {
10554         __Pyx_RaiseArgtupleInvalid("convertGT", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10555       }
10556     }
10557     if (unlikely(kw_args > 0)) {
10558       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "convertGT") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10559     }
10560     __pyx_v_self = values[0];
10561     __pyx_v_GTstring = values[1];
10562   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10563     goto __pyx_L5_argtuple_error;
10564   } else {
10565     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
10566     __pyx_v_GTstring = PyTuple_GET_ITEM(__pyx_args, 1);
10567   }
10568   goto __pyx_L4_argument_unpacking_done;
10569   __pyx_L5_argtuple_error:;
10570   __Pyx_RaiseArgtupleInvalid("convertGT", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10571   __pyx_L3_error:;
10572   __Pyx_AddTraceback("cvcf.VCF.convertGT");
10573   __Pyx_RefNannyFinishContext();
10574   return NULL;
10575   __pyx_L4_argument_unpacking_done:;
10576   __pyx_v_gts = Py_None; __Pyx_INCREF(Py_None);
10577
10578   /* "cvcf.pyx":557
10579  * 
10580  *     def convertGT(self, GTstring):
10581  *         if GTstring == ".": return ["."]             # <<<<<<<<<<<<<<
10582  *         try:
10583  *             gts = gtsRegEx.split(GTstring)
10584  */
10585   __pyx_t_1 = PyObject_RichCompare(__pyx_v_GTstring, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10586   __Pyx_GOTREF(__pyx_t_1);
10587   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10588   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10589   if (__pyx_t_2) {
10590     __Pyx_XDECREF(__pyx_r);
10591     __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10592     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10593     __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
10594     PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_9));
10595     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
10596     __pyx_r = ((PyObject *)__pyx_t_1);
10597     __pyx_t_1 = 0;
10598     goto __pyx_L0;
10599     goto __pyx_L6;
10600   }
10601   __pyx_L6:;
10602
10603   /* "cvcf.pyx":558
10604  *     def convertGT(self, GTstring):
10605  *         if GTstring == ".": return ["."]
10606  *         try:             # <<<<<<<<<<<<<<
10607  *             gts = gtsRegEx.split(GTstring)
10608  *             if len(gts) == 1: return [int(gts[0])]
10609  */
10610   {
10611     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
10612     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
10613     __Pyx_XGOTREF(__pyx_save_exc_type);
10614     __Pyx_XGOTREF(__pyx_save_exc_value);
10615     __Pyx_XGOTREF(__pyx_save_exc_tb);
10616     /*try:*/ {
10617
10618       /* "cvcf.pyx":559
10619  *         if GTstring == ".": return ["."]
10620  *         try:
10621  *             gts = gtsRegEx.split(GTstring)             # <<<<<<<<<<<<<<
10622  *             if len(gts) == 1: return [int(gts[0])]
10623  *             if len(gts) != 2: raise ValueError()
10624  */
10625       __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__gtsRegEx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10626       __Pyx_GOTREF(__pyx_t_1);
10627       __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10628       __Pyx_GOTREF(__pyx_t_3);
10629       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10630       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10631       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10632       __Pyx_INCREF(__pyx_v_GTstring);
10633       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_GTstring);
10634       __Pyx_GIVEREF(__pyx_v_GTstring);
10635       __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10636       __Pyx_GOTREF(__pyx_t_4);
10637       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10638       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
10639       __Pyx_DECREF(__pyx_v_gts);
10640       __pyx_v_gts = __pyx_t_4;
10641       __pyx_t_4 = 0;
10642
10643       /* "cvcf.pyx":560
10644  *         try:
10645  *             gts = gtsRegEx.split(GTstring)
10646  *             if len(gts) == 1: return [int(gts[0])]             # <<<<<<<<<<<<<<
10647  *             if len(gts) != 2: raise ValueError()
10648  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
10649  */
10650       __pyx_t_5 = PyObject_Length(__pyx_v_gts); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10651       __pyx_t_2 = (__pyx_t_5 == 1);
10652       if (__pyx_t_2) {
10653         __Pyx_XDECREF(__pyx_r);
10654         __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_gts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10655         __Pyx_GOTREF(__pyx_t_4);
10656         __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10657         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10658         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
10659         __Pyx_GIVEREF(__pyx_t_4);
10660         __pyx_t_4 = 0;
10661         __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10662         __Pyx_GOTREF(__pyx_t_4);
10663         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
10664         __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10665         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10666         PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
10667         __Pyx_GIVEREF(__pyx_t_4);
10668         __pyx_t_4 = 0;
10669         __pyx_r = ((PyObject *)__pyx_t_1);
10670         __pyx_t_1 = 0;
10671         goto __pyx_L11_try_return;
10672         goto __pyx_L15;
10673       }
10674       __pyx_L15:;
10675
10676       /* "cvcf.pyx":561
10677  *             gts = gtsRegEx.split(GTstring)
10678  *             if len(gts) == 1: return [int(gts[0])]
10679  *             if len(gts) != 2: raise ValueError()             # <<<<<<<<<<<<<<
10680  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
10681  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
10682  */
10683       __pyx_t_5 = PyObject_Length(__pyx_v_gts); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10684       __pyx_t_2 = (__pyx_t_5 != 2);
10685       if (__pyx_t_2) {
10686         __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10687         __Pyx_GOTREF(__pyx_t_1);
10688         __Pyx_Raise(__pyx_t_1, 0, 0);
10689         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10690         {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10691         goto __pyx_L16;
10692       }
10693       __pyx_L16:;
10694
10695       /* "cvcf.pyx":562
10696  *             if len(gts) == 1: return [int(gts[0])]
10697  *             if len(gts) != 2: raise ValueError()
10698  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]             # <<<<<<<<<<<<<<
10699  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
10700  *         except ValueError:
10701  */
10702       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_gts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10703       __Pyx_GOTREF(__pyx_t_1);
10704       __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10705       __Pyx_GOTREF(__pyx_t_4);
10706       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10707       __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10708       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10709       if (__pyx_t_2) {
10710         __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_gts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10711         __Pyx_GOTREF(__pyx_t_4);
10712         __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10713         __Pyx_GOTREF(__pyx_t_1);
10714         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10715         __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10716         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10717         __pyx_t_7 = __pyx_t_6;
10718       } else {
10719         __pyx_t_7 = __pyx_t_2;
10720       }
10721       if (__pyx_t_7) {
10722         __Pyx_XDECREF(__pyx_r);
10723         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_gts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10724         __Pyx_GOTREF(__pyx_t_1);
10725         __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_gts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10726         __Pyx_GOTREF(__pyx_t_4);
10727         __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10728         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10729         __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_gts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10730         __Pyx_GOTREF(__pyx_t_4);
10731         __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10732         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10733         __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_GTstring, __pyx_t_5, (-__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10734         __Pyx_GOTREF(__pyx_t_4);
10735         __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_gts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10736         __Pyx_GOTREF(__pyx_t_3);
10737         __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10738         __Pyx_GOTREF(((PyObject *)__pyx_t_9));
10739         PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
10740         __Pyx_GIVEREF(__pyx_t_1);
10741         PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_4);
10742         __Pyx_GIVEREF(__pyx_t_4);
10743         PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
10744         __Pyx_GIVEREF(__pyx_t_3);
10745         __pyx_t_1 = 0;
10746         __pyx_t_4 = 0;
10747         __pyx_t_3 = 0;
10748         __pyx_r = ((PyObject *)__pyx_t_9);
10749         __pyx_t_9 = 0;
10750         goto __pyx_L11_try_return;
10751         goto __pyx_L17;
10752       }
10753       __pyx_L17:;
10754
10755       /* "cvcf.pyx":563
10756  *             if len(gts) != 2: raise ValueError()
10757  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
10758  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]             # <<<<<<<<<<<<<<
10759  *         except ValueError:
10760  *             self.error(self._line,self.BAD_GENOTYPE,GTstring)
10761  */
10762       __Pyx_XDECREF(__pyx_r);
10763       __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_gts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10764       __Pyx_GOTREF(__pyx_t_9);
10765       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10766       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
10767       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
10768       __Pyx_GIVEREF(__pyx_t_9);
10769       __pyx_t_9 = 0;
10770       __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10771       __Pyx_GOTREF(__pyx_t_9);
10772       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
10773       __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_gts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10774       __Pyx_GOTREF(__pyx_t_3);
10775       __pyx_t_8 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10776       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10777       __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_gts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10778       __Pyx_GOTREF(__pyx_t_3);
10779       __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10780       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10781       __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_GTstring, __pyx_t_8, (-__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10782       __Pyx_GOTREF(__pyx_t_3);
10783       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_gts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10784       __Pyx_GOTREF(__pyx_t_4);
10785       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10786       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10787       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
10788       __Pyx_GIVEREF(__pyx_t_4);
10789       __pyx_t_4 = 0;
10790       __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10791       __Pyx_GOTREF(__pyx_t_4);
10792       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
10793       __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10794       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10795       PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
10796       __Pyx_GIVEREF(__pyx_t_9);
10797       PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
10798       __Pyx_GIVEREF(__pyx_t_3);
10799       PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
10800       __Pyx_GIVEREF(__pyx_t_4);
10801       __pyx_t_9 = 0;
10802       __pyx_t_3 = 0;
10803       __pyx_t_4 = 0;
10804       __pyx_r = ((PyObject *)__pyx_t_1);
10805       __pyx_t_1 = 0;
10806       goto __pyx_L11_try_return;
10807     }
10808     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
10809     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
10810     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
10811     goto __pyx_L14_try_end;
10812     __pyx_L11_try_return:;
10813     __Pyx_XGIVEREF(__pyx_save_exc_type);
10814     __Pyx_XGIVEREF(__pyx_save_exc_value);
10815     __Pyx_XGIVEREF(__pyx_save_exc_tb);
10816     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
10817     goto __pyx_L0;
10818     __pyx_L7_error:;
10819     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10820     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10821     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10822     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10823
10824     /* "cvcf.pyx":564
10825  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
10826  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
10827  *         except ValueError:             # <<<<<<<<<<<<<<
10828  *             self.error(self._line,self.BAD_GENOTYPE,GTstring)
10829  *             return [".","|","."]
10830  */
10831     __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
10832     if (__pyx_t_10) {
10833       __Pyx_AddTraceback("cvcf.VCF.convertGT");
10834       if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
10835       __Pyx_GOTREF(__pyx_t_1);
10836       __Pyx_GOTREF(__pyx_t_4);
10837       __Pyx_GOTREF(__pyx_t_3);
10838
10839       /* "cvcf.pyx":565
10840  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
10841  *         except ValueError:
10842  *             self.error(self._line,self.BAD_GENOTYPE,GTstring)             # <<<<<<<<<<<<<<
10843  *             return [".","|","."]
10844  * 
10845  */
10846       __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
10847       __Pyx_GOTREF(__pyx_t_9);
10848       __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___line); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
10849       __Pyx_GOTREF(__pyx_t_11);
10850       __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__BAD_GENOTYPE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
10851       __Pyx_GOTREF(__pyx_t_12);
10852       __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
10853       __Pyx_GOTREF(((PyObject *)__pyx_t_13));
10854       PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11);
10855       __Pyx_GIVEREF(__pyx_t_11);
10856       PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12);
10857       __Pyx_GIVEREF(__pyx_t_12);
10858       __Pyx_INCREF(__pyx_v_GTstring);
10859       PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_GTstring);
10860       __Pyx_GIVEREF(__pyx_v_GTstring);
10861       __pyx_t_11 = 0;
10862       __pyx_t_12 = 0;
10863       __pyx_t_12 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
10864       __Pyx_GOTREF(__pyx_t_12);
10865       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10866       __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
10867       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10868
10869       /* "cvcf.pyx":566
10870  *         except ValueError:
10871  *             self.error(self._line,self.BAD_GENOTYPE,GTstring)
10872  *             return [".","|","."]             # <<<<<<<<<<<<<<
10873  * 
10874  * 
10875  */
10876       __Pyx_XDECREF(__pyx_r);
10877       __pyx_t_12 = PyList_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
10878       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
10879       __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
10880       PyList_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_kp_s_9));
10881       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
10882       __Pyx_INCREF(((PyObject *)__pyx_kp_s_92));
10883       PyList_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_kp_s_92));
10884       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_92));
10885       __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
10886       PyList_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_kp_s_9));
10887       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
10888       __pyx_r = ((PyObject *)__pyx_t_12);
10889       __pyx_t_12 = 0;
10890       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10891       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10892       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10893       goto __pyx_L10_except_return;
10894       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10895       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10896       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10897       goto __pyx_L8_exception_handled;
10898     }
10899     __pyx_L9_except_error:;
10900     __Pyx_XGIVEREF(__pyx_save_exc_type);
10901     __Pyx_XGIVEREF(__pyx_save_exc_value);
10902     __Pyx_XGIVEREF(__pyx_save_exc_tb);
10903     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
10904     goto __pyx_L1_error;
10905     __pyx_L10_except_return:;
10906     __Pyx_XGIVEREF(__pyx_save_exc_type);
10907     __Pyx_XGIVEREF(__pyx_save_exc_value);
10908     __Pyx_XGIVEREF(__pyx_save_exc_tb);
10909     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
10910     goto __pyx_L0;
10911     __pyx_L8_exception_handled:;
10912     __Pyx_XGIVEREF(__pyx_save_exc_type);
10913     __Pyx_XGIVEREF(__pyx_save_exc_value);
10914     __Pyx_XGIVEREF(__pyx_save_exc_tb);
10915     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
10916     __pyx_L14_try_end:;
10917   }
10918
10919   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10920   goto __pyx_L0;
10921   __pyx_L1_error:;
10922   __Pyx_XDECREF(__pyx_t_1);
10923   __Pyx_XDECREF(__pyx_t_3);
10924   __Pyx_XDECREF(__pyx_t_4);
10925   __Pyx_XDECREF(__pyx_t_9);
10926   __Pyx_XDECREF(__pyx_t_11);
10927   __Pyx_XDECREF(__pyx_t_12);
10928   __Pyx_XDECREF(__pyx_t_13);
10929   __Pyx_AddTraceback("cvcf.VCF.convertGT");
10930   __pyx_r = NULL;
10931   __pyx_L0:;
10932   __Pyx_DECREF(__pyx_v_gts);
10933   __Pyx_XGIVEREF(__pyx_r);
10934   __Pyx_RefNannyFinishContext();
10935   return __pyx_r;
10936 }
10937
10938 /* "cvcf.pyx":569
10939  * 
10940  * 
10941  *     def convertGTback(self, GTdata):             # <<<<<<<<<<<<<<
10942  *         return ''.join(map(str,GTdata))
10943  * 
10944  */
10945
10946 static PyObject *__pyx_pf_4cvcf_3VCF_13convertGTback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10947 static PyMethodDef __pyx_mdef_4cvcf_3VCF_13convertGTback = {__Pyx_NAMESTR("convertGTback"), (PyCFunction)__pyx_pf_4cvcf_3VCF_13convertGTback, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
10948 static PyObject *__pyx_pf_4cvcf_3VCF_13convertGTback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10949   PyObject *__pyx_v_self = 0;
10950   PyObject *__pyx_v_GTdata = 0;
10951   PyObject *__pyx_r = NULL;
10952   PyObject *__pyx_t_1 = NULL;
10953   PyObject *__pyx_t_2 = NULL;
10954   PyObject *__pyx_t_3 = NULL;
10955   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__GTdata,0};
10956   __Pyx_RefNannySetupContext("convertGTback");
10957   __pyx_self = __pyx_self;
10958   if (unlikely(__pyx_kwds)) {
10959     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
10960     PyObject* values[2] = {0,0};
10961     switch (PyTuple_GET_SIZE(__pyx_args)) {
10962       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10963       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10964       case  0: break;
10965       default: goto __pyx_L5_argtuple_error;
10966     }
10967     switch (PyTuple_GET_SIZE(__pyx_args)) {
10968       case  0:
10969       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
10970       if (likely(values[0])) kw_args--;
10971       else goto __pyx_L5_argtuple_error;
10972       case  1:
10973       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__GTdata);
10974       if (likely(values[1])) kw_args--;
10975       else {
10976         __Pyx_RaiseArgtupleInvalid("convertGTback", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10977       }
10978     }
10979     if (unlikely(kw_args > 0)) {
10980       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "convertGTback") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10981     }
10982     __pyx_v_self = values[0];
10983     __pyx_v_GTdata = values[1];
10984   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10985     goto __pyx_L5_argtuple_error;
10986   } else {
10987     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
10988     __pyx_v_GTdata = PyTuple_GET_ITEM(__pyx_args, 1);
10989   }
10990   goto __pyx_L4_argument_unpacking_done;
10991   __pyx_L5_argtuple_error:;
10992   __Pyx_RaiseArgtupleInvalid("convertGTback", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10993   __pyx_L3_error:;
10994   __Pyx_AddTraceback("cvcf.VCF.convertGTback");
10995   __Pyx_RefNannyFinishContext();
10996   return NULL;
10997   __pyx_L4_argument_unpacking_done:;
10998
10999   /* "cvcf.pyx":570
11000  * 
11001  *     def convertGTback(self, GTdata):
11002  *         return ''.join(map(str,GTdata))             # <<<<<<<<<<<<<<
11003  * 
11004  *     def parse_formatdata( self, key, value, formatdict, line ):
11005  */
11006   __Pyx_XDECREF(__pyx_r);
11007   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11008   __Pyx_GOTREF(__pyx_t_1);
11009   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11010   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
11011   __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
11012   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
11013   __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
11014   __Pyx_INCREF(__pyx_v_GTdata);
11015   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_GTdata);
11016   __Pyx_GIVEREF(__pyx_v_GTdata);
11017   __pyx_t_3 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11018   __Pyx_GOTREF(__pyx_t_3);
11019   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
11020   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11021   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
11022   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
11023   __Pyx_GIVEREF(__pyx_t_3);
11024   __pyx_t_3 = 0;
11025   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11026   __Pyx_GOTREF(__pyx_t_3);
11027   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11028   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
11029   __pyx_r = __pyx_t_3;
11030   __pyx_t_3 = 0;
11031   goto __pyx_L0;
11032
11033   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11034   goto __pyx_L0;
11035   __pyx_L1_error:;
11036   __Pyx_XDECREF(__pyx_t_1);
11037   __Pyx_XDECREF(__pyx_t_2);
11038   __Pyx_XDECREF(__pyx_t_3);
11039   __Pyx_AddTraceback("cvcf.VCF.convertGTback");
11040   __pyx_r = NULL;
11041   __pyx_L0:;
11042   __Pyx_XGIVEREF(__pyx_r);
11043   __Pyx_RefNannyFinishContext();
11044   return __pyx_r;
11045 }
11046
11047 /* "cvcf.pyx":572
11048  *         return ''.join(map(str,GTdata))
11049  * 
11050  *     def parse_formatdata( self, key, value, formatdict, line ):             # <<<<<<<<<<<<<<
11051  *         # To do: check that the right number of values is present
11052  *         f = formatdict.get(key,None)
11053  */
11054
11055 static PyObject *__pyx_pf_4cvcf_3VCF_14parse_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11056 static PyMethodDef __pyx_mdef_4cvcf_3VCF_14parse_formatdata = {__Pyx_NAMESTR("parse_formatdata"), (PyCFunction)__pyx_pf_4cvcf_3VCF_14parse_formatdata, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
11057 static PyObject *__pyx_pf_4cvcf_3VCF_14parse_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11058   PyObject *__pyx_v_self = 0;
11059   PyObject *__pyx_v_key = 0;
11060   PyObject *__pyx_v_value = 0;
11061   PyObject *__pyx_v_formatdict = 0;
11062   PyObject *__pyx_v_line = 0;
11063   PyObject *__pyx_v_f;
11064   PyObject *__pyx_v_values;
11065   PyObject *__pyx_v_idx;
11066   PyObject *__pyx_v_v;
11067   PyObject *__pyx_r = NULL;
11068   PyObject *__pyx_t_1 = NULL;
11069   PyObject *__pyx_t_2 = NULL;
11070   PyObject *__pyx_t_3 = NULL;
11071   int __pyx_t_4;
11072   int __pyx_t_5;
11073   int __pyx_t_6;
11074   Py_ssize_t __pyx_t_7;
11075   int __pyx_t_8;
11076   PyObject *__pyx_t_9 = NULL;
11077   PyObject *__pyx_t_10 = NULL;
11078   PyObject *__pyx_t_11 = NULL;
11079   PyObject *__pyx_t_12 = NULL;
11080   PyObject *__pyx_t_13 = NULL;
11081   Py_ssize_t __pyx_t_14;
11082   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__key,&__pyx_n_s__value,&__pyx_n_s__formatdict,&__pyx_n_s__line,0};
11083   __Pyx_RefNannySetupContext("parse_formatdata");
11084   __pyx_self = __pyx_self;
11085   if (unlikely(__pyx_kwds)) {
11086     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
11087     PyObject* values[5] = {0,0,0,0,0};
11088     switch (PyTuple_GET_SIZE(__pyx_args)) {
11089       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11090       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11091       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11092       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11093       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11094       case  0: break;
11095       default: goto __pyx_L5_argtuple_error;
11096     }
11097     switch (PyTuple_GET_SIZE(__pyx_args)) {
11098       case  0:
11099       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
11100       if (likely(values[0])) kw_args--;
11101       else goto __pyx_L5_argtuple_error;
11102       case  1:
11103       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
11104       if (likely(values[1])) kw_args--;
11105       else {
11106         __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11107       }
11108       case  2:
11109       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
11110       if (likely(values[2])) kw_args--;
11111       else {
11112         __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11113       }
11114       case  3:
11115       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__formatdict);
11116       if (likely(values[3])) kw_args--;
11117       else {
11118         __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11119       }
11120       case  4:
11121       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
11122       if (likely(values[4])) kw_args--;
11123       else {
11124         __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11125       }
11126     }
11127     if (unlikely(kw_args > 0)) {
11128       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parse_formatdata") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11129     }
11130     __pyx_v_self = values[0];
11131     __pyx_v_key = values[1];
11132     __pyx_v_value = values[2];
11133     __pyx_v_formatdict = values[3];
11134     __pyx_v_line = values[4];
11135   } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
11136     goto __pyx_L5_argtuple_error;
11137   } else {
11138     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
11139     __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
11140     __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 2);
11141     __pyx_v_formatdict = PyTuple_GET_ITEM(__pyx_args, 3);
11142     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 4);
11143   }
11144   goto __pyx_L4_argument_unpacking_done;
11145   __pyx_L5_argtuple_error:;
11146   __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11147   __pyx_L3_error:;
11148   __Pyx_AddTraceback("cvcf.VCF.parse_formatdata");
11149   __Pyx_RefNannyFinishContext();
11150   return NULL;
11151   __pyx_L4_argument_unpacking_done:;
11152   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
11153   __pyx_v_values = Py_None; __Pyx_INCREF(Py_None);
11154   __pyx_v_idx = Py_None; __Pyx_INCREF(Py_None);
11155   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
11156
11157   /* "cvcf.pyx":574
11158  *     def parse_formatdata( self, key, value, formatdict, line ):
11159  *         # To do: check that the right number of values is present
11160  *         f = formatdict.get(key,None)             # <<<<<<<<<<<<<<
11161  *         if f == None:
11162  *             self._add_definition(formatdict, key, value, line )
11163  */
11164   __pyx_t_1 = PyObject_GetAttr(__pyx_v_formatdict, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11165   __Pyx_GOTREF(__pyx_t_1);
11166   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11167   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
11168   __Pyx_INCREF(__pyx_v_key);
11169   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
11170   __Pyx_GIVEREF(__pyx_v_key);
11171   __Pyx_INCREF(Py_None);
11172   PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
11173   __Pyx_GIVEREF(Py_None);
11174   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11175   __Pyx_GOTREF(__pyx_t_3);
11176   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11177   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
11178   __Pyx_DECREF(__pyx_v_f);
11179   __pyx_v_f = __pyx_t_3;
11180   __pyx_t_3 = 0;
11181
11182   /* "cvcf.pyx":575
11183  *         # To do: check that the right number of values is present
11184  *         f = formatdict.get(key,None)
11185  *         if f == None:             # <<<<<<<<<<<<<<
11186  *             self._add_definition(formatdict, key, value, line )
11187  *             f = formatdict[key]
11188  */
11189   __pyx_t_3 = PyObject_RichCompare(__pyx_v_f, Py_None, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11190   __Pyx_GOTREF(__pyx_t_3);
11191   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11192   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11193   if (__pyx_t_4) {
11194
11195     /* "cvcf.pyx":576
11196  *         f = formatdict.get(key,None)
11197  *         if f == None:
11198  *             self._add_definition(formatdict, key, value, line )             # <<<<<<<<<<<<<<
11199  *             f = formatdict[key]
11200  *         if f.type == "Flag":
11201  */
11202     __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___add_definition); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11203     __Pyx_GOTREF(__pyx_t_3);
11204     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11205     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
11206     __Pyx_INCREF(__pyx_v_formatdict);
11207     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_formatdict);
11208     __Pyx_GIVEREF(__pyx_v_formatdict);
11209     __Pyx_INCREF(__pyx_v_key);
11210     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key);
11211     __Pyx_GIVEREF(__pyx_v_key);
11212     __Pyx_INCREF(__pyx_v_value);
11213     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value);
11214     __Pyx_GIVEREF(__pyx_v_value);
11215     __Pyx_INCREF(__pyx_v_line);
11216     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_line);
11217     __Pyx_GIVEREF(__pyx_v_line);
11218     __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11219     __Pyx_GOTREF(__pyx_t_1);
11220     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11221     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
11222     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11223
11224     /* "cvcf.pyx":577
11225  *         if f == None:
11226  *             self._add_definition(formatdict, key, value, line )
11227  *             f = formatdict[key]             # <<<<<<<<<<<<<<
11228  *         if f.type == "Flag":
11229  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
11230  */
11231     __pyx_t_1 = PyObject_GetItem(__pyx_v_formatdict, __pyx_v_key); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11232     __Pyx_GOTREF(__pyx_t_1);
11233     __Pyx_DECREF(__pyx_v_f);
11234     __pyx_v_f = __pyx_t_1;
11235     __pyx_t_1 = 0;
11236     goto __pyx_L6;
11237   }
11238   __pyx_L6:;
11239
11240   /* "cvcf.pyx":578
11241  *             self._add_definition(formatdict, key, value, line )
11242  *             f = formatdict[key]
11243  *         if f.type == "Flag":             # <<<<<<<<<<<<<<
11244  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
11245  *             return []
11246  */
11247   __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11248   __Pyx_GOTREF(__pyx_t_1);
11249   __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__Flag), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11250   __Pyx_GOTREF(__pyx_t_2);
11251   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11252   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11253   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11254   if (__pyx_t_4) {
11255
11256     /* "cvcf.pyx":579
11257  *             f = formatdict[key]
11258  *         if f.type == "Flag":
11259  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)             # <<<<<<<<<<<<<<
11260  *             return []
11261  *         values = value.split(',')
11262  */
11263     __pyx_t_4 = (__pyx_v_value != Py_None);
11264     if (__pyx_t_4) {
11265       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11266       __Pyx_GOTREF(__pyx_t_2);
11267       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_93); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11268       __Pyx_GOTREF(__pyx_t_1);
11269       __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11270       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
11271       __Pyx_INCREF(__pyx_v_line);
11272       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_line);
11273       __Pyx_GIVEREF(__pyx_v_line);
11274       PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
11275       __Pyx_GIVEREF(__pyx_t_1);
11276       __pyx_t_1 = 0;
11277       __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11278       __Pyx_GOTREF(__pyx_t_1);
11279       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11280       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
11281       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11282       goto __pyx_L8;
11283     }
11284     __pyx_L8:;
11285
11286     /* "cvcf.pyx":580
11287  *         if f.type == "Flag":
11288  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
11289  *             return []             # <<<<<<<<<<<<<<
11290  *         values = value.split(',')
11291  *         # deal with trailing data in some early VCF files
11292  */
11293     __Pyx_XDECREF(__pyx_r);
11294     __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11295     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
11296     __pyx_r = ((PyObject *)__pyx_t_1);
11297     __pyx_t_1 = 0;
11298     goto __pyx_L0;
11299     goto __pyx_L7;
11300   }
11301   __pyx_L7:;
11302
11303   /* "cvcf.pyx":581
11304  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
11305  *             return []
11306  *         values = value.split(',')             # <<<<<<<<<<<<<<
11307  *         # deal with trailing data in some early VCF files
11308  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
11309  */
11310   __pyx_t_1 = PyObject_GetAttr(__pyx_v_value, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11311   __Pyx_GOTREF(__pyx_t_1);
11312   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11313   __Pyx_GOTREF(__pyx_t_3);
11314   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11315   __Pyx_DECREF(__pyx_v_values);
11316   __pyx_v_values = __pyx_t_3;
11317   __pyx_t_3 = 0;
11318
11319   /* "cvcf.pyx":583
11320  *         values = value.split(',')
11321  *         # deal with trailing data in some early VCF files
11322  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:             # <<<<<<<<<<<<<<
11323  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
11324  *             values[-1] = values[-1].split(';')[0]
11325  */
11326   __pyx_t_3 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11327   __Pyx_GOTREF(__pyx_t_3);
11328   __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__Float), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11329   __Pyx_GOTREF(__pyx_t_1);
11330   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11331   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11332   __pyx_t_5 = __pyx_t_4;
11333   if (!__pyx_t_5) {
11334     __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__Integer), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11335     __Pyx_GOTREF(__pyx_t_1);
11336     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11337     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11338     __pyx_t_6 = __pyx_t_4;
11339     __pyx_t_4 = __pyx_t_6;
11340   } else {
11341     __pyx_t_4 = __pyx_t_5;
11342   }
11343   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11344   __pyx_t_5 = __pyx_t_4;
11345   if (__pyx_t_5) {
11346     __pyx_t_7 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11347     __pyx_t_4 = (__pyx_t_7 > 0);
11348     if (__pyx_t_4) {
11349       __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_values, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11350       __Pyx_GOTREF(__pyx_t_3);
11351       __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__find); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11352       __Pyx_GOTREF(__pyx_t_1);
11353       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11354       __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11355       __Pyx_GOTREF(__pyx_t_3);
11356       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11357       __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_neg_1, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11358       __Pyx_GOTREF(__pyx_t_1);
11359       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11360       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11361       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11362       __pyx_t_8 = __pyx_t_6;
11363     } else {
11364       __pyx_t_8 = __pyx_t_4;
11365     }
11366     __pyx_t_4 = __pyx_t_8;
11367   } else {
11368     __pyx_t_4 = __pyx_t_5;
11369   }
11370   if (__pyx_t_4) {
11371
11372     /* "cvcf.pyx":584
11373  *         # deal with trailing data in some early VCF files
11374  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
11375  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])             # <<<<<<<<<<<<<<
11376  *             values[-1] = values[-1].split(';')[0]
11377  *         if f.type == "Integer":
11378  */
11379     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11380     __Pyx_GOTREF(__pyx_t_1);
11381     __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ERROR_TRAILING_DATA); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11382     __Pyx_GOTREF(__pyx_t_3);
11383     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11384     __Pyx_GOTREF(__pyx_t_2);
11385     __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11386     __Pyx_GOTREF(((PyObject *)__pyx_t_9));
11387     __Pyx_INCREF(__pyx_v_line);
11388     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
11389     __Pyx_GIVEREF(__pyx_v_line);
11390     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3);
11391     __Pyx_GIVEREF(__pyx_t_3);
11392     PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_2);
11393     __Pyx_GIVEREF(__pyx_t_2);
11394     __pyx_t_3 = 0;
11395     __pyx_t_2 = 0;
11396     __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11397     __Pyx_GOTREF(__pyx_t_2);
11398     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11399     __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
11400     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11401
11402     /* "cvcf.pyx":585
11403  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
11404  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
11405  *             values[-1] = values[-1].split(';')[0]             # <<<<<<<<<<<<<<
11406  *         if f.type == "Integer":
11407  *             for idx,v in enumerate(values):
11408  */
11409     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11410     __Pyx_GOTREF(__pyx_t_2);
11411     __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__split); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11412     __Pyx_GOTREF(__pyx_t_9);
11413     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11414     __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_96), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11415     __Pyx_GOTREF(__pyx_t_2);
11416     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11417     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11418     __Pyx_GOTREF(__pyx_t_9);
11419     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11420     if (__Pyx_SetItemInt(__pyx_v_values, -1, __pyx_t_9, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11421     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11422     goto __pyx_L9;
11423   }
11424   __pyx_L9:;
11425
11426   /* "cvcf.pyx":586
11427  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
11428  *             values[-1] = values[-1].split(';')[0]
11429  *         if f.type == "Integer":             # <<<<<<<<<<<<<<
11430  *             for idx,v in enumerate(values):
11431  *                 try:
11432  */
11433   __pyx_t_9 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11434   __Pyx_GOTREF(__pyx_t_9);
11435   __pyx_t_2 = PyObject_RichCompare(__pyx_t_9, ((PyObject *)__pyx_n_s__Integer), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11436   __Pyx_GOTREF(__pyx_t_2);
11437   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11438   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11439   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11440   if (__pyx_t_4) {
11441
11442     /* "cvcf.pyx":587
11443  *             values[-1] = values[-1].split(';')[0]
11444  *         if f.type == "Integer":
11445  *             for idx,v in enumerate(values):             # <<<<<<<<<<<<<<
11446  *                 try:
11447  *                     if v == ".": values[idx] = f.missingvalue
11448  */
11449     __Pyx_INCREF(__pyx_int_0);
11450     __pyx_t_2 = __pyx_int_0;
11451     if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
11452       __pyx_t_7 = 0; __pyx_t_9 = __pyx_v_values; __Pyx_INCREF(__pyx_t_9);
11453     } else {
11454       __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11455       __Pyx_GOTREF(__pyx_t_9);
11456     }
11457     for (;;) {
11458       if (likely(PyList_CheckExact(__pyx_t_9))) {
11459         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_9)) break;
11460         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
11461       } else if (likely(PyTuple_CheckExact(__pyx_t_9))) {
11462         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
11463         __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
11464       } else {
11465         __pyx_t_1 = PyIter_Next(__pyx_t_9);
11466         if (!__pyx_t_1) {
11467           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11468           break;
11469         }
11470         __Pyx_GOTREF(__pyx_t_1);
11471       }
11472       __Pyx_DECREF(__pyx_v_v);
11473       __pyx_v_v = __pyx_t_1;
11474       __pyx_t_1 = 0;
11475       __Pyx_INCREF(__pyx_t_2);
11476       __Pyx_DECREF(__pyx_v_idx);
11477       __pyx_v_idx = __pyx_t_2;
11478       __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11479       __Pyx_GOTREF(__pyx_t_1);
11480       __Pyx_DECREF(__pyx_t_2);
11481       __pyx_t_2 = __pyx_t_1;
11482       __pyx_t_1 = 0;
11483
11484       /* "cvcf.pyx":588
11485  *         if f.type == "Integer":
11486  *             for idx,v in enumerate(values):
11487  *                 try:             # <<<<<<<<<<<<<<
11488  *                     if v == ".": values[idx] = f.missingvalue
11489  *                     else:        values[idx] = int(v)
11490  */
11491       {
11492         PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
11493         __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
11494         __Pyx_XGOTREF(__pyx_save_exc_type);
11495         __Pyx_XGOTREF(__pyx_save_exc_value);
11496         __Pyx_XGOTREF(__pyx_save_exc_tb);
11497         /*try:*/ {
11498
11499           /* "cvcf.pyx":589
11500  *             for idx,v in enumerate(values):
11501  *                 try:
11502  *                     if v == ".": values[idx] = f.missingvalue             # <<<<<<<<<<<<<<
11503  *                     else:        values[idx] = int(v)
11504  *                 except:
11505  */
11506           __pyx_t_1 = PyObject_RichCompare(__pyx_v_v, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11507           __Pyx_GOTREF(__pyx_t_1);
11508           __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11509           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11510           if (__pyx_t_4) {
11511             __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__missingvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11512             __Pyx_GOTREF(__pyx_t_1);
11513             if (PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11514             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11515             goto __pyx_L21;
11516           }
11517           /*else*/ {
11518
11519             /* "cvcf.pyx":590
11520  *                 try:
11521  *                     if v == ".": values[idx] = f.missingvalue
11522  *                     else:        values[idx] = int(v)             # <<<<<<<<<<<<<<
11523  *                 except:
11524  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11525  */
11526             __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11527             __Pyx_GOTREF(((PyObject *)__pyx_t_1));
11528             __Pyx_INCREF(__pyx_v_v);
11529             PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_v);
11530             __Pyx_GIVEREF(__pyx_v_v);
11531             __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11532             __Pyx_GOTREF(__pyx_t_3);
11533             __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
11534             if (PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11535             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11536           }
11537           __pyx_L21:;
11538         }
11539         __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
11540         __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
11541         __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
11542         goto __pyx_L20_try_end;
11543         __pyx_L13_error:;
11544         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11545         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11546
11547         /* "cvcf.pyx":591
11548  *                     if v == ".": values[idx] = f.missingvalue
11549  *                     else:        values[idx] = int(v)
11550  *                 except:             # <<<<<<<<<<<<<<
11551  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11552  *                     return [0] * len(values)
11553  */
11554         /*except:*/ {
11555           __Pyx_AddTraceback("cvcf.VCF.parse_formatdata");
11556           if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11557           __Pyx_GOTREF(__pyx_t_3);
11558           __Pyx_GOTREF(__pyx_t_1);
11559           __Pyx_GOTREF(__pyx_t_10);
11560
11561           /* "cvcf.pyx":592
11562  *                     else:        values[idx] = int(v)
11563  *                 except:
11564  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)             # <<<<<<<<<<<<<<
11565  *                     return [0] * len(values)
11566  *             return values
11567  */
11568           __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11569           __Pyx_GOTREF(__pyx_t_11);
11570           __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_97); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11571           __Pyx_GOTREF(__pyx_t_12);
11572           __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11573           __Pyx_GOTREF(((PyObject *)__pyx_t_13));
11574           __Pyx_INCREF(__pyx_v_line);
11575           PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_line);
11576           __Pyx_GIVEREF(__pyx_v_line);
11577           PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12);
11578           __Pyx_GIVEREF(__pyx_t_12);
11579           __Pyx_INCREF(__pyx_v_values);
11580           PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_values);
11581           __Pyx_GIVEREF(__pyx_v_values);
11582           __pyx_t_12 = 0;
11583           __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11584           __Pyx_GOTREF(__pyx_t_12);
11585           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11586           __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
11587           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11588
11589           /* "cvcf.pyx":593
11590  *                 except:
11591  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11592  *                     return [0] * len(values)             # <<<<<<<<<<<<<<
11593  *             return values
11594  *         elif f.type == "String":
11595  */
11596           __Pyx_XDECREF(__pyx_r);
11597           __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11598           __Pyx_GOTREF(((PyObject *)__pyx_t_12));
11599           __Pyx_INCREF(__pyx_int_0);
11600           PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
11601           __Pyx_GIVEREF(__pyx_int_0);
11602           __pyx_t_14 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11603           __pyx_t_13 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11604           __Pyx_GOTREF(__pyx_t_13);
11605           __pyx_t_11 = PyNumber_Multiply(((PyObject *)__pyx_t_12), __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11606           __Pyx_GOTREF(__pyx_t_11);
11607           __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
11608           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
11609           __pyx_r = __pyx_t_11;
11610           __pyx_t_11 = 0;
11611           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11612           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11613           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11614           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11615           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11616           goto __pyx_L16_except_return;
11617           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11618           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11619           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11620           goto __pyx_L14_exception_handled;
11621         }
11622         __pyx_L15_except_error:;
11623         __Pyx_XGIVEREF(__pyx_save_exc_type);
11624         __Pyx_XGIVEREF(__pyx_save_exc_value);
11625         __Pyx_XGIVEREF(__pyx_save_exc_tb);
11626         __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11627         goto __pyx_L1_error;
11628         __pyx_L16_except_return:;
11629         __Pyx_XGIVEREF(__pyx_save_exc_type);
11630         __Pyx_XGIVEREF(__pyx_save_exc_value);
11631         __Pyx_XGIVEREF(__pyx_save_exc_tb);
11632         __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11633         goto __pyx_L0;
11634         __pyx_L14_exception_handled:;
11635         __Pyx_XGIVEREF(__pyx_save_exc_type);
11636         __Pyx_XGIVEREF(__pyx_save_exc_value);
11637         __Pyx_XGIVEREF(__pyx_save_exc_tb);
11638         __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11639         __pyx_L20_try_end:;
11640       }
11641     }
11642     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11643     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11644
11645     /* "cvcf.pyx":594
11646  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11647  *                     return [0] * len(values)
11648  *             return values             # <<<<<<<<<<<<<<
11649  *         elif f.type == "String":
11650  *             self._line = line
11651  */
11652     __Pyx_XDECREF(__pyx_r);
11653     __Pyx_INCREF(__pyx_v_values);
11654     __pyx_r = __pyx_v_values;
11655     goto __pyx_L0;
11656     goto __pyx_L10;
11657   }
11658
11659   /* "cvcf.pyx":595
11660  *                     return [0] * len(values)
11661  *             return values
11662  *         elif f.type == "String":             # <<<<<<<<<<<<<<
11663  *             self._line = line
11664  *             if f.id == "GT": values = map( self.convertGT, values )
11665  */
11666   __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11667   __Pyx_GOTREF(__pyx_t_2);
11668   __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__String), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11669   __Pyx_GOTREF(__pyx_t_9);
11670   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11671   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11672   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11673   if (__pyx_t_4) {
11674
11675     /* "cvcf.pyx":596
11676  *             return values
11677  *         elif f.type == "String":
11678  *             self._line = line             # <<<<<<<<<<<<<<
11679  *             if f.id == "GT": values = map( self.convertGT, values )
11680  *             return values
11681  */
11682     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___line, __pyx_v_line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11683
11684     /* "cvcf.pyx":597
11685  *         elif f.type == "String":
11686  *             self._line = line
11687  *             if f.id == "GT": values = map( self.convertGT, values )             # <<<<<<<<<<<<<<
11688  *             return values
11689  *         elif f.type == "Character":
11690  */
11691     __pyx_t_9 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__id); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11692     __Pyx_GOTREF(__pyx_t_9);
11693     __pyx_t_2 = PyObject_RichCompare(__pyx_t_9, ((PyObject *)__pyx_n_s__GT), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11694     __Pyx_GOTREF(__pyx_t_2);
11695     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11696     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11697     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11698     if (__pyx_t_4) {
11699       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__convertGT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11700       __Pyx_GOTREF(__pyx_t_2);
11701       __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11702       __Pyx_GOTREF(((PyObject *)__pyx_t_9));
11703       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
11704       __Pyx_GIVEREF(__pyx_t_2);
11705       __Pyx_INCREF(__pyx_v_values);
11706       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_values);
11707       __Pyx_GIVEREF(__pyx_v_values);
11708       __pyx_t_2 = 0;
11709       __pyx_t_2 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11710       __Pyx_GOTREF(__pyx_t_2);
11711       __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
11712       __Pyx_DECREF(__pyx_v_values);
11713       __pyx_v_values = __pyx_t_2;
11714       __pyx_t_2 = 0;
11715       goto __pyx_L24;
11716     }
11717     __pyx_L24:;
11718
11719     /* "cvcf.pyx":598
11720  *             self._line = line
11721  *             if f.id == "GT": values = map( self.convertGT, values )
11722  *             return values             # <<<<<<<<<<<<<<
11723  *         elif f.type == "Character":
11724  *             for v in values:
11725  */
11726     __Pyx_XDECREF(__pyx_r);
11727     __Pyx_INCREF(__pyx_v_values);
11728     __pyx_r = __pyx_v_values;
11729     goto __pyx_L0;
11730     goto __pyx_L10;
11731   }
11732
11733   /* "cvcf.pyx":599
11734  *             if f.id == "GT": values = map( self.convertGT, values )
11735  *             return values
11736  *         elif f.type == "Character":             # <<<<<<<<<<<<<<
11737  *             for v in values:
11738  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
11739  */
11740   __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11741   __Pyx_GOTREF(__pyx_t_2);
11742   __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__Character), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11743   __Pyx_GOTREF(__pyx_t_9);
11744   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11745   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11746   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11747   if (__pyx_t_4) {
11748
11749     /* "cvcf.pyx":600
11750  *             return values
11751  *         elif f.type == "Character":
11752  *             for v in values:             # <<<<<<<<<<<<<<
11753  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
11754  *             return values
11755  */
11756     if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
11757       __pyx_t_7 = 0; __pyx_t_9 = __pyx_v_values; __Pyx_INCREF(__pyx_t_9);
11758     } else {
11759       __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11760       __Pyx_GOTREF(__pyx_t_9);
11761     }
11762     for (;;) {
11763       if (likely(PyList_CheckExact(__pyx_t_9))) {
11764         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_9)) break;
11765         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
11766       } else if (likely(PyTuple_CheckExact(__pyx_t_9))) {
11767         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
11768         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
11769       } else {
11770         __pyx_t_2 = PyIter_Next(__pyx_t_9);
11771         if (!__pyx_t_2) {
11772           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11773           break;
11774         }
11775         __Pyx_GOTREF(__pyx_t_2);
11776       }
11777       __Pyx_DECREF(__pyx_v_v);
11778       __pyx_v_v = __pyx_t_2;
11779       __pyx_t_2 = 0;
11780
11781       /* "cvcf.pyx":601
11782  *         elif f.type == "Character":
11783  *             for v in values:
11784  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)             # <<<<<<<<<<<<<<
11785  *             return values
11786  *         elif f.type == "Float":
11787  */
11788       __pyx_t_14 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11789       __pyx_t_4 = (__pyx_t_14 != 1);
11790       if (__pyx_t_4) {
11791         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11792         __Pyx_GOTREF(__pyx_t_2);
11793         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_98); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11794         __Pyx_GOTREF(__pyx_t_10);
11795         __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11796         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
11797         __Pyx_INCREF(__pyx_v_line);
11798         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
11799         __Pyx_GIVEREF(__pyx_v_line);
11800         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_10);
11801         __Pyx_GIVEREF(__pyx_t_10);
11802         __pyx_t_10 = 0;
11803         __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11804         __Pyx_GOTREF(__pyx_t_10);
11805         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11806         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
11807         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11808         goto __pyx_L27;
11809       }
11810       __pyx_L27:;
11811     }
11812     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11813
11814     /* "cvcf.pyx":602
11815  *             for v in values:
11816  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
11817  *             return values             # <<<<<<<<<<<<<<
11818  *         elif f.type == "Float":
11819  *             for idx,v in enumerate(values):
11820  */
11821     __Pyx_XDECREF(__pyx_r);
11822     __Pyx_INCREF(__pyx_v_values);
11823     __pyx_r = __pyx_v_values;
11824     goto __pyx_L0;
11825     goto __pyx_L10;
11826   }
11827
11828   /* "cvcf.pyx":603
11829  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
11830  *             return values
11831  *         elif f.type == "Float":             # <<<<<<<<<<<<<<
11832  *             for idx,v in enumerate(values):
11833  *                 if v == ".": values[idx] = f.missingvalue
11834  */
11835   __pyx_t_9 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11836   __Pyx_GOTREF(__pyx_t_9);
11837   __pyx_t_10 = PyObject_RichCompare(__pyx_t_9, ((PyObject *)__pyx_n_s__Float), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11838   __Pyx_GOTREF(__pyx_t_10);
11839   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11840   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11841   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11842   if (__pyx_t_4) {
11843
11844     /* "cvcf.pyx":604
11845  *             return values
11846  *         elif f.type == "Float":
11847  *             for idx,v in enumerate(values):             # <<<<<<<<<<<<<<
11848  *                 if v == ".": values[idx] = f.missingvalue
11849  *             try: return map(float,values)
11850  */
11851     __Pyx_INCREF(__pyx_int_0);
11852     __pyx_t_10 = __pyx_int_0;
11853     if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
11854       __pyx_t_7 = 0; __pyx_t_9 = __pyx_v_values; __Pyx_INCREF(__pyx_t_9);
11855     } else {
11856       __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11857       __Pyx_GOTREF(__pyx_t_9);
11858     }
11859     for (;;) {
11860       if (likely(PyList_CheckExact(__pyx_t_9))) {
11861         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_9)) break;
11862         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
11863       } else if (likely(PyTuple_CheckExact(__pyx_t_9))) {
11864         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
11865         __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
11866       } else {
11867         __pyx_t_1 = PyIter_Next(__pyx_t_9);
11868         if (!__pyx_t_1) {
11869           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11870           break;
11871         }
11872         __Pyx_GOTREF(__pyx_t_1);
11873       }
11874       __Pyx_DECREF(__pyx_v_v);
11875       __pyx_v_v = __pyx_t_1;
11876       __pyx_t_1 = 0;
11877       __Pyx_INCREF(__pyx_t_10);
11878       __Pyx_DECREF(__pyx_v_idx);
11879       __pyx_v_idx = __pyx_t_10;
11880       __pyx_t_1 = PyNumber_Add(__pyx_t_10, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11881       __Pyx_GOTREF(__pyx_t_1);
11882       __Pyx_DECREF(__pyx_t_10);
11883       __pyx_t_10 = __pyx_t_1;
11884       __pyx_t_1 = 0;
11885
11886       /* "cvcf.pyx":605
11887  *         elif f.type == "Float":
11888  *             for idx,v in enumerate(values):
11889  *                 if v == ".": values[idx] = f.missingvalue             # <<<<<<<<<<<<<<
11890  *             try: return map(float,values)
11891  *             except:
11892  */
11893       __pyx_t_1 = PyObject_RichCompare(__pyx_v_v, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11894       __Pyx_GOTREF(__pyx_t_1);
11895       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11896       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11897       if (__pyx_t_4) {
11898         __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__missingvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11899         __Pyx_GOTREF(__pyx_t_1);
11900         if (PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11901         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11902         goto __pyx_L30;
11903       }
11904       __pyx_L30:;
11905     }
11906     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11907     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11908
11909     /* "cvcf.pyx":606
11910  *             for idx,v in enumerate(values):
11911  *                 if v == ".": values[idx] = f.missingvalue
11912  *             try: return map(float,values)             # <<<<<<<<<<<<<<
11913  *             except:
11914  *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11915  */
11916     {
11917       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
11918       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
11919       __Pyx_XGOTREF(__pyx_save_exc_type);
11920       __Pyx_XGOTREF(__pyx_save_exc_value);
11921       __Pyx_XGOTREF(__pyx_save_exc_tb);
11922       /*try:*/ {
11923         __Pyx_XDECREF(__pyx_r);
11924         __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
11925         __Pyx_GOTREF(((PyObject *)__pyx_t_10));
11926         __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
11927         PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)((PyObject*)(&PyFloat_Type))));
11928         __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
11929         __Pyx_INCREF(__pyx_v_values);
11930         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_values);
11931         __Pyx_GIVEREF(__pyx_v_values);
11932         __pyx_t_9 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
11933         __Pyx_GOTREF(__pyx_t_9);
11934         __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
11935         __pyx_r = __pyx_t_9;
11936         __pyx_t_9 = 0;
11937         goto __pyx_L35_try_return;
11938       }
11939       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
11940       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
11941       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
11942       goto __pyx_L38_try_end;
11943       __pyx_L35_try_return:;
11944       __Pyx_XGIVEREF(__pyx_save_exc_type);
11945       __Pyx_XGIVEREF(__pyx_save_exc_value);
11946       __Pyx_XGIVEREF(__pyx_save_exc_tb);
11947       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11948       goto __pyx_L0;
11949       __pyx_L31_error:;
11950       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
11951       __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
11952       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
11953       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11954       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11955       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11956       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
11957       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11958
11959       /* "cvcf.pyx":607
11960  *                 if v == ".": values[idx] = f.missingvalue
11961  *             try: return map(float,values)
11962  *             except:             # <<<<<<<<<<<<<<
11963  *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11964  *                 return [0.0] * len(values)
11965  */
11966       /*except:*/ {
11967         __Pyx_AddTraceback("cvcf.VCF.parse_formatdata");
11968         if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
11969         __Pyx_GOTREF(__pyx_t_9);
11970         __Pyx_GOTREF(__pyx_t_10);
11971         __Pyx_GOTREF(__pyx_t_1);
11972
11973         /* "cvcf.pyx":608
11974  *             try: return map(float,values)
11975  *             except:
11976  *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)             # <<<<<<<<<<<<<<
11977  *                 return [0.0] * len(values)
11978  *         else:
11979  */
11980         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
11981         __Pyx_GOTREF(__pyx_t_2);
11982         __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_97); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
11983         __Pyx_GOTREF(__pyx_t_3);
11984         __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
11985         __Pyx_GOTREF(((PyObject *)__pyx_t_11));
11986         __Pyx_INCREF(__pyx_v_line);
11987         PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_line);
11988         __Pyx_GIVEREF(__pyx_v_line);
11989         PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3);
11990         __Pyx_GIVEREF(__pyx_t_3);
11991         __Pyx_INCREF(__pyx_v_values);
11992         PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_values);
11993         __Pyx_GIVEREF(__pyx_v_values);
11994         __pyx_t_3 = 0;
11995         __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
11996         __Pyx_GOTREF(__pyx_t_3);
11997         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11998         __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
11999         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12000
12001         /* "cvcf.pyx":609
12002  *             except:
12003  *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
12004  *                 return [0.0] * len(values)             # <<<<<<<<<<<<<<
12005  *         else:
12006  *             # can't happen
12007  */
12008         __Pyx_XDECREF(__pyx_r);
12009         __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12010         __Pyx_GOTREF(__pyx_t_3);
12011         __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12012         __Pyx_GOTREF(((PyObject *)__pyx_t_11));
12013         PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
12014         __Pyx_GIVEREF(__pyx_t_3);
12015         __pyx_t_3 = 0;
12016         __pyx_t_7 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12017         __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12018         __Pyx_GOTREF(__pyx_t_3);
12019         __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_t_11), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12020         __Pyx_GOTREF(__pyx_t_2);
12021         __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
12022         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12023         __pyx_r = __pyx_t_2;
12024         __pyx_t_2 = 0;
12025         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12026         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12027         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12028         goto __pyx_L34_except_return;
12029         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12030         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12031         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12032         goto __pyx_L32_exception_handled;
12033       }
12034       __pyx_L33_except_error:;
12035       __Pyx_XGIVEREF(__pyx_save_exc_type);
12036       __Pyx_XGIVEREF(__pyx_save_exc_value);
12037       __Pyx_XGIVEREF(__pyx_save_exc_tb);
12038       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12039       goto __pyx_L1_error;
12040       __pyx_L34_except_return:;
12041       __Pyx_XGIVEREF(__pyx_save_exc_type);
12042       __Pyx_XGIVEREF(__pyx_save_exc_value);
12043       __Pyx_XGIVEREF(__pyx_save_exc_tb);
12044       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12045       goto __pyx_L0;
12046       __pyx_L32_exception_handled:;
12047       __Pyx_XGIVEREF(__pyx_save_exc_type);
12048       __Pyx_XGIVEREF(__pyx_save_exc_value);
12049       __Pyx_XGIVEREF(__pyx_save_exc_tb);
12050       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12051       __pyx_L38_try_end:;
12052     }
12053     goto __pyx_L10;
12054   }
12055   /*else*/ {
12056
12057     /* "cvcf.pyx":612
12058  *         else:
12059  *             # can't happen
12060  *             self.error(line,self.ERROR_INFO_STRING)             # <<<<<<<<<<<<<<
12061  * 
12062  * 
12063  */
12064     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12065     __Pyx_GOTREF(__pyx_t_1);
12066     __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ERROR_INFO_STRING); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12067     __Pyx_GOTREF(__pyx_t_10);
12068     __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12069     __Pyx_GOTREF(((PyObject *)__pyx_t_9));
12070     __Pyx_INCREF(__pyx_v_line);
12071     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
12072     __Pyx_GIVEREF(__pyx_v_line);
12073     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
12074     __Pyx_GIVEREF(__pyx_t_10);
12075     __pyx_t_10 = 0;
12076     __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12077     __Pyx_GOTREF(__pyx_t_10);
12078     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12079     __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
12080     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12081   }
12082   __pyx_L10:;
12083
12084   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12085   goto __pyx_L0;
12086   __pyx_L1_error:;
12087   __Pyx_XDECREF(__pyx_t_1);
12088   __Pyx_XDECREF(__pyx_t_2);
12089   __Pyx_XDECREF(__pyx_t_3);
12090   __Pyx_XDECREF(__pyx_t_9);
12091   __Pyx_XDECREF(__pyx_t_10);
12092   __Pyx_XDECREF(__pyx_t_11);
12093   __Pyx_XDECREF(__pyx_t_12);
12094   __Pyx_XDECREF(__pyx_t_13);
12095   __Pyx_AddTraceback("cvcf.VCF.parse_formatdata");
12096   __pyx_r = NULL;
12097   __pyx_L0:;
12098   __Pyx_DECREF(__pyx_v_f);
12099   __Pyx_DECREF(__pyx_v_values);
12100   __Pyx_DECREF(__pyx_v_idx);
12101   __Pyx_DECREF(__pyx_v_v);
12102   __Pyx_XGIVEREF(__pyx_r);
12103   __Pyx_RefNannyFinishContext();
12104   return __pyx_r;
12105 }
12106
12107 /* "cvcf.pyx":615
12108  * 
12109  * 
12110  *     def inregion(self, chrom, pos):             # <<<<<<<<<<<<<<
12111  *         if not self._regions: return True
12112  *         for r in self._regions:
12113  */
12114
12115 static PyObject *__pyx_pf_4cvcf_3VCF_15inregion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12116 static PyMethodDef __pyx_mdef_4cvcf_3VCF_15inregion = {__Pyx_NAMESTR("inregion"), (PyCFunction)__pyx_pf_4cvcf_3VCF_15inregion, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
12117 static PyObject *__pyx_pf_4cvcf_3VCF_15inregion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12118   PyObject *__pyx_v_self = 0;
12119   PyObject *__pyx_v_chrom = 0;
12120   PyObject *__pyx_v_pos = 0;
12121   PyObject *__pyx_v_r;
12122   PyObject *__pyx_r = NULL;
12123   PyObject *__pyx_t_1 = NULL;
12124   int __pyx_t_2;
12125   int __pyx_t_3;
12126   Py_ssize_t __pyx_t_4;
12127   PyObject *__pyx_t_5 = NULL;
12128   PyObject *__pyx_t_6 = NULL;
12129   PyObject *__pyx_t_7 = NULL;
12130   int __pyx_t_8;
12131   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chrom,&__pyx_n_s__pos,0};
12132   __Pyx_RefNannySetupContext("inregion");
12133   __pyx_self = __pyx_self;
12134   if (unlikely(__pyx_kwds)) {
12135     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
12136     PyObject* values[3] = {0,0,0};
12137     switch (PyTuple_GET_SIZE(__pyx_args)) {
12138       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12139       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12140       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12141       case  0: break;
12142       default: goto __pyx_L5_argtuple_error;
12143     }
12144     switch (PyTuple_GET_SIZE(__pyx_args)) {
12145       case  0:
12146       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
12147       if (likely(values[0])) kw_args--;
12148       else goto __pyx_L5_argtuple_error;
12149       case  1:
12150       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom);
12151       if (likely(values[1])) kw_args--;
12152       else {
12153         __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12154       }
12155       case  2:
12156       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos);
12157       if (likely(values[2])) kw_args--;
12158       else {
12159         __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12160       }
12161     }
12162     if (unlikely(kw_args > 0)) {
12163       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "inregion") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12164     }
12165     __pyx_v_self = values[0];
12166     __pyx_v_chrom = values[1];
12167     __pyx_v_pos = values[2];
12168   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
12169     goto __pyx_L5_argtuple_error;
12170   } else {
12171     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
12172     __pyx_v_chrom = PyTuple_GET_ITEM(__pyx_args, 1);
12173     __pyx_v_pos = PyTuple_GET_ITEM(__pyx_args, 2);
12174   }
12175   goto __pyx_L4_argument_unpacking_done;
12176   __pyx_L5_argtuple_error:;
12177   __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12178   __pyx_L3_error:;
12179   __Pyx_AddTraceback("cvcf.VCF.inregion");
12180   __Pyx_RefNannyFinishContext();
12181   return NULL;
12182   __pyx_L4_argument_unpacking_done:;
12183   __pyx_v_r = Py_None; __Pyx_INCREF(Py_None);
12184
12185   /* "cvcf.pyx":616
12186  * 
12187  *     def inregion(self, chrom, pos):
12188  *         if not self._regions: return True             # <<<<<<<<<<<<<<
12189  *         for r in self._regions:
12190  *             if r[0] == chrom and r[1] <= pos < r[2]: return True
12191  */
12192   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___regions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12193   __Pyx_GOTREF(__pyx_t_1);
12194   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12195   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12196   __pyx_t_3 = (!__pyx_t_2);
12197   if (__pyx_t_3) {
12198     __Pyx_XDECREF(__pyx_r);
12199     __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12200     __Pyx_GOTREF(__pyx_t_1);
12201     __pyx_r = __pyx_t_1;
12202     __pyx_t_1 = 0;
12203     goto __pyx_L0;
12204     goto __pyx_L6;
12205   }
12206   __pyx_L6:;
12207
12208   /* "cvcf.pyx":617
12209  *     def inregion(self, chrom, pos):
12210  *         if not self._regions: return True
12211  *         for r in self._regions:             # <<<<<<<<<<<<<<
12212  *             if r[0] == chrom and r[1] <= pos < r[2]: return True
12213  *         return False
12214  */
12215   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___regions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12216   __Pyx_GOTREF(__pyx_t_1);
12217   if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
12218     __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5);
12219   } else {
12220     __pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12221     __Pyx_GOTREF(__pyx_t_5);
12222   }
12223   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12224   for (;;) {
12225     if (likely(PyList_CheckExact(__pyx_t_5))) {
12226       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
12227       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
12228     } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
12229       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
12230       __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
12231     } else {
12232       __pyx_t_1 = PyIter_Next(__pyx_t_5);
12233       if (!__pyx_t_1) {
12234         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12235         break;
12236       }
12237       __Pyx_GOTREF(__pyx_t_1);
12238     }
12239     __Pyx_DECREF(__pyx_v_r);
12240     __pyx_v_r = __pyx_t_1;
12241     __pyx_t_1 = 0;
12242
12243     /* "cvcf.pyx":618
12244  *         if not self._regions: return True
12245  *         for r in self._regions:
12246  *             if r[0] == chrom and r[1] <= pos < r[2]: return True             # <<<<<<<<<<<<<<
12247  *         return False
12248  * 
12249  */
12250     __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_r, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12251     __Pyx_GOTREF(__pyx_t_1);
12252     __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_v_chrom, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12253     __Pyx_GOTREF(__pyx_t_6);
12254     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12255     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12256     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12257     if (__pyx_t_3) {
12258       __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_r, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12259       __Pyx_GOTREF(__pyx_t_6);
12260       __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_v_pos, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12261       __Pyx_GOTREF(__pyx_t_1);
12262       if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
12263         __Pyx_DECREF(__pyx_t_1);
12264         __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_r, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12265         __Pyx_GOTREF(__pyx_t_7);
12266         __pyx_t_1 = PyObject_RichCompare(__pyx_v_pos, __pyx_t_7, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12267         __Pyx_GOTREF(__pyx_t_1);
12268         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12269       }
12270       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12271       __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12272       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12273       __pyx_t_8 = __pyx_t_2;
12274     } else {
12275       __pyx_t_8 = __pyx_t_3;
12276     }
12277     if (__pyx_t_8) {
12278       __Pyx_XDECREF(__pyx_r);
12279       __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12280       __Pyx_GOTREF(__pyx_t_1);
12281       __pyx_r = __pyx_t_1;
12282       __pyx_t_1 = 0;
12283       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12284       goto __pyx_L0;
12285       goto __pyx_L9;
12286     }
12287     __pyx_L9:;
12288   }
12289   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12290
12291   /* "cvcf.pyx":619
12292  *         for r in self._regions:
12293  *             if r[0] == chrom and r[1] <= pos < r[2]: return True
12294  *         return False             # <<<<<<<<<<<<<<
12295  * 
12296  * 
12297  */
12298   __Pyx_XDECREF(__pyx_r);
12299   __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12300   __Pyx_GOTREF(__pyx_t_5);
12301   __pyx_r = __pyx_t_5;
12302   __pyx_t_5 = 0;
12303   goto __pyx_L0;
12304
12305   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12306   goto __pyx_L0;
12307   __pyx_L1_error:;
12308   __Pyx_XDECREF(__pyx_t_1);
12309   __Pyx_XDECREF(__pyx_t_5);
12310   __Pyx_XDECREF(__pyx_t_6);
12311   __Pyx_XDECREF(__pyx_t_7);
12312   __Pyx_AddTraceback("cvcf.VCF.inregion");
12313   __pyx_r = NULL;
12314   __pyx_L0:;
12315   __Pyx_DECREF(__pyx_v_r);
12316   __Pyx_XGIVEREF(__pyx_r);
12317   __Pyx_RefNannyFinishContext();
12318   return __pyx_r;
12319 }
12320
12321 /* "cvcf.pyx":622
12322  * 
12323  * 
12324  *     def parse_data( self, line, lineparse=False ):             # <<<<<<<<<<<<<<
12325  *         cols = line.split('\t')
12326  *         if len(cols) != len(self._samples)+9:
12327  */
12328
12329 static PyObject *__pyx_pf_4cvcf_3VCF_16parse_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12330 static PyMethodDef __pyx_mdef_4cvcf_3VCF_16parse_data = {__Pyx_NAMESTR("parse_data"), (PyCFunction)__pyx_pf_4cvcf_3VCF_16parse_data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
12331 static PyObject *__pyx_pf_4cvcf_3VCF_16parse_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12332   PyObject *__pyx_v_self = 0;
12333   PyObject *__pyx_v_line = 0;
12334   PyObject *__pyx_v_lineparse = 0;
12335   PyObject *__pyx_v_cols;
12336   PyObject *__pyx_v_chrom;
12337   PyObject *__pyx_v_pos;
12338   PyObject *__pyx_v_id;
12339   PyObject *__pyx_v_ref;
12340   PyObject *__pyx_v_c;
12341   PyObject *__pyx_v_left;
12342   PyObject *__pyx_v_faref_leftflank;
12343   PyObject *__pyx_v_faref;
12344   PyObject *__pyx_v_alt;
12345   double __pyx_v_qual;
12346   PyObject *__pyx_v_filter;
12347   PyObject *__pyx_v_info;
12348   PyObject *__pyx_v_blurp;
12349   PyObject *__pyx_v_elts;
12350   PyObject *__pyx_v_v;
12351   PyObject *__pyx_v_format;
12352   PyObject *__pyx_v_f;
12353   PyObject *__pyx_v_newalts;
12354   int __pyx_v_have_deletions;
12355   PyObject *__pyx_v_a;
12356   PyObject *__pyx_v_l;
12357   PyObject *__pyx_v_addns;
12358   PyObject *__pyx_v_i;
12359   PyObject *__pyx_v_na;
12360   PyObject *__pyx_v_s;
12361   PyObject *__pyx_v_addn;
12362   PyObject *__pyx_v_allele;
12363   int __pyx_v_movable;
12364   PyObject *__pyx_v_longest;
12365   PyObject *__pyx_v_shortest;
12366   PyObject *__pyx_v_samples;
12367   PyObject *__pyx_v_sample;
12368   PyObject *__pyx_v_dict;
12369   PyObject *__pyx_v_values;
12370   Py_ssize_t __pyx_v_idx;
12371   PyObject *__pyx_v_expected;
12372   PyObject *__pyx_v_value;
12373   PyObject *__pyx_v_d;
12374   PyObject *__pyx_v_key;
12375   PyObject *__pyx_r = NULL;
12376   PyObject *__pyx_t_1 = NULL;
12377   PyObject *__pyx_t_2 = NULL;
12378   Py_ssize_t __pyx_t_3;
12379   Py_ssize_t __pyx_t_4;
12380   int __pyx_t_5;
12381   int __pyx_t_6;
12382   int __pyx_t_7;
12383   PyObject *__pyx_t_8 = NULL;
12384   PyObject *__pyx_t_9 = NULL;
12385   PyObject *__pyx_t_10 = NULL;
12386   PyObject *__pyx_t_11 = NULL;
12387   PyObject *__pyx_t_12 = NULL;
12388   long __pyx_t_13;
12389   double __pyx_t_14;
12390   int __pyx_t_15;
12391   int __pyx_t_16;
12392   Py_ssize_t __pyx_t_17;
12393   PyObject *__pyx_t_18 = NULL;
12394   PyObject *__pyx_t_19 = NULL;
12395   PyObject *__pyx_t_20 = NULL;
12396   Py_ssize_t __pyx_t_21;
12397   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,&__pyx_n_s__lineparse,0};
12398   __Pyx_RefNannySetupContext("parse_data");
12399   __pyx_self = __pyx_self;
12400   if (unlikely(__pyx_kwds)) {
12401     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
12402     PyObject* values[3] = {0,0,0};
12403     values[2] = __pyx_k_99;
12404     switch (PyTuple_GET_SIZE(__pyx_args)) {
12405       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12406       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12407       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12408       case  0: break;
12409       default: goto __pyx_L5_argtuple_error;
12410     }
12411     switch (PyTuple_GET_SIZE(__pyx_args)) {
12412       case  0:
12413       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
12414       if (likely(values[0])) kw_args--;
12415       else goto __pyx_L5_argtuple_error;
12416       case  1:
12417       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
12418       if (likely(values[1])) kw_args--;
12419       else {
12420         __Pyx_RaiseArgtupleInvalid("parse_data", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12421       }
12422       case  2:
12423       if (kw_args > 0) {
12424         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lineparse);
12425         if (value) { values[2] = value; kw_args--; }
12426       }
12427     }
12428     if (unlikely(kw_args > 0)) {
12429       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parse_data") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12430     }
12431     __pyx_v_self = values[0];
12432     __pyx_v_line = values[1];
12433     __pyx_v_lineparse = values[2];
12434   } else {
12435     __pyx_v_lineparse = __pyx_k_99;
12436     switch (PyTuple_GET_SIZE(__pyx_args)) {
12437       case  3:
12438       __pyx_v_lineparse = PyTuple_GET_ITEM(__pyx_args, 2);
12439       case  2:
12440       __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
12441       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
12442       break;
12443       default: goto __pyx_L5_argtuple_error;
12444     }
12445   }
12446   goto __pyx_L4_argument_unpacking_done;
12447   __pyx_L5_argtuple_error:;
12448   __Pyx_RaiseArgtupleInvalid("parse_data", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12449   __pyx_L3_error:;
12450   __Pyx_AddTraceback("cvcf.VCF.parse_data");
12451   __Pyx_RefNannyFinishContext();
12452   return NULL;
12453   __pyx_L4_argument_unpacking_done:;
12454   __pyx_v_cols = Py_None; __Pyx_INCREF(Py_None);
12455   __pyx_v_chrom = Py_None; __Pyx_INCREF(Py_None);
12456   __pyx_v_pos = Py_None; __Pyx_INCREF(Py_None);
12457   __pyx_v_id = Py_None; __Pyx_INCREF(Py_None);
12458   __pyx_v_ref = Py_None; __Pyx_INCREF(Py_None);
12459   __pyx_v_c = Py_None; __Pyx_INCREF(Py_None);
12460   __pyx_v_left = Py_None; __Pyx_INCREF(Py_None);
12461   __pyx_v_faref_leftflank = Py_None; __Pyx_INCREF(Py_None);
12462   __pyx_v_faref = Py_None; __Pyx_INCREF(Py_None);
12463   __pyx_v_alt = Py_None; __Pyx_INCREF(Py_None);
12464   __pyx_v_filter = Py_None; __Pyx_INCREF(Py_None);
12465   __pyx_v_info = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
12466   __pyx_v_blurp = Py_None; __Pyx_INCREF(Py_None);
12467   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
12468   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
12469   __pyx_v_format = Py_None; __Pyx_INCREF(Py_None);
12470   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
12471   __pyx_v_newalts = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
12472   __pyx_v_a = Py_None; __Pyx_INCREF(Py_None);
12473   __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
12474   __pyx_v_addns = Py_None; __Pyx_INCREF(Py_None);
12475   __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
12476   __pyx_v_na = Py_None; __Pyx_INCREF(Py_None);
12477   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
12478   __pyx_v_addn = Py_None; __Pyx_INCREF(Py_None);
12479   __pyx_v_allele = Py_None; __Pyx_INCREF(Py_None);
12480   __pyx_v_longest = Py_None; __Pyx_INCREF(Py_None);
12481   __pyx_v_shortest = Py_None; __Pyx_INCREF(Py_None);
12482   __pyx_v_samples = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
12483   __pyx_v_sample = Py_None; __Pyx_INCREF(Py_None);
12484   __pyx_v_dict = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
12485   __pyx_v_values = Py_None; __Pyx_INCREF(Py_None);
12486   __pyx_v_expected = Py_None; __Pyx_INCREF(Py_None);
12487   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
12488   __pyx_v_d = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
12489   __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
12490
12491   /* "cvcf.pyx":623
12492  * 
12493  *     def parse_data( self, line, lineparse=False ):
12494  *         cols = line.split('\t')             # <<<<<<<<<<<<<<
12495  *         if len(cols) != len(self._samples)+9:
12496  *             # gracefully deal with absent FORMAT column
12497  */
12498   __pyx_t_1 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12499   __Pyx_GOTREF(__pyx_t_1);
12500   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12501   __Pyx_GOTREF(__pyx_t_2);
12502   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12503   __Pyx_DECREF(__pyx_v_cols);
12504   __pyx_v_cols = __pyx_t_2;
12505   __pyx_t_2 = 0;
12506
12507   /* "cvcf.pyx":624
12508  *     def parse_data( self, line, lineparse=False ):
12509  *         cols = line.split('\t')
12510  *         if len(cols) != len(self._samples)+9:             # <<<<<<<<<<<<<<
12511  *             # gracefully deal with absent FORMAT column
12512  *             if len(cols) == 8 and len(self._samples)==0:
12513  */
12514   __pyx_t_3 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12515   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12516   __Pyx_GOTREF(__pyx_t_2);
12517   __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12518   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12519   __pyx_t_5 = (__pyx_t_3 != (__pyx_t_4 + 9));
12520   if (__pyx_t_5) {
12521
12522     /* "cvcf.pyx":626
12523  *         if len(cols) != len(self._samples)+9:
12524  *             # gracefully deal with absent FORMAT column
12525  *             if len(cols) == 8 and len(self._samples)==0:             # <<<<<<<<<<<<<<
12526  *                 cols.append("")
12527  *             else:
12528  */
12529     __pyx_t_4 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12530     __pyx_t_5 = (__pyx_t_4 == 8);
12531     if (__pyx_t_5) {
12532       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12533       __Pyx_GOTREF(__pyx_t_2);
12534       __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12535       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12536       __pyx_t_6 = (__pyx_t_4 == 0);
12537       __pyx_t_7 = __pyx_t_6;
12538     } else {
12539       __pyx_t_7 = __pyx_t_5;
12540     }
12541     if (__pyx_t_7) {
12542
12543       /* "cvcf.pyx":627
12544  *             # gracefully deal with absent FORMAT column
12545  *             if len(cols) == 8 and len(self._samples)==0:
12546  *                 cols.append("")             # <<<<<<<<<<<<<<
12547  *             else:
12548  *                 self.error(line,
12549  */
12550       __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_cols, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12551       __Pyx_GOTREF(__pyx_t_2);
12552       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12553       goto __pyx_L7;
12554     }
12555     /*else*/ {
12556
12557       /* "cvcf.pyx":629
12558  *                 cols.append("")
12559  *             else:
12560  *                 self.error(line,             # <<<<<<<<<<<<<<
12561  *                            self.BAD_NUMBER_OF_COLUMNS,
12562  *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
12563  */
12564       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12565       __Pyx_GOTREF(__pyx_t_2);
12566
12567       /* "cvcf.pyx":630
12568  *             else:
12569  *                 self.error(line,
12570  *                            self.BAD_NUMBER_OF_COLUMNS,             # <<<<<<<<<<<<<<
12571  *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
12572  * 
12573  */
12574       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_101); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12575       __Pyx_GOTREF(__pyx_t_1);
12576
12577       /* "cvcf.pyx":631
12578  *                 self.error(line,
12579  *                            self.BAD_NUMBER_OF_COLUMNS,
12580  *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))             # <<<<<<<<<<<<<<
12581  * 
12582  *         chrom = cols[0]
12583  */
12584       __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12585       __Pyx_GOTREF(__pyx_t_8);
12586       __pyx_t_4 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12587       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12588       __pyx_t_8 = PyInt_FromSsize_t((__pyx_t_4 + 9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12589       __Pyx_GOTREF(__pyx_t_8);
12590       __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12591       __Pyx_GOTREF(__pyx_t_9);
12592       __pyx_t_4 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12593       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12594       __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12595       __Pyx_GOTREF(__pyx_t_9);
12596       __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12597       __Pyx_GOTREF(__pyx_t_10);
12598       __pyx_t_4 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12599       __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12600       __Pyx_GOTREF(__pyx_t_11);
12601       __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12602       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
12603       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8);
12604       __Pyx_GIVEREF(__pyx_t_8);
12605       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_9);
12606       __Pyx_GIVEREF(__pyx_t_9);
12607       PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_10);
12608       __Pyx_GIVEREF(__pyx_t_10);
12609       PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_11);
12610       __Pyx_GIVEREF(__pyx_t_11);
12611       __pyx_t_8 = 0;
12612       __pyx_t_9 = 0;
12613       __pyx_t_10 = 0;
12614       __pyx_t_11 = 0;
12615       __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_102), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12616       __Pyx_GOTREF(((PyObject *)__pyx_t_11));
12617       __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
12618       __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12619       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
12620       __Pyx_INCREF(__pyx_v_line);
12621       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
12622       __Pyx_GIVEREF(__pyx_v_line);
12623       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1);
12624       __Pyx_GIVEREF(__pyx_t_1);
12625       PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_t_11));
12626       __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
12627       __pyx_t_1 = 0;
12628       __pyx_t_11 = 0;
12629       __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12630       __Pyx_GOTREF(__pyx_t_11);
12631       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12632       __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
12633       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12634     }
12635     __pyx_L7:;
12636     goto __pyx_L6;
12637   }
12638   __pyx_L6:;
12639
12640   /* "cvcf.pyx":633
12641  *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
12642  * 
12643  *         chrom = cols[0]             # <<<<<<<<<<<<<<
12644  * 
12645  *         # get 0-based position
12646  */
12647   __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12648   __Pyx_GOTREF(__pyx_t_11);
12649   __Pyx_DECREF(__pyx_v_chrom);
12650   __pyx_v_chrom = __pyx_t_11;
12651   __pyx_t_11 = 0;
12652
12653   /* "cvcf.pyx":636
12654  * 
12655  *         # get 0-based position
12656  *         try:    pos = int(cols[1])-1             # <<<<<<<<<<<<<<
12657  *         except: self.error(line,self.POS_NOT_NUMERICAL)
12658  *         if pos < 0: self.error(line,self.POS_NOT_POSITIVE)
12659  */
12660   {
12661     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
12662     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
12663     __Pyx_XGOTREF(__pyx_save_exc_type);
12664     __Pyx_XGOTREF(__pyx_save_exc_value);
12665     __Pyx_XGOTREF(__pyx_save_exc_tb);
12666     /*try:*/ {
12667       __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
12668       __Pyx_GOTREF(__pyx_t_11);
12669       __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
12670       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
12671       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11);
12672       __Pyx_GIVEREF(__pyx_t_11);
12673       __pyx_t_11 = 0;
12674       __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
12675       __Pyx_GOTREF(__pyx_t_11);
12676       __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
12677       __pyx_t_12 = PyNumber_Subtract(__pyx_t_11, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
12678       __Pyx_GOTREF(__pyx_t_12);
12679       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12680       __Pyx_DECREF(__pyx_v_pos);
12681       __pyx_v_pos = __pyx_t_12;
12682       __pyx_t_12 = 0;
12683     }
12684     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
12685     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
12686     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
12687     goto __pyx_L15_try_end;
12688     __pyx_L8_error:;
12689     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12690     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12691     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12692     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12693     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12694     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12695     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
12696
12697     /* "cvcf.pyx":637
12698  *         # get 0-based position
12699  *         try:    pos = int(cols[1])-1
12700  *         except: self.error(line,self.POS_NOT_NUMERICAL)             # <<<<<<<<<<<<<<
12701  *         if pos < 0: self.error(line,self.POS_NOT_POSITIVE)
12702  * 
12703  */
12704     /*except:*/ {
12705       __Pyx_AddTraceback("cvcf.VCF.parse_data");
12706       if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
12707       __Pyx_GOTREF(__pyx_t_12);
12708       __Pyx_GOTREF(__pyx_t_11);
12709       __Pyx_GOTREF(__pyx_t_2);
12710       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
12711       __Pyx_GOTREF(__pyx_t_1);
12712       __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__POS_NOT_NUMERICAL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
12713       __Pyx_GOTREF(__pyx_t_10);
12714       __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
12715       __Pyx_GOTREF(((PyObject *)__pyx_t_9));
12716       __Pyx_INCREF(__pyx_v_line);
12717       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
12718       __Pyx_GIVEREF(__pyx_v_line);
12719       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
12720       __Pyx_GIVEREF(__pyx_t_10);
12721       __pyx_t_10 = 0;
12722       __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
12723       __Pyx_GOTREF(__pyx_t_10);
12724       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12725       __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
12726       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12727       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12728       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12729       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12730       goto __pyx_L9_exception_handled;
12731     }
12732     __pyx_L10_except_error:;
12733     __Pyx_XGIVEREF(__pyx_save_exc_type);
12734     __Pyx_XGIVEREF(__pyx_save_exc_value);
12735     __Pyx_XGIVEREF(__pyx_save_exc_tb);
12736     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12737     goto __pyx_L1_error;
12738     __pyx_L9_exception_handled:;
12739     __Pyx_XGIVEREF(__pyx_save_exc_type);
12740     __Pyx_XGIVEREF(__pyx_save_exc_value);
12741     __Pyx_XGIVEREF(__pyx_save_exc_tb);
12742     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12743     __pyx_L15_try_end:;
12744   }
12745
12746   /* "cvcf.pyx":638
12747  *         try:    pos = int(cols[1])-1
12748  *         except: self.error(line,self.POS_NOT_NUMERICAL)
12749  *         if pos < 0: self.error(line,self.POS_NOT_POSITIVE)             # <<<<<<<<<<<<<<
12750  * 
12751  *         # implement filtering
12752  */
12753   __pyx_t_2 = PyObject_RichCompare(__pyx_v_pos, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12754   __Pyx_GOTREF(__pyx_t_2);
12755   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12756   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12757   if (__pyx_t_7) {
12758     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12759     __Pyx_GOTREF(__pyx_t_2);
12760     __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__POS_NOT_POSITIVE); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12761     __Pyx_GOTREF(__pyx_t_11);
12762     __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12763     __Pyx_GOTREF(((PyObject *)__pyx_t_12));
12764     __Pyx_INCREF(__pyx_v_line);
12765     PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
12766     __Pyx_GIVEREF(__pyx_v_line);
12767     PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
12768     __Pyx_GIVEREF(__pyx_t_11);
12769     __pyx_t_11 = 0;
12770     __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12771     __Pyx_GOTREF(__pyx_t_11);
12772     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12773     __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
12774     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12775     goto __pyx_L18;
12776   }
12777   __pyx_L18:;
12778
12779   /* "cvcf.pyx":641
12780  * 
12781  *         # implement filtering
12782  *         if not self.inregion(chrom,pos): return None             # <<<<<<<<<<<<<<
12783  * 
12784  *         # end of first-pass parse for sortedVCF
12785  */
12786   __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__inregion); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12787   __Pyx_GOTREF(__pyx_t_11);
12788   __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12789   __Pyx_GOTREF(((PyObject *)__pyx_t_12));
12790   __Pyx_INCREF(__pyx_v_chrom);
12791   PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_chrom);
12792   __Pyx_GIVEREF(__pyx_v_chrom);
12793   __Pyx_INCREF(__pyx_v_pos);
12794   PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_pos);
12795   __Pyx_GIVEREF(__pyx_v_pos);
12796   __pyx_t_2 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12797   __Pyx_GOTREF(__pyx_t_2);
12798   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12799   __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
12800   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12801   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12802   __pyx_t_5 = (!__pyx_t_7);
12803   if (__pyx_t_5) {
12804     __Pyx_XDECREF(__pyx_r);
12805     __Pyx_INCREF(Py_None);
12806     __pyx_r = Py_None;
12807     goto __pyx_L0;
12808     goto __pyx_L19;
12809   }
12810   __pyx_L19:;
12811
12812   /* "cvcf.pyx":644
12813  * 
12814  *         # end of first-pass parse for sortedVCF
12815  *         if lineparse: return chrom, pos, line             # <<<<<<<<<<<<<<
12816  * 
12817  *         id = cols[2]
12818  */
12819   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_lineparse); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12820   if (__pyx_t_5) {
12821     __Pyx_XDECREF(__pyx_r);
12822     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12823     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
12824     __Pyx_INCREF(__pyx_v_chrom);
12825     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
12826     __Pyx_GIVEREF(__pyx_v_chrom);
12827     __Pyx_INCREF(__pyx_v_pos);
12828     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_pos);
12829     __Pyx_GIVEREF(__pyx_v_pos);
12830     __Pyx_INCREF(__pyx_v_line);
12831     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_line);
12832     __Pyx_GIVEREF(__pyx_v_line);
12833     __pyx_r = ((PyObject *)__pyx_t_2);
12834     __pyx_t_2 = 0;
12835     goto __pyx_L0;
12836     goto __pyx_L20;
12837   }
12838   __pyx_L20:;
12839
12840   /* "cvcf.pyx":646
12841  *         if lineparse: return chrom, pos, line
12842  * 
12843  *         id = cols[2]             # <<<<<<<<<<<<<<
12844  * 
12845  *         ref = cols[3].upper()
12846  */
12847   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12848   __Pyx_GOTREF(__pyx_t_2);
12849   __Pyx_DECREF(__pyx_v_id);
12850   __pyx_v_id = __pyx_t_2;
12851   __pyx_t_2 = 0;
12852
12853   /* "cvcf.pyx":648
12854  *         id = cols[2]
12855  * 
12856  *         ref = cols[3].upper()             # <<<<<<<<<<<<<<
12857  *         if ref == ".":
12858  *             self.error(line,self.MISSING_REF)
12859  */
12860   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12861   __Pyx_GOTREF(__pyx_t_2);
12862   __pyx_t_12 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__upper); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12863   __Pyx_GOTREF(__pyx_t_12);
12864   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12865   __pyx_t_2 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12866   __Pyx_GOTREF(__pyx_t_2);
12867   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12868   __Pyx_DECREF(__pyx_v_ref);
12869   __pyx_v_ref = __pyx_t_2;
12870   __pyx_t_2 = 0;
12871
12872   /* "cvcf.pyx":649
12873  * 
12874  *         ref = cols[3].upper()
12875  *         if ref == ".":             # <<<<<<<<<<<<<<
12876  *             self.error(line,self.MISSING_REF)
12877  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
12878  */
12879   __pyx_t_2 = PyObject_RichCompare(__pyx_v_ref, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12880   __Pyx_GOTREF(__pyx_t_2);
12881   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12882   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12883   if (__pyx_t_5) {
12884
12885     /* "cvcf.pyx":650
12886  *         ref = cols[3].upper()
12887  *         if ref == ".":
12888  *             self.error(line,self.MISSING_REF)             # <<<<<<<<<<<<<<
12889  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
12890  *             else:                   ref = ""
12891  */
12892     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12893     __Pyx_GOTREF(__pyx_t_2);
12894     __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__MISSING_REF); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12895     __Pyx_GOTREF(__pyx_t_12);
12896     __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12897     __Pyx_GOTREF(((PyObject *)__pyx_t_11));
12898     __Pyx_INCREF(__pyx_v_line);
12899     PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_line);
12900     __Pyx_GIVEREF(__pyx_v_line);
12901     PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12);
12902     __Pyx_GIVEREF(__pyx_t_12);
12903     __pyx_t_12 = 0;
12904     __pyx_t_12 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12905     __Pyx_GOTREF(__pyx_t_12);
12906     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12907     __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
12908     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12909
12910     /* "cvcf.pyx":651
12911  *         if ref == ".":
12912  *             self.error(line,self.MISSING_REF)
12913  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)             # <<<<<<<<<<<<<<
12914  *             else:                   ref = ""
12915  *         else:
12916  */
12917     __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12918     __Pyx_GOTREF(__pyx_t_12);
12919     __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_int_33, Py_EQ); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12920     __Pyx_GOTREF(__pyx_t_11);
12921     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12922     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12923     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12924     if (__pyx_t_5) {
12925       __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12926       __Pyx_GOTREF(__pyx_t_11);
12927       __pyx_t_12 = PyNumber_Add(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12928       __Pyx_GOTREF(__pyx_t_12);
12929       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12930       __Pyx_GOTREF(__pyx_t_2);
12931       __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12932       __Pyx_GOTREF(((PyObject *)__pyx_t_10));
12933       __Pyx_INCREF(__pyx_v_chrom);
12934       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
12935       __Pyx_GIVEREF(__pyx_v_chrom);
12936       __Pyx_INCREF(__pyx_v_pos);
12937       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_pos);
12938       __Pyx_GIVEREF(__pyx_v_pos);
12939       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_12);
12940       __Pyx_GIVEREF(__pyx_t_12);
12941       PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_2);
12942       __Pyx_GIVEREF(__pyx_t_2);
12943       __pyx_t_12 = 0;
12944       __pyx_t_2 = 0;
12945       __pyx_t_2 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12946       __Pyx_GOTREF(__pyx_t_2);
12947       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12948       __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
12949       __Pyx_DECREF(__pyx_v_ref);
12950       __pyx_v_ref = __pyx_t_2;
12951       __pyx_t_2 = 0;
12952       goto __pyx_L22;
12953     }
12954     /*else*/ {
12955
12956       /* "cvcf.pyx":652
12957  *             self.error(line,self.MISSING_REF)
12958  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
12959  *             else:                   ref = ""             # <<<<<<<<<<<<<<
12960  *         else:
12961  *             for c in ref:
12962  */
12963       __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
12964       __Pyx_DECREF(__pyx_v_ref);
12965       __pyx_v_ref = ((PyObject *)__pyx_kp_s_1);
12966     }
12967     __pyx_L22:;
12968     goto __pyx_L21;
12969   }
12970   /*else*/ {
12971
12972     /* "cvcf.pyx":654
12973  *             else:                   ref = ""
12974  *         else:
12975  *             for c in ref:             # <<<<<<<<<<<<<<
12976  *                 if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF)
12977  *             if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference)
12978  */
12979     if (PyList_CheckExact(__pyx_v_ref) || PyTuple_CheckExact(__pyx_v_ref)) {
12980       __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_ref; __Pyx_INCREF(__pyx_t_2);
12981     } else {
12982       __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12983       __Pyx_GOTREF(__pyx_t_2);
12984     }
12985     for (;;) {
12986       if (likely(PyList_CheckExact(__pyx_t_2))) {
12987         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
12988         __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++;
12989       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
12990         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
12991         __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++;
12992       } else {
12993         __pyx_t_10 = PyIter_Next(__pyx_t_2);
12994         if (!__pyx_t_10) {
12995           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12996           break;
12997         }
12998         __Pyx_GOTREF(__pyx_t_10);
12999       }
13000       __Pyx_DECREF(__pyx_v_c);
13001       __pyx_v_c = __pyx_t_10;
13002       __pyx_t_10 = 0;
13003
13004       /* "cvcf.pyx":655
13005  *         else:
13006  *             for c in ref:
13007  *                 if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF)             # <<<<<<<<<<<<<<
13008  *             if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference)
13009  * 
13010  */
13011       __pyx_t_5 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_n_s__ACGTN), __pyx_v_c))); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13012       if (__pyx_t_5) {
13013         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13014         __Pyx_GOTREF(__pyx_t_10);
13015         __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__UNKNOWN_CHAR_IN_REF); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13016         __Pyx_GOTREF(__pyx_t_11);
13017         __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13018         __Pyx_GOTREF(((PyObject *)__pyx_t_12));
13019         __Pyx_INCREF(__pyx_v_line);
13020         PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
13021         __Pyx_GIVEREF(__pyx_v_line);
13022         PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
13023         __Pyx_GIVEREF(__pyx_t_11);
13024         __pyx_t_11 = 0;
13025         __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13026         __Pyx_GOTREF(__pyx_t_11);
13027         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13028         __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
13029         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13030         goto __pyx_L25;
13031       }
13032       __pyx_L25:;
13033     }
13034     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13035
13036     /* "cvcf.pyx":656
13037  *             for c in ref:
13038  *                 if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF)
13039  *             if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference)             # <<<<<<<<<<<<<<
13040  * 
13041  *         # make sure reference is sane
13042  */
13043     __pyx_t_5 = ((PySequence_Contains(__pyx_v_ref, ((PyObject *)__pyx_n_s__N)))); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13044     if (__pyx_t_5) {
13045       __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13046       __Pyx_GOTREF(__pyx_t_2);
13047       __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13048       __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13049       __Pyx_GOTREF(__pyx_t_11);
13050       __pyx_t_12 = PyNumber_Add(__pyx_v_pos, __pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13051       __Pyx_GOTREF(__pyx_t_12);
13052       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13053       __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13054       __Pyx_GOTREF(__pyx_t_11);
13055       __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13056       __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13057       __Pyx_INCREF(__pyx_v_chrom);
13058       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
13059       __Pyx_GIVEREF(__pyx_v_chrom);
13060       __Pyx_INCREF(__pyx_v_pos);
13061       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_pos);
13062       __Pyx_GIVEREF(__pyx_v_pos);
13063       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_12);
13064       __Pyx_GIVEREF(__pyx_t_12);
13065       PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_11);
13066       __Pyx_GIVEREF(__pyx_t_11);
13067       __pyx_t_12 = 0;
13068       __pyx_t_11 = 0;
13069       __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13070       __Pyx_GOTREF(__pyx_t_11);
13071       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13072       __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
13073       __Pyx_DECREF(__pyx_v_ref);
13074       __pyx_v_ref = __pyx_t_11;
13075       __pyx_t_11 = 0;
13076       goto __pyx_L26;
13077     }
13078     __pyx_L26:;
13079   }
13080   __pyx_L21:;
13081
13082   /* "cvcf.pyx":659
13083  * 
13084  *         # make sure reference is sane
13085  *         if self._reference:             # <<<<<<<<<<<<<<
13086  *             left = max(0,pos-100)
13087  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
13088  */
13089   __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13090   __Pyx_GOTREF(__pyx_t_11);
13091   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13092   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13093   if (__pyx_t_5) {
13094
13095     /* "cvcf.pyx":660
13096  *         # make sure reference is sane
13097  *         if self._reference:
13098  *             left = max(0,pos-100)             # <<<<<<<<<<<<<<
13099  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
13100  *             faref = faref_leftflank[pos-left:]
13101  */
13102     __pyx_t_11 = PyNumber_Subtract(__pyx_v_pos, __pyx_int_100); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13103     __Pyx_GOTREF(__pyx_t_11);
13104     __pyx_t_13 = 0;
13105     __pyx_t_2 = PyInt_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13106     __Pyx_GOTREF(__pyx_t_2);
13107     __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_2, Py_GT); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13108     __Pyx_GOTREF(__pyx_t_12);
13109     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13110     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13111     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13112     if (__pyx_t_5) {
13113       __Pyx_INCREF(__pyx_t_11);
13114       __pyx_t_10 = __pyx_t_11;
13115     } else {
13116       __pyx_t_12 = PyInt_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13117       __Pyx_GOTREF(__pyx_t_12);
13118       __pyx_t_10 = __pyx_t_12;
13119       __pyx_t_12 = 0;
13120     }
13121     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13122     __Pyx_INCREF(__pyx_t_10);
13123     __Pyx_DECREF(__pyx_v_left);
13124     __pyx_v_left = __pyx_t_10;
13125     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13126
13127     /* "cvcf.pyx":661
13128  *         if self._reference:
13129  *             left = max(0,pos-100)
13130  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)             # <<<<<<<<<<<<<<
13131  *             faref = faref_leftflank[pos-left:]
13132  *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
13133  */
13134     __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13135     __Pyx_GOTREF(__pyx_t_10);
13136     __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13137     __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13138     __Pyx_GOTREF(__pyx_t_11);
13139     __pyx_t_12 = PyNumber_Add(__pyx_v_pos, __pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13140     __Pyx_GOTREF(__pyx_t_12);
13141     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13142     __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13143     __Pyx_GOTREF(__pyx_t_11);
13144     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13145     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
13146     __Pyx_INCREF(__pyx_v_chrom);
13147     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
13148     __Pyx_GIVEREF(__pyx_v_chrom);
13149     __Pyx_INCREF(__pyx_v_left);
13150     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_left);
13151     __Pyx_GIVEREF(__pyx_v_left);
13152     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_12);
13153     __Pyx_GIVEREF(__pyx_t_12);
13154     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_11);
13155     __Pyx_GIVEREF(__pyx_t_11);
13156     __pyx_t_12 = 0;
13157     __pyx_t_11 = 0;
13158     __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13159     __Pyx_GOTREF(__pyx_t_11);
13160     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13161     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
13162     __Pyx_DECREF(__pyx_v_faref_leftflank);
13163     __pyx_v_faref_leftflank = __pyx_t_11;
13164     __pyx_t_11 = 0;
13165
13166     /* "cvcf.pyx":662
13167  *             left = max(0,pos-100)
13168  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
13169  *             faref = faref_leftflank[pos-left:]             # <<<<<<<<<<<<<<
13170  *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
13171  *             ref = faref
13172  */
13173     __pyx_t_11 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13174     __Pyx_GOTREF(__pyx_t_11);
13175     __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13176     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13177     __pyx_t_11 = __Pyx_PySequence_GetSlice(__pyx_v_faref_leftflank, __pyx_t_4, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13178     __Pyx_GOTREF(__pyx_t_11);
13179     __Pyx_DECREF(__pyx_v_faref);
13180     __pyx_v_faref = __pyx_t_11;
13181     __pyx_t_11 = 0;
13182
13183     /* "cvcf.pyx":663
13184  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
13185  *             faref = faref_leftflank[pos-left:]
13186  *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))             # <<<<<<<<<<<<<<
13187  *             ref = faref
13188  * 
13189  */
13190     __pyx_t_11 = PyObject_RichCompare(__pyx_v_faref, __pyx_v_ref, Py_NE); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13191     __Pyx_GOTREF(__pyx_t_11);
13192     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13193     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13194     if (__pyx_t_5) {
13195       __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13196       __Pyx_GOTREF(__pyx_t_11);
13197       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__WRONG_REF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13198       __Pyx_GOTREF(__pyx_t_2);
13199       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13200       __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13201       __Pyx_INCREF(__pyx_v_faref);
13202       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_faref);
13203       __Pyx_GIVEREF(__pyx_v_faref);
13204       __Pyx_INCREF(__pyx_v_ref);
13205       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_ref);
13206       __Pyx_GIVEREF(__pyx_v_ref);
13207       __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_103), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13208       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
13209       __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
13210       __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13211       __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13212       __Pyx_INCREF(__pyx_v_line);
13213       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
13214       __Pyx_GIVEREF(__pyx_v_line);
13215       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
13216       __Pyx_GIVEREF(__pyx_t_2);
13217       PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_t_12));
13218       __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
13219       __pyx_t_2 = 0;
13220       __pyx_t_12 = 0;
13221       __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13222       __Pyx_GOTREF(__pyx_t_12);
13223       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13224       __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
13225       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13226       goto __pyx_L28;
13227     }
13228     __pyx_L28:;
13229
13230     /* "cvcf.pyx":664
13231  *             faref = faref_leftflank[pos-left:]
13232  *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
13233  *             ref = faref             # <<<<<<<<<<<<<<
13234  * 
13235  *         # convert v3.3 to v4.0 alleles below
13236  */
13237     __Pyx_INCREF(__pyx_v_faref);
13238     __Pyx_DECREF(__pyx_v_ref);
13239     __pyx_v_ref = __pyx_v_faref;
13240     goto __pyx_L27;
13241   }
13242   __pyx_L27:;
13243
13244   /* "cvcf.pyx":667
13245  * 
13246  *         # convert v3.3 to v4.0 alleles below
13247  *         if cols[4] == ".": alt = []             # <<<<<<<<<<<<<<
13248  *         else: alt = cols[4].upper().split(',')
13249  * 
13250  */
13251   __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13252   __Pyx_GOTREF(__pyx_t_12);
13253   __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13254   __Pyx_GOTREF(__pyx_t_10);
13255   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13256   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13257   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13258   if (__pyx_t_5) {
13259     __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13260     __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13261     __Pyx_DECREF(__pyx_v_alt);
13262     __pyx_v_alt = ((PyObject *)__pyx_t_10);
13263     __pyx_t_10 = 0;
13264     goto __pyx_L29;
13265   }
13266   /*else*/ {
13267
13268     /* "cvcf.pyx":668
13269  *         # convert v3.3 to v4.0 alleles below
13270  *         if cols[4] == ".": alt = []
13271  *         else: alt = cols[4].upper().split(',')             # <<<<<<<<<<<<<<
13272  * 
13273  *         if cols[5] == ".": qual = -1
13274  */
13275     __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13276     __Pyx_GOTREF(__pyx_t_10);
13277     __pyx_t_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__upper); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13278     __Pyx_GOTREF(__pyx_t_12);
13279     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13280     __pyx_t_10 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13281     __Pyx_GOTREF(__pyx_t_10);
13282     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13283     __pyx_t_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__split); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13284     __Pyx_GOTREF(__pyx_t_12);
13285     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13286     __pyx_t_10 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13287     __Pyx_GOTREF(__pyx_t_10);
13288     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13289     __Pyx_DECREF(__pyx_v_alt);
13290     __pyx_v_alt = __pyx_t_10;
13291     __pyx_t_10 = 0;
13292   }
13293   __pyx_L29:;
13294
13295   /* "cvcf.pyx":670
13296  *         else: alt = cols[4].upper().split(',')
13297  * 
13298  *         if cols[5] == ".": qual = -1             # <<<<<<<<<<<<<<
13299  *         else:
13300  *             try:    qual = float(cols[5])
13301  */
13302   __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13303   __Pyx_GOTREF(__pyx_t_10);
13304   __pyx_t_12 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13305   __Pyx_GOTREF(__pyx_t_12);
13306   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13307   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13308   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13309   if (__pyx_t_5) {
13310     __pyx_v_qual = -1.0;
13311     goto __pyx_L30;
13312   }
13313   /*else*/ {
13314
13315     /* "cvcf.pyx":672
13316  *         if cols[5] == ".": qual = -1
13317  *         else:
13318  *             try:    qual = float(cols[5])             # <<<<<<<<<<<<<<
13319  *             except: self.error(line,self.QUAL_NOT_NUMERICAL)
13320  * 
13321  */
13322     {
13323       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
13324       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
13325       __Pyx_XGOTREF(__pyx_save_exc_type);
13326       __Pyx_XGOTREF(__pyx_save_exc_value);
13327       __Pyx_XGOTREF(__pyx_save_exc_tb);
13328       /*try:*/ {
13329         __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
13330         __Pyx_GOTREF(__pyx_t_12);
13331         __pyx_t_14 = __Pyx_PyObject_AsDouble(__pyx_t_12); if (unlikely(__pyx_t_14 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
13332         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13333         __pyx_v_qual = __pyx_t_14;
13334       }
13335       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
13336       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
13337       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
13338       goto __pyx_L38_try_end;
13339       __pyx_L31_error:;
13340       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13341       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13342       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13343       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13344       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
13345       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13346       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
13347
13348       /* "cvcf.pyx":673
13349  *         else:
13350  *             try:    qual = float(cols[5])
13351  *             except: self.error(line,self.QUAL_NOT_NUMERICAL)             # <<<<<<<<<<<<<<
13352  * 
13353  *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
13354  */
13355       /*except:*/ {
13356         __Pyx_AddTraceback("cvcf.VCF.parse_data");
13357         if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
13358         __Pyx_GOTREF(__pyx_t_12);
13359         __Pyx_GOTREF(__pyx_t_10);
13360         __Pyx_GOTREF(__pyx_t_11);
13361         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
13362         __Pyx_GOTREF(__pyx_t_2);
13363         __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__QUAL_NOT_NUMERICAL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
13364         __Pyx_GOTREF(__pyx_t_9);
13365         __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
13366         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
13367         __Pyx_INCREF(__pyx_v_line);
13368         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
13369         __Pyx_GIVEREF(__pyx_v_line);
13370         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9);
13371         __Pyx_GIVEREF(__pyx_t_9);
13372         __pyx_t_9 = 0;
13373         __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
13374         __Pyx_GOTREF(__pyx_t_9);
13375         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13376         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
13377         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13378         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13379         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13380         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13381         goto __pyx_L32_exception_handled;
13382       }
13383       __pyx_L33_except_error:;
13384       __Pyx_XGIVEREF(__pyx_save_exc_type);
13385       __Pyx_XGIVEREF(__pyx_save_exc_value);
13386       __Pyx_XGIVEREF(__pyx_save_exc_tb);
13387       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
13388       goto __pyx_L1_error;
13389       __pyx_L32_exception_handled:;
13390       __Pyx_XGIVEREF(__pyx_save_exc_type);
13391       __Pyx_XGIVEREF(__pyx_save_exc_value);
13392       __Pyx_XGIVEREF(__pyx_save_exc_tb);
13393       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
13394       __pyx_L38_try_end:;
13395     }
13396   }
13397   __pyx_L30:;
13398
13399   /* "cvcf.pyx":676
13400  * 
13401  *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
13402  *         if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = []             # <<<<<<<<<<<<<<
13403  *         else: filter = cols[6].split(';')
13404  * 
13405  */
13406   __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13407   __Pyx_GOTREF(__pyx_t_11);
13408   __pyx_t_10 = PyObject_RichCompare(__pyx_t_11, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13409   __Pyx_GOTREF(__pyx_t_10);
13410   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13411   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13412   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13413   if (!__pyx_t_5) {
13414     __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13415     __Pyx_GOTREF(__pyx_t_10);
13416     __pyx_t_11 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_n_s__PASS), Py_EQ); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13417     __Pyx_GOTREF(__pyx_t_11);
13418     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13419     __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13420     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13421     if (!__pyx_t_7) {
13422       __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13423       __Pyx_GOTREF(__pyx_t_11);
13424       __pyx_t_10 = PyObject_RichCompare(__pyx_t_11, ((PyObject *)__pyx_kp_s__0), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13425       __Pyx_GOTREF(__pyx_t_10);
13426       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13427       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13428       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13429       __pyx_t_15 = __pyx_t_6;
13430     } else {
13431       __pyx_t_15 = __pyx_t_7;
13432     }
13433     __pyx_t_7 = __pyx_t_15;
13434   } else {
13435     __pyx_t_7 = __pyx_t_5;
13436   }
13437   if (__pyx_t_7) {
13438     __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13439     __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13440     __Pyx_DECREF(__pyx_v_filter);
13441     __pyx_v_filter = ((PyObject *)__pyx_t_10);
13442     __pyx_t_10 = 0;
13443     goto __pyx_L41;
13444   }
13445   /*else*/ {
13446
13447     /* "cvcf.pyx":677
13448  *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
13449  *         if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = []
13450  *         else: filter = cols[6].split(';')             # <<<<<<<<<<<<<<
13451  * 
13452  *         # dictionary of keys, and list of values
13453  */
13454     __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13455     __Pyx_GOTREF(__pyx_t_10);
13456     __pyx_t_11 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__split); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13457     __Pyx_GOTREF(__pyx_t_11);
13458     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13459     __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_105), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13460     __Pyx_GOTREF(__pyx_t_10);
13461     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13462     __Pyx_DECREF(__pyx_v_filter);
13463     __pyx_v_filter = __pyx_t_10;
13464     __pyx_t_10 = 0;
13465   }
13466   __pyx_L41:;
13467
13468   /* "cvcf.pyx":680
13469  * 
13470  *         # dictionary of keys, and list of values
13471  *         info = {}             # <<<<<<<<<<<<<<
13472  *         if cols[7] != ".":
13473  *             for blurp in cols[7].split(';'):
13474  */
13475   __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13476   __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13477   __Pyx_DECREF(((PyObject *)__pyx_v_info));
13478   __pyx_v_info = __pyx_t_10;
13479   __pyx_t_10 = 0;
13480
13481   /* "cvcf.pyx":681
13482  *         # dictionary of keys, and list of values
13483  *         info = {}
13484  *         if cols[7] != ".":             # <<<<<<<<<<<<<<
13485  *             for blurp in cols[7].split(';'):
13486  *                 elts = blurp.split('=')
13487  */
13488   __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 7, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13489   __Pyx_GOTREF(__pyx_t_10);
13490   __pyx_t_11 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_kp_s_9), Py_NE); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13491   __Pyx_GOTREF(__pyx_t_11);
13492   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13493   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13494   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13495   if (__pyx_t_7) {
13496
13497     /* "cvcf.pyx":682
13498  *         info = {}
13499  *         if cols[7] != ".":
13500  *             for blurp in cols[7].split(';'):             # <<<<<<<<<<<<<<
13501  *                 elts = blurp.split('=')
13502  *                 if len(elts) == 1: v = None
13503  */
13504     __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 7, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13505     __Pyx_GOTREF(__pyx_t_11);
13506     __pyx_t_10 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__split); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13507     __Pyx_GOTREF(__pyx_t_10);
13508     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13509     __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13510     __Pyx_GOTREF(__pyx_t_11);
13511     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13512     if (PyList_CheckExact(__pyx_t_11) || PyTuple_CheckExact(__pyx_t_11)) {
13513       __pyx_t_4 = 0; __pyx_t_10 = __pyx_t_11; __Pyx_INCREF(__pyx_t_10);
13514     } else {
13515       __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13516       __Pyx_GOTREF(__pyx_t_10);
13517     }
13518     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13519     for (;;) {
13520       if (likely(PyList_CheckExact(__pyx_t_10))) {
13521         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_10)) break;
13522         __pyx_t_11 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++;
13523       } else if (likely(PyTuple_CheckExact(__pyx_t_10))) {
13524         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
13525         __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++;
13526       } else {
13527         __pyx_t_11 = PyIter_Next(__pyx_t_10);
13528         if (!__pyx_t_11) {
13529           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13530           break;
13531         }
13532         __Pyx_GOTREF(__pyx_t_11);
13533       }
13534       __Pyx_DECREF(__pyx_v_blurp);
13535       __pyx_v_blurp = __pyx_t_11;
13536       __pyx_t_11 = 0;
13537
13538       /* "cvcf.pyx":683
13539  *         if cols[7] != ".":
13540  *             for blurp in cols[7].split(';'):
13541  *                 elts = blurp.split('=')             # <<<<<<<<<<<<<<
13542  *                 if len(elts) == 1: v = None
13543  *                 elif len(elts) == 2: v = elts[1]
13544  */
13545       __pyx_t_11 = PyObject_GetAttr(__pyx_v_blurp, __pyx_n_s__split); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13546       __Pyx_GOTREF(__pyx_t_11);
13547       __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13548       __Pyx_GOTREF(__pyx_t_12);
13549       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13550       __Pyx_DECREF(__pyx_v_elts);
13551       __pyx_v_elts = __pyx_t_12;
13552       __pyx_t_12 = 0;
13553
13554       /* "cvcf.pyx":684
13555  *             for blurp in cols[7].split(';'):
13556  *                 elts = blurp.split('=')
13557  *                 if len(elts) == 1: v = None             # <<<<<<<<<<<<<<
13558  *                 elif len(elts) == 2: v = elts[1]
13559  *                 else: self.error(line,self.ERROR_INFO_STRING)
13560  */
13561       __pyx_t_3 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13562       __pyx_t_7 = (__pyx_t_3 == 1);
13563       if (__pyx_t_7) {
13564         __Pyx_INCREF(Py_None);
13565         __Pyx_DECREF(__pyx_v_v);
13566         __pyx_v_v = Py_None;
13567         goto __pyx_L45;
13568       }
13569
13570       /* "cvcf.pyx":685
13571  *                 elts = blurp.split('=')
13572  *                 if len(elts) == 1: v = None
13573  *                 elif len(elts) == 2: v = elts[1]             # <<<<<<<<<<<<<<
13574  *                 else: self.error(line,self.ERROR_INFO_STRING)
13575  *                 info[elts[0]] = self.parse_formatdata(elts[0], v, self._info, line)
13576  */
13577       __pyx_t_3 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13578       __pyx_t_7 = (__pyx_t_3 == 2);
13579       if (__pyx_t_7) {
13580         __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13581         __Pyx_GOTREF(__pyx_t_12);
13582         __Pyx_DECREF(__pyx_v_v);
13583         __pyx_v_v = __pyx_t_12;
13584         __pyx_t_12 = 0;
13585         goto __pyx_L45;
13586       }
13587       /*else*/ {
13588
13589         /* "cvcf.pyx":686
13590  *                 if len(elts) == 1: v = None
13591  *                 elif len(elts) == 2: v = elts[1]
13592  *                 else: self.error(line,self.ERROR_INFO_STRING)             # <<<<<<<<<<<<<<
13593  *                 info[elts[0]] = self.parse_formatdata(elts[0], v, self._info, line)
13594  * 
13595  */
13596         __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13597         __Pyx_GOTREF(__pyx_t_12);
13598         __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ERROR_INFO_STRING); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13599         __Pyx_GOTREF(__pyx_t_11);
13600         __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13601         __Pyx_GOTREF(((PyObject *)__pyx_t_9));
13602         __Pyx_INCREF(__pyx_v_line);
13603         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
13604         __Pyx_GIVEREF(__pyx_v_line);
13605         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11);
13606         __Pyx_GIVEREF(__pyx_t_11);
13607         __pyx_t_11 = 0;
13608         __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13609         __Pyx_GOTREF(__pyx_t_11);
13610         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13611         __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
13612         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13613       }
13614       __pyx_L45:;
13615
13616       /* "cvcf.pyx":687
13617  *                 elif len(elts) == 2: v = elts[1]
13618  *                 else: self.error(line,self.ERROR_INFO_STRING)
13619  *                 info[elts[0]] = self.parse_formatdata(elts[0], v, self._info, line)             # <<<<<<<<<<<<<<
13620  * 
13621  *         # Gracefully deal with absent FORMAT column
13622  */
13623       __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_formatdata); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13624       __Pyx_GOTREF(__pyx_t_11);
13625       __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13626       __Pyx_GOTREF(__pyx_t_9);
13627       __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___info); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13628       __Pyx_GOTREF(__pyx_t_12);
13629       __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13630       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
13631       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
13632       __Pyx_GIVEREF(__pyx_t_9);
13633       __Pyx_INCREF(__pyx_v_v);
13634       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_v);
13635       __Pyx_GIVEREF(__pyx_v_v);
13636       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_12);
13637       __Pyx_GIVEREF(__pyx_t_12);
13638       __Pyx_INCREF(__pyx_v_line);
13639       PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_line);
13640       __Pyx_GIVEREF(__pyx_v_line);
13641       __pyx_t_9 = 0;
13642       __pyx_t_12 = 0;
13643       __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13644       __Pyx_GOTREF(__pyx_t_12);
13645       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13646       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
13647       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13648       __Pyx_GOTREF(__pyx_t_1);
13649       if (PyDict_SetItem(((PyObject *)__pyx_v_info), __pyx_t_1, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13650       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13651       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13652     }
13653     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13654     goto __pyx_L42;
13655   }
13656   __pyx_L42:;
13657
13658   /* "cvcf.pyx":690
13659  * 
13660  *         # Gracefully deal with absent FORMAT column
13661  *         if cols[8] == "": format = []             # <<<<<<<<<<<<<<
13662  *         else: format = cols[8].split(':')
13663  * 
13664  */
13665   __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 8, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13666   __Pyx_GOTREF(__pyx_t_10);
13667   __pyx_t_12 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_kp_s_1), Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13668   __Pyx_GOTREF(__pyx_t_12);
13669   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13670   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13671   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13672   if (__pyx_t_7) {
13673     __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13674     __Pyx_GOTREF(((PyObject *)__pyx_t_12));
13675     __Pyx_DECREF(__pyx_v_format);
13676     __pyx_v_format = ((PyObject *)__pyx_t_12);
13677     __pyx_t_12 = 0;
13678     goto __pyx_L46;
13679   }
13680   /*else*/ {
13681
13682     /* "cvcf.pyx":691
13683  *         # Gracefully deal with absent FORMAT column
13684  *         if cols[8] == "": format = []
13685  *         else: format = cols[8].split(':')             # <<<<<<<<<<<<<<
13686  * 
13687  *         # check: all filters are defined
13688  */
13689     __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 8, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13690     __Pyx_GOTREF(__pyx_t_12);
13691     __pyx_t_10 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__split); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13692     __Pyx_GOTREF(__pyx_t_10);
13693     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13694     __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13695     __Pyx_GOTREF(__pyx_t_12);
13696     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13697     __Pyx_DECREF(__pyx_v_format);
13698     __pyx_v_format = __pyx_t_12;
13699     __pyx_t_12 = 0;
13700   }
13701   __pyx_L46:;
13702
13703   /* "cvcf.pyx":694
13704  * 
13705  *         # check: all filters are defined
13706  *         for f in filter:             # <<<<<<<<<<<<<<
13707  *             if f not in self._filter: self.error(line,self.FILTER_NOT_DEFINED, f)
13708  * 
13709  */
13710   if (PyList_CheckExact(__pyx_v_filter) || PyTuple_CheckExact(__pyx_v_filter)) {
13711     __pyx_t_4 = 0; __pyx_t_12 = __pyx_v_filter; __Pyx_INCREF(__pyx_t_12);
13712   } else {
13713     __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_filter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13714     __Pyx_GOTREF(__pyx_t_12);
13715   }
13716   for (;;) {
13717     if (likely(PyList_CheckExact(__pyx_t_12))) {
13718       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
13719       __pyx_t_10 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++;
13720     } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
13721       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
13722       __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++;
13723     } else {
13724       __pyx_t_10 = PyIter_Next(__pyx_t_12);
13725       if (!__pyx_t_10) {
13726         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13727         break;
13728       }
13729       __Pyx_GOTREF(__pyx_t_10);
13730     }
13731     __Pyx_DECREF(__pyx_v_f);
13732     __pyx_v_f = __pyx_t_10;
13733     __pyx_t_10 = 0;
13734
13735     /* "cvcf.pyx":695
13736  *         # check: all filters are defined
13737  *         for f in filter:
13738  *             if f not in self._filter: self.error(line,self.FILTER_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
13739  * 
13740  *         # check: format fields are defined
13741  */
13742     __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___filter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13743     __Pyx_GOTREF(__pyx_t_10);
13744     __pyx_t_7 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_10, __pyx_v_f))); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13745     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13746     if (__pyx_t_7) {
13747       __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13748       __Pyx_GOTREF(__pyx_t_10);
13749       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__FILTER_NOT_DEFINED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13750       __Pyx_GOTREF(__pyx_t_1);
13751       __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13752       __Pyx_GOTREF(((PyObject *)__pyx_t_11));
13753       __Pyx_INCREF(__pyx_v_line);
13754       PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_line);
13755       __Pyx_GIVEREF(__pyx_v_line);
13756       PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
13757       __Pyx_GIVEREF(__pyx_t_1);
13758       __Pyx_INCREF(__pyx_v_f);
13759       PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_f);
13760       __Pyx_GIVEREF(__pyx_v_f);
13761       __pyx_t_1 = 0;
13762       __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13763       __Pyx_GOTREF(__pyx_t_1);
13764       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13765       __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
13766       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13767       goto __pyx_L49;
13768     }
13769     __pyx_L49:;
13770   }
13771   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13772
13773   /* "cvcf.pyx":698
13774  * 
13775  *         # check: format fields are defined
13776  *         for f in format:             # <<<<<<<<<<<<<<
13777  *             if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f)
13778  * 
13779  */
13780   if (PyList_CheckExact(__pyx_v_format) || PyTuple_CheckExact(__pyx_v_format)) {
13781     __pyx_t_4 = 0; __pyx_t_12 = __pyx_v_format; __Pyx_INCREF(__pyx_t_12);
13782   } else {
13783     __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_format); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13784     __Pyx_GOTREF(__pyx_t_12);
13785   }
13786   for (;;) {
13787     if (likely(PyList_CheckExact(__pyx_t_12))) {
13788       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
13789       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
13790     } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
13791       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
13792       __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
13793     } else {
13794       __pyx_t_1 = PyIter_Next(__pyx_t_12);
13795       if (!__pyx_t_1) {
13796         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13797         break;
13798       }
13799       __Pyx_GOTREF(__pyx_t_1);
13800     }
13801     __Pyx_DECREF(__pyx_v_f);
13802     __pyx_v_f = __pyx_t_1;
13803     __pyx_t_1 = 0;
13804
13805     /* "cvcf.pyx":699
13806  *         # check: format fields are defined
13807  *         for f in format:
13808  *             if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
13809  * 
13810  *         # convert v3.3 alleles
13811  */
13812     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13813     __Pyx_GOTREF(__pyx_t_1);
13814     __pyx_t_7 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_1, __pyx_v_f))); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13815     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13816     if (__pyx_t_7) {
13817       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13818       __Pyx_GOTREF(__pyx_t_1);
13819       __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__FORMAT_NOT_DEFINED); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13820       __Pyx_GOTREF(__pyx_t_11);
13821       __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13822       __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13823       __Pyx_INCREF(__pyx_v_line);
13824       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
13825       __Pyx_GIVEREF(__pyx_v_line);
13826       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
13827       __Pyx_GIVEREF(__pyx_t_11);
13828       __Pyx_INCREF(__pyx_v_f);
13829       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_f);
13830       __Pyx_GIVEREF(__pyx_v_f);
13831       __pyx_t_11 = 0;
13832       __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13833       __Pyx_GOTREF(__pyx_t_11);
13834       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13835       __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
13836       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13837       goto __pyx_L52;
13838     }
13839     __pyx_L52:;
13840   }
13841   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13842
13843   /* "cvcf.pyx":702
13844  * 
13845  *         # convert v3.3 alleles
13846  *         if self._version == 33:             # <<<<<<<<<<<<<<
13847  *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)
13848  *             newalts = []
13849  */
13850   __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13851   __Pyx_GOTREF(__pyx_t_12);
13852   __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_int_33, Py_EQ); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13853   __Pyx_GOTREF(__pyx_t_11);
13854   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13855   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13856   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13857   if (__pyx_t_7) {
13858
13859     /* "cvcf.pyx":703
13860  *         # convert v3.3 alleles
13861  *         if self._version == 33:
13862  *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)             # <<<<<<<<<<<<<<
13863  *             newalts = []
13864  *             have_deletions = False
13865  */
13866     __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13867     __pyx_t_7 = (__pyx_t_4 != 1);
13868     if (__pyx_t_7) {
13869       __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13870       __Pyx_GOTREF(__pyx_t_11);
13871       __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__V33_BAD_REF); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13872       __Pyx_GOTREF(__pyx_t_12);
13873       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13874       __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13875       __Pyx_INCREF(__pyx_v_line);
13876       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
13877       __Pyx_GIVEREF(__pyx_v_line);
13878       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12);
13879       __Pyx_GIVEREF(__pyx_t_12);
13880       __pyx_t_12 = 0;
13881       __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13882       __Pyx_GOTREF(__pyx_t_12);
13883       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13884       __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
13885       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13886       goto __pyx_L54;
13887     }
13888     __pyx_L54:;
13889
13890     /* "cvcf.pyx":704
13891  *         if self._version == 33:
13892  *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)
13893  *             newalts = []             # <<<<<<<<<<<<<<
13894  *             have_deletions = False
13895  *             for a in alt:
13896  */
13897     __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13898     __Pyx_GOTREF(((PyObject *)__pyx_t_12));
13899     __Pyx_DECREF(((PyObject *)__pyx_v_newalts));
13900     __pyx_v_newalts = __pyx_t_12;
13901     __pyx_t_12 = 0;
13902
13903     /* "cvcf.pyx":705
13904  *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)
13905  *             newalts = []
13906  *             have_deletions = False             # <<<<<<<<<<<<<<
13907  *             for a in alt:
13908  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
13909  */
13910     __pyx_v_have_deletions = 0;
13911
13912     /* "cvcf.pyx":706
13913  *             newalts = []
13914  *             have_deletions = False
13915  *             for a in alt:             # <<<<<<<<<<<<<<
13916  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
13917  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
13918  */
13919     if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
13920       __pyx_t_4 = 0; __pyx_t_12 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_12);
13921     } else {
13922       __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13923       __Pyx_GOTREF(__pyx_t_12);
13924     }
13925     for (;;) {
13926       if (likely(PyList_CheckExact(__pyx_t_12))) {
13927         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
13928         __pyx_t_10 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++;
13929       } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
13930         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
13931         __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++;
13932       } else {
13933         __pyx_t_10 = PyIter_Next(__pyx_t_12);
13934         if (!__pyx_t_10) {
13935           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13936           break;
13937         }
13938         __Pyx_GOTREF(__pyx_t_10);
13939       }
13940       __Pyx_DECREF(__pyx_v_a);
13941       __pyx_v_a = __pyx_t_10;
13942       __pyx_t_10 = 0;
13943
13944       /* "cvcf.pyx":707
13945  *             have_deletions = False
13946  *             for a in alt:
13947  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference             # <<<<<<<<<<<<<<
13948  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
13949  *                 elif a.startswith('D'): # allow D<seq> and D<num>
13950  */
13951       __pyx_t_3 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13952       __pyx_t_7 = (__pyx_t_3 == 1);
13953       if (__pyx_t_7) {
13954         __pyx_t_10 = __Pyx_PySequence_GetSlice(__pyx_v_ref, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13955         __Pyx_GOTREF(__pyx_t_10);
13956         __pyx_t_11 = PyNumber_Add(__pyx_v_a, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13957         __Pyx_GOTREF(__pyx_t_11);
13958         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13959         __Pyx_DECREF(__pyx_v_a);
13960         __pyx_v_a = __pyx_t_11;
13961         __pyx_t_11 = 0;
13962         goto __pyx_L57;
13963       }
13964
13965       /* "cvcf.pyx":708
13966  *             for a in alt:
13967  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
13968  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference             # <<<<<<<<<<<<<<
13969  *                 elif a.startswith('D'): # allow D<seq> and D<num>
13970  *                     have_deletions = True
13971  */
13972       __pyx_t_11 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__startswith); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13973       __Pyx_GOTREF(__pyx_t_11);
13974       __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_109), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13975       __Pyx_GOTREF(__pyx_t_10);
13976       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13977       __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13978       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13979       if (__pyx_t_7) {
13980         __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13981         __Pyx_GOTREF(__pyx_t_10);
13982         __pyx_t_11 = __Pyx_PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13983         __Pyx_GOTREF(__pyx_t_11);
13984         __pyx_t_1 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13985         __Pyx_GOTREF(__pyx_t_1);
13986         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13987         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13988         __pyx_t_11 = __Pyx_PySequence_GetSlice(__pyx_v_ref, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13989         __Pyx_GOTREF(__pyx_t_11);
13990         __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13991         __Pyx_GOTREF(__pyx_t_10);
13992         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13993         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13994         __Pyx_DECREF(__pyx_v_a);
13995         __pyx_v_a = __pyx_t_10;
13996         __pyx_t_10 = 0;
13997         goto __pyx_L57;
13998       }
13999
14000       /* "cvcf.pyx":709
14001  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
14002  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
14003  *                 elif a.startswith('D'): # allow D<seq> and D<num>             # <<<<<<<<<<<<<<
14004  *                     have_deletions = True
14005  *                     try:
14006  */
14007       __pyx_t_10 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__startswith); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14008       __Pyx_GOTREF(__pyx_t_10);
14009       __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14010       __Pyx_GOTREF(__pyx_t_11);
14011       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14012       __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14013       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14014       if (__pyx_t_7) {
14015
14016         /* "cvcf.pyx":710
14017  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
14018  *                 elif a.startswith('D'): # allow D<seq> and D<num>
14019  *                     have_deletions = True             # <<<<<<<<<<<<<<
14020  *                     try:
14021  *                         l = int(a[1:])          # throws ValueError if sequence
14022  */
14023         __pyx_v_have_deletions = 1;
14024
14025         /* "cvcf.pyx":711
14026  *                 elif a.startswith('D'): # allow D<seq> and D<num>
14027  *                     have_deletions = True
14028  *                     try:             # <<<<<<<<<<<<<<
14029  *                         l = int(a[1:])          # throws ValueError if sequence
14030  *                         if len(ref) < l:        # add to reference if necessary
14031  */
14032         {
14033           PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
14034           __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
14035           __Pyx_XGOTREF(__pyx_save_exc_type);
14036           __Pyx_XGOTREF(__pyx_save_exc_value);
14037           __Pyx_XGOTREF(__pyx_save_exc_tb);
14038           /*try:*/ {
14039
14040             /* "cvcf.pyx":712
14041  *                     have_deletions = True
14042  *                     try:
14043  *                         l = int(a[1:])          # throws ValueError if sequence             # <<<<<<<<<<<<<<
14044  *                         if len(ref) < l:        # add to reference if necessary
14045  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
14046  */
14047             __pyx_t_11 = __Pyx_PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14048             __Pyx_GOTREF(__pyx_t_11);
14049             __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14050             __Pyx_GOTREF(((PyObject *)__pyx_t_10));
14051             PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
14052             __Pyx_GIVEREF(__pyx_t_11);
14053             __pyx_t_11 = 0;
14054             __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14055             __Pyx_GOTREF(__pyx_t_11);
14056             __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
14057             __Pyx_DECREF(__pyx_v_l);
14058             __pyx_v_l = __pyx_t_11;
14059             __pyx_t_11 = 0;
14060
14061             /* "cvcf.pyx":713
14062  *                     try:
14063  *                         l = int(a[1:])          # throws ValueError if sequence
14064  *                         if len(ref) < l:        # add to reference if necessary             # <<<<<<<<<<<<<<
14065  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
14066  *                             ref += addns
14067  */
14068             __pyx_t_3 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14069             __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14070             __Pyx_GOTREF(__pyx_t_11);
14071             __pyx_t_10 = PyObject_RichCompare(__pyx_t_11, __pyx_v_l, Py_LT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14072             __Pyx_GOTREF(__pyx_t_10);
14073             __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14074             __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14075             __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14076             if (__pyx_t_7) {
14077
14078               /* "cvcf.pyx":714
14079  *                         l = int(a[1:])          # throws ValueError if sequence
14080  *                         if len(ref) < l:        # add to reference if necessary
14081  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)             # <<<<<<<<<<<<<<
14082  *                             ref += addns
14083  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14084  */
14085               __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14086               __Pyx_GOTREF(__pyx_t_10);
14087               __pyx_t_3 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14088               __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14089               __Pyx_GOTREF(__pyx_t_11);
14090               __pyx_t_1 = PyNumber_Add(__pyx_v_pos, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14091               __Pyx_GOTREF(__pyx_t_1);
14092               __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14093               __pyx_t_11 = PyNumber_Add(__pyx_v_pos, __pyx_v_l); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14094               __Pyx_GOTREF(__pyx_t_11);
14095               __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14096               __Pyx_GOTREF(__pyx_t_9);
14097               __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14098               __Pyx_GOTREF(((PyObject *)__pyx_t_2));
14099               __Pyx_INCREF(__pyx_v_chrom);
14100               PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
14101               __Pyx_GIVEREF(__pyx_v_chrom);
14102               PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
14103               __Pyx_GIVEREF(__pyx_t_1);
14104               PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_11);
14105               __Pyx_GIVEREF(__pyx_t_11);
14106               PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_9);
14107               __Pyx_GIVEREF(__pyx_t_9);
14108               __pyx_t_1 = 0;
14109               __pyx_t_11 = 0;
14110               __pyx_t_9 = 0;
14111               __pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14112               __Pyx_GOTREF(__pyx_t_9);
14113               __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14114               __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
14115               __Pyx_DECREF(__pyx_v_addns);
14116               __pyx_v_addns = __pyx_t_9;
14117               __pyx_t_9 = 0;
14118
14119               /* "cvcf.pyx":715
14120  *                         if len(ref) < l:        # add to reference if necessary
14121  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
14122  *                             ref += addns             # <<<<<<<<<<<<<<
14123  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14124  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
14125  */
14126               __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addns); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14127               __Pyx_GOTREF(__pyx_t_9);
14128               __Pyx_DECREF(__pyx_v_ref);
14129               __pyx_v_ref = __pyx_t_9;
14130               __pyx_t_9 = 0;
14131
14132               /* "cvcf.pyx":716
14133  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
14134  *                             ref += addns
14135  *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
14136  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
14137  *                     except ValueError:
14138  */
14139               __Pyx_INCREF(__pyx_int_0);
14140               __pyx_t_9 = __pyx_int_0;
14141               __pyx_t_3 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_newalts); __Pyx_INCREF(__pyx_t_2);
14142               for (;;) {
14143                 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
14144                 __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++;
14145                 __Pyx_DECREF(__pyx_v_na);
14146                 __pyx_v_na = __pyx_t_10;
14147                 __pyx_t_10 = 0;
14148                 __Pyx_INCREF(__pyx_t_9);
14149                 __Pyx_DECREF(__pyx_v_i);
14150                 __pyx_v_i = __pyx_t_9;
14151                 __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14152                 __Pyx_GOTREF(__pyx_t_10);
14153                 __Pyx_DECREF(__pyx_t_9);
14154                 __pyx_t_9 = __pyx_t_10;
14155                 __pyx_t_10 = 0;
14156                 __pyx_t_10 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14157                 __Pyx_GOTREF(__pyx_t_10);
14158                 if (PyObject_SetItem(((PyObject *)__pyx_v_newalts), __pyx_v_i, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14159                 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14160               }
14161               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14162               __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14163               goto __pyx_L66;
14164             }
14165             __pyx_L66:;
14166
14167             /* "cvcf.pyx":717
14168  *                             ref += addns
14169  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14170  *                         a = ref[l:]             # new deletion, deleting pos...pos+l             # <<<<<<<<<<<<<<
14171  *                     except ValueError:
14172  *                         s = a[1:]
14173  */
14174             __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14175             __pyx_t_9 = __Pyx_PySequence_GetSlice(__pyx_v_ref, __pyx_t_3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14176             __Pyx_GOTREF(__pyx_t_9);
14177             __Pyx_DECREF(__pyx_v_a);
14178             __pyx_v_a = __pyx_t_9;
14179             __pyx_t_9 = 0;
14180           }
14181           __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
14182           __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
14183           __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
14184           goto __pyx_L65_try_end;
14185           __pyx_L58_error:;
14186           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
14187           __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14188           __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
14189           __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14190           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14191           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14192
14193           /* "cvcf.pyx":718
14194  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14195  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
14196  *                     except ValueError:             # <<<<<<<<<<<<<<
14197  *                         s = a[1:]
14198  *                         if len(ref) < len(s):   # add Ns to reference if necessary
14199  */
14200           __pyx_t_16 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
14201           if (__pyx_t_16) {
14202             __Pyx_AddTraceback("cvcf.VCF.parse_data");
14203             if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_2, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14204             __Pyx_GOTREF(__pyx_t_9);
14205             __Pyx_GOTREF(__pyx_t_2);
14206             __Pyx_GOTREF(__pyx_t_10);
14207
14208             /* "cvcf.pyx":719
14209  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
14210  *                     except ValueError:
14211  *                         s = a[1:]             # <<<<<<<<<<<<<<
14212  *                         if len(ref) < len(s):   # add Ns to reference if necessary
14213  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
14214  */
14215             __pyx_t_11 = __Pyx_PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14216             __Pyx_GOTREF(__pyx_t_11);
14217             __Pyx_DECREF(__pyx_v_s);
14218             __pyx_v_s = __pyx_t_11;
14219             __pyx_t_11 = 0;
14220
14221             /* "cvcf.pyx":720
14222  *                     except ValueError:
14223  *                         s = a[1:]
14224  *                         if len(ref) < len(s):   # add Ns to reference if necessary             # <<<<<<<<<<<<<<
14225  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
14226  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
14227  */
14228             __pyx_t_3 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14229             __pyx_t_17 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14230             __pyx_t_7 = (__pyx_t_3 < __pyx_t_17);
14231             if (__pyx_t_7) {
14232
14233               /* "cvcf.pyx":721
14234  *                         s = a[1:]
14235  *                         if len(ref) < len(s):   # add Ns to reference if necessary
14236  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)             # <<<<<<<<<<<<<<
14237  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
14238  *                                 self.error(line,self.V33_UNMATCHED_DELETION,
14239  */
14240               __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14241               __Pyx_GOTREF(__pyx_t_11);
14242               __pyx_t_17 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14243               __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14244               __Pyx_GOTREF(__pyx_t_1);
14245               __pyx_t_8 = PyNumber_Add(__pyx_v_pos, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14246               __Pyx_GOTREF(__pyx_t_8);
14247               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14248               __pyx_t_17 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14249               __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14250               __Pyx_GOTREF(__pyx_t_1);
14251               __pyx_t_18 = PyNumber_Add(__pyx_v_pos, __pyx_t_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14252               __Pyx_GOTREF(__pyx_t_18);
14253               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14254               __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14255               __Pyx_GOTREF(__pyx_t_1);
14256               __pyx_t_19 = PyTuple_New(4); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14257               __Pyx_GOTREF(((PyObject *)__pyx_t_19));
14258               __Pyx_INCREF(__pyx_v_chrom);
14259               PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_chrom);
14260               __Pyx_GIVEREF(__pyx_v_chrom);
14261               PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_8);
14262               __Pyx_GIVEREF(__pyx_t_8);
14263               PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_18);
14264               __Pyx_GIVEREF(__pyx_t_18);
14265               PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_1);
14266               __Pyx_GIVEREF(__pyx_t_1);
14267               __pyx_t_8 = 0;
14268               __pyx_t_18 = 0;
14269               __pyx_t_1 = 0;
14270               __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14271               __Pyx_GOTREF(__pyx_t_1);
14272               __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14273               __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
14274               __Pyx_DECREF(__pyx_v_addns);
14275               __pyx_v_addns = __pyx_t_1;
14276               __pyx_t_1 = 0;
14277
14278               /* "cvcf.pyx":722
14279  *                         if len(ref) < len(s):   # add Ns to reference if necessary
14280  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
14281  *                             if not s.endswith(addns) and addns != 'N'*len(addns):             # <<<<<<<<<<<<<<
14282  *                                 self.error(line,self.V33_UNMATCHED_DELETION,
14283  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
14284  */
14285               __pyx_t_1 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__endswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14286               __Pyx_GOTREF(__pyx_t_1);
14287               __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14288               __Pyx_GOTREF(((PyObject *)__pyx_t_19));
14289               __Pyx_INCREF(__pyx_v_addns);
14290               PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_addns);
14291               __Pyx_GIVEREF(__pyx_v_addns);
14292               __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14293               __Pyx_GOTREF(__pyx_t_11);
14294               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14295               __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
14296               __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14297               __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14298               __pyx_t_5 = (!__pyx_t_7);
14299               if (__pyx_t_5) {
14300                 __pyx_t_17 = PyObject_Length(__pyx_v_addns); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14301                 __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14302                 __Pyx_GOTREF(__pyx_t_11);
14303                 __pyx_t_19 = PyNumber_Multiply(((PyObject *)__pyx_n_s__N), __pyx_t_11); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14304                 __Pyx_GOTREF(((PyObject *)__pyx_t_19));
14305                 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14306                 __pyx_t_11 = PyObject_RichCompare(__pyx_v_addns, ((PyObject *)__pyx_t_19), Py_NE); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14307                 __Pyx_GOTREF(__pyx_t_11);
14308                 __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
14309                 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14310                 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14311                 __pyx_t_15 = __pyx_t_7;
14312               } else {
14313                 __pyx_t_15 = __pyx_t_5;
14314               }
14315               if (__pyx_t_15) {
14316
14317                 /* "cvcf.pyx":723
14318  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
14319  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
14320  *                                 self.error(line,self.V33_UNMATCHED_DELETION,             # <<<<<<<<<<<<<<
14321  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
14322  *                             ref += addns
14323  */
14324                 __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14325                 __Pyx_GOTREF(__pyx_t_11);
14326                 __pyx_t_19 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_111); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14327                 __Pyx_GOTREF(__pyx_t_19);
14328
14329                 /* "cvcf.pyx":724
14330  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
14331  *                                 self.error(line,self.V33_UNMATCHED_DELETION,
14332  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))             # <<<<<<<<<<<<<<
14333  *                             ref += addns
14334  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14335  */
14336                 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14337                 __Pyx_GOTREF(__pyx_t_1);
14338                 __pyx_t_17 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14339                 __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14340                 __Pyx_GOTREF(__pyx_t_18);
14341                 __pyx_t_8 = PyNumber_Add(__pyx_v_pos, __pyx_t_18); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14342                 __Pyx_GOTREF(__pyx_t_8);
14343                 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14344                 __pyx_t_18 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14345                 __Pyx_GOTREF(__pyx_t_18);
14346                 __pyx_t_20 = PyTuple_New(4); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14347                 __Pyx_GOTREF(((PyObject *)__pyx_t_20));
14348                 __Pyx_INCREF(__pyx_v_chrom);
14349                 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_chrom);
14350                 __Pyx_GIVEREF(__pyx_v_chrom);
14351                 __Pyx_INCREF(__pyx_v_pos);
14352                 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_pos);
14353                 __Pyx_GIVEREF(__pyx_v_pos);
14354                 PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_8);
14355                 __Pyx_GIVEREF(__pyx_t_8);
14356                 PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_18);
14357                 __Pyx_GIVEREF(__pyx_t_18);
14358                 __pyx_t_8 = 0;
14359                 __pyx_t_18 = 0;
14360                 __pyx_t_18 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14361                 __Pyx_GOTREF(__pyx_t_18);
14362                 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14363                 __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
14364                 __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14365                 __Pyx_GOTREF(((PyObject *)__pyx_t_20));
14366                 __Pyx_INCREF(__pyx_v_a);
14367                 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_a);
14368                 __Pyx_GIVEREF(__pyx_v_a);
14369                 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_18);
14370                 __Pyx_GIVEREF(__pyx_t_18);
14371                 __pyx_t_18 = 0;
14372                 __pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14373                 __Pyx_GOTREF(((PyObject *)__pyx_t_18));
14374                 __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
14375                 __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14376                 __Pyx_GOTREF(((PyObject *)__pyx_t_20));
14377                 __Pyx_INCREF(__pyx_v_line);
14378                 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_line);
14379                 __Pyx_GIVEREF(__pyx_v_line);
14380                 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
14381                 __Pyx_GIVEREF(__pyx_t_19);
14382                 PyTuple_SET_ITEM(__pyx_t_20, 2, ((PyObject *)__pyx_t_18));
14383                 __Pyx_GIVEREF(((PyObject *)__pyx_t_18));
14384                 __pyx_t_19 = 0;
14385                 __pyx_t_18 = 0;
14386                 __pyx_t_18 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14387                 __Pyx_GOTREF(__pyx_t_18);
14388                 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14389                 __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
14390                 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14391                 goto __pyx_L72;
14392               }
14393               __pyx_L72:;
14394
14395               /* "cvcf.pyx":725
14396  *                                 self.error(line,self.V33_UNMATCHED_DELETION,
14397  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
14398  *                             ref += addns             # <<<<<<<<<<<<<<
14399  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14400  *                         a = ref[len(s):]        # new deletion, deleting from pos
14401  */
14402               __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addns); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14403               __Pyx_GOTREF(__pyx_t_18);
14404               __Pyx_DECREF(__pyx_v_ref);
14405               __pyx_v_ref = __pyx_t_18;
14406               __pyx_t_18 = 0;
14407
14408               /* "cvcf.pyx":726
14409  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
14410  *                             ref += addns
14411  *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
14412  *                         a = ref[len(s):]        # new deletion, deleting from pos
14413  *                 else:
14414  */
14415               __Pyx_INCREF(__pyx_int_0);
14416               __pyx_t_18 = __pyx_int_0;
14417               __pyx_t_17 = 0; __pyx_t_20 = ((PyObject *)__pyx_v_newalts); __Pyx_INCREF(__pyx_t_20);
14418               for (;;) {
14419                 if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_20)) break;
14420                 __pyx_t_11 = PyList_GET_ITEM(__pyx_t_20, __pyx_t_17); __Pyx_INCREF(__pyx_t_11); __pyx_t_17++;
14421                 __Pyx_DECREF(__pyx_v_na);
14422                 __pyx_v_na = __pyx_t_11;
14423                 __pyx_t_11 = 0;
14424                 __Pyx_INCREF(__pyx_t_18);
14425                 __Pyx_DECREF(__pyx_v_i);
14426                 __pyx_v_i = __pyx_t_18;
14427                 __pyx_t_11 = PyNumber_Add(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14428                 __Pyx_GOTREF(__pyx_t_11);
14429                 __Pyx_DECREF(__pyx_t_18);
14430                 __pyx_t_18 = __pyx_t_11;
14431                 __pyx_t_11 = 0;
14432                 __pyx_t_11 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14433                 __Pyx_GOTREF(__pyx_t_11);
14434                 if (PyObject_SetItem(((PyObject *)__pyx_v_newalts), __pyx_v_i, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14435                 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14436               }
14437               __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
14438               __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14439               goto __pyx_L71;
14440             }
14441             __pyx_L71:;
14442
14443             /* "cvcf.pyx":727
14444  *                             ref += addns
14445  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14446  *                         a = ref[len(s):]        # new deletion, deleting from pos             # <<<<<<<<<<<<<<
14447  *                 else:
14448  *                     self.error(line,self.V33_BAD_ALLELE)
14449  */
14450             __pyx_t_17 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14451             __pyx_t_18 = __Pyx_PySequence_GetSlice(__pyx_v_ref, __pyx_t_17, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14452             __Pyx_GOTREF(__pyx_t_18);
14453             __Pyx_DECREF(__pyx_v_a);
14454             __pyx_v_a = __pyx_t_18;
14455             __pyx_t_18 = 0;
14456             __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14457             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14458             __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14459             goto __pyx_L59_exception_handled;
14460           }
14461           __pyx_L60_except_error:;
14462           __Pyx_XGIVEREF(__pyx_save_exc_type);
14463           __Pyx_XGIVEREF(__pyx_save_exc_value);
14464           __Pyx_XGIVEREF(__pyx_save_exc_tb);
14465           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
14466           goto __pyx_L1_error;
14467           __pyx_L59_exception_handled:;
14468           __Pyx_XGIVEREF(__pyx_save_exc_type);
14469           __Pyx_XGIVEREF(__pyx_save_exc_value);
14470           __Pyx_XGIVEREF(__pyx_save_exc_tb);
14471           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
14472           __pyx_L65_try_end:;
14473         }
14474         goto __pyx_L57;
14475       }
14476       /*else*/ {
14477
14478         /* "cvcf.pyx":729
14479  *                         a = ref[len(s):]        # new deletion, deleting from pos
14480  *                 else:
14481  *                     self.error(line,self.V33_BAD_ALLELE)             # <<<<<<<<<<<<<<
14482  *                 newalts.append(a)
14483  *             alt = newalts
14484  */
14485         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14486         __Pyx_GOTREF(__pyx_t_10);
14487         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__V33_BAD_ALLELE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14488         __Pyx_GOTREF(__pyx_t_2);
14489         __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14490         __Pyx_GOTREF(((PyObject *)__pyx_t_9));
14491         __Pyx_INCREF(__pyx_v_line);
14492         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
14493         __Pyx_GIVEREF(__pyx_v_line);
14494         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
14495         __Pyx_GIVEREF(__pyx_t_2);
14496         __pyx_t_2 = 0;
14497         __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14498         __Pyx_GOTREF(__pyx_t_2);
14499         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14500         __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
14501         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14502       }
14503       __pyx_L57:;
14504
14505       /* "cvcf.pyx":730
14506  *                 else:
14507  *                     self.error(line,self.V33_BAD_ALLELE)
14508  *                 newalts.append(a)             # <<<<<<<<<<<<<<
14509  *             alt = newalts
14510  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
14511  */
14512       if (unlikely(__pyx_v_newalts == Py_None)) {
14513         PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
14514       }
14515       __pyx_t_16 = PyList_Append(__pyx_v_newalts, __pyx_v_a); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14516     }
14517     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14518
14519     /* "cvcf.pyx":731
14520  *                     self.error(line,self.V33_BAD_ALLELE)
14521  *                 newalts.append(a)
14522  *             alt = newalts             # <<<<<<<<<<<<<<
14523  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
14524  *             if have_deletions:
14525  */
14526     __Pyx_INCREF(((PyObject *)__pyx_v_newalts));
14527     __Pyx_DECREF(__pyx_v_alt);
14528     __pyx_v_alt = ((PyObject *)__pyx_v_newalts);
14529
14530     /* "cvcf.pyx":733
14531  *             alt = newalts
14532  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
14533  *             if have_deletions:             # <<<<<<<<<<<<<<
14534  *                 if pos == 0:
14535  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
14536  */
14537     if (__pyx_v_have_deletions) {
14538
14539       /* "cvcf.pyx":734
14540  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
14541  *             if have_deletions:
14542  *                 if pos == 0:             # <<<<<<<<<<<<<<
14543  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
14544  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
14545  */
14546       __pyx_t_12 = PyObject_RichCompare(__pyx_v_pos, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14547       __Pyx_GOTREF(__pyx_t_12);
14548       __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14549       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14550       if (__pyx_t_15) {
14551
14552         /* "cvcf.pyx":736
14553  *                 if pos == 0:
14554  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
14555  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)             # <<<<<<<<<<<<<<
14556  *                     ref += addn
14557  *                     alt = [allele+addn for allele in alt]
14558  */
14559         __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14560         __Pyx_GOTREF(__pyx_t_12);
14561         __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14562         __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14563         __Pyx_GOTREF(__pyx_t_2);
14564         __pyx_t_9 = PyNumber_Add(__pyx_v_pos, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14565         __Pyx_GOTREF(__pyx_t_9);
14566         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14567         __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14568         __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14569         __Pyx_GOTREF(__pyx_t_2);
14570         __pyx_t_10 = PyNumber_Add(__pyx_v_pos, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14571         __Pyx_GOTREF(__pyx_t_10);
14572         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14573         __pyx_t_2 = PyNumber_Add(__pyx_t_10, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14574         __Pyx_GOTREF(__pyx_t_2);
14575         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14576         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14577         __Pyx_GOTREF(__pyx_t_10);
14578         __pyx_t_18 = PyTuple_New(4); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14579         __Pyx_GOTREF(((PyObject *)__pyx_t_18));
14580         __Pyx_INCREF(__pyx_v_chrom);
14581         PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_chrom);
14582         __Pyx_GIVEREF(__pyx_v_chrom);
14583         PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_9);
14584         __Pyx_GIVEREF(__pyx_t_9);
14585         PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_2);
14586         __Pyx_GIVEREF(__pyx_t_2);
14587         PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_10);
14588         __Pyx_GIVEREF(__pyx_t_10);
14589         __pyx_t_9 = 0;
14590         __pyx_t_2 = 0;
14591         __pyx_t_10 = 0;
14592         __pyx_t_10 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14593         __Pyx_GOTREF(__pyx_t_10);
14594         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14595         __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
14596         __Pyx_DECREF(__pyx_v_addn);
14597         __pyx_v_addn = __pyx_t_10;
14598         __pyx_t_10 = 0;
14599
14600         /* "cvcf.pyx":737
14601  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
14602  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
14603  *                     ref += addn             # <<<<<<<<<<<<<<
14604  *                     alt = [allele+addn for allele in alt]
14605  *                 else:
14606  */
14607         __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addn); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14608         __Pyx_GOTREF(__pyx_t_10);
14609         __Pyx_DECREF(__pyx_v_ref);
14610         __pyx_v_ref = __pyx_t_10;
14611         __pyx_t_10 = 0;
14612
14613         /* "cvcf.pyx":738
14614  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
14615  *                     ref += addn
14616  *                     alt = [allele+addn for allele in alt]             # <<<<<<<<<<<<<<
14617  *                 else:
14618  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
14619  */
14620         __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14621         __Pyx_GOTREF(((PyObject *)__pyx_t_10));
14622         if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
14623           __pyx_t_4 = 0; __pyx_t_18 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_18);
14624         } else {
14625           __pyx_t_4 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14626           __Pyx_GOTREF(__pyx_t_18);
14627         }
14628         for (;;) {
14629           if (likely(PyList_CheckExact(__pyx_t_18))) {
14630             if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_18)) break;
14631             __pyx_t_12 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
14632           } else if (likely(PyTuple_CheckExact(__pyx_t_18))) {
14633             if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_18)) break;
14634             __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
14635           } else {
14636             __pyx_t_12 = PyIter_Next(__pyx_t_18);
14637             if (!__pyx_t_12) {
14638               if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14639               break;
14640             }
14641             __Pyx_GOTREF(__pyx_t_12);
14642           }
14643           __Pyx_DECREF(__pyx_v_allele);
14644           __pyx_v_allele = __pyx_t_12;
14645           __pyx_t_12 = 0;
14646           __pyx_t_12 = PyNumber_Add(__pyx_v_allele, __pyx_v_addn); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14647           __Pyx_GOTREF(__pyx_t_12);
14648           if (unlikely(PyList_Append(__pyx_t_10, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14649           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14650         }
14651         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14652         __Pyx_INCREF(((PyObject *)__pyx_t_10));
14653         __Pyx_DECREF(__pyx_v_alt);
14654         __pyx_v_alt = ((PyObject *)__pyx_t_10);
14655         __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
14656         goto __pyx_L76;
14657       }
14658       /*else*/ {
14659
14660         /* "cvcf.pyx":740
14661  *                     alt = [allele+addn for allele in alt]
14662  *                 else:
14663  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)             # <<<<<<<<<<<<<<
14664  *                     ref = addn + ref
14665  *                     alt = [addn + allele for allele in alt]
14666  */
14667         __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14668         __Pyx_GOTREF(__pyx_t_10);
14669         __pyx_t_18 = PyNumber_Subtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14670         __Pyx_GOTREF(__pyx_t_18);
14671         __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14672         __Pyx_GOTREF(__pyx_t_12);
14673         __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14674         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
14675         __Pyx_INCREF(__pyx_v_chrom);
14676         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
14677         __Pyx_GIVEREF(__pyx_v_chrom);
14678         PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_18);
14679         __Pyx_GIVEREF(__pyx_t_18);
14680         __Pyx_INCREF(__pyx_v_pos);
14681         PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_pos);
14682         __Pyx_GIVEREF(__pyx_v_pos);
14683         PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_12);
14684         __Pyx_GIVEREF(__pyx_t_12);
14685         __pyx_t_18 = 0;
14686         __pyx_t_12 = 0;
14687         __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14688         __Pyx_GOTREF(__pyx_t_12);
14689         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14690         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
14691         __Pyx_DECREF(__pyx_v_addn);
14692         __pyx_v_addn = __pyx_t_12;
14693         __pyx_t_12 = 0;
14694
14695         /* "cvcf.pyx":741
14696  *                 else:
14697  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
14698  *                     ref = addn + ref             # <<<<<<<<<<<<<<
14699  *                     alt = [addn + allele for allele in alt]
14700  *                     pos -= 1
14701  */
14702         __pyx_t_12 = PyNumber_Add(__pyx_v_addn, __pyx_v_ref); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14703         __Pyx_GOTREF(__pyx_t_12);
14704         __Pyx_DECREF(__pyx_v_ref);
14705         __pyx_v_ref = __pyx_t_12;
14706         __pyx_t_12 = 0;
14707
14708         /* "cvcf.pyx":742
14709  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
14710  *                     ref = addn + ref
14711  *                     alt = [addn + allele for allele in alt]             # <<<<<<<<<<<<<<
14712  *                     pos -= 1
14713  *         else:
14714  */
14715         __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14716         __Pyx_GOTREF(((PyObject *)__pyx_t_12));
14717         if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
14718           __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2);
14719         } else {
14720           __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14721           __Pyx_GOTREF(__pyx_t_2);
14722         }
14723         for (;;) {
14724           if (likely(PyList_CheckExact(__pyx_t_2))) {
14725             if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
14726             __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++;
14727           } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
14728             if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
14729             __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++;
14730           } else {
14731             __pyx_t_10 = PyIter_Next(__pyx_t_2);
14732             if (!__pyx_t_10) {
14733               if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14734               break;
14735             }
14736             __Pyx_GOTREF(__pyx_t_10);
14737           }
14738           __Pyx_DECREF(__pyx_v_allele);
14739           __pyx_v_allele = __pyx_t_10;
14740           __pyx_t_10 = 0;
14741           __pyx_t_10 = PyNumber_Add(__pyx_v_addn, __pyx_v_allele); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14742           __Pyx_GOTREF(__pyx_t_10);
14743           if (unlikely(PyList_Append(__pyx_t_12, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14744           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14745         }
14746         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14747         __Pyx_INCREF(((PyObject *)__pyx_t_12));
14748         __Pyx_DECREF(__pyx_v_alt);
14749         __pyx_v_alt = ((PyObject *)__pyx_t_12);
14750         __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
14751
14752         /* "cvcf.pyx":743
14753  *                     ref = addn + ref
14754  *                     alt = [addn + allele for allele in alt]
14755  *                     pos -= 1             # <<<<<<<<<<<<<<
14756  *         else:
14757  *             # format v4.0 -- just check for nucleotides
14758  */
14759         __pyx_t_12 = PyNumber_InPlaceSubtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14760         __Pyx_GOTREF(__pyx_t_12);
14761         __Pyx_DECREF(__pyx_v_pos);
14762         __pyx_v_pos = __pyx_t_12;
14763         __pyx_t_12 = 0;
14764       }
14765       __pyx_L76:;
14766       goto __pyx_L75;
14767     }
14768     __pyx_L75:;
14769     goto __pyx_L53;
14770   }
14771   /*else*/ {
14772
14773     /* "cvcf.pyx":746
14774  *         else:
14775  *             # format v4.0 -- just check for nucleotides
14776  *             for allele in alt:             # <<<<<<<<<<<<<<
14777  *                 if not alleleRegEx.match(allele):
14778  *                     self.error(line,self.V40_BAD_ALLELE,allele)
14779  */
14780     if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
14781       __pyx_t_4 = 0; __pyx_t_12 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_12);
14782     } else {
14783       __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14784       __Pyx_GOTREF(__pyx_t_12);
14785     }
14786     for (;;) {
14787       if (likely(PyList_CheckExact(__pyx_t_12))) {
14788         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
14789         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
14790       } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
14791         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
14792         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
14793       } else {
14794         __pyx_t_2 = PyIter_Next(__pyx_t_12);
14795         if (!__pyx_t_2) {
14796           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14797           break;
14798         }
14799         __Pyx_GOTREF(__pyx_t_2);
14800       }
14801       __Pyx_DECREF(__pyx_v_allele);
14802       __pyx_v_allele = __pyx_t_2;
14803       __pyx_t_2 = 0;
14804
14805       /* "cvcf.pyx":747
14806  *             # format v4.0 -- just check for nucleotides
14807  *             for allele in alt:
14808  *                 if not alleleRegEx.match(allele):             # <<<<<<<<<<<<<<
14809  *                     self.error(line,self.V40_BAD_ALLELE,allele)
14810  * 
14811  */
14812       __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__alleleRegEx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14813       __Pyx_GOTREF(__pyx_t_2);
14814       __pyx_t_10 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__match); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14815       __Pyx_GOTREF(__pyx_t_10);
14816       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14817       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14818       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
14819       __Pyx_INCREF(__pyx_v_allele);
14820       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_allele);
14821       __Pyx_GIVEREF(__pyx_v_allele);
14822       __pyx_t_18 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14823       __Pyx_GOTREF(__pyx_t_18);
14824       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14825       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
14826       __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14827       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14828       __pyx_t_5 = (!__pyx_t_15);
14829       if (__pyx_t_5) {
14830
14831         /* "cvcf.pyx":748
14832  *             for allele in alt:
14833  *                 if not alleleRegEx.match(allele):
14834  *                     self.error(line,self.V40_BAD_ALLELE,allele)             # <<<<<<<<<<<<<<
14835  * 
14836  *         # check for leading nucleotide in indel calls
14837  */
14838         __pyx_t_18 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14839         __Pyx_GOTREF(__pyx_t_18);
14840         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__V40_BAD_ALLELE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14841         __Pyx_GOTREF(__pyx_t_2);
14842         __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14843         __Pyx_GOTREF(((PyObject *)__pyx_t_10));
14844         __Pyx_INCREF(__pyx_v_line);
14845         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
14846         __Pyx_GIVEREF(__pyx_v_line);
14847         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
14848         __Pyx_GIVEREF(__pyx_t_2);
14849         __Pyx_INCREF(__pyx_v_allele);
14850         PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_allele);
14851         __Pyx_GIVEREF(__pyx_v_allele);
14852         __pyx_t_2 = 0;
14853         __pyx_t_2 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14854         __Pyx_GOTREF(__pyx_t_2);
14855         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14856         __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
14857         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14858         goto __pyx_L83;
14859       }
14860       __pyx_L83:;
14861     }
14862     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14863   }
14864   __pyx_L53:;
14865
14866   /* "cvcf.pyx":751
14867  * 
14868  *         # check for leading nucleotide in indel calls
14869  *         for allele in alt:             # <<<<<<<<<<<<<<
14870  *             if len(allele) != len(ref):
14871  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
14872  */
14873   if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
14874     __pyx_t_4 = 0; __pyx_t_12 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_12);
14875   } else {
14876     __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14877     __Pyx_GOTREF(__pyx_t_12);
14878   }
14879   for (;;) {
14880     if (likely(PyList_CheckExact(__pyx_t_12))) {
14881       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
14882       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
14883     } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
14884       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
14885       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
14886     } else {
14887       __pyx_t_2 = PyIter_Next(__pyx_t_12);
14888       if (!__pyx_t_2) {
14889         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14890         break;
14891       }
14892       __Pyx_GOTREF(__pyx_t_2);
14893     }
14894     __Pyx_DECREF(__pyx_v_allele);
14895     __pyx_v_allele = __pyx_t_2;
14896     __pyx_t_2 = 0;
14897
14898     /* "cvcf.pyx":752
14899  *         # check for leading nucleotide in indel calls
14900  *         for allele in alt:
14901  *             if len(allele) != len(ref):             # <<<<<<<<<<<<<<
14902  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
14903  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
14904  */
14905     __pyx_t_17 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14906     __pyx_t_3 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14907     __pyx_t_5 = (__pyx_t_17 != __pyx_t_3);
14908     if (__pyx_t_5) {
14909
14910       /* "cvcf.pyx":753
14911  *         for allele in alt:
14912  *             if len(allele) != len(ref):
14913  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)             # <<<<<<<<<<<<<<
14914  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
14915  *                     self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE)
14916  */
14917       __pyx_t_3 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14918       __pyx_t_5 = (__pyx_t_3 == 0);
14919       if (__pyx_t_5) {
14920         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14921         __Pyx_GOTREF(__pyx_t_2);
14922         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ZERO_LENGTH_ALLELE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14923         __Pyx_GOTREF(__pyx_t_10);
14924         __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14925         __Pyx_GOTREF(((PyObject *)__pyx_t_18));
14926         __Pyx_INCREF(__pyx_v_line);
14927         PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_line);
14928         __Pyx_GIVEREF(__pyx_v_line);
14929         PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_10);
14930         __Pyx_GIVEREF(__pyx_t_10);
14931         __pyx_t_10 = 0;
14932         __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14933         __Pyx_GOTREF(__pyx_t_10);
14934         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14935         __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
14936         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14937         goto __pyx_L87;
14938       }
14939       __pyx_L87:;
14940
14941       /* "cvcf.pyx":754
14942  *             if len(allele) != len(ref):
14943  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
14944  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():             # <<<<<<<<<<<<<<
14945  *                     self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE)
14946  * 
14947  */
14948       __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14949       __Pyx_GOTREF(__pyx_t_10);
14950       __pyx_t_18 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__upper); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14951       __Pyx_GOTREF(__pyx_t_18);
14952       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14953       __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14954       __Pyx_GOTREF(__pyx_t_10);
14955       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14956       __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_allele, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14957       __Pyx_GOTREF(__pyx_t_18);
14958       __pyx_t_2 = PyObject_GetAttr(__pyx_t_18, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14959       __Pyx_GOTREF(__pyx_t_2);
14960       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14961       __pyx_t_18 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14962       __Pyx_GOTREF(__pyx_t_18);
14963       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14964       __pyx_t_2 = PyObject_RichCompare(__pyx_t_10, __pyx_t_18, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14965       __Pyx_GOTREF(__pyx_t_2);
14966       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14967       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14968       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14969       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14970       if (__pyx_t_5) {
14971         __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14972         __Pyx_GOTREF(__pyx_t_2);
14973         __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_allele, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14974         __Pyx_GOTREF(__pyx_t_18);
14975         __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_18); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14976         __Pyx_GOTREF(__pyx_t_10);
14977         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14978         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14979         __pyx_t_18 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__upper); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14980         __Pyx_GOTREF(__pyx_t_18);
14981         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14982         __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14983         __Pyx_GOTREF(__pyx_t_10);
14984         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14985         __pyx_t_15 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_10, ((PyObject *)__pyx_n_s__N)))); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14986         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14987         __pyx_t_7 = __pyx_t_15;
14988       } else {
14989         __pyx_t_7 = __pyx_t_5;
14990       }
14991       if (__pyx_t_7) {
14992
14993         /* "cvcf.pyx":755
14994  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
14995  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
14996  *                     self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE)             # <<<<<<<<<<<<<<
14997  * 
14998  *         # trim trailing bases in alleles
14999  */
15000         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15001         __Pyx_GOTREF(__pyx_t_10);
15002         __pyx_t_18 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_113); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15003         __Pyx_GOTREF(__pyx_t_18);
15004         __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15005         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
15006         __Pyx_INCREF(__pyx_v_line);
15007         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
15008         __Pyx_GIVEREF(__pyx_v_line);
15009         PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_18);
15010         __Pyx_GIVEREF(__pyx_t_18);
15011         __pyx_t_18 = 0;
15012         __pyx_t_18 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15013         __Pyx_GOTREF(__pyx_t_18);
15014         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15015         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
15016         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15017         goto __pyx_L88;
15018       }
15019       __pyx_L88:;
15020       goto __pyx_L86;
15021     }
15022     __pyx_L86:;
15023   }
15024   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15025
15026   /* "cvcf.pyx":758
15027  * 
15028  *         # trim trailing bases in alleles
15029  *         for i in range(1,min(len(ref),min(map(len,alt)))):             # <<<<<<<<<<<<<<
15030  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
15031  *                 break
15032  */
15033   __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15034   __Pyx_GOTREF(((PyObject *)__pyx_t_12));
15035   __Pyx_INCREF(__pyx_builtin_len);
15036   PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_builtin_len);
15037   __Pyx_GIVEREF(__pyx_builtin_len);
15038   __Pyx_INCREF(__pyx_v_alt);
15039   PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_alt);
15040   __Pyx_GIVEREF(__pyx_v_alt);
15041   __pyx_t_18 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15042   __Pyx_GOTREF(__pyx_t_18);
15043   __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
15044   __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15045   __Pyx_GOTREF(((PyObject *)__pyx_t_12));
15046   PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_18);
15047   __Pyx_GIVEREF(__pyx_t_18);
15048   __pyx_t_18 = 0;
15049   __pyx_t_18 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15050   __Pyx_GOTREF(__pyx_t_18);
15051   __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
15052   __pyx_t_3 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15053   __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15054   __Pyx_GOTREF(__pyx_t_2);
15055   __pyx_t_10 = PyObject_RichCompare(__pyx_t_18, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15056   __Pyx_GOTREF(__pyx_t_10);
15057   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15058   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15059   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15060   if (__pyx_t_7) {
15061     __Pyx_INCREF(__pyx_t_18);
15062     __pyx_t_12 = __pyx_t_18;
15063   } else {
15064     __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15065     __Pyx_GOTREF(__pyx_t_10);
15066     __pyx_t_12 = __pyx_t_10;
15067     __pyx_t_10 = 0;
15068   }
15069   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15070   __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15071   __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15072   __Pyx_INCREF(__pyx_int_1);
15073   PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_int_1);
15074   __Pyx_GIVEREF(__pyx_int_1);
15075   __Pyx_INCREF(__pyx_t_12);
15076   PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_12);
15077   __Pyx_GIVEREF(__pyx_t_12);
15078   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15079   __pyx_t_12 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15080   __Pyx_GOTREF(__pyx_t_12);
15081   __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15082   if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
15083     __pyx_t_4 = 0; __pyx_t_18 = __pyx_t_12; __Pyx_INCREF(__pyx_t_18);
15084   } else {
15085     __pyx_t_4 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15086     __Pyx_GOTREF(__pyx_t_18);
15087   }
15088   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15089   for (;;) {
15090     if (likely(PyList_CheckExact(__pyx_t_18))) {
15091       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_18)) break;
15092       __pyx_t_12 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
15093     } else if (likely(PyTuple_CheckExact(__pyx_t_18))) {
15094       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_18)) break;
15095       __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
15096     } else {
15097       __pyx_t_12 = PyIter_Next(__pyx_t_18);
15098       if (!__pyx_t_12) {
15099         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15100         break;
15101       }
15102       __Pyx_GOTREF(__pyx_t_12);
15103     }
15104     __Pyx_DECREF(__pyx_v_i);
15105     __pyx_v_i = __pyx_t_12;
15106     __pyx_t_12 = 0;
15107
15108     /* "cvcf.pyx":759
15109  *         # trim trailing bases in alleles
15110  *         for i in range(1,min(len(ref),min(map(len,alt)))):
15111  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():             # <<<<<<<<<<<<<<
15112  *                 break
15113  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]
15114  */
15115     { /* enter inner scope */
15116       PyObject *__pyx_7genexpr__pyx_v_allele;
15117       __pyx_7genexpr__pyx_v_allele = Py_None; __Pyx_INCREF(Py_None);
15118       __pyx_t_12 = PySet_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L94_error;}
15119       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
15120       if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15121         __pyx_t_3 = 0; __pyx_t_10 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_10);
15122       } else {
15123         __pyx_t_3 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L94_error;}
15124         __Pyx_GOTREF(__pyx_t_10);
15125       }
15126       for (;;) {
15127         if (likely(PyList_CheckExact(__pyx_t_10))) {
15128           if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_10)) break;
15129           __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
15130         } else if (likely(PyTuple_CheckExact(__pyx_t_10))) {
15131           if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
15132           __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
15133         } else {
15134           __pyx_t_2 = PyIter_Next(__pyx_t_10);
15135           if (!__pyx_t_2) {
15136             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L94_error;}
15137             break;
15138           }
15139           __Pyx_GOTREF(__pyx_t_2);
15140         }
15141         __Pyx_DECREF(__pyx_7genexpr__pyx_v_allele);
15142         __pyx_7genexpr__pyx_v_allele = __pyx_t_2;
15143         __pyx_t_2 = 0;
15144         __pyx_t_2 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_allele, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L94_error;}
15145         __Pyx_GOTREF(__pyx_t_2);
15146         __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__upper); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L94_error;}
15147         __Pyx_GOTREF(__pyx_t_9);
15148         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15149         __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L94_error;}
15150         __Pyx_GOTREF(__pyx_t_2);
15151         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15152         if (unlikely(PySet_Add(__pyx_t_12, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L94_error;}
15153         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15154       }
15155       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15156       __Pyx_DECREF(__pyx_7genexpr__pyx_v_allele);
15157       goto __pyx_L97_exit_scope;
15158       __pyx_L94_error:;
15159       __Pyx_DECREF(__pyx_7genexpr__pyx_v_allele);
15160       goto __pyx_L1_error;
15161       __pyx_L97_exit_scope:;
15162     } /* exit inner scope */
15163     __pyx_t_3 = PySet_Size(((PyObject *)__pyx_t_12)); 
15164     __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
15165     __pyx_t_7 = (__pyx_t_3 > 1);
15166     if (!__pyx_t_7) {
15167       __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_ref, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15168       __Pyx_GOTREF(__pyx_t_12);
15169       __pyx_t_10 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__upper); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15170       __Pyx_GOTREF(__pyx_t_10);
15171       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15172       __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15173       __Pyx_GOTREF(__pyx_t_12);
15174       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15175       __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15176       __Pyx_GOTREF(__pyx_t_10);
15177       __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_10, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15178       __Pyx_GOTREF(__pyx_t_2);
15179       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15180       __pyx_t_10 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__upper); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15181       __Pyx_GOTREF(__pyx_t_10);
15182       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15183       __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15184       __Pyx_GOTREF(__pyx_t_2);
15185       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15186       __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15187       __Pyx_GOTREF(__pyx_t_10);
15188       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15189       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15190       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15191       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15192       __pyx_t_15 = __pyx_t_5;
15193     } else {
15194       __pyx_t_15 = __pyx_t_7;
15195     }
15196     if (__pyx_t_15) {
15197
15198       /* "cvcf.pyx":760
15199  *         for i in range(1,min(len(ref),min(map(len,alt)))):
15200  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
15201  *                 break             # <<<<<<<<<<<<<<
15202  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]
15203  * 
15204  */
15205       goto __pyx_L90_break;
15206       goto __pyx_L91;
15207     }
15208     __pyx_L91:;
15209
15210     /* "cvcf.pyx":761
15211  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
15212  *                 break
15213  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
15214  * 
15215  *         # left-align alleles, if a reference is available
15216  */
15217     __pyx_t_10 = __Pyx_PySequence_GetSlice(__pyx_v_ref, 0, -1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15218     __Pyx_GOTREF(__pyx_t_10);
15219     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15220     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
15221     if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15222       __pyx_t_3 = 0; __pyx_t_12 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_12);
15223     } else {
15224       __pyx_t_3 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15225       __Pyx_GOTREF(__pyx_t_12);
15226     }
15227     for (;;) {
15228       if (likely(PyList_CheckExact(__pyx_t_12))) {
15229         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_12)) break;
15230         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_3); __Pyx_INCREF(__pyx_t_9); __pyx_t_3++;
15231       } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
15232         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
15233         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_3); __Pyx_INCREF(__pyx_t_9); __pyx_t_3++;
15234       } else {
15235         __pyx_t_9 = PyIter_Next(__pyx_t_12);
15236         if (!__pyx_t_9) {
15237           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15238           break;
15239         }
15240         __Pyx_GOTREF(__pyx_t_9);
15241       }
15242       __Pyx_DECREF(__pyx_v_allele);
15243       __pyx_v_allele = __pyx_t_9;
15244       __pyx_t_9 = 0;
15245       __pyx_t_9 = __Pyx_PySequence_GetSlice(__pyx_v_allele, 0, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15246       __Pyx_GOTREF(__pyx_t_9);
15247       if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15248       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15249     }
15250     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15251     __pyx_t_12 = ((PyObject *)__pyx_t_2);
15252     __Pyx_INCREF(__pyx_t_12);
15253     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
15254     __Pyx_DECREF(__pyx_v_ref);
15255     __pyx_v_ref = __pyx_t_10;
15256     __pyx_t_10 = 0;
15257     __Pyx_DECREF(__pyx_v_alt);
15258     __pyx_v_alt = __pyx_t_12;
15259     __pyx_t_12 = 0;
15260   }
15261   __pyx_L90_break:;
15262   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15263
15264   /* "cvcf.pyx":764
15265  * 
15266  *         # left-align alleles, if a reference is available
15267  *         if self._leftalign and self._reference:             # <<<<<<<<<<<<<<
15268  *             while left < pos:
15269  *                 movable = True
15270  */
15271   __pyx_t_18 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___leftalign); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15272   __Pyx_GOTREF(__pyx_t_18);
15273   __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15274   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15275   if (__pyx_t_15) {
15276     __pyx_t_18 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15277     __Pyx_GOTREF(__pyx_t_18);
15278     __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15279     __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15280     __pyx_t_5 = __pyx_t_7;
15281   } else {
15282     __pyx_t_5 = __pyx_t_15;
15283   }
15284   if (__pyx_t_5) {
15285
15286     /* "cvcf.pyx":765
15287  *         # left-align alleles, if a reference is available
15288  *         if self._leftalign and self._reference:
15289  *             while left < pos:             # <<<<<<<<<<<<<<
15290  *                 movable = True
15291  *                 for allele in alt:
15292  */
15293     while (1) {
15294       __pyx_t_18 = PyObject_RichCompare(__pyx_v_left, __pyx_v_pos, Py_LT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15295       __Pyx_GOTREF(__pyx_t_18);
15296       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15297       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15298       if (!__pyx_t_5) break;
15299
15300       /* "cvcf.pyx":766
15301  *         if self._leftalign and self._reference:
15302  *             while left < pos:
15303  *                 movable = True             # <<<<<<<<<<<<<<
15304  *                 for allele in alt:
15305  *                     if len(allele) > len(ref):
15306  */
15307       __pyx_v_movable = 1;
15308
15309       /* "cvcf.pyx":767
15310  *             while left < pos:
15311  *                 movable = True
15312  *                 for allele in alt:             # <<<<<<<<<<<<<<
15313  *                     if len(allele) > len(ref):
15314  *                         longest, shortest = allele, ref
15315  */
15316       if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15317         __pyx_t_4 = 0; __pyx_t_18 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_18);
15318       } else {
15319         __pyx_t_4 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15320         __Pyx_GOTREF(__pyx_t_18);
15321       }
15322       for (;;) {
15323         if (likely(PyList_CheckExact(__pyx_t_18))) {
15324           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_18)) break;
15325           __pyx_t_12 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
15326         } else if (likely(PyTuple_CheckExact(__pyx_t_18))) {
15327           if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_18)) break;
15328           __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
15329         } else {
15330           __pyx_t_12 = PyIter_Next(__pyx_t_18);
15331           if (!__pyx_t_12) {
15332             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15333             break;
15334           }
15335           __Pyx_GOTREF(__pyx_t_12);
15336         }
15337         __Pyx_DECREF(__pyx_v_allele);
15338         __pyx_v_allele = __pyx_t_12;
15339         __pyx_t_12 = 0;
15340
15341         /* "cvcf.pyx":768
15342  *                 movable = True
15343  *                 for allele in alt:
15344  *                     if len(allele) > len(ref):             # <<<<<<<<<<<<<<
15345  *                         longest, shortest = allele, ref
15346  *                     else:
15347  */
15348         __pyx_t_3 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15349         __pyx_t_17 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15350         __pyx_t_5 = (__pyx_t_3 > __pyx_t_17);
15351         if (__pyx_t_5) {
15352
15353           /* "cvcf.pyx":769
15354  *                 for allele in alt:
15355  *                     if len(allele) > len(ref):
15356  *                         longest, shortest = allele, ref             # <<<<<<<<<<<<<<
15357  *                     else:
15358  *                         longest, shortest = ref, allele
15359  */
15360           __pyx_t_12 = __pyx_v_allele;
15361           __Pyx_INCREF(__pyx_t_12);
15362           __pyx_t_10 = __pyx_v_ref;
15363           __Pyx_INCREF(__pyx_t_10);
15364           __Pyx_DECREF(__pyx_v_longest);
15365           __pyx_v_longest = __pyx_t_12;
15366           __pyx_t_12 = 0;
15367           __Pyx_DECREF(__pyx_v_shortest);
15368           __pyx_v_shortest = __pyx_t_10;
15369           __pyx_t_10 = 0;
15370           goto __pyx_L105;
15371         }
15372         /*else*/ {
15373
15374           /* "cvcf.pyx":771
15375  *                         longest, shortest = allele, ref
15376  *                     else:
15377  *                         longest, shortest = ref, allele             # <<<<<<<<<<<<<<
15378  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
15379  *                         movable = False
15380  */
15381           __pyx_t_10 = __pyx_v_ref;
15382           __Pyx_INCREF(__pyx_t_10);
15383           __pyx_t_12 = __pyx_v_allele;
15384           __Pyx_INCREF(__pyx_t_12);
15385           __Pyx_DECREF(__pyx_v_longest);
15386           __pyx_v_longest = __pyx_t_10;
15387           __pyx_t_10 = 0;
15388           __Pyx_DECREF(__pyx_v_shortest);
15389           __pyx_v_shortest = __pyx_t_12;
15390           __pyx_t_12 = 0;
15391         }
15392         __pyx_L105:;
15393
15394         /* "cvcf.pyx":772
15395  *                     else:
15396  *                         longest, shortest = ref, allele
15397  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():             # <<<<<<<<<<<<<<
15398  *                         movable = False
15399  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
15400  */
15401         __pyx_t_17 = PyObject_Length(__pyx_v_longest); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15402         __pyx_t_3 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15403         __pyx_t_5 = (__pyx_t_17 == __pyx_t_3);
15404         if (!__pyx_t_5) {
15405           __pyx_t_3 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15406           __pyx_t_12 = __Pyx_PySequence_GetSlice(__pyx_v_longest, 0, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15407           __Pyx_GOTREF(__pyx_t_12);
15408           __pyx_t_10 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__upper); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15409           __Pyx_GOTREF(__pyx_t_10);
15410           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15411           __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15412           __Pyx_GOTREF(__pyx_t_12);
15413           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15414           __pyx_t_10 = PyObject_GetAttr(__pyx_v_shortest, __pyx_n_s__upper); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15415           __Pyx_GOTREF(__pyx_t_10);
15416           __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15417           __Pyx_GOTREF(__pyx_t_2);
15418           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15419           __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15420           __Pyx_GOTREF(__pyx_t_10);
15421           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15422           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15423           __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15424           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15425           __pyx_t_7 = __pyx_t_15;
15426         } else {
15427           __pyx_t_7 = __pyx_t_5;
15428         }
15429         if (__pyx_t_7) {
15430
15431           /* "cvcf.pyx":773
15432  *                         longest, shortest = ref, allele
15433  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
15434  *                         movable = False             # <<<<<<<<<<<<<<
15435  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
15436  *                         movable = False
15437  */
15438           __pyx_v_movable = 0;
15439           goto __pyx_L106;
15440         }
15441         __pyx_L106:;
15442
15443         /* "cvcf.pyx":774
15444  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
15445  *                         movable = False
15446  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():             # <<<<<<<<<<<<<<
15447  *                         movable = False
15448  *                 if not movable:
15449  */
15450         __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_longest, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15451         __Pyx_GOTREF(__pyx_t_10);
15452         __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15453         __Pyx_GOTREF(__pyx_t_2);
15454         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15455         __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15456         __Pyx_GOTREF(__pyx_t_10);
15457         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15458         __pyx_t_3 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15459         __pyx_t_17 = (__pyx_t_3 - 1);
15460         __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_longest, __pyx_t_17, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15461         __Pyx_GOTREF(__pyx_t_2);
15462         __pyx_t_12 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__upper); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15463         __Pyx_GOTREF(__pyx_t_12);
15464         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15465         __pyx_t_2 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15466         __Pyx_GOTREF(__pyx_t_2);
15467         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15468         __pyx_t_12 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15469         __Pyx_GOTREF(__pyx_t_12);
15470         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15471         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15472         __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15473         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15474         if (__pyx_t_7) {
15475
15476           /* "cvcf.pyx":775
15477  *                         movable = False
15478  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
15479  *                         movable = False             # <<<<<<<<<<<<<<
15480  *                 if not movable:
15481  *                     break
15482  */
15483           __pyx_v_movable = 0;
15484           goto __pyx_L107;
15485         }
15486         __pyx_L107:;
15487       }
15488       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15489
15490       /* "cvcf.pyx":776
15491  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
15492  *                         movable = False
15493  *                 if not movable:             # <<<<<<<<<<<<<<
15494  *                     break
15495  *                 ref = ref[:-1]
15496  */
15497       __pyx_t_7 = (!__pyx_v_movable);
15498       if (__pyx_t_7) {
15499
15500         /* "cvcf.pyx":777
15501  *                         movable = False
15502  *                 if not movable:
15503  *                     break             # <<<<<<<<<<<<<<
15504  *                 ref = ref[:-1]
15505  *                 alt = [allele[:-1] for allele in alt]
15506  */
15507         goto __pyx_L102_break;
15508         goto __pyx_L108;
15509       }
15510       __pyx_L108:;
15511
15512       /* "cvcf.pyx":778
15513  *                 if not movable:
15514  *                     break
15515  *                 ref = ref[:-1]             # <<<<<<<<<<<<<<
15516  *                 alt = [allele[:-1] for allele in alt]
15517  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
15518  */
15519       __pyx_t_18 = __Pyx_PySequence_GetSlice(__pyx_v_ref, 0, -1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15520       __Pyx_GOTREF(__pyx_t_18);
15521       __Pyx_DECREF(__pyx_v_ref);
15522       __pyx_v_ref = __pyx_t_18;
15523       __pyx_t_18 = 0;
15524
15525       /* "cvcf.pyx":779
15526  *                     break
15527  *                 ref = ref[:-1]
15528  *                 alt = [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
15529  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
15530  *                     ref = faref_leftflank[pos-left-1] + ref
15531  */
15532       __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15533       __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15534       if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15535         __pyx_t_4 = 0; __pyx_t_12 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_12);
15536       } else {
15537         __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15538         __Pyx_GOTREF(__pyx_t_12);
15539       }
15540       for (;;) {
15541         if (likely(PyList_CheckExact(__pyx_t_12))) {
15542           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
15543           __pyx_t_2 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
15544         } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
15545           if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
15546           __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
15547         } else {
15548           __pyx_t_2 = PyIter_Next(__pyx_t_12);
15549           if (!__pyx_t_2) {
15550             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15551             break;
15552           }
15553           __Pyx_GOTREF(__pyx_t_2);
15554         }
15555         __Pyx_DECREF(__pyx_v_allele);
15556         __pyx_v_allele = __pyx_t_2;
15557         __pyx_t_2 = 0;
15558         __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_allele, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15559         __Pyx_GOTREF(__pyx_t_2);
15560         if (unlikely(PyList_Append(__pyx_t_18, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15561         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15562       }
15563       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15564       __Pyx_INCREF(((PyObject *)__pyx_t_18));
15565       __Pyx_DECREF(__pyx_v_alt);
15566       __pyx_v_alt = ((PyObject *)__pyx_t_18);
15567       __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15568
15569       /* "cvcf.pyx":780
15570  *                 ref = ref[:-1]
15571  *                 alt = [allele[:-1] for allele in alt]
15572  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:             # <<<<<<<<<<<<<<
15573  *                     ref = faref_leftflank[pos-left-1] + ref
15574  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
15575  */
15576       __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15577       __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15578       if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15579         __pyx_t_4 = 0; __pyx_t_12 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_12);
15580       } else {
15581         __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15582         __Pyx_GOTREF(__pyx_t_12);
15583       }
15584       for (;;) {
15585         if (likely(PyList_CheckExact(__pyx_t_12))) {
15586           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
15587           __pyx_t_2 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
15588         } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
15589           if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
15590           __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
15591         } else {
15592           __pyx_t_2 = PyIter_Next(__pyx_t_12);
15593           if (!__pyx_t_2) {
15594             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15595             break;
15596           }
15597           __Pyx_GOTREF(__pyx_t_2);
15598         }
15599         __Pyx_DECREF(__pyx_v_allele);
15600         __pyx_v_allele = __pyx_t_2;
15601         __pyx_t_2 = 0;
15602         __pyx_t_17 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15603         __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15604         __Pyx_GOTREF(__pyx_t_2);
15605         if (unlikely(PyList_Append(__pyx_t_18, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15606         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15607       }
15608       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15609       __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15610       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
15611       __Pyx_INCREF(((PyObject *)__pyx_t_18));
15612       PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_18));
15613       __Pyx_GIVEREF(((PyObject *)__pyx_t_18));
15614       __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15615       __pyx_t_18 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15616       __Pyx_GOTREF(__pyx_t_18);
15617       __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
15618       __pyx_t_12 = PyObject_RichCompare(__pyx_t_18, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15619       __Pyx_GOTREF(__pyx_t_12);
15620       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15621       __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15622       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15623       if (!__pyx_t_7) {
15624         __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15625         __pyx_t_5 = (__pyx_t_4 == 0);
15626         __pyx_t_15 = __pyx_t_5;
15627       } else {
15628         __pyx_t_15 = __pyx_t_7;
15629       }
15630       if (__pyx_t_15) {
15631
15632         /* "cvcf.pyx":781
15633  *                 alt = [allele[:-1] for allele in alt]
15634  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
15635  *                     ref = faref_leftflank[pos-left-1] + ref             # <<<<<<<<<<<<<<
15636  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
15637  *                     pos -= 1
15638  */
15639         __pyx_t_12 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15640         __Pyx_GOTREF(__pyx_t_12);
15641         __pyx_t_18 = PyNumber_Subtract(__pyx_t_12, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15642         __Pyx_GOTREF(__pyx_t_18);
15643         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15644         __pyx_t_12 = PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_18); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15645         __Pyx_GOTREF(__pyx_t_12);
15646         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15647         __pyx_t_18 = PyNumber_Add(__pyx_t_12, __pyx_v_ref); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15648         __Pyx_GOTREF(__pyx_t_18);
15649         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15650         __Pyx_DECREF(__pyx_v_ref);
15651         __pyx_v_ref = __pyx_t_18;
15652         __pyx_t_18 = 0;
15653
15654         /* "cvcf.pyx":782
15655  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
15656  *                     ref = faref_leftflank[pos-left-1] + ref
15657  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]             # <<<<<<<<<<<<<<
15658  *                     pos -= 1
15659  * 
15660  */
15661         __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15662         __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15663         if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15664           __pyx_t_4 = 0; __pyx_t_12 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_12);
15665         } else {
15666           __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15667           __Pyx_GOTREF(__pyx_t_12);
15668         }
15669         for (;;) {
15670           if (likely(PyList_CheckExact(__pyx_t_12))) {
15671             if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
15672             __pyx_t_2 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
15673           } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
15674             if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
15675             __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
15676           } else {
15677             __pyx_t_2 = PyIter_Next(__pyx_t_12);
15678             if (!__pyx_t_2) {
15679               if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15680               break;
15681             }
15682             __Pyx_GOTREF(__pyx_t_2);
15683           }
15684           __Pyx_DECREF(__pyx_v_allele);
15685           __pyx_v_allele = __pyx_t_2;
15686           __pyx_t_2 = 0;
15687           __pyx_t_2 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15688           __Pyx_GOTREF(__pyx_t_2);
15689           __pyx_t_10 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15690           __Pyx_GOTREF(__pyx_t_10);
15691           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15692           __pyx_t_2 = PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_10); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15693           __Pyx_GOTREF(__pyx_t_2);
15694           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15695           __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_v_allele); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15696           __Pyx_GOTREF(__pyx_t_10);
15697           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15698           if (unlikely(PyList_Append(__pyx_t_18, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15699           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15700         }
15701         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15702         __Pyx_INCREF(((PyObject *)__pyx_t_18));
15703         __Pyx_DECREF(__pyx_v_alt);
15704         __pyx_v_alt = ((PyObject *)__pyx_t_18);
15705         __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15706
15707         /* "cvcf.pyx":783
15708  *                     ref = faref_leftflank[pos-left-1] + ref
15709  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
15710  *                     pos -= 1             # <<<<<<<<<<<<<<
15711  * 
15712  *         # parse sample columns
15713  */
15714         __pyx_t_18 = PyNumber_InPlaceSubtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15715         __Pyx_GOTREF(__pyx_t_18);
15716         __Pyx_DECREF(__pyx_v_pos);
15717         __pyx_v_pos = __pyx_t_18;
15718         __pyx_t_18 = 0;
15719         goto __pyx_L111;
15720       }
15721       __pyx_L111:;
15722     }
15723     __pyx_L102_break:;
15724     goto __pyx_L100;
15725   }
15726   __pyx_L100:;
15727
15728   /* "cvcf.pyx":786
15729  * 
15730  *         # parse sample columns
15731  *         samples = []             # <<<<<<<<<<<<<<
15732  *         for sample in cols[9:]:
15733  *             dict = {}
15734  */
15735   __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15736   __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15737   __Pyx_DECREF(((PyObject *)__pyx_v_samples));
15738   __pyx_v_samples = __pyx_t_18;
15739   __pyx_t_18 = 0;
15740
15741   /* "cvcf.pyx":787
15742  *         # parse sample columns
15743  *         samples = []
15744  *         for sample in cols[9:]:             # <<<<<<<<<<<<<<
15745  *             dict = {}
15746  *             values = sample.split(':')
15747  */
15748   __pyx_t_18 = __Pyx_PySequence_GetSlice(__pyx_v_cols, 9, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15749   __Pyx_GOTREF(__pyx_t_18);
15750   if (PyList_CheckExact(__pyx_t_18) || PyTuple_CheckExact(__pyx_t_18)) {
15751     __pyx_t_4 = 0; __pyx_t_12 = __pyx_t_18; __Pyx_INCREF(__pyx_t_12);
15752   } else {
15753     __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_18); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15754     __Pyx_GOTREF(__pyx_t_12);
15755   }
15756   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15757   for (;;) {
15758     if (likely(PyList_CheckExact(__pyx_t_12))) {
15759       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
15760       __pyx_t_18 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_18); __pyx_t_4++;
15761     } else if (likely(PyTuple_CheckExact(__pyx_t_12))) {
15762       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
15763       __pyx_t_18 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_18); __pyx_t_4++;
15764     } else {
15765       __pyx_t_18 = PyIter_Next(__pyx_t_12);
15766       if (!__pyx_t_18) {
15767         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15768         break;
15769       }
15770       __Pyx_GOTREF(__pyx_t_18);
15771     }
15772     __Pyx_DECREF(__pyx_v_sample);
15773     __pyx_v_sample = __pyx_t_18;
15774     __pyx_t_18 = 0;
15775
15776     /* "cvcf.pyx":788
15777  *         samples = []
15778  *         for sample in cols[9:]:
15779  *             dict = {}             # <<<<<<<<<<<<<<
15780  *             values = sample.split(':')
15781  *             if len(values) > len(format):
15782  */
15783     __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15784     __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15785     __Pyx_DECREF(((PyObject *)__pyx_v_dict));
15786     __pyx_v_dict = __pyx_t_18;
15787     __pyx_t_18 = 0;
15788
15789     /* "cvcf.pyx":789
15790  *         for sample in cols[9:]:
15791  *             dict = {}
15792  *             values = sample.split(':')             # <<<<<<<<<<<<<<
15793  *             if len(values) > len(format):
15794  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
15795  */
15796     __pyx_t_18 = PyObject_GetAttr(__pyx_v_sample, __pyx_n_s__split); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15797     __Pyx_GOTREF(__pyx_t_18);
15798     __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15799     __Pyx_GOTREF(__pyx_t_10);
15800     __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15801     __Pyx_DECREF(__pyx_v_values);
15802     __pyx_v_values = __pyx_t_10;
15803     __pyx_t_10 = 0;
15804
15805     /* "cvcf.pyx":790
15806  *             dict = {}
15807  *             values = sample.split(':')
15808  *             if len(values) > len(format):             # <<<<<<<<<<<<<<
15809  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
15810  *             for idx in range(len(format)):
15811  */
15812     __pyx_t_17 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15813     __pyx_t_3 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15814     __pyx_t_15 = (__pyx_t_17 > __pyx_t_3);
15815     if (__pyx_t_15) {
15816
15817       /* "cvcf.pyx":791
15818  *             values = sample.split(':')
15819  *             if len(values) > len(format):
15820  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))             # <<<<<<<<<<<<<<
15821  *             for idx in range(len(format)):
15822  *                 expected = self.get_expected(format[idx], self._format, alt)
15823  */
15824       __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15825       __Pyx_GOTREF(__pyx_t_10);
15826       __pyx_t_18 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_18); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15827       __Pyx_GOTREF(__pyx_t_18);
15828       __pyx_t_3 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15829       __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15830       __Pyx_GOTREF(__pyx_t_2);
15831       __pyx_t_3 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15832       __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15833       __Pyx_GOTREF(__pyx_t_9);
15834       __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15835       __Pyx_GOTREF(((PyObject *)__pyx_t_20));
15836       PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_2);
15837       __Pyx_GIVEREF(__pyx_t_2);
15838       __Pyx_INCREF(__pyx_v_sample);
15839       PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_sample);
15840       __Pyx_GIVEREF(__pyx_v_sample);
15841       PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_9);
15842       __Pyx_GIVEREF(__pyx_t_9);
15843       __pyx_t_2 = 0;
15844       __pyx_t_9 = 0;
15845       __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_19), ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15846       __Pyx_GOTREF(((PyObject *)__pyx_t_9));
15847       __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
15848       __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15849       __Pyx_GOTREF(((PyObject *)__pyx_t_20));
15850       __Pyx_INCREF(__pyx_v_line);
15851       PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_line);
15852       __Pyx_GIVEREF(__pyx_v_line);
15853       PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_18);
15854       __Pyx_GIVEREF(__pyx_t_18);
15855       PyTuple_SET_ITEM(__pyx_t_20, 2, ((PyObject *)__pyx_t_9));
15856       __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
15857       __pyx_t_18 = 0;
15858       __pyx_t_9 = 0;
15859       __pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15860       __Pyx_GOTREF(__pyx_t_9);
15861       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15862       __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
15863       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15864       goto __pyx_L118;
15865     }
15866     __pyx_L118:;
15867
15868     /* "cvcf.pyx":792
15869  *             if len(values) > len(format):
15870  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
15871  *             for idx in range(len(format)):             # <<<<<<<<<<<<<<
15872  *                 expected = self.get_expected(format[idx], self._format, alt)
15873  *                 if idx < len(values): value = values[idx]
15874  */
15875     __pyx_t_3 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15876     for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_3; __pyx_t_17+=1) {
15877       __pyx_v_idx = __pyx_t_17;
15878
15879       /* "cvcf.pyx":793
15880  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
15881  *             for idx in range(len(format)):
15882  *                 expected = self.get_expected(format[idx], self._format, alt)             # <<<<<<<<<<<<<<
15883  *                 if idx < len(values): value = values[idx]
15884  *                 else:
15885  */
15886       __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_expected); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15887       __Pyx_GOTREF(__pyx_t_9);
15888       __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15889       __Pyx_GOTREF(__pyx_t_20);
15890       __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15891       __Pyx_GOTREF(__pyx_t_10);
15892       __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15893       __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15894       PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_20);
15895       __Pyx_GIVEREF(__pyx_t_20);
15896       PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_10);
15897       __Pyx_GIVEREF(__pyx_t_10);
15898       __Pyx_INCREF(__pyx_v_alt);
15899       PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_v_alt);
15900       __Pyx_GIVEREF(__pyx_v_alt);
15901       __pyx_t_20 = 0;
15902       __pyx_t_10 = 0;
15903       __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15904       __Pyx_GOTREF(__pyx_t_10);
15905       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15906       __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15907       __Pyx_DECREF(__pyx_v_expected);
15908       __pyx_v_expected = __pyx_t_10;
15909       __pyx_t_10 = 0;
15910
15911       /* "cvcf.pyx":794
15912  *             for idx in range(len(format)):
15913  *                 expected = self.get_expected(format[idx], self._format, alt)
15914  *                 if idx < len(values): value = values[idx]             # <<<<<<<<<<<<<<
15915  *                 else:
15916  *                     if expected == -1: value = "."
15917  */
15918       __pyx_t_21 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15919       __pyx_t_15 = (__pyx_v_idx < __pyx_t_21);
15920       if (__pyx_t_15) {
15921         __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15922         __Pyx_GOTREF(__pyx_t_10);
15923         __Pyx_DECREF(__pyx_v_value);
15924         __pyx_v_value = __pyx_t_10;
15925         __pyx_t_10 = 0;
15926         goto __pyx_L121;
15927       }
15928       /*else*/ {
15929
15930         /* "cvcf.pyx":796
15931  *                 if idx < len(values): value = values[idx]
15932  *                 else:
15933  *                     if expected == -1: value = "."             # <<<<<<<<<<<<<<
15934  *                     else: value = ",".join(["."]*expected)
15935  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)
15936  */
15937         __pyx_t_10 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15938         __Pyx_GOTREF(__pyx_t_10);
15939         __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15940         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15941         if (__pyx_t_15) {
15942           __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
15943           __Pyx_DECREF(__pyx_v_value);
15944           __pyx_v_value = ((PyObject *)__pyx_kp_s_9);
15945           goto __pyx_L122;
15946         }
15947         /*else*/ {
15948
15949           /* "cvcf.pyx":797
15950  *                 else:
15951  *                     if expected == -1: value = "."
15952  *                     else: value = ",".join(["."]*expected)             # <<<<<<<<<<<<<<
15953  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)
15954  *                 if expected != -1 and len(dict[format[idx]]) != expected:
15955  */
15956           __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15957           __Pyx_GOTREF(__pyx_t_10);
15958           __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15959           __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15960           __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
15961           PyList_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_kp_s_9));
15962           __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
15963           __pyx_t_9 = PyNumber_Multiply(((PyObject *)__pyx_t_18), __pyx_v_expected); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15964           __Pyx_GOTREF(__pyx_t_9);
15965           __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15966           __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15967           __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15968           PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_9);
15969           __Pyx_GIVEREF(__pyx_t_9);
15970           __pyx_t_9 = 0;
15971           __pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15972           __Pyx_GOTREF(__pyx_t_9);
15973           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15974           __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15975           __Pyx_DECREF(__pyx_v_value);
15976           __pyx_v_value = __pyx_t_9;
15977           __pyx_t_9 = 0;
15978         }
15979         __pyx_L122:;
15980       }
15981       __pyx_L121:;
15982
15983       /* "cvcf.pyx":798
15984  *                     if expected == -1: value = "."
15985  *                     else: value = ",".join(["."]*expected)
15986  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)             # <<<<<<<<<<<<<<
15987  *                 if expected != -1 and len(dict[format[idx]]) != expected:
15988  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
15989  */
15990       __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_formatdata); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15991       __Pyx_GOTREF(__pyx_t_9);
15992       __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15993       __Pyx_GOTREF(__pyx_t_18);
15994       __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15995       __Pyx_GOTREF(__pyx_t_10);
15996       __pyx_t_20 = PyTuple_New(4); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15997       __Pyx_GOTREF(((PyObject *)__pyx_t_20));
15998       PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18);
15999       __Pyx_GIVEREF(__pyx_t_18);
16000       __Pyx_INCREF(__pyx_v_value);
16001       PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_value);
16002       __Pyx_GIVEREF(__pyx_v_value);
16003       PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_10);
16004       __Pyx_GIVEREF(__pyx_t_10);
16005       __Pyx_INCREF(__pyx_v_line);
16006       PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_v_line);
16007       __Pyx_GIVEREF(__pyx_v_line);
16008       __pyx_t_18 = 0;
16009       __pyx_t_10 = 0;
16010       __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16011       __Pyx_GOTREF(__pyx_t_10);
16012       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16013       __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
16014       __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16015       __Pyx_GOTREF(__pyx_t_20);
16016       if (PyDict_SetItem(((PyObject *)__pyx_v_dict), __pyx_t_20, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16017       __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16018       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16019
16020       /* "cvcf.pyx":799
16021  *                     else: value = ",".join(["."]*expected)
16022  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)
16023  *                 if expected != -1 and len(dict[format[idx]]) != expected:             # <<<<<<<<<<<<<<
16024  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
16025  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
16026  */
16027       __pyx_t_10 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_NE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16028       __Pyx_GOTREF(__pyx_t_10);
16029       __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16030       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16031       if (__pyx_t_15) {
16032         __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16033         __Pyx_GOTREF(__pyx_t_10);
16034         __pyx_t_20 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_10); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16035         __Pyx_GOTREF(__pyx_t_20);
16036         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16037         __pyx_t_21 = PyObject_Length(__pyx_t_20); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16038         __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16039         __pyx_t_20 = PyInt_FromSsize_t(__pyx_t_21); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16040         __Pyx_GOTREF(__pyx_t_20);
16041         __pyx_t_10 = PyObject_RichCompare(__pyx_t_20, __pyx_v_expected, Py_NE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16042         __Pyx_GOTREF(__pyx_t_10);
16043         __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16044         __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16045         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16046         __pyx_t_5 = __pyx_t_7;
16047       } else {
16048         __pyx_t_5 = __pyx_t_15;
16049       }
16050       if (__pyx_t_5) {
16051
16052         /* "cvcf.pyx":800
16053  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)
16054  *                 if expected != -1 and len(dict[format[idx]]) != expected:
16055  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,             # <<<<<<<<<<<<<<
16056  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
16057  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
16058  */
16059         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16060         __Pyx_GOTREF(__pyx_t_10);
16061         __pyx_t_20 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16062         __Pyx_GOTREF(__pyx_t_20);
16063
16064         /* "cvcf.pyx":801
16065  *                 if expected != -1 and len(dict[format[idx]]) != expected:
16066  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
16067  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))             # <<<<<<<<<<<<<<
16068  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
16069  *                     dict[format[idx]] = dict[format[idx]][:expected]
16070  */
16071         __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16072         __Pyx_GOTREF(__pyx_t_9);
16073         __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16074         __Pyx_GOTREF(__pyx_t_18);
16075         __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_18); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16076         __Pyx_GOTREF(__pyx_t_2);
16077         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16078         __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16079         __Pyx_GOTREF(((PyObject *)__pyx_t_18));
16080         PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_9);
16081         __Pyx_GIVEREF(__pyx_t_9);
16082         __Pyx_INCREF(__pyx_v_expected);
16083         PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_v_expected);
16084         __Pyx_GIVEREF(__pyx_v_expected);
16085         PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_2);
16086         __Pyx_GIVEREF(__pyx_t_2);
16087         __pyx_t_9 = 0;
16088         __pyx_t_2 = 0;
16089         __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16090         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16091         __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
16092         __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16093         __Pyx_GOTREF(((PyObject *)__pyx_t_18));
16094         __Pyx_INCREF(__pyx_v_line);
16095         PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_line);
16096         __Pyx_GIVEREF(__pyx_v_line);
16097         PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_20);
16098         __Pyx_GIVEREF(__pyx_t_20);
16099         PyTuple_SET_ITEM(__pyx_t_18, 2, ((PyObject *)__pyx_t_2));
16100         __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
16101         __pyx_t_20 = 0;
16102         __pyx_t_2 = 0;
16103         __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16104         __Pyx_GOTREF(__pyx_t_2);
16105         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16106         __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
16107         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16108
16109         /* "cvcf.pyx":802
16110  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
16111  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
16112  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))             # <<<<<<<<<<<<<<
16113  *                     dict[format[idx]] = dict[format[idx]][:expected]
16114  *             samples.append( dict )
16115  */
16116         __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16117         __Pyx_GOTREF(__pyx_t_2);
16118         __pyx_t_18 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_2); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16119         __Pyx_GOTREF(__pyx_t_18);
16120         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16121         __pyx_t_21 = PyObject_Length(__pyx_t_18); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16122         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16123         __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_21); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16124         __Pyx_GOTREF(__pyx_t_18);
16125         __pyx_t_2 = PyObject_RichCompare(__pyx_t_18, __pyx_v_expected, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16126         __Pyx_GOTREF(__pyx_t_2);
16127         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16128         __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16129         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16130         if (__pyx_t_5) {
16131           __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16132           __Pyx_GOTREF(__pyx_t_2);
16133           __pyx_t_18 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_2); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16134           __Pyx_GOTREF(__pyx_t_18);
16135           __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16136           __Pyx_GOTREF(__pyx_t_10);
16137           __pyx_t_20 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_10); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16138           __Pyx_GOTREF(__pyx_t_20);
16139           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16140           __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_20, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16141           __Pyx_GOTREF(__pyx_t_10);
16142           __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16143           __pyx_t_20 = PyList_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16144           __Pyx_GOTREF(((PyObject *)__pyx_t_20));
16145           PyList_SET_ITEM(__pyx_t_20, 0, __pyx_t_10);
16146           __Pyx_GIVEREF(__pyx_t_10);
16147           __pyx_t_10 = 0;
16148           __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16149           __Pyx_GOTREF(__pyx_t_10);
16150           __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_10); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16151           __Pyx_GOTREF(__pyx_t_9);
16152           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16153           __pyx_t_21 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16154           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16155           __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_21); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16156           __Pyx_GOTREF(__pyx_t_9);
16157           __pyx_t_10 = PyNumber_Subtract(__pyx_v_expected, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16158           __Pyx_GOTREF(__pyx_t_10);
16159           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16160           __pyx_t_9 = PyNumber_Multiply(((PyObject *)__pyx_t_20), __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16161           __Pyx_GOTREF(__pyx_t_9);
16162           __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
16163           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16164           __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_t_18, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16165           __Pyx_GOTREF(__pyx_t_10);
16166           __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16167           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16168           if (PyDict_SetItem(((PyObject *)__pyx_v_dict), __pyx_t_2, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16169           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16170           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16171           goto __pyx_L124;
16172         }
16173         __pyx_L124:;
16174
16175         /* "cvcf.pyx":803
16176  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
16177  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
16178  *                     dict[format[idx]] = dict[format[idx]][:expected]             # <<<<<<<<<<<<<<
16179  *             samples.append( dict )
16180  * 
16181  */
16182         __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16183         __Pyx_GOTREF(__pyx_t_2);
16184         __pyx_t_10 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_2); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16185         __Pyx_GOTREF(__pyx_t_10);
16186         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16187         __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_expected); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16188         __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_t_10, 0, __pyx_t_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16189         __Pyx_GOTREF(__pyx_t_2);
16190         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16191         __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16192         __Pyx_GOTREF(__pyx_t_10);
16193         if (PyDict_SetItem(((PyObject *)__pyx_v_dict), __pyx_t_10, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16194         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16195         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16196         goto __pyx_L123;
16197       }
16198       __pyx_L123:;
16199     }
16200
16201     /* "cvcf.pyx":804
16202  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
16203  *                     dict[format[idx]] = dict[format[idx]][:expected]
16204  *             samples.append( dict )             # <<<<<<<<<<<<<<
16205  * 
16206  *         # done
16207  */
16208     if (unlikely(__pyx_v_samples == Py_None)) {
16209       PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
16210     }
16211     __pyx_t_16 = PyList_Append(__pyx_v_samples, ((PyObject *)__pyx_v_dict)); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16212   }
16213   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
16214
16215   /* "cvcf.pyx":807
16216  * 
16217  *         # done
16218  *         d = {'chrom':chrom,             # <<<<<<<<<<<<<<
16219  *              'pos':pos,      # return 0-based position
16220  *              'id':id,
16221  */
16222   __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16223   __Pyx_GOTREF(((PyObject *)__pyx_t_12));
16224   if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__chrom), __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16225
16226   /* "cvcf.pyx":808
16227  *         # done
16228  *         d = {'chrom':chrom,
16229  *              'pos':pos,      # return 0-based position             # <<<<<<<<<<<<<<
16230  *              'id':id,
16231  *              'ref':ref,
16232  */
16233   if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__pos), __pyx_v_pos) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16234
16235   /* "cvcf.pyx":809
16236  *         d = {'chrom':chrom,
16237  *              'pos':pos,      # return 0-based position
16238  *              'id':id,             # <<<<<<<<<<<<<<
16239  *              'ref':ref,
16240  *              'alt':alt,
16241  */
16242   if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__id), __pyx_v_id) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16243
16244   /* "cvcf.pyx":810
16245  *              'pos':pos,      # return 0-based position
16246  *              'id':id,
16247  *              'ref':ref,             # <<<<<<<<<<<<<<
16248  *              'alt':alt,
16249  *              'qual':qual,
16250  */
16251   if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__ref), __pyx_v_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16252
16253   /* "cvcf.pyx":811
16254  *              'id':id,
16255  *              'ref':ref,
16256  *              'alt':alt,             # <<<<<<<<<<<<<<
16257  *              'qual':qual,
16258  *              'filter':filter,
16259  */
16260   if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__alt), __pyx_v_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16261
16262   /* "cvcf.pyx":812
16263  *              'ref':ref,
16264  *              'alt':alt,
16265  *              'qual':qual,             # <<<<<<<<<<<<<<
16266  *              'filter':filter,
16267  *              'info':info,
16268  */
16269   __pyx_t_2 = PyFloat_FromDouble(__pyx_v_qual); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16270   __Pyx_GOTREF(__pyx_t_2);
16271   if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__qual), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16272   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16273
16274   /* "cvcf.pyx":813
16275  *              'alt':alt,
16276  *              'qual':qual,
16277  *              'filter':filter,             # <<<<<<<<<<<<<<
16278  *              'info':info,
16279  *              'format':format}
16280  */
16281   if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__filter), __pyx_v_filter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16282
16283   /* "cvcf.pyx":814
16284  *              'qual':qual,
16285  *              'filter':filter,
16286  *              'info':info,             # <<<<<<<<<<<<<<
16287  *              'format':format}
16288  *         for key,value in zip(self._samples,samples):
16289  */
16290   if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__info), ((PyObject *)__pyx_v_info)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16291
16292   /* "cvcf.pyx":815
16293  *              'filter':filter,
16294  *              'info':info,
16295  *              'format':format}             # <<<<<<<<<<<<<<
16296  *         for key,value in zip(self._samples,samples):
16297  *             d[key] = value
16298  */
16299   if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__format), __pyx_v_format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16300   __Pyx_DECREF(((PyObject *)__pyx_v_d));
16301   __pyx_v_d = __pyx_t_12;
16302   __pyx_t_12 = 0;
16303
16304   /* "cvcf.pyx":816
16305  *              'info':info,
16306  *              'format':format}
16307  *         for key,value in zip(self._samples,samples):             # <<<<<<<<<<<<<<
16308  *             d[key] = value
16309  * 
16310  */
16311   __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16312   __Pyx_GOTREF(__pyx_t_12);
16313   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16314   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16315   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12);
16316   __Pyx_GIVEREF(__pyx_t_12);
16317   __Pyx_INCREF(((PyObject *)__pyx_v_samples));
16318   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_samples));
16319   __Pyx_GIVEREF(((PyObject *)__pyx_v_samples));
16320   __pyx_t_12 = 0;
16321   __pyx_t_12 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16322   __Pyx_GOTREF(__pyx_t_12);
16323   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
16324   if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
16325     __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_12; __Pyx_INCREF(__pyx_t_2);
16326   } else {
16327     __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16328     __Pyx_GOTREF(__pyx_t_2);
16329   }
16330   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
16331   for (;;) {
16332     if (likely(PyList_CheckExact(__pyx_t_2))) {
16333       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
16334       __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
16335     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
16336       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
16337       __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
16338     } else {
16339       __pyx_t_12 = PyIter_Next(__pyx_t_2);
16340       if (!__pyx_t_12) {
16341         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16342         break;
16343       }
16344       __Pyx_GOTREF(__pyx_t_12);
16345     }
16346     if (PyTuple_CheckExact(__pyx_t_12) && likely(PyTuple_GET_SIZE(__pyx_t_12) == 2)) {
16347       PyObject* tuple = __pyx_t_12;
16348       __pyx_t_10 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_10);
16349       __pyx_t_9 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_9);
16350       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
16351       __Pyx_DECREF(__pyx_v_key);
16352       __pyx_v_key = __pyx_t_10;
16353       __pyx_t_10 = 0;
16354       __Pyx_DECREF(__pyx_v_value);
16355       __pyx_v_value = __pyx_t_9;
16356       __pyx_t_9 = 0;
16357     } else {
16358       __pyx_t_18 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16359       __Pyx_GOTREF(__pyx_t_18);
16360       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
16361       __pyx_t_10 = __Pyx_UnpackItem(__pyx_t_18, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16362       __Pyx_GOTREF(__pyx_t_10);
16363       __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_18, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16364       __Pyx_GOTREF(__pyx_t_9);
16365       if (__Pyx_EndUnpack(__pyx_t_18, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16366       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16367       __Pyx_DECREF(__pyx_v_key);
16368       __pyx_v_key = __pyx_t_10;
16369       __pyx_t_10 = 0;
16370       __Pyx_DECREF(__pyx_v_value);
16371       __pyx_v_value = __pyx_t_9;
16372       __pyx_t_9 = 0;
16373     }
16374
16375     /* "cvcf.pyx":817
16376  *              'format':format}
16377  *         for key,value in zip(self._samples,samples):
16378  *             d[key] = value             # <<<<<<<<<<<<<<
16379  * 
16380  *         return d
16381  */
16382     if (PyDict_SetItem(((PyObject *)__pyx_v_d), __pyx_v_key, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16383   }
16384   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16385
16386   /* "cvcf.pyx":819
16387  *             d[key] = value
16388  * 
16389  *         return d             # <<<<<<<<<<<<<<
16390  * 
16391  * 
16392  */
16393   __Pyx_XDECREF(__pyx_r);
16394   __Pyx_INCREF(((PyObject *)__pyx_v_d));
16395   __pyx_r = ((PyObject *)__pyx_v_d);
16396   goto __pyx_L0;
16397
16398   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16399   goto __pyx_L0;
16400   __pyx_L1_error:;
16401   __Pyx_XDECREF(__pyx_t_1);
16402   __Pyx_XDECREF(__pyx_t_2);
16403   __Pyx_XDECREF(__pyx_t_8);
16404   __Pyx_XDECREF(__pyx_t_9);
16405   __Pyx_XDECREF(__pyx_t_10);
16406   __Pyx_XDECREF(__pyx_t_11);
16407   __Pyx_XDECREF(__pyx_t_12);
16408   __Pyx_XDECREF(__pyx_t_18);
16409   __Pyx_XDECREF(__pyx_t_19);
16410   __Pyx_XDECREF(__pyx_t_20);
16411   __Pyx_AddTraceback("cvcf.VCF.parse_data");
16412   __pyx_r = NULL;
16413   __pyx_L0:;
16414   __Pyx_DECREF(__pyx_v_cols);
16415   __Pyx_DECREF(__pyx_v_chrom);
16416   __Pyx_DECREF(__pyx_v_pos);
16417   __Pyx_DECREF(__pyx_v_id);
16418   __Pyx_DECREF(__pyx_v_ref);
16419   __Pyx_DECREF(__pyx_v_c);
16420   __Pyx_DECREF(__pyx_v_left);
16421   __Pyx_DECREF(__pyx_v_faref_leftflank);
16422   __Pyx_DECREF(__pyx_v_faref);
16423   __Pyx_DECREF(__pyx_v_alt);
16424   __Pyx_DECREF(__pyx_v_filter);
16425   __Pyx_DECREF(__pyx_v_info);
16426   __Pyx_DECREF(__pyx_v_blurp);
16427   __Pyx_DECREF(__pyx_v_elts);
16428   __Pyx_DECREF(__pyx_v_v);
16429   __Pyx_DECREF(__pyx_v_format);
16430   __Pyx_DECREF(__pyx_v_f);
16431   __Pyx_DECREF(__pyx_v_newalts);
16432   __Pyx_DECREF(__pyx_v_a);
16433   __Pyx_DECREF(__pyx_v_l);
16434   __Pyx_DECREF(__pyx_v_addns);
16435   __Pyx_DECREF(__pyx_v_i);
16436   __Pyx_DECREF(__pyx_v_na);
16437   __Pyx_DECREF(__pyx_v_s);
16438   __Pyx_DECREF(__pyx_v_addn);
16439   __Pyx_DECREF(__pyx_v_allele);
16440   __Pyx_DECREF(__pyx_v_longest);
16441   __Pyx_DECREF(__pyx_v_shortest);
16442   __Pyx_DECREF(__pyx_v_samples);
16443   __Pyx_DECREF(__pyx_v_sample);
16444   __Pyx_DECREF(__pyx_v_dict);
16445   __Pyx_DECREF(__pyx_v_values);
16446   __Pyx_DECREF(__pyx_v_expected);
16447   __Pyx_DECREF(__pyx_v_value);
16448   __Pyx_DECREF(__pyx_v_d);
16449   __Pyx_DECREF(__pyx_v_key);
16450   __Pyx_XGIVEREF(__pyx_r);
16451   __Pyx_RefNannyFinishContext();
16452   return __pyx_r;
16453 }
16454
16455 /* "cvcf.pyx":822
16456  * 
16457  * 
16458  *     def write_data(self, stream, data):             # <<<<<<<<<<<<<<
16459  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
16460  *         for k in required:
16461  */
16462
16463 static PyObject *__pyx_pf_4cvcf_3VCF_17write_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
16464 static PyMethodDef __pyx_mdef_4cvcf_3VCF_17write_data = {__Pyx_NAMESTR("write_data"), (PyCFunction)__pyx_pf_4cvcf_3VCF_17write_data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
16465 static PyObject *__pyx_pf_4cvcf_3VCF_17write_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16466   PyObject *__pyx_v_self = 0;
16467   PyObject *__pyx_v_stream = 0;
16468   PyObject *__pyx_v_data = 0;
16469   PyObject *__pyx_v_required;
16470   PyObject *__pyx_v_k;
16471   PyObject *__pyx_v_alt;
16472   PyObject *__pyx_v_filter;
16473   PyObject *__pyx_v_qual;
16474   PyObject *__pyx_v_output;
16475   PyObject *__pyx_v_s;
16476   PyObject *__pyx_r = NULL;
16477   PyObject *__pyx_t_1 = NULL;
16478   PyObject *__pyx_t_2 = NULL;
16479   PyObject *__pyx_t_3 = NULL;
16480   Py_ssize_t __pyx_t_4;
16481   int __pyx_t_5;
16482   PyObject *__pyx_t_6 = NULL;
16483   PyObject *__pyx_t_7 = NULL;
16484   PyObject *__pyx_t_8 = NULL;
16485   PyObject *__pyx_t_9 = NULL;
16486   PyObject *__pyx_t_10 = NULL;
16487   PyObject *__pyx_t_11 = NULL;
16488   int __pyx_t_12;
16489   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,&__pyx_n_s__data,0};
16490   __Pyx_RefNannySetupContext("write_data");
16491   __pyx_self = __pyx_self;
16492   if (unlikely(__pyx_kwds)) {
16493     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
16494     PyObject* values[3] = {0,0,0};
16495     switch (PyTuple_GET_SIZE(__pyx_args)) {
16496       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16497       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16498       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16499       case  0: break;
16500       default: goto __pyx_L5_argtuple_error;
16501     }
16502     switch (PyTuple_GET_SIZE(__pyx_args)) {
16503       case  0:
16504       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
16505       if (likely(values[0])) kw_args--;
16506       else goto __pyx_L5_argtuple_error;
16507       case  1:
16508       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
16509       if (likely(values[1])) kw_args--;
16510       else {
16511         __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16512       }
16513       case  2:
16514       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
16515       if (likely(values[2])) kw_args--;
16516       else {
16517         __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16518       }
16519     }
16520     if (unlikely(kw_args > 0)) {
16521       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "write_data") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16522     }
16523     __pyx_v_self = values[0];
16524     __pyx_v_stream = values[1];
16525     __pyx_v_data = values[2];
16526   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
16527     goto __pyx_L5_argtuple_error;
16528   } else {
16529     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
16530     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
16531     __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 2);
16532   }
16533   goto __pyx_L4_argument_unpacking_done;
16534   __pyx_L5_argtuple_error:;
16535   __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16536   __pyx_L3_error:;
16537   __Pyx_AddTraceback("cvcf.VCF.write_data");
16538   __Pyx_RefNannyFinishContext();
16539   return NULL;
16540   __pyx_L4_argument_unpacking_done:;
16541   __pyx_v_required = Py_None; __Pyx_INCREF(Py_None);
16542   __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
16543   __pyx_v_alt = Py_None; __Pyx_INCREF(Py_None);
16544   __pyx_v_filter = Py_None; __Pyx_INCREF(Py_None);
16545   __pyx_v_qual = Py_None; __Pyx_INCREF(Py_None);
16546   __pyx_v_output = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
16547   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
16548
16549   /* "cvcf.pyx":823
16550  * 
16551  *     def write_data(self, stream, data):
16552  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples             # <<<<<<<<<<<<<<
16553  *         for k in required:
16554  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
16555  */
16556   __pyx_t_1 = PyList_New(9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16557   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
16558   __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
16559   PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__chrom));
16560   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
16561   __Pyx_INCREF(((PyObject *)__pyx_n_s__pos));
16562   PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__pos));
16563   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos));
16564   __Pyx_INCREF(((PyObject *)__pyx_n_s__id));
16565   PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__id));
16566   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__id));
16567   __Pyx_INCREF(((PyObject *)__pyx_n_s__ref));
16568   PyList_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__ref));
16569   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ref));
16570   __Pyx_INCREF(((PyObject *)__pyx_n_s__alt));
16571   PyList_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_s__alt));
16572   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__alt));
16573   __Pyx_INCREF(((PyObject *)__pyx_n_s__qual));
16574   PyList_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_n_s__qual));
16575   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__qual));
16576   __Pyx_INCREF(((PyObject *)__pyx_n_s__filter));
16577   PyList_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_n_s__filter));
16578   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__filter));
16579   __Pyx_INCREF(((PyObject *)__pyx_n_s__info));
16580   PyList_SET_ITEM(__pyx_t_1, 7, ((PyObject *)__pyx_n_s__info));
16581   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__info));
16582   __Pyx_INCREF(((PyObject *)__pyx_n_s__format));
16583   PyList_SET_ITEM(__pyx_t_1, 8, ((PyObject *)__pyx_n_s__format));
16584   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__format));
16585   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16586   __Pyx_GOTREF(__pyx_t_2);
16587   __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_t_1), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16588   __Pyx_GOTREF(__pyx_t_3);
16589   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
16590   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16591   __Pyx_DECREF(__pyx_v_required);
16592   __pyx_v_required = __pyx_t_3;
16593   __pyx_t_3 = 0;
16594
16595   /* "cvcf.pyx":824
16596  *     def write_data(self, stream, data):
16597  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
16598  *         for k in required:             # <<<<<<<<<<<<<<
16599  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
16600  *         if data['alt'] == []: alt = "."
16601  */
16602   if (PyList_CheckExact(__pyx_v_required) || PyTuple_CheckExact(__pyx_v_required)) {
16603     __pyx_t_4 = 0; __pyx_t_3 = __pyx_v_required; __Pyx_INCREF(__pyx_t_3);
16604   } else {
16605     __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_required); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16606     __Pyx_GOTREF(__pyx_t_3);
16607   }
16608   for (;;) {
16609     if (likely(PyList_CheckExact(__pyx_t_3))) {
16610       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
16611       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
16612     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
16613       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
16614       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
16615     } else {
16616       __pyx_t_2 = PyIter_Next(__pyx_t_3);
16617       if (!__pyx_t_2) {
16618         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16619         break;
16620       }
16621       __Pyx_GOTREF(__pyx_t_2);
16622     }
16623     __Pyx_DECREF(__pyx_v_k);
16624     __pyx_v_k = __pyx_t_2;
16625     __pyx_t_2 = 0;
16626
16627     /* "cvcf.pyx":825
16628  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
16629  *         for k in required:
16630  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))             # <<<<<<<<<<<<<<
16631  *         if data['alt'] == []: alt = "."
16632  *         else: alt = ",".join(data['alt'])
16633  */
16634     __pyx_t_5 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_data, __pyx_v_k))); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16635     if (__pyx_t_5) {
16636       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16637       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16638       __Pyx_INCREF(__pyx_v_k);
16639       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k);
16640       __Pyx_GIVEREF(__pyx_v_k);
16641       __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16642       __Pyx_GOTREF(__pyx_t_1);
16643       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
16644       __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_115), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16645       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16646       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16647       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16648       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
16649       PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
16650       __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
16651       __pyx_t_2 = 0;
16652       __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16653       __Pyx_GOTREF(__pyx_t_2);
16654       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
16655       __Pyx_Raise(__pyx_t_2, 0, 0);
16656       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16657       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16658       goto __pyx_L8;
16659     }
16660     __pyx_L8:;
16661   }
16662   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16663
16664   /* "cvcf.pyx":826
16665  *         for k in required:
16666  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
16667  *         if data['alt'] == []: alt = "."             # <<<<<<<<<<<<<<
16668  *         else: alt = ",".join(data['alt'])
16669  *         if data['filter'] == None: filter = "."
16670  */
16671   __pyx_t_3 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__alt)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16672   __Pyx_GOTREF(__pyx_t_3);
16673   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16674   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16675   __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_t_2), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16676   __Pyx_GOTREF(__pyx_t_1);
16677   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16678   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
16679   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16680   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16681   if (__pyx_t_5) {
16682     __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
16683     __Pyx_DECREF(__pyx_v_alt);
16684     __pyx_v_alt = ((PyObject *)__pyx_kp_s_9);
16685     goto __pyx_L9;
16686   }
16687   /*else*/ {
16688
16689     /* "cvcf.pyx":827
16690  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
16691  *         if data['alt'] == []: alt = "."
16692  *         else: alt = ",".join(data['alt'])             # <<<<<<<<<<<<<<
16693  *         if data['filter'] == None: filter = "."
16694  *         elif data['filter'] == []:
16695  */
16696     __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16697     __Pyx_GOTREF(__pyx_t_1);
16698     __pyx_t_2 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__alt)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16699     __Pyx_GOTREF(__pyx_t_2);
16700     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16701     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
16702     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
16703     __Pyx_GIVEREF(__pyx_t_2);
16704     __pyx_t_2 = 0;
16705     __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16706     __Pyx_GOTREF(__pyx_t_2);
16707     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16708     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
16709     __Pyx_DECREF(__pyx_v_alt);
16710     __pyx_v_alt = __pyx_t_2;
16711     __pyx_t_2 = 0;
16712   }
16713   __pyx_L9:;
16714
16715   /* "cvcf.pyx":828
16716  *         if data['alt'] == []: alt = "."
16717  *         else: alt = ",".join(data['alt'])
16718  *         if data['filter'] == None: filter = "."             # <<<<<<<<<<<<<<
16719  *         elif data['filter'] == []:
16720  *             if self._version == 33: filter = "0"
16721  */
16722   __pyx_t_2 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__filter)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16723   __Pyx_GOTREF(__pyx_t_2);
16724   __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, Py_None, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16725   __Pyx_GOTREF(__pyx_t_3);
16726   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16727   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16728   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16729   if (__pyx_t_5) {
16730     __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
16731     __Pyx_DECREF(__pyx_v_filter);
16732     __pyx_v_filter = ((PyObject *)__pyx_kp_s_9);
16733     goto __pyx_L10;
16734   }
16735
16736   /* "cvcf.pyx":829
16737  *         else: alt = ",".join(data['alt'])
16738  *         if data['filter'] == None: filter = "."
16739  *         elif data['filter'] == []:             # <<<<<<<<<<<<<<
16740  *             if self._version == 33: filter = "0"
16741  *             else: filter = "PASS"
16742  */
16743   __pyx_t_3 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__filter)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16744   __Pyx_GOTREF(__pyx_t_3);
16745   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16746   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16747   __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_t_2), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16748   __Pyx_GOTREF(__pyx_t_1);
16749   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16750   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
16751   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16752   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16753   if (__pyx_t_5) {
16754
16755     /* "cvcf.pyx":830
16756  *         if data['filter'] == None: filter = "."
16757  *         elif data['filter'] == []:
16758  *             if self._version == 33: filter = "0"             # <<<<<<<<<<<<<<
16759  *             else: filter = "PASS"
16760  *         else: filter = ';'.join(data['filter'])
16761  */
16762     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16763     __Pyx_GOTREF(__pyx_t_1);
16764     __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_33, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16765     __Pyx_GOTREF(__pyx_t_2);
16766     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16767     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16768     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16769     if (__pyx_t_5) {
16770       __Pyx_INCREF(((PyObject *)__pyx_kp_s__0));
16771       __Pyx_DECREF(__pyx_v_filter);
16772       __pyx_v_filter = ((PyObject *)__pyx_kp_s__0);
16773       goto __pyx_L11;
16774     }
16775     /*else*/ {
16776
16777       /* "cvcf.pyx":831
16778  *         elif data['filter'] == []:
16779  *             if self._version == 33: filter = "0"
16780  *             else: filter = "PASS"             # <<<<<<<<<<<<<<
16781  *         else: filter = ';'.join(data['filter'])
16782  *         if data['qual'] == -1: qual = "."
16783  */
16784       __Pyx_INCREF(((PyObject *)__pyx_n_s__PASS));
16785       __Pyx_DECREF(__pyx_v_filter);
16786       __pyx_v_filter = ((PyObject *)__pyx_n_s__PASS);
16787     }
16788     __pyx_L11:;
16789     goto __pyx_L10;
16790   }
16791   /*else*/ {
16792
16793     /* "cvcf.pyx":832
16794  *             if self._version == 33: filter = "0"
16795  *             else: filter = "PASS"
16796  *         else: filter = ';'.join(data['filter'])             # <<<<<<<<<<<<<<
16797  *         if data['qual'] == -1: qual = "."
16798  *         else: qual = str(data['qual'])
16799  */
16800     __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_11), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16801     __Pyx_GOTREF(__pyx_t_2);
16802     __pyx_t_1 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__filter)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16803     __Pyx_GOTREF(__pyx_t_1);
16804     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16805     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
16806     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
16807     __Pyx_GIVEREF(__pyx_t_1);
16808     __pyx_t_1 = 0;
16809     __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16810     __Pyx_GOTREF(__pyx_t_1);
16811     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16812     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
16813     __Pyx_DECREF(__pyx_v_filter);
16814     __pyx_v_filter = __pyx_t_1;
16815     __pyx_t_1 = 0;
16816   }
16817   __pyx_L10:;
16818
16819   /* "cvcf.pyx":833
16820  *             else: filter = "PASS"
16821  *         else: filter = ';'.join(data['filter'])
16822  *         if data['qual'] == -1: qual = "."             # <<<<<<<<<<<<<<
16823  *         else: qual = str(data['qual'])
16824  * 
16825  */
16826   __pyx_t_1 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__qual)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16827   __Pyx_GOTREF(__pyx_t_1);
16828   __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16829   __Pyx_GOTREF(__pyx_t_3);
16830   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16831   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16832   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16833   if (__pyx_t_5) {
16834     __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
16835     __Pyx_DECREF(__pyx_v_qual);
16836     __pyx_v_qual = ((PyObject *)__pyx_kp_s_9);
16837     goto __pyx_L12;
16838   }
16839   /*else*/ {
16840
16841     /* "cvcf.pyx":834
16842  *         else: filter = ';'.join(data['filter'])
16843  *         if data['qual'] == -1: qual = "."
16844  *         else: qual = str(data['qual'])             # <<<<<<<<<<<<<<
16845  * 
16846  *         output = [data['chrom'],
16847  */
16848     __pyx_t_3 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__qual)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16849     __Pyx_GOTREF(__pyx_t_3);
16850     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16851     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
16852     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
16853     __Pyx_GIVEREF(__pyx_t_3);
16854     __pyx_t_3 = 0;
16855     __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16856     __Pyx_GOTREF(__pyx_t_3);
16857     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
16858     __Pyx_DECREF(__pyx_v_qual);
16859     __pyx_v_qual = __pyx_t_3;
16860     __pyx_t_3 = 0;
16861   }
16862   __pyx_L12:;
16863
16864   /* "cvcf.pyx":836
16865  *         else: qual = str(data['qual'])
16866  * 
16867  *         output = [data['chrom'],             # <<<<<<<<<<<<<<
16868  *                   str(data['pos']+1),   # change to 1-based position
16869  *                   data['id'],
16870  */
16871   __pyx_t_3 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16872   __Pyx_GOTREF(__pyx_t_3);
16873
16874   /* "cvcf.pyx":837
16875  * 
16876  *         output = [data['chrom'],
16877  *                   str(data['pos']+1),   # change to 1-based position             # <<<<<<<<<<<<<<
16878  *                   data['id'],
16879  *                   data['ref'],
16880  */
16881   __pyx_t_1 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16882   __Pyx_GOTREF(__pyx_t_1);
16883   __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16884   __Pyx_GOTREF(__pyx_t_2);
16885   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16886   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16887   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
16888   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
16889   __Pyx_GIVEREF(__pyx_t_2);
16890   __pyx_t_2 = 0;
16891   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16892   __Pyx_GOTREF(__pyx_t_2);
16893   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
16894
16895   /* "cvcf.pyx":838
16896  *         output = [data['chrom'],
16897  *                   str(data['pos']+1),   # change to 1-based position
16898  *                   data['id'],             # <<<<<<<<<<<<<<
16899  *                   data['ref'],
16900  *                   alt,
16901  */
16902   __pyx_t_1 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__id)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16903   __Pyx_GOTREF(__pyx_t_1);
16904
16905   /* "cvcf.pyx":839
16906  *                   str(data['pos']+1),   # change to 1-based position
16907  *                   data['id'],
16908  *                   data['ref'],             # <<<<<<<<<<<<<<
16909  *                   alt,
16910  *                   qual,
16911  */
16912   __pyx_t_6 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__ref)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16913   __Pyx_GOTREF(__pyx_t_6);
16914
16915   /* "cvcf.pyx":843
16916  *                   qual,
16917  *                   filter,
16918  *                   self.format_formatdata( data['info'], self._info, separator=";" ),             # <<<<<<<<<<<<<<
16919  *                   self.format_formatdata( data['format'], self._format, value=False ) ]
16920  * 
16921  */
16922   __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__format_formatdata); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16923   __Pyx_GOTREF(__pyx_t_7);
16924   __pyx_t_8 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__info)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16925   __Pyx_GOTREF(__pyx_t_8);
16926   __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16927   __Pyx_GOTREF(__pyx_t_9);
16928   __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16929   __Pyx_GOTREF(((PyObject *)__pyx_t_10));
16930   PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
16931   __Pyx_GIVEREF(__pyx_t_8);
16932   PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
16933   __Pyx_GIVEREF(__pyx_t_9);
16934   __pyx_t_8 = 0;
16935   __pyx_t_9 = 0;
16936   __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16937   __Pyx_GOTREF(((PyObject *)__pyx_t_9));
16938   if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__separator), ((PyObject *)__pyx_kp_s_11)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16939   __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16940   __Pyx_GOTREF(__pyx_t_8);
16941   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16942   __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
16943   __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
16944
16945   /* "cvcf.pyx":844
16946  *                   filter,
16947  *                   self.format_formatdata( data['info'], self._info, separator=";" ),
16948  *                   self.format_formatdata( data['format'], self._format, value=False ) ]             # <<<<<<<<<<<<<<
16949  * 
16950  *         for s in self._samples:
16951  */
16952   __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__format_formatdata); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16953   __Pyx_GOTREF(__pyx_t_9);
16954   __pyx_t_10 = PyObject_GetItem(__pyx_v_data, ((PyObject *)__pyx_n_s__format)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16955   __Pyx_GOTREF(__pyx_t_10);
16956   __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16957   __Pyx_GOTREF(__pyx_t_7);
16958   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16959   __Pyx_GOTREF(((PyObject *)__pyx_t_11));
16960   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
16961   __Pyx_GIVEREF(__pyx_t_10);
16962   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7);
16963   __Pyx_GIVEREF(__pyx_t_7);
16964   __pyx_t_10 = 0;
16965   __pyx_t_7 = 0;
16966   __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16967   __Pyx_GOTREF(((PyObject *)__pyx_t_7));
16968   __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16969   __Pyx_GOTREF(__pyx_t_10);
16970   if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__value), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16971   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16972   __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_9, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16973   __Pyx_GOTREF(__pyx_t_10);
16974   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16975   __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
16976   __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
16977   __pyx_t_7 = PyList_New(9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16978   __Pyx_GOTREF(((PyObject *)__pyx_t_7));
16979   PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
16980   __Pyx_GIVEREF(__pyx_t_3);
16981   PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
16982   __Pyx_GIVEREF(__pyx_t_2);
16983   PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_1);
16984   __Pyx_GIVEREF(__pyx_t_1);
16985   PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_6);
16986   __Pyx_GIVEREF(__pyx_t_6);
16987   __Pyx_INCREF(__pyx_v_alt);
16988   PyList_SET_ITEM(__pyx_t_7, 4, __pyx_v_alt);
16989   __Pyx_GIVEREF(__pyx_v_alt);
16990   __Pyx_INCREF(__pyx_v_qual);
16991   PyList_SET_ITEM(__pyx_t_7, 5, __pyx_v_qual);
16992   __Pyx_GIVEREF(__pyx_v_qual);
16993   __Pyx_INCREF(__pyx_v_filter);
16994   PyList_SET_ITEM(__pyx_t_7, 6, __pyx_v_filter);
16995   __Pyx_GIVEREF(__pyx_v_filter);
16996   PyList_SET_ITEM(__pyx_t_7, 7, __pyx_t_8);
16997   __Pyx_GIVEREF(__pyx_t_8);
16998   PyList_SET_ITEM(__pyx_t_7, 8, __pyx_t_10);
16999   __Pyx_GIVEREF(__pyx_t_10);
17000   __pyx_t_3 = 0;
17001   __pyx_t_2 = 0;
17002   __pyx_t_1 = 0;
17003   __pyx_t_6 = 0;
17004   __pyx_t_8 = 0;
17005   __pyx_t_10 = 0;
17006   __Pyx_DECREF(((PyObject *)__pyx_v_output));
17007   __pyx_v_output = __pyx_t_7;
17008   __pyx_t_7 = 0;
17009
17010   /* "cvcf.pyx":846
17011  *                   self.format_formatdata( data['format'], self._format, value=False ) ]
17012  * 
17013  *         for s in self._samples:             # <<<<<<<<<<<<<<
17014  *             output.append( self.format_formatdata( data[s], self._format, key=False ) )
17015  * 
17016  */
17017   __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17018   __Pyx_GOTREF(__pyx_t_7);
17019   if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
17020     __pyx_t_4 = 0; __pyx_t_10 = __pyx_t_7; __Pyx_INCREF(__pyx_t_10);
17021   } else {
17022     __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17023     __Pyx_GOTREF(__pyx_t_10);
17024   }
17025   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17026   for (;;) {
17027     if (likely(PyList_CheckExact(__pyx_t_10))) {
17028       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_10)) break;
17029       __pyx_t_7 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++;
17030     } else if (likely(PyTuple_CheckExact(__pyx_t_10))) {
17031       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
17032       __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++;
17033     } else {
17034       __pyx_t_7 = PyIter_Next(__pyx_t_10);
17035       if (!__pyx_t_7) {
17036         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17037         break;
17038       }
17039       __Pyx_GOTREF(__pyx_t_7);
17040     }
17041     __Pyx_DECREF(__pyx_v_s);
17042     __pyx_v_s = __pyx_t_7;
17043     __pyx_t_7 = 0;
17044
17045     /* "cvcf.pyx":847
17046  * 
17047  *         for s in self._samples:
17048  *             output.append( self.format_formatdata( data[s], self._format, key=False ) )             # <<<<<<<<<<<<<<
17049  * 
17050  *         stream.write( "\t".join(output) + "\n" )
17051  */
17052     if (unlikely(__pyx_v_output == Py_None)) {
17053       PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
17054     }
17055     __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__format_formatdata); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17056     __Pyx_GOTREF(__pyx_t_7);
17057     __pyx_t_8 = PyObject_GetItem(__pyx_v_data, __pyx_v_s); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17058     __Pyx_GOTREF(__pyx_t_8);
17059     __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17060     __Pyx_GOTREF(__pyx_t_6);
17061     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17062     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17063     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
17064     __Pyx_GIVEREF(__pyx_t_8);
17065     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
17066     __Pyx_GIVEREF(__pyx_t_6);
17067     __pyx_t_8 = 0;
17068     __pyx_t_6 = 0;
17069     __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17070     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
17071     __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17072     __Pyx_GOTREF(__pyx_t_8);
17073     if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__key), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17074     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17075     __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17076     __Pyx_GOTREF(__pyx_t_8);
17077     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17078     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
17079     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
17080     __pyx_t_12 = PyList_Append(__pyx_v_output, __pyx_t_8); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17081     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17082   }
17083   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17084
17085   /* "cvcf.pyx":849
17086  *             output.append( self.format_formatdata( data[s], self._format, key=False ) )
17087  * 
17088  *         stream.write( "\t".join(output) + "\n" )             # <<<<<<<<<<<<<<
17089  * 
17090  *     def _parse_header(self, stream):
17091  */
17092   __pyx_t_10 = PyObject_GetAttr(__pyx_v_stream, __pyx_n_s__write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17093   __Pyx_GOTREF(__pyx_t_10);
17094   __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_85), __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17095   __Pyx_GOTREF(__pyx_t_8);
17096   __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17097   __Pyx_GOTREF(((PyObject *)__pyx_t_6));
17098   __Pyx_INCREF(((PyObject *)__pyx_v_output));
17099   PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_output));
17100   __Pyx_GIVEREF(((PyObject *)__pyx_v_output));
17101   __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17102   __Pyx_GOTREF(__pyx_t_1);
17103   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17104   __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
17105   __pyx_t_6 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_91)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17106   __Pyx_GOTREF(__pyx_t_6);
17107   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17108   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17109   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17110   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
17111   __Pyx_GIVEREF(__pyx_t_6);
17112   __pyx_t_6 = 0;
17113   __pyx_t_6 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17114   __Pyx_GOTREF(__pyx_t_6);
17115   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17116   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
17117   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17118
17119   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17120   goto __pyx_L0;
17121   __pyx_L1_error:;
17122   __Pyx_XDECREF(__pyx_t_1);
17123   __Pyx_XDECREF(__pyx_t_2);
17124   __Pyx_XDECREF(__pyx_t_3);
17125   __Pyx_XDECREF(__pyx_t_6);
17126   __Pyx_XDECREF(__pyx_t_7);
17127   __Pyx_XDECREF(__pyx_t_8);
17128   __Pyx_XDECREF(__pyx_t_9);
17129   __Pyx_XDECREF(__pyx_t_10);
17130   __Pyx_XDECREF(__pyx_t_11);
17131   __Pyx_AddTraceback("cvcf.VCF.write_data");
17132   __pyx_r = NULL;
17133   __pyx_L0:;
17134   __Pyx_DECREF(__pyx_v_required);
17135   __Pyx_DECREF(__pyx_v_k);
17136   __Pyx_DECREF(__pyx_v_alt);
17137   __Pyx_DECREF(__pyx_v_filter);
17138   __Pyx_DECREF(__pyx_v_qual);
17139   __Pyx_DECREF(__pyx_v_output);
17140   __Pyx_DECREF(__pyx_v_s);
17141   __Pyx_XGIVEREF(__pyx_r);
17142   __Pyx_RefNannyFinishContext();
17143   return __pyx_r;
17144 }
17145
17146 /* "cvcf.pyx":851
17147  *         stream.write( "\t".join(output) + "\n" )
17148  * 
17149  *     def _parse_header(self, stream):             # <<<<<<<<<<<<<<
17150  *         self._lineno = 0
17151  *         for line in stream:
17152  */
17153
17154 static PyObject *__pyx_pf_4cvcf_3VCF_18_parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17155 static PyMethodDef __pyx_mdef_4cvcf_3VCF_18_parse_header = {__Pyx_NAMESTR("_parse_header"), (PyCFunction)__pyx_pf_4cvcf_3VCF_18_parse_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
17156 static PyObject *__pyx_pf_4cvcf_3VCF_18_parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17157   PyObject *__pyx_v_self = 0;
17158   PyObject *__pyx_v_stream = 0;
17159   PyObject *__pyx_v_line;
17160   PyObject *__pyx_r = NULL;
17161   Py_ssize_t __pyx_t_1;
17162   PyObject *__pyx_t_2 = NULL;
17163   PyObject *__pyx_t_3 = NULL;
17164   PyObject *__pyx_t_4 = NULL;
17165   int __pyx_t_5;
17166   PyObject *__pyx_t_6 = NULL;
17167   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
17168   __Pyx_RefNannySetupContext("_parse_header");
17169   __pyx_self = __pyx_self;
17170   if (unlikely(__pyx_kwds)) {
17171     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
17172     PyObject* values[2] = {0,0};
17173     switch (PyTuple_GET_SIZE(__pyx_args)) {
17174       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17175       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17176       case  0: break;
17177       default: goto __pyx_L5_argtuple_error;
17178     }
17179     switch (PyTuple_GET_SIZE(__pyx_args)) {
17180       case  0:
17181       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
17182       if (likely(values[0])) kw_args--;
17183       else goto __pyx_L5_argtuple_error;
17184       case  1:
17185       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
17186       if (likely(values[1])) kw_args--;
17187       else {
17188         __Pyx_RaiseArgtupleInvalid("_parse_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17189       }
17190     }
17191     if (unlikely(kw_args > 0)) {
17192       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_parse_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17193     }
17194     __pyx_v_self = values[0];
17195     __pyx_v_stream = values[1];
17196   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
17197     goto __pyx_L5_argtuple_error;
17198   } else {
17199     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
17200     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
17201   }
17202   goto __pyx_L4_argument_unpacking_done;
17203   __pyx_L5_argtuple_error:;
17204   __Pyx_RaiseArgtupleInvalid("_parse_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17205   __pyx_L3_error:;
17206   __Pyx_AddTraceback("cvcf.VCF._parse_header");
17207   __Pyx_RefNannyFinishContext();
17208   return NULL;
17209   __pyx_L4_argument_unpacking_done:;
17210   __pyx_v_line = Py_None; __Pyx_INCREF(Py_None);
17211
17212   /* "cvcf.pyx":852
17213  * 
17214  *     def _parse_header(self, stream):
17215  *         self._lineno = 0             # <<<<<<<<<<<<<<
17216  *         for line in stream:
17217  *             self._lineno += 1
17218  */
17219   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___lineno, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17220
17221   /* "cvcf.pyx":853
17222  *     def _parse_header(self, stream):
17223  *         self._lineno = 0
17224  *         for line in stream:             # <<<<<<<<<<<<<<
17225  *             self._lineno += 1
17226  *             if line.startswith('##'):
17227  */
17228   if (PyList_CheckExact(__pyx_v_stream) || PyTuple_CheckExact(__pyx_v_stream)) {
17229     __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_stream; __Pyx_INCREF(__pyx_t_2);
17230   } else {
17231     __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_stream); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17232     __Pyx_GOTREF(__pyx_t_2);
17233   }
17234   for (;;) {
17235     if (likely(PyList_CheckExact(__pyx_t_2))) {
17236       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
17237       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
17238     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
17239       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
17240       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
17241     } else {
17242       __pyx_t_3 = PyIter_Next(__pyx_t_2);
17243       if (!__pyx_t_3) {
17244         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17245         break;
17246       }
17247       __Pyx_GOTREF(__pyx_t_3);
17248     }
17249     __Pyx_DECREF(__pyx_v_line);
17250     __pyx_v_line = __pyx_t_3;
17251     __pyx_t_3 = 0;
17252
17253     /* "cvcf.pyx":854
17254  *         self._lineno = 0
17255  *         for line in stream:
17256  *             self._lineno += 1             # <<<<<<<<<<<<<<
17257  *             if line.startswith('##'):
17258  *                 self.parse_header( line.strip() )
17259  */
17260     __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___lineno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17261     __Pyx_GOTREF(__pyx_t_3);
17262     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17263     __Pyx_GOTREF(__pyx_t_4);
17264     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17265     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___lineno, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17266     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17267
17268     /* "cvcf.pyx":855
17269  *         for line in stream:
17270  *             self._lineno += 1
17271  *             if line.startswith('##'):             # <<<<<<<<<<<<<<
17272  *                 self.parse_header( line.strip() )
17273  *             elif line.startswith('#'):
17274  */
17275     __pyx_t_4 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17276     __Pyx_GOTREF(__pyx_t_4);
17277     __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17278     __Pyx_GOTREF(__pyx_t_3);
17279     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17280     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17281     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17282     if (__pyx_t_5) {
17283
17284       /* "cvcf.pyx":856
17285  *             self._lineno += 1
17286  *             if line.startswith('##'):
17287  *                 self.parse_header( line.strip() )             # <<<<<<<<<<<<<<
17288  *             elif line.startswith('#'):
17289  *                 self.parse_heading( line.strip() )
17290  */
17291       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17292       __Pyx_GOTREF(__pyx_t_3);
17293       __pyx_t_4 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17294       __Pyx_GOTREF(__pyx_t_4);
17295       __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17296       __Pyx_GOTREF(__pyx_t_6);
17297       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17298       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17299       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
17300       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
17301       __Pyx_GIVEREF(__pyx_t_6);
17302       __pyx_t_6 = 0;
17303       __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17304       __Pyx_GOTREF(__pyx_t_6);
17305       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17306       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
17307       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17308       goto __pyx_L8;
17309     }
17310
17311     /* "cvcf.pyx":857
17312  *             if line.startswith('##'):
17313  *                 self.parse_header( line.strip() )
17314  *             elif line.startswith('#'):             # <<<<<<<<<<<<<<
17315  *                 self.parse_heading( line.strip() )
17316  *                 self.enter_default_format()
17317  */
17318     __pyx_t_6 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__startswith); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17319     __Pyx_GOTREF(__pyx_t_6);
17320     __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17321     __Pyx_GOTREF(__pyx_t_4);
17322     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17323     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17324     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17325     if (__pyx_t_5) {
17326
17327       /* "cvcf.pyx":858
17328  *                 self.parse_header( line.strip() )
17329  *             elif line.startswith('#'):
17330  *                 self.parse_heading( line.strip() )             # <<<<<<<<<<<<<<
17331  *                 self.enter_default_format()
17332  *             else:
17333  */
17334       __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_heading); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17335       __Pyx_GOTREF(__pyx_t_4);
17336       __pyx_t_6 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17337       __Pyx_GOTREF(__pyx_t_6);
17338       __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17339       __Pyx_GOTREF(__pyx_t_3);
17340       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17341       __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17342       __Pyx_GOTREF(((PyObject *)__pyx_t_6));
17343       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
17344       __Pyx_GIVEREF(__pyx_t_3);
17345       __pyx_t_3 = 0;
17346       __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17347       __Pyx_GOTREF(__pyx_t_3);
17348       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17349       __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
17350       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17351
17352       /* "cvcf.pyx":859
17353  *             elif line.startswith('#'):
17354  *                 self.parse_heading( line.strip() )
17355  *                 self.enter_default_format()             # <<<<<<<<<<<<<<
17356  *             else:
17357  *                 break
17358  */
17359       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_118); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17360       __Pyx_GOTREF(__pyx_t_3);
17361       __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17362       __Pyx_GOTREF(__pyx_t_6);
17363       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17364       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17365       goto __pyx_L8;
17366     }
17367     /*else*/ {
17368
17369       /* "cvcf.pyx":861
17370  *                 self.enter_default_format()
17371  *             else:
17372  *                 break             # <<<<<<<<<<<<<<
17373  *         return line
17374  * 
17375  */
17376       goto __pyx_L7_break;
17377     }
17378     __pyx_L8:;
17379   }
17380   __pyx_L7_break:;
17381   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17382
17383   /* "cvcf.pyx":862
17384  *             else:
17385  *                 break
17386  *         return line             # <<<<<<<<<<<<<<
17387  * 
17388  *     def _parse(self, line, stream):
17389  */
17390   __Pyx_XDECREF(__pyx_r);
17391   __Pyx_INCREF(__pyx_v_line);
17392   __pyx_r = __pyx_v_line;
17393   goto __pyx_L0;
17394
17395   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17396   goto __pyx_L0;
17397   __pyx_L1_error:;
17398   __Pyx_XDECREF(__pyx_t_2);
17399   __Pyx_XDECREF(__pyx_t_3);
17400   __Pyx_XDECREF(__pyx_t_4);
17401   __Pyx_XDECREF(__pyx_t_6);
17402   __Pyx_AddTraceback("cvcf.VCF._parse_header");
17403   __pyx_r = NULL;
17404   __pyx_L0:;
17405   __Pyx_DECREF(__pyx_v_line);
17406   __Pyx_XGIVEREF(__pyx_r);
17407   __Pyx_RefNannyFinishContext();
17408   return __pyx_r;
17409 }
17410
17411 /* "cvcf.pyx":864
17412  *         return line
17413  * 
17414  *     def _parse(self, line, stream):             # <<<<<<<<<<<<<<
17415  *         if len(line.strip()) > 0:
17416  *             d = self.parse_data( line.strip() )
17417  */
17418
17419 static PyObject *__pyx_pf_4cvcf_3VCF_19_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17420 static PyMethodDef __pyx_mdef_4cvcf_3VCF_19_parse = {__Pyx_NAMESTR("_parse"), (PyCFunction)__pyx_pf_4cvcf_3VCF_19_parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
17421 static PyObject *__pyx_pf_4cvcf_3VCF_19_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17422   PyObject *__pyx_v_self = 0;
17423   PyObject *__pyx_v_line = 0;
17424   PyObject *__pyx_v_stream = 0;
17425   PyObject *__pyx_v_d;
17426   PyObject *__pyx_r = NULL;
17427   PyObject *__pyx_t_1 = NULL;
17428   PyObject *__pyx_t_2 = NULL;
17429   Py_ssize_t __pyx_t_3;
17430   int __pyx_t_4;
17431   PyObject *__pyx_t_5 = NULL;
17432   PyObject *__pyx_t_6 = NULL;
17433   int __pyx_t_7;
17434   int __pyx_t_8;
17435   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,&__pyx_n_s__stream,0};
17436   __Pyx_RefNannySetupContext("_parse");
17437   __pyx_self = __pyx_self;
17438   if (unlikely(__pyx_kwds)) {
17439     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
17440     PyObject* values[3] = {0,0,0};
17441     switch (PyTuple_GET_SIZE(__pyx_args)) {
17442       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17443       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17444       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17445       case  0: break;
17446       default: goto __pyx_L5_argtuple_error;
17447     }
17448     switch (PyTuple_GET_SIZE(__pyx_args)) {
17449       case  0:
17450       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
17451       if (likely(values[0])) kw_args--;
17452       else goto __pyx_L5_argtuple_error;
17453       case  1:
17454       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
17455       if (likely(values[1])) kw_args--;
17456       else {
17457         __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17458       }
17459       case  2:
17460       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
17461       if (likely(values[2])) kw_args--;
17462       else {
17463         __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17464       }
17465     }
17466     if (unlikely(kw_args > 0)) {
17467       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_parse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17468     }
17469     __pyx_v_self = values[0];
17470     __pyx_v_line = values[1];
17471     __pyx_v_stream = values[2];
17472   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
17473     goto __pyx_L5_argtuple_error;
17474   } else {
17475     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
17476     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
17477     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 2);
17478   }
17479   goto __pyx_L4_argument_unpacking_done;
17480   __pyx_L5_argtuple_error:;
17481   __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17482   __pyx_L3_error:;
17483   __Pyx_AddTraceback("cvcf.VCF._parse");
17484   __Pyx_RefNannyFinishContext();
17485   return NULL;
17486   __pyx_L4_argument_unpacking_done:;
17487   __Pyx_INCREF(__pyx_v_line);
17488   __pyx_v_d = Py_None; __Pyx_INCREF(Py_None);
17489
17490   /* "cvcf.pyx":865
17491  * 
17492  *     def _parse(self, line, stream):
17493  *         if len(line.strip()) > 0:             # <<<<<<<<<<<<<<
17494  *             d = self.parse_data( line.strip() )
17495  *             #if d: yield d
17496  */
17497   __pyx_t_1 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17498   __Pyx_GOTREF(__pyx_t_1);
17499   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17500   __Pyx_GOTREF(__pyx_t_2);
17501   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17502   __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17503   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17504   __pyx_t_4 = (__pyx_t_3 > 0);
17505   if (__pyx_t_4) {
17506
17507     /* "cvcf.pyx":866
17508  *     def _parse(self, line, stream):
17509  *         if len(line.strip()) > 0:
17510  *             d = self.parse_data( line.strip() )             # <<<<<<<<<<<<<<
17511  *             #if d: yield d
17512  *         for line in stream:
17513  */
17514     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17515     __Pyx_GOTREF(__pyx_t_2);
17516     __pyx_t_1 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17517     __Pyx_GOTREF(__pyx_t_1);
17518     __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17519     __Pyx_GOTREF(__pyx_t_5);
17520     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17521     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17522     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17523     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
17524     __Pyx_GIVEREF(__pyx_t_5);
17525     __pyx_t_5 = 0;
17526     __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17527     __Pyx_GOTREF(__pyx_t_5);
17528     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17529     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
17530     __Pyx_DECREF(__pyx_v_d);
17531     __pyx_v_d = __pyx_t_5;
17532     __pyx_t_5 = 0;
17533     goto __pyx_L6;
17534   }
17535   __pyx_L6:;
17536
17537   /* "cvcf.pyx":868
17538  *             d = self.parse_data( line.strip() )
17539  *             #if d: yield d
17540  *         for line in stream:             # <<<<<<<<<<<<<<
17541  *             self._lineno += 1
17542  *             if self._lines and self._lineno > self._lines: raise StopIteration
17543  */
17544   if (PyList_CheckExact(__pyx_v_stream) || PyTuple_CheckExact(__pyx_v_stream)) {
17545     __pyx_t_3 = 0; __pyx_t_5 = __pyx_v_stream; __Pyx_INCREF(__pyx_t_5);
17546   } else {
17547     __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_stream); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17548     __Pyx_GOTREF(__pyx_t_5);
17549   }
17550   for (;;) {
17551     if (likely(PyList_CheckExact(__pyx_t_5))) {
17552       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
17553       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
17554     } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
17555       if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
17556       __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
17557     } else {
17558       __pyx_t_1 = PyIter_Next(__pyx_t_5);
17559       if (!__pyx_t_1) {
17560         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17561         break;
17562       }
17563       __Pyx_GOTREF(__pyx_t_1);
17564     }
17565     __Pyx_DECREF(__pyx_v_line);
17566     __pyx_v_line = __pyx_t_1;
17567     __pyx_t_1 = 0;
17568
17569     /* "cvcf.pyx":869
17570  *             #if d: yield d
17571  *         for line in stream:
17572  *             self._lineno += 1             # <<<<<<<<<<<<<<
17573  *             if self._lines and self._lineno > self._lines: raise StopIteration
17574  *             d = self.parse_data( line.strip() )
17575  */
17576     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___lineno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17577     __Pyx_GOTREF(__pyx_t_1);
17578     __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17579     __Pyx_GOTREF(__pyx_t_2);
17580     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17581     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___lineno, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17582     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17583
17584     /* "cvcf.pyx":870
17585  *         for line in stream:
17586  *             self._lineno += 1
17587  *             if self._lines and self._lineno > self._lines: raise StopIteration             # <<<<<<<<<<<<<<
17588  *             d = self.parse_data( line.strip() )
17589  *             #if d: yield d
17590  */
17591     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17592     __Pyx_GOTREF(__pyx_t_2);
17593     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17594     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17595     if (__pyx_t_4) {
17596       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___lineno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17597       __Pyx_GOTREF(__pyx_t_2);
17598       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17599       __Pyx_GOTREF(__pyx_t_1);
17600       __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17601       __Pyx_GOTREF(__pyx_t_6);
17602       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17603       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17604       __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17605       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17606       __pyx_t_8 = __pyx_t_7;
17607     } else {
17608       __pyx_t_8 = __pyx_t_4;
17609     }
17610     if (__pyx_t_8) {
17611       __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
17612       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17613       goto __pyx_L9;
17614     }
17615     __pyx_L9:;
17616
17617     /* "cvcf.pyx":871
17618  *             self._lineno += 1
17619  *             if self._lines and self._lineno > self._lines: raise StopIteration
17620  *             d = self.parse_data( line.strip() )             # <<<<<<<<<<<<<<
17621  *             #if d: yield d
17622  * 
17623  */
17624     __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_data); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17625     __Pyx_GOTREF(__pyx_t_6);
17626     __pyx_t_1 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17627     __Pyx_GOTREF(__pyx_t_1);
17628     __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17629     __Pyx_GOTREF(__pyx_t_2);
17630     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17631     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17632     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17633     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
17634     __Pyx_GIVEREF(__pyx_t_2);
17635     __pyx_t_2 = 0;
17636     __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17637     __Pyx_GOTREF(__pyx_t_2);
17638     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17639     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
17640     __Pyx_DECREF(__pyx_v_d);
17641     __pyx_v_d = __pyx_t_2;
17642     __pyx_t_2 = 0;
17643   }
17644   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17645
17646   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17647   goto __pyx_L0;
17648   __pyx_L1_error:;
17649   __Pyx_XDECREF(__pyx_t_1);
17650   __Pyx_XDECREF(__pyx_t_2);
17651   __Pyx_XDECREF(__pyx_t_5);
17652   __Pyx_XDECREF(__pyx_t_6);
17653   __Pyx_AddTraceback("cvcf.VCF._parse");
17654   __pyx_r = NULL;
17655   __pyx_L0:;
17656   __Pyx_DECREF(__pyx_v_d);
17657   __Pyx_DECREF(__pyx_v_line);
17658   __Pyx_XGIVEREF(__pyx_r);
17659   __Pyx_RefNannyFinishContext();
17660   return __pyx_r;
17661 }
17662
17663 /* "cvcf.pyx":880
17664  *     ######################################################################################################
17665  * 
17666  *     def getsamples(self):             # <<<<<<<<<<<<<<
17667  *         """ List of samples in VCF file """
17668  *         return self._samples
17669  */
17670
17671 static PyObject *__pyx_pf_4cvcf_3VCF_20getsamples(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
17672 static char __pyx_doc_4cvcf_3VCF_20getsamples[] = " List of samples in VCF file ";
17673 static PyMethodDef __pyx_mdef_4cvcf_3VCF_20getsamples = {__Pyx_NAMESTR("getsamples"), (PyCFunction)__pyx_pf_4cvcf_3VCF_20getsamples, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_20getsamples)};
17674 static PyObject *__pyx_pf_4cvcf_3VCF_20getsamples(PyObject *__pyx_self, PyObject *__pyx_v_self) {
17675   PyObject *__pyx_r = NULL;
17676   PyObject *__pyx_t_1 = NULL;
17677   __Pyx_RefNannySetupContext("getsamples");
17678   __pyx_self = __pyx_self;
17679
17680   /* "cvcf.pyx":882
17681  *     def getsamples(self):
17682  *         """ List of samples in VCF file """
17683  *         return self._samples             # <<<<<<<<<<<<<<
17684  * 
17685  *     def setsamples(self,samples):
17686  */
17687   __Pyx_XDECREF(__pyx_r);
17688   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17689   __Pyx_GOTREF(__pyx_t_1);
17690   __pyx_r = __pyx_t_1;
17691   __pyx_t_1 = 0;
17692   goto __pyx_L0;
17693
17694   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17695   goto __pyx_L0;
17696   __pyx_L1_error:;
17697   __Pyx_XDECREF(__pyx_t_1);
17698   __Pyx_AddTraceback("cvcf.VCF.getsamples");
17699   __pyx_r = NULL;
17700   __pyx_L0:;
17701   __Pyx_XGIVEREF(__pyx_r);
17702   __Pyx_RefNannyFinishContext();
17703   return __pyx_r;
17704 }
17705
17706 /* "cvcf.pyx":884
17707  *         return self._samples
17708  * 
17709  *     def setsamples(self,samples):             # <<<<<<<<<<<<<<
17710  *         """ List of samples in VCF file """
17711  *         self._samples = samples
17712  */
17713
17714 static PyObject *__pyx_pf_4cvcf_3VCF_21setsamples(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17715 static char __pyx_doc_4cvcf_3VCF_21setsamples[] = " List of samples in VCF file ";
17716 static PyMethodDef __pyx_mdef_4cvcf_3VCF_21setsamples = {__Pyx_NAMESTR("setsamples"), (PyCFunction)__pyx_pf_4cvcf_3VCF_21setsamples, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_21setsamples)};
17717 static PyObject *__pyx_pf_4cvcf_3VCF_21setsamples(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17718   PyObject *__pyx_v_self = 0;
17719   PyObject *__pyx_v_samples = 0;
17720   PyObject *__pyx_r = NULL;
17721   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__samples,0};
17722   __Pyx_RefNannySetupContext("setsamples");
17723   __pyx_self = __pyx_self;
17724   if (unlikely(__pyx_kwds)) {
17725     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
17726     PyObject* values[2] = {0,0};
17727     switch (PyTuple_GET_SIZE(__pyx_args)) {
17728       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17729       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17730       case  0: break;
17731       default: goto __pyx_L5_argtuple_error;
17732     }
17733     switch (PyTuple_GET_SIZE(__pyx_args)) {
17734       case  0:
17735       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
17736       if (likely(values[0])) kw_args--;
17737       else goto __pyx_L5_argtuple_error;
17738       case  1:
17739       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samples);
17740       if (likely(values[1])) kw_args--;
17741       else {
17742         __Pyx_RaiseArgtupleInvalid("setsamples", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17743       }
17744     }
17745     if (unlikely(kw_args > 0)) {
17746       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setsamples") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17747     }
17748     __pyx_v_self = values[0];
17749     __pyx_v_samples = values[1];
17750   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
17751     goto __pyx_L5_argtuple_error;
17752   } else {
17753     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
17754     __pyx_v_samples = PyTuple_GET_ITEM(__pyx_args, 1);
17755   }
17756   goto __pyx_L4_argument_unpacking_done;
17757   __pyx_L5_argtuple_error:;
17758   __Pyx_RaiseArgtupleInvalid("setsamples", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17759   __pyx_L3_error:;
17760   __Pyx_AddTraceback("cvcf.VCF.setsamples");
17761   __Pyx_RefNannyFinishContext();
17762   return NULL;
17763   __pyx_L4_argument_unpacking_done:;
17764
17765   /* "cvcf.pyx":886
17766  *     def setsamples(self,samples):
17767  *         """ List of samples in VCF file """
17768  *         self._samples = samples             # <<<<<<<<<<<<<<
17769  * 
17770  *     def getheader(self):
17771  */
17772   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___samples, __pyx_v_samples) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17773
17774   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17775   goto __pyx_L0;
17776   __pyx_L1_error:;
17777   __Pyx_AddTraceback("cvcf.VCF.setsamples");
17778   __pyx_r = NULL;
17779   __pyx_L0:;
17780   __Pyx_XGIVEREF(__pyx_r);
17781   __Pyx_RefNannyFinishContext();
17782   return __pyx_r;
17783 }
17784
17785 /* "cvcf.pyx":888
17786  *         self._samples = samples
17787  * 
17788  *     def getheader(self):             # <<<<<<<<<<<<<<
17789  *         """ List of header key-value pairs (strings) """
17790  *         return self._header
17791  */
17792
17793 static PyObject *__pyx_pf_4cvcf_3VCF_22getheader(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
17794 static char __pyx_doc_4cvcf_3VCF_22getheader[] = " List of header key-value pairs (strings) ";
17795 static PyMethodDef __pyx_mdef_4cvcf_3VCF_22getheader = {__Pyx_NAMESTR("getheader"), (PyCFunction)__pyx_pf_4cvcf_3VCF_22getheader, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_22getheader)};
17796 static PyObject *__pyx_pf_4cvcf_3VCF_22getheader(PyObject *__pyx_self, PyObject *__pyx_v_self) {
17797   PyObject *__pyx_r = NULL;
17798   PyObject *__pyx_t_1 = NULL;
17799   __Pyx_RefNannySetupContext("getheader");
17800   __pyx_self = __pyx_self;
17801
17802   /* "cvcf.pyx":890
17803  *     def getheader(self):
17804  *         """ List of header key-value pairs (strings) """
17805  *         return self._header             # <<<<<<<<<<<<<<
17806  * 
17807  *     def setheader(self,header):
17808  */
17809   __Pyx_XDECREF(__pyx_r);
17810   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17811   __Pyx_GOTREF(__pyx_t_1);
17812   __pyx_r = __pyx_t_1;
17813   __pyx_t_1 = 0;
17814   goto __pyx_L0;
17815
17816   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17817   goto __pyx_L0;
17818   __pyx_L1_error:;
17819   __Pyx_XDECREF(__pyx_t_1);
17820   __Pyx_AddTraceback("cvcf.VCF.getheader");
17821   __pyx_r = NULL;
17822   __pyx_L0:;
17823   __Pyx_XGIVEREF(__pyx_r);
17824   __Pyx_RefNannyFinishContext();
17825   return __pyx_r;
17826 }
17827
17828 /* "cvcf.pyx":892
17829  *         return self._header
17830  * 
17831  *     def setheader(self,header):             # <<<<<<<<<<<<<<
17832  *         """ List of header key-value pairs (strings) """
17833  *         self._header = header
17834  */
17835
17836 static PyObject *__pyx_pf_4cvcf_3VCF_23setheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17837 static char __pyx_doc_4cvcf_3VCF_23setheader[] = " List of header key-value pairs (strings) ";
17838 static PyMethodDef __pyx_mdef_4cvcf_3VCF_23setheader = {__Pyx_NAMESTR("setheader"), (PyCFunction)__pyx_pf_4cvcf_3VCF_23setheader, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_23setheader)};
17839 static PyObject *__pyx_pf_4cvcf_3VCF_23setheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17840   PyObject *__pyx_v_self = 0;
17841   PyObject *__pyx_v_header = 0;
17842   PyObject *__pyx_r = NULL;
17843   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__header,0};
17844   __Pyx_RefNannySetupContext("setheader");
17845   __pyx_self = __pyx_self;
17846   if (unlikely(__pyx_kwds)) {
17847     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
17848     PyObject* values[2] = {0,0};
17849     switch (PyTuple_GET_SIZE(__pyx_args)) {
17850       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17851       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17852       case  0: break;
17853       default: goto __pyx_L5_argtuple_error;
17854     }
17855     switch (PyTuple_GET_SIZE(__pyx_args)) {
17856       case  0:
17857       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
17858       if (likely(values[0])) kw_args--;
17859       else goto __pyx_L5_argtuple_error;
17860       case  1:
17861       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__header);
17862       if (likely(values[1])) kw_args--;
17863       else {
17864         __Pyx_RaiseArgtupleInvalid("setheader", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17865       }
17866     }
17867     if (unlikely(kw_args > 0)) {
17868       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setheader") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17869     }
17870     __pyx_v_self = values[0];
17871     __pyx_v_header = values[1];
17872   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
17873     goto __pyx_L5_argtuple_error;
17874   } else {
17875     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
17876     __pyx_v_header = PyTuple_GET_ITEM(__pyx_args, 1);
17877   }
17878   goto __pyx_L4_argument_unpacking_done;
17879   __pyx_L5_argtuple_error:;
17880   __Pyx_RaiseArgtupleInvalid("setheader", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17881   __pyx_L3_error:;
17882   __Pyx_AddTraceback("cvcf.VCF.setheader");
17883   __Pyx_RefNannyFinishContext();
17884   return NULL;
17885   __pyx_L4_argument_unpacking_done:;
17886
17887   /* "cvcf.pyx":894
17888  *     def setheader(self,header):
17889  *         """ List of header key-value pairs (strings) """
17890  *         self._header = header             # <<<<<<<<<<<<<<
17891  * 
17892  *     def getinfo(self):
17893  */
17894   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___header, __pyx_v_header) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17895
17896   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17897   goto __pyx_L0;
17898   __pyx_L1_error:;
17899   __Pyx_AddTraceback("cvcf.VCF.setheader");
17900   __pyx_r = NULL;
17901   __pyx_L0:;
17902   __Pyx_XGIVEREF(__pyx_r);
17903   __Pyx_RefNannyFinishContext();
17904   return __pyx_r;
17905 }
17906
17907 /* "cvcf.pyx":896
17908  *         self._header = header
17909  * 
17910  *     def getinfo(self):             # <<<<<<<<<<<<<<
17911  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
17912  *         return self._info
17913  */
17914
17915 static PyObject *__pyx_pf_4cvcf_3VCF_24getinfo(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
17916 static char __pyx_doc_4cvcf_3VCF_24getinfo[] = " Dictionary of ##INFO tags, as VCF.FORMAT values ";
17917 static PyMethodDef __pyx_mdef_4cvcf_3VCF_24getinfo = {__Pyx_NAMESTR("getinfo"), (PyCFunction)__pyx_pf_4cvcf_3VCF_24getinfo, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_24getinfo)};
17918 static PyObject *__pyx_pf_4cvcf_3VCF_24getinfo(PyObject *__pyx_self, PyObject *__pyx_v_self) {
17919   PyObject *__pyx_r = NULL;
17920   PyObject *__pyx_t_1 = NULL;
17921   __Pyx_RefNannySetupContext("getinfo");
17922   __pyx_self = __pyx_self;
17923
17924   /* "cvcf.pyx":898
17925  *     def getinfo(self):
17926  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
17927  *         return self._info             # <<<<<<<<<<<<<<
17928  * 
17929  *     def setinfo(self,info):
17930  */
17931   __Pyx_XDECREF(__pyx_r);
17932   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17933   __Pyx_GOTREF(__pyx_t_1);
17934   __pyx_r = __pyx_t_1;
17935   __pyx_t_1 = 0;
17936   goto __pyx_L0;
17937
17938   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17939   goto __pyx_L0;
17940   __pyx_L1_error:;
17941   __Pyx_XDECREF(__pyx_t_1);
17942   __Pyx_AddTraceback("cvcf.VCF.getinfo");
17943   __pyx_r = NULL;
17944   __pyx_L0:;
17945   __Pyx_XGIVEREF(__pyx_r);
17946   __Pyx_RefNannyFinishContext();
17947   return __pyx_r;
17948 }
17949
17950 /* "cvcf.pyx":900
17951  *         return self._info
17952  * 
17953  *     def setinfo(self,info):             # <<<<<<<<<<<<<<
17954  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
17955  *         self._info = info
17956  */
17957
17958 static PyObject *__pyx_pf_4cvcf_3VCF_25setinfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17959 static char __pyx_doc_4cvcf_3VCF_25setinfo[] = " Dictionary of ##INFO tags, as VCF.FORMAT values ";
17960 static PyMethodDef __pyx_mdef_4cvcf_3VCF_25setinfo = {__Pyx_NAMESTR("setinfo"), (PyCFunction)__pyx_pf_4cvcf_3VCF_25setinfo, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_25setinfo)};
17961 static PyObject *__pyx_pf_4cvcf_3VCF_25setinfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17962   PyObject *__pyx_v_self = 0;
17963   PyObject *__pyx_v_info = 0;
17964   PyObject *__pyx_r = NULL;
17965   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__info,0};
17966   __Pyx_RefNannySetupContext("setinfo");
17967   __pyx_self = __pyx_self;
17968   if (unlikely(__pyx_kwds)) {
17969     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
17970     PyObject* values[2] = {0,0};
17971     switch (PyTuple_GET_SIZE(__pyx_args)) {
17972       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17973       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17974       case  0: break;
17975       default: goto __pyx_L5_argtuple_error;
17976     }
17977     switch (PyTuple_GET_SIZE(__pyx_args)) {
17978       case  0:
17979       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
17980       if (likely(values[0])) kw_args--;
17981       else goto __pyx_L5_argtuple_error;
17982       case  1:
17983       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__info);
17984       if (likely(values[1])) kw_args--;
17985       else {
17986         __Pyx_RaiseArgtupleInvalid("setinfo", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17987       }
17988     }
17989     if (unlikely(kw_args > 0)) {
17990       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setinfo") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17991     }
17992     __pyx_v_self = values[0];
17993     __pyx_v_info = values[1];
17994   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
17995     goto __pyx_L5_argtuple_error;
17996   } else {
17997     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
17998     __pyx_v_info = PyTuple_GET_ITEM(__pyx_args, 1);
17999   }
18000   goto __pyx_L4_argument_unpacking_done;
18001   __pyx_L5_argtuple_error:;
18002   __Pyx_RaiseArgtupleInvalid("setinfo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18003   __pyx_L3_error:;
18004   __Pyx_AddTraceback("cvcf.VCF.setinfo");
18005   __Pyx_RefNannyFinishContext();
18006   return NULL;
18007   __pyx_L4_argument_unpacking_done:;
18008
18009   /* "cvcf.pyx":902
18010  *     def setinfo(self,info):
18011  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
18012  *         self._info = info             # <<<<<<<<<<<<<<
18013  * 
18014  *     def getformat(self):
18015  */
18016   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___info, __pyx_v_info) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18017
18018   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18019   goto __pyx_L0;
18020   __pyx_L1_error:;
18021   __Pyx_AddTraceback("cvcf.VCF.setinfo");
18022   __pyx_r = NULL;
18023   __pyx_L0:;
18024   __Pyx_XGIVEREF(__pyx_r);
18025   __Pyx_RefNannyFinishContext();
18026   return __pyx_r;
18027 }
18028
18029 /* "cvcf.pyx":904
18030  *         self._info = info
18031  * 
18032  *     def getformat(self):             # <<<<<<<<<<<<<<
18033  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
18034  *         return self._format
18035  */
18036
18037 static PyObject *__pyx_pf_4cvcf_3VCF_26getformat(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
18038 static char __pyx_doc_4cvcf_3VCF_26getformat[] = " Dictionary of ##FORMAT tags, as VCF.FORMAT values ";
18039 static PyMethodDef __pyx_mdef_4cvcf_3VCF_26getformat = {__Pyx_NAMESTR("getformat"), (PyCFunction)__pyx_pf_4cvcf_3VCF_26getformat, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_26getformat)};
18040 static PyObject *__pyx_pf_4cvcf_3VCF_26getformat(PyObject *__pyx_self, PyObject *__pyx_v_self) {
18041   PyObject *__pyx_r = NULL;
18042   PyObject *__pyx_t_1 = NULL;
18043   __Pyx_RefNannySetupContext("getformat");
18044   __pyx_self = __pyx_self;
18045
18046   /* "cvcf.pyx":906
18047  *     def getformat(self):
18048  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
18049  *         return self._format             # <<<<<<<<<<<<<<
18050  * 
18051  *     def setformat(self,format):
18052  */
18053   __Pyx_XDECREF(__pyx_r);
18054   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18055   __Pyx_GOTREF(__pyx_t_1);
18056   __pyx_r = __pyx_t_1;
18057   __pyx_t_1 = 0;
18058   goto __pyx_L0;
18059
18060   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18061   goto __pyx_L0;
18062   __pyx_L1_error:;
18063   __Pyx_XDECREF(__pyx_t_1);
18064   __Pyx_AddTraceback("cvcf.VCF.getformat");
18065   __pyx_r = NULL;
18066   __pyx_L0:;
18067   __Pyx_XGIVEREF(__pyx_r);
18068   __Pyx_RefNannyFinishContext();
18069   return __pyx_r;
18070 }
18071
18072 /* "cvcf.pyx":908
18073  *         return self._format
18074  * 
18075  *     def setformat(self,format):             # <<<<<<<<<<<<<<
18076  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
18077  *         self._format = format
18078  */
18079
18080 static PyObject *__pyx_pf_4cvcf_3VCF_27setformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18081 static char __pyx_doc_4cvcf_3VCF_27setformat[] = " Dictionary of ##FORMAT tags, as VCF.FORMAT values ";
18082 static PyMethodDef __pyx_mdef_4cvcf_3VCF_27setformat = {__Pyx_NAMESTR("setformat"), (PyCFunction)__pyx_pf_4cvcf_3VCF_27setformat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_27setformat)};
18083 static PyObject *__pyx_pf_4cvcf_3VCF_27setformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18084   PyObject *__pyx_v_self = 0;
18085   PyObject *__pyx_v_format = 0;
18086   PyObject *__pyx_r = NULL;
18087   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__format,0};
18088   __Pyx_RefNannySetupContext("setformat");
18089   __pyx_self = __pyx_self;
18090   if (unlikely(__pyx_kwds)) {
18091     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18092     PyObject* values[2] = {0,0};
18093     switch (PyTuple_GET_SIZE(__pyx_args)) {
18094       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18095       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18096       case  0: break;
18097       default: goto __pyx_L5_argtuple_error;
18098     }
18099     switch (PyTuple_GET_SIZE(__pyx_args)) {
18100       case  0:
18101       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18102       if (likely(values[0])) kw_args--;
18103       else goto __pyx_L5_argtuple_error;
18104       case  1:
18105       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
18106       if (likely(values[1])) kw_args--;
18107       else {
18108         __Pyx_RaiseArgtupleInvalid("setformat", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18109       }
18110     }
18111     if (unlikely(kw_args > 0)) {
18112       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setformat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18113     }
18114     __pyx_v_self = values[0];
18115     __pyx_v_format = values[1];
18116   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18117     goto __pyx_L5_argtuple_error;
18118   } else {
18119     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18120     __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 1);
18121   }
18122   goto __pyx_L4_argument_unpacking_done;
18123   __pyx_L5_argtuple_error:;
18124   __Pyx_RaiseArgtupleInvalid("setformat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18125   __pyx_L3_error:;
18126   __Pyx_AddTraceback("cvcf.VCF.setformat");
18127   __Pyx_RefNannyFinishContext();
18128   return NULL;
18129   __pyx_L4_argument_unpacking_done:;
18130
18131   /* "cvcf.pyx":910
18132  *     def setformat(self,format):
18133  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
18134  *         self._format = format             # <<<<<<<<<<<<<<
18135  * 
18136  *     def getfilter(self):
18137  */
18138   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___format, __pyx_v_format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18139
18140   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18141   goto __pyx_L0;
18142   __pyx_L1_error:;
18143   __Pyx_AddTraceback("cvcf.VCF.setformat");
18144   __pyx_r = NULL;
18145   __pyx_L0:;
18146   __Pyx_XGIVEREF(__pyx_r);
18147   __Pyx_RefNannyFinishContext();
18148   return __pyx_r;
18149 }
18150
18151 /* "cvcf.pyx":912
18152  *         self._format = format
18153  * 
18154  *     def getfilter(self):             # <<<<<<<<<<<<<<
18155  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
18156  *         return self._filter
18157  */
18158
18159 static PyObject *__pyx_pf_4cvcf_3VCF_28getfilter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
18160 static char __pyx_doc_4cvcf_3VCF_28getfilter[] = " Dictionary of ##FILTER tags, as VCF.FORMAT values ";
18161 static PyMethodDef __pyx_mdef_4cvcf_3VCF_28getfilter = {__Pyx_NAMESTR("getfilter"), (PyCFunction)__pyx_pf_4cvcf_3VCF_28getfilter, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_28getfilter)};
18162 static PyObject *__pyx_pf_4cvcf_3VCF_28getfilter(PyObject *__pyx_self, PyObject *__pyx_v_self) {
18163   PyObject *__pyx_r = NULL;
18164   PyObject *__pyx_t_1 = NULL;
18165   __Pyx_RefNannySetupContext("getfilter");
18166   __pyx_self = __pyx_self;
18167
18168   /* "cvcf.pyx":914
18169  *     def getfilter(self):
18170  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
18171  *         return self._filter             # <<<<<<<<<<<<<<
18172  * 
18173  *     def setfilter(self,filter):
18174  */
18175   __Pyx_XDECREF(__pyx_r);
18176   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18177   __Pyx_GOTREF(__pyx_t_1);
18178   __pyx_r = __pyx_t_1;
18179   __pyx_t_1 = 0;
18180   goto __pyx_L0;
18181
18182   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18183   goto __pyx_L0;
18184   __pyx_L1_error:;
18185   __Pyx_XDECREF(__pyx_t_1);
18186   __Pyx_AddTraceback("cvcf.VCF.getfilter");
18187   __pyx_r = NULL;
18188   __pyx_L0:;
18189   __Pyx_XGIVEREF(__pyx_r);
18190   __Pyx_RefNannyFinishContext();
18191   return __pyx_r;
18192 }
18193
18194 /* "cvcf.pyx":916
18195  *         return self._filter
18196  * 
18197  *     def setfilter(self,filter):             # <<<<<<<<<<<<<<
18198  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
18199  *         self._filter = filter
18200  */
18201
18202 static PyObject *__pyx_pf_4cvcf_3VCF_29setfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18203 static char __pyx_doc_4cvcf_3VCF_29setfilter[] = " Dictionary of ##FILTER tags, as VCF.FORMAT values ";
18204 static PyMethodDef __pyx_mdef_4cvcf_3VCF_29setfilter = {__Pyx_NAMESTR("setfilter"), (PyCFunction)__pyx_pf_4cvcf_3VCF_29setfilter, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_29setfilter)};
18205 static PyObject *__pyx_pf_4cvcf_3VCF_29setfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18206   PyObject *__pyx_v_self = 0;
18207   PyObject *__pyx_v_filter = 0;
18208   PyObject *__pyx_r = NULL;
18209   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__filter,0};
18210   __Pyx_RefNannySetupContext("setfilter");
18211   __pyx_self = __pyx_self;
18212   if (unlikely(__pyx_kwds)) {
18213     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18214     PyObject* values[2] = {0,0};
18215     switch (PyTuple_GET_SIZE(__pyx_args)) {
18216       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18217       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18218       case  0: break;
18219       default: goto __pyx_L5_argtuple_error;
18220     }
18221     switch (PyTuple_GET_SIZE(__pyx_args)) {
18222       case  0:
18223       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18224       if (likely(values[0])) kw_args--;
18225       else goto __pyx_L5_argtuple_error;
18226       case  1:
18227       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
18228       if (likely(values[1])) kw_args--;
18229       else {
18230         __Pyx_RaiseArgtupleInvalid("setfilter", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18231       }
18232     }
18233     if (unlikely(kw_args > 0)) {
18234       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setfilter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18235     }
18236     __pyx_v_self = values[0];
18237     __pyx_v_filter = values[1];
18238   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18239     goto __pyx_L5_argtuple_error;
18240   } else {
18241     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18242     __pyx_v_filter = PyTuple_GET_ITEM(__pyx_args, 1);
18243   }
18244   goto __pyx_L4_argument_unpacking_done;
18245   __pyx_L5_argtuple_error:;
18246   __Pyx_RaiseArgtupleInvalid("setfilter", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18247   __pyx_L3_error:;
18248   __Pyx_AddTraceback("cvcf.VCF.setfilter");
18249   __Pyx_RefNannyFinishContext();
18250   return NULL;
18251   __pyx_L4_argument_unpacking_done:;
18252
18253   /* "cvcf.pyx":918
18254  *     def setfilter(self,filter):
18255  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
18256  *         self._filter = filter             # <<<<<<<<<<<<<<
18257  * 
18258  *     def setversion(self, version):
18259  */
18260   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___filter, __pyx_v_filter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18261
18262   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18263   goto __pyx_L0;
18264   __pyx_L1_error:;
18265   __Pyx_AddTraceback("cvcf.VCF.setfilter");
18266   __pyx_r = NULL;
18267   __pyx_L0:;
18268   __Pyx_XGIVEREF(__pyx_r);
18269   __Pyx_RefNannyFinishContext();
18270   return __pyx_r;
18271 }
18272
18273 /* "cvcf.pyx":920
18274  *         self._filter = filter
18275  * 
18276  *     def setversion(self, version):             # <<<<<<<<<<<<<<
18277  *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
18278  *         self._version = version
18279  */
18280
18281 static PyObject *__pyx_pf_4cvcf_3VCF_30setversion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18282 static PyMethodDef __pyx_mdef_4cvcf_3VCF_30setversion = {__Pyx_NAMESTR("setversion"), (PyCFunction)__pyx_pf_4cvcf_3VCF_30setversion, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
18283 static PyObject *__pyx_pf_4cvcf_3VCF_30setversion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18284   PyObject *__pyx_v_self = 0;
18285   PyObject *__pyx_v_version = 0;
18286   PyObject *__pyx_r = NULL;
18287   PyObject *__pyx_t_1 = NULL;
18288   int __pyx_t_2;
18289   int __pyx_t_3;
18290   int __pyx_t_4;
18291   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__version,0};
18292   __Pyx_RefNannySetupContext("setversion");
18293   __pyx_self = __pyx_self;
18294   if (unlikely(__pyx_kwds)) {
18295     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18296     PyObject* values[2] = {0,0};
18297     switch (PyTuple_GET_SIZE(__pyx_args)) {
18298       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18299       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18300       case  0: break;
18301       default: goto __pyx_L5_argtuple_error;
18302     }
18303     switch (PyTuple_GET_SIZE(__pyx_args)) {
18304       case  0:
18305       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18306       if (likely(values[0])) kw_args--;
18307       else goto __pyx_L5_argtuple_error;
18308       case  1:
18309       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__version);
18310       if (likely(values[1])) kw_args--;
18311       else {
18312         __Pyx_RaiseArgtupleInvalid("setversion", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18313       }
18314     }
18315     if (unlikely(kw_args > 0)) {
18316       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setversion") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18317     }
18318     __pyx_v_self = values[0];
18319     __pyx_v_version = values[1];
18320   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18321     goto __pyx_L5_argtuple_error;
18322   } else {
18323     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18324     __pyx_v_version = PyTuple_GET_ITEM(__pyx_args, 1);
18325   }
18326   goto __pyx_L4_argument_unpacking_done;
18327   __pyx_L5_argtuple_error:;
18328   __Pyx_RaiseArgtupleInvalid("setversion", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18329   __pyx_L3_error:;
18330   __Pyx_AddTraceback("cvcf.VCF.setversion");
18331   __Pyx_RefNannyFinishContext();
18332   return NULL;
18333   __pyx_L4_argument_unpacking_done:;
18334
18335   /* "cvcf.pyx":921
18336  * 
18337  *     def setversion(self, version):
18338  *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")             # <<<<<<<<<<<<<<
18339  *         self._version = version
18340  * 
18341  */
18342   __pyx_t_1 = PyObject_RichCompare(__pyx_v_version, __pyx_int_33, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18343   __Pyx_GOTREF(__pyx_t_1);
18344   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18345   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18346   if (__pyx_t_2) {
18347     __pyx_t_1 = PyObject_RichCompare(__pyx_v_version, __pyx_int_40, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18348     __Pyx_GOTREF(__pyx_t_1);
18349     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18350     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18351     __pyx_t_4 = __pyx_t_3;
18352   } else {
18353     __pyx_t_4 = __pyx_t_2;
18354   }
18355   if (__pyx_t_4) {
18356     __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18357     __Pyx_GOTREF(__pyx_t_1);
18358     __Pyx_Raise(__pyx_t_1, 0, 0);
18359     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18360     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18361     goto __pyx_L6;
18362   }
18363   __pyx_L6:;
18364
18365   /* "cvcf.pyx":922
18366  *     def setversion(self, version):
18367  *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
18368  *         self._version = version             # <<<<<<<<<<<<<<
18369  * 
18370  *     def setregions(self, regions):
18371  */
18372   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___version, __pyx_v_version) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18373
18374   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18375   goto __pyx_L0;
18376   __pyx_L1_error:;
18377   __Pyx_XDECREF(__pyx_t_1);
18378   __Pyx_AddTraceback("cvcf.VCF.setversion");
18379   __pyx_r = NULL;
18380   __pyx_L0:;
18381   __Pyx_XGIVEREF(__pyx_r);
18382   __Pyx_RefNannyFinishContext();
18383   return __pyx_r;
18384 }
18385
18386 /* "cvcf.pyx":924
18387  *         self._version = version
18388  * 
18389  *     def setregions(self, regions):             # <<<<<<<<<<<<<<
18390  *         self._regions = regions
18391  * 
18392  */
18393
18394 static PyObject *__pyx_pf_4cvcf_3VCF_31setregions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18395 static PyMethodDef __pyx_mdef_4cvcf_3VCF_31setregions = {__Pyx_NAMESTR("setregions"), (PyCFunction)__pyx_pf_4cvcf_3VCF_31setregions, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
18396 static PyObject *__pyx_pf_4cvcf_3VCF_31setregions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18397   PyObject *__pyx_v_self = 0;
18398   PyObject *__pyx_v_regions = 0;
18399   PyObject *__pyx_r = NULL;
18400   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__regions,0};
18401   __Pyx_RefNannySetupContext("setregions");
18402   __pyx_self = __pyx_self;
18403   if (unlikely(__pyx_kwds)) {
18404     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18405     PyObject* values[2] = {0,0};
18406     switch (PyTuple_GET_SIZE(__pyx_args)) {
18407       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18408       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18409       case  0: break;
18410       default: goto __pyx_L5_argtuple_error;
18411     }
18412     switch (PyTuple_GET_SIZE(__pyx_args)) {
18413       case  0:
18414       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18415       if (likely(values[0])) kw_args--;
18416       else goto __pyx_L5_argtuple_error;
18417       case  1:
18418       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__regions);
18419       if (likely(values[1])) kw_args--;
18420       else {
18421         __Pyx_RaiseArgtupleInvalid("setregions", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18422       }
18423     }
18424     if (unlikely(kw_args > 0)) {
18425       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setregions") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18426     }
18427     __pyx_v_self = values[0];
18428     __pyx_v_regions = values[1];
18429   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18430     goto __pyx_L5_argtuple_error;
18431   } else {
18432     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18433     __pyx_v_regions = PyTuple_GET_ITEM(__pyx_args, 1);
18434   }
18435   goto __pyx_L4_argument_unpacking_done;
18436   __pyx_L5_argtuple_error:;
18437   __Pyx_RaiseArgtupleInvalid("setregions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18438   __pyx_L3_error:;
18439   __Pyx_AddTraceback("cvcf.VCF.setregions");
18440   __Pyx_RefNannyFinishContext();
18441   return NULL;
18442   __pyx_L4_argument_unpacking_done:;
18443
18444   /* "cvcf.pyx":925
18445  * 
18446  *     def setregions(self, regions):
18447  *         self._regions = regions             # <<<<<<<<<<<<<<
18448  * 
18449  *     def setreference(self, ref):
18450  */
18451   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___regions, __pyx_v_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18452
18453   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18454   goto __pyx_L0;
18455   __pyx_L1_error:;
18456   __Pyx_AddTraceback("cvcf.VCF.setregions");
18457   __pyx_r = NULL;
18458   __pyx_L0:;
18459   __Pyx_XGIVEREF(__pyx_r);
18460   __Pyx_RefNannyFinishContext();
18461   return __pyx_r;
18462 }
18463
18464 /* "cvcf.pyx":927
18465  *         self._regions = regions
18466  * 
18467  *     def setreference(self, ref):             # <<<<<<<<<<<<<<
18468  *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
18469  *         self._reference = ref
18470  */
18471
18472 static PyObject *__pyx_pf_4cvcf_3VCF_32setreference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18473 static char __pyx_doc_4cvcf_3VCF_32setreference[] = " Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile ";
18474 static PyMethodDef __pyx_mdef_4cvcf_3VCF_32setreference = {__Pyx_NAMESTR("setreference"), (PyCFunction)__pyx_pf_4cvcf_3VCF_32setreference, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_32setreference)};
18475 static PyObject *__pyx_pf_4cvcf_3VCF_32setreference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18476   PyObject *__pyx_v_self = 0;
18477   PyObject *__pyx_v_ref = 0;
18478   PyObject *__pyx_r = NULL;
18479   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__ref,0};
18480   __Pyx_RefNannySetupContext("setreference");
18481   __pyx_self = __pyx_self;
18482   if (unlikely(__pyx_kwds)) {
18483     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18484     PyObject* values[2] = {0,0};
18485     switch (PyTuple_GET_SIZE(__pyx_args)) {
18486       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18487       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18488       case  0: break;
18489       default: goto __pyx_L5_argtuple_error;
18490     }
18491     switch (PyTuple_GET_SIZE(__pyx_args)) {
18492       case  0:
18493       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18494       if (likely(values[0])) kw_args--;
18495       else goto __pyx_L5_argtuple_error;
18496       case  1:
18497       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ref);
18498       if (likely(values[1])) kw_args--;
18499       else {
18500         __Pyx_RaiseArgtupleInvalid("setreference", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18501       }
18502     }
18503     if (unlikely(kw_args > 0)) {
18504       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setreference") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18505     }
18506     __pyx_v_self = values[0];
18507     __pyx_v_ref = values[1];
18508   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18509     goto __pyx_L5_argtuple_error;
18510   } else {
18511     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18512     __pyx_v_ref = PyTuple_GET_ITEM(__pyx_args, 1);
18513   }
18514   goto __pyx_L4_argument_unpacking_done;
18515   __pyx_L5_argtuple_error:;
18516   __Pyx_RaiseArgtupleInvalid("setreference", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18517   __pyx_L3_error:;
18518   __Pyx_AddTraceback("cvcf.VCF.setreference");
18519   __Pyx_RefNannyFinishContext();
18520   return NULL;
18521   __pyx_L4_argument_unpacking_done:;
18522
18523   /* "cvcf.pyx":929
18524  *     def setreference(self, ref):
18525  *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
18526  *         self._reference = ref             # <<<<<<<<<<<<<<
18527  * 
18528  *     def ignoreerror(self, errorstring):
18529  */
18530   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___reference, __pyx_v_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18531
18532   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18533   goto __pyx_L0;
18534   __pyx_L1_error:;
18535   __Pyx_AddTraceback("cvcf.VCF.setreference");
18536   __pyx_r = NULL;
18537   __pyx_L0:;
18538   __Pyx_XGIVEREF(__pyx_r);
18539   __Pyx_RefNannyFinishContext();
18540   return __pyx_r;
18541 }
18542
18543 /* "cvcf.pyx":931
18544  *         self._reference = ref
18545  * 
18546  *     def ignoreerror(self, errorstring):             # <<<<<<<<<<<<<<
18547  *         try:             self._ignored_errors.add(self.__dict__[errorstring])
18548  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18549  */
18550
18551 static PyObject *__pyx_pf_4cvcf_3VCF_33ignoreerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18552 static PyMethodDef __pyx_mdef_4cvcf_3VCF_33ignoreerror = {__Pyx_NAMESTR("ignoreerror"), (PyCFunction)__pyx_pf_4cvcf_3VCF_33ignoreerror, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
18553 static PyObject *__pyx_pf_4cvcf_3VCF_33ignoreerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18554   PyObject *__pyx_v_self = 0;
18555   PyObject *__pyx_v_errorstring = 0;
18556   PyObject *__pyx_r = NULL;
18557   PyObject *__pyx_t_1 = NULL;
18558   PyObject *__pyx_t_2 = NULL;
18559   PyObject *__pyx_t_3 = NULL;
18560   int __pyx_t_4;
18561   PyObject *__pyx_t_5 = NULL;
18562   PyObject *__pyx_t_6 = NULL;
18563   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__errorstring,0};
18564   __Pyx_RefNannySetupContext("ignoreerror");
18565   __pyx_self = __pyx_self;
18566   if (unlikely(__pyx_kwds)) {
18567     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18568     PyObject* values[2] = {0,0};
18569     switch (PyTuple_GET_SIZE(__pyx_args)) {
18570       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18571       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18572       case  0: break;
18573       default: goto __pyx_L5_argtuple_error;
18574     }
18575     switch (PyTuple_GET_SIZE(__pyx_args)) {
18576       case  0:
18577       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18578       if (likely(values[0])) kw_args--;
18579       else goto __pyx_L5_argtuple_error;
18580       case  1:
18581       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__errorstring);
18582       if (likely(values[1])) kw_args--;
18583       else {
18584         __Pyx_RaiseArgtupleInvalid("ignoreerror", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18585       }
18586     }
18587     if (unlikely(kw_args > 0)) {
18588       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "ignoreerror") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18589     }
18590     __pyx_v_self = values[0];
18591     __pyx_v_errorstring = values[1];
18592   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18593     goto __pyx_L5_argtuple_error;
18594   } else {
18595     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18596     __pyx_v_errorstring = PyTuple_GET_ITEM(__pyx_args, 1);
18597   }
18598   goto __pyx_L4_argument_unpacking_done;
18599   __pyx_L5_argtuple_error:;
18600   __Pyx_RaiseArgtupleInvalid("ignoreerror", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18601   __pyx_L3_error:;
18602   __Pyx_AddTraceback("cvcf.VCF.ignoreerror");
18603   __Pyx_RefNannyFinishContext();
18604   return NULL;
18605   __pyx_L4_argument_unpacking_done:;
18606
18607   /* "cvcf.pyx":932
18608  * 
18609  *     def ignoreerror(self, errorstring):
18610  *         try:             self._ignored_errors.add(self.__dict__[errorstring])             # <<<<<<<<<<<<<<
18611  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18612  * 
18613  */
18614   {
18615     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
18616     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
18617     __Pyx_XGOTREF(__pyx_save_exc_type);
18618     __Pyx_XGOTREF(__pyx_save_exc_value);
18619     __Pyx_XGOTREF(__pyx_save_exc_tb);
18620     /*try:*/ {
18621       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___ignored_errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18622       __Pyx_GOTREF(__pyx_t_1);
18623       __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18624       __Pyx_GOTREF(__pyx_t_2);
18625       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18626       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____dict__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18627       __Pyx_GOTREF(__pyx_t_1);
18628       __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_v_errorstring); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18629       __Pyx_GOTREF(__pyx_t_3);
18630       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18631       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18632       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
18633       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
18634       __Pyx_GIVEREF(__pyx_t_3);
18635       __pyx_t_3 = 0;
18636       __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18637       __Pyx_GOTREF(__pyx_t_3);
18638       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18639       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
18640       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18641     }
18642     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
18643     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
18644     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
18645     goto __pyx_L13_try_end;
18646     __pyx_L6_error:;
18647     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18648     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18649     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18650
18651     /* "cvcf.pyx":933
18652  *     def ignoreerror(self, errorstring):
18653  *         try:             self._ignored_errors.add(self.__dict__[errorstring])
18654  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)             # <<<<<<<<<<<<<<
18655  * 
18656  *     def warnerror(self, errorstring):
18657  */
18658     __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
18659     if (__pyx_t_4) {
18660       __Pyx_AddTraceback("cvcf.VCF.ignoreerror");
18661       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18662       __Pyx_GOTREF(__pyx_t_3);
18663       __Pyx_GOTREF(__pyx_t_1);
18664       __Pyx_GOTREF(__pyx_t_2);
18665       __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_v_errorstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18666       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
18667       __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18668       __Pyx_GOTREF(((PyObject *)__pyx_t_6));
18669       PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
18670       __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
18671       __pyx_t_5 = 0;
18672       __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18673       __Pyx_GOTREF(__pyx_t_5);
18674       __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
18675       __Pyx_Raise(__pyx_t_5, 0, 0);
18676       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18677       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18678       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18679       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18680       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18681       goto __pyx_L7_exception_handled;
18682     }
18683     __pyx_L8_except_error:;
18684     __Pyx_XGIVEREF(__pyx_save_exc_type);
18685     __Pyx_XGIVEREF(__pyx_save_exc_value);
18686     __Pyx_XGIVEREF(__pyx_save_exc_tb);
18687     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
18688     goto __pyx_L1_error;
18689     __pyx_L7_exception_handled:;
18690     __Pyx_XGIVEREF(__pyx_save_exc_type);
18691     __Pyx_XGIVEREF(__pyx_save_exc_value);
18692     __Pyx_XGIVEREF(__pyx_save_exc_tb);
18693     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
18694     __pyx_L13_try_end:;
18695   }
18696
18697   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18698   goto __pyx_L0;
18699   __pyx_L1_error:;
18700   __Pyx_XDECREF(__pyx_t_1);
18701   __Pyx_XDECREF(__pyx_t_2);
18702   __Pyx_XDECREF(__pyx_t_3);
18703   __Pyx_XDECREF(__pyx_t_5);
18704   __Pyx_XDECREF(__pyx_t_6);
18705   __Pyx_AddTraceback("cvcf.VCF.ignoreerror");
18706   __pyx_r = NULL;
18707   __pyx_L0:;
18708   __Pyx_XGIVEREF(__pyx_r);
18709   __Pyx_RefNannyFinishContext();
18710   return __pyx_r;
18711 }
18712
18713 /* "cvcf.pyx":935
18714  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18715  * 
18716  *     def warnerror(self, errorstring):             # <<<<<<<<<<<<<<
18717  *         try:             self._warn_errors.add(self.__dict__[errorstring])
18718  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18719  */
18720
18721 static PyObject *__pyx_pf_4cvcf_3VCF_34warnerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18722 static PyMethodDef __pyx_mdef_4cvcf_3VCF_34warnerror = {__Pyx_NAMESTR("warnerror"), (PyCFunction)__pyx_pf_4cvcf_3VCF_34warnerror, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
18723 static PyObject *__pyx_pf_4cvcf_3VCF_34warnerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18724   PyObject *__pyx_v_self = 0;
18725   PyObject *__pyx_v_errorstring = 0;
18726   PyObject *__pyx_r = NULL;
18727   PyObject *__pyx_t_1 = NULL;
18728   PyObject *__pyx_t_2 = NULL;
18729   PyObject *__pyx_t_3 = NULL;
18730   int __pyx_t_4;
18731   PyObject *__pyx_t_5 = NULL;
18732   PyObject *__pyx_t_6 = NULL;
18733   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__errorstring,0};
18734   __Pyx_RefNannySetupContext("warnerror");
18735   __pyx_self = __pyx_self;
18736   if (unlikely(__pyx_kwds)) {
18737     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18738     PyObject* values[2] = {0,0};
18739     switch (PyTuple_GET_SIZE(__pyx_args)) {
18740       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18741       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18742       case  0: break;
18743       default: goto __pyx_L5_argtuple_error;
18744     }
18745     switch (PyTuple_GET_SIZE(__pyx_args)) {
18746       case  0:
18747       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18748       if (likely(values[0])) kw_args--;
18749       else goto __pyx_L5_argtuple_error;
18750       case  1:
18751       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__errorstring);
18752       if (likely(values[1])) kw_args--;
18753       else {
18754         __Pyx_RaiseArgtupleInvalid("warnerror", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18755       }
18756     }
18757     if (unlikely(kw_args > 0)) {
18758       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "warnerror") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18759     }
18760     __pyx_v_self = values[0];
18761     __pyx_v_errorstring = values[1];
18762   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18763     goto __pyx_L5_argtuple_error;
18764   } else {
18765     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18766     __pyx_v_errorstring = PyTuple_GET_ITEM(__pyx_args, 1);
18767   }
18768   goto __pyx_L4_argument_unpacking_done;
18769   __pyx_L5_argtuple_error:;
18770   __Pyx_RaiseArgtupleInvalid("warnerror", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18771   __pyx_L3_error:;
18772   __Pyx_AddTraceback("cvcf.VCF.warnerror");
18773   __Pyx_RefNannyFinishContext();
18774   return NULL;
18775   __pyx_L4_argument_unpacking_done:;
18776
18777   /* "cvcf.pyx":936
18778  * 
18779  *     def warnerror(self, errorstring):
18780  *         try:             self._warn_errors.add(self.__dict__[errorstring])             # <<<<<<<<<<<<<<
18781  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18782  * 
18783  */
18784   {
18785     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
18786     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
18787     __Pyx_XGOTREF(__pyx_save_exc_type);
18788     __Pyx_XGOTREF(__pyx_save_exc_value);
18789     __Pyx_XGOTREF(__pyx_save_exc_tb);
18790     /*try:*/ {
18791       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___warn_errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18792       __Pyx_GOTREF(__pyx_t_1);
18793       __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18794       __Pyx_GOTREF(__pyx_t_2);
18795       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18796       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____dict__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18797       __Pyx_GOTREF(__pyx_t_1);
18798       __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_v_errorstring); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18799       __Pyx_GOTREF(__pyx_t_3);
18800       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18801       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18802       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
18803       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
18804       __Pyx_GIVEREF(__pyx_t_3);
18805       __pyx_t_3 = 0;
18806       __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18807       __Pyx_GOTREF(__pyx_t_3);
18808       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18809       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
18810       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18811     }
18812     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
18813     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
18814     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
18815     goto __pyx_L13_try_end;
18816     __pyx_L6_error:;
18817     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18818     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18819     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18820
18821     /* "cvcf.pyx":937
18822  *     def warnerror(self, errorstring):
18823  *         try:             self._warn_errors.add(self.__dict__[errorstring])
18824  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)             # <<<<<<<<<<<<<<
18825  * 
18826  *     def parse(self, stream):
18827  */
18828     __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
18829     if (__pyx_t_4) {
18830       __Pyx_AddTraceback("cvcf.VCF.warnerror");
18831       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18832       __Pyx_GOTREF(__pyx_t_3);
18833       __Pyx_GOTREF(__pyx_t_1);
18834       __Pyx_GOTREF(__pyx_t_2);
18835       __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_v_errorstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18836       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
18837       __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18838       __Pyx_GOTREF(((PyObject *)__pyx_t_6));
18839       PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
18840       __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
18841       __pyx_t_5 = 0;
18842       __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18843       __Pyx_GOTREF(__pyx_t_5);
18844       __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
18845       __Pyx_Raise(__pyx_t_5, 0, 0);
18846       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18847       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18848       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18849       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18850       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18851       goto __pyx_L7_exception_handled;
18852     }
18853     __pyx_L8_except_error:;
18854     __Pyx_XGIVEREF(__pyx_save_exc_type);
18855     __Pyx_XGIVEREF(__pyx_save_exc_value);
18856     __Pyx_XGIVEREF(__pyx_save_exc_tb);
18857     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
18858     goto __pyx_L1_error;
18859     __pyx_L7_exception_handled:;
18860     __Pyx_XGIVEREF(__pyx_save_exc_type);
18861     __Pyx_XGIVEREF(__pyx_save_exc_value);
18862     __Pyx_XGIVEREF(__pyx_save_exc_tb);
18863     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
18864     __pyx_L13_try_end:;
18865   }
18866
18867   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18868   goto __pyx_L0;
18869   __pyx_L1_error:;
18870   __Pyx_XDECREF(__pyx_t_1);
18871   __Pyx_XDECREF(__pyx_t_2);
18872   __Pyx_XDECREF(__pyx_t_3);
18873   __Pyx_XDECREF(__pyx_t_5);
18874   __Pyx_XDECREF(__pyx_t_6);
18875   __Pyx_AddTraceback("cvcf.VCF.warnerror");
18876   __pyx_r = NULL;
18877   __pyx_L0:;
18878   __Pyx_XGIVEREF(__pyx_r);
18879   __Pyx_RefNannyFinishContext();
18880   return __pyx_r;
18881 }
18882
18883 /* "cvcf.pyx":939
18884  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18885  * 
18886  *     def parse(self, stream):             # <<<<<<<<<<<<<<
18887  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
18888  *         last_line = self._parse_header(stream)
18889  */
18890
18891 static PyObject *__pyx_pf_4cvcf_3VCF_35parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18892 static char __pyx_doc_4cvcf_3VCF_35parse[] = " Parse a stream of VCF-formatted lines.  Initializes class instance and return generator ";
18893 static PyMethodDef __pyx_mdef_4cvcf_3VCF_35parse = {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pf_4cvcf_3VCF_35parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_35parse)};
18894 static PyObject *__pyx_pf_4cvcf_3VCF_35parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18895   PyObject *__pyx_v_self = 0;
18896   PyObject *__pyx_v_stream = 0;
18897   PyObject *__pyx_v_last_line;
18898   PyObject *__pyx_r = NULL;
18899   PyObject *__pyx_t_1 = NULL;
18900   PyObject *__pyx_t_2 = NULL;
18901   PyObject *__pyx_t_3 = NULL;
18902   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
18903   __Pyx_RefNannySetupContext("parse");
18904   __pyx_self = __pyx_self;
18905   if (unlikely(__pyx_kwds)) {
18906     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18907     PyObject* values[2] = {0,0};
18908     switch (PyTuple_GET_SIZE(__pyx_args)) {
18909       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18910       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18911       case  0: break;
18912       default: goto __pyx_L5_argtuple_error;
18913     }
18914     switch (PyTuple_GET_SIZE(__pyx_args)) {
18915       case  0:
18916       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18917       if (likely(values[0])) kw_args--;
18918       else goto __pyx_L5_argtuple_error;
18919       case  1:
18920       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
18921       if (likely(values[1])) kw_args--;
18922       else {
18923         __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18924       }
18925     }
18926     if (unlikely(kw_args > 0)) {
18927       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18928     }
18929     __pyx_v_self = values[0];
18930     __pyx_v_stream = values[1];
18931   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18932     goto __pyx_L5_argtuple_error;
18933   } else {
18934     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18935     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
18936   }
18937   goto __pyx_L4_argument_unpacking_done;
18938   __pyx_L5_argtuple_error:;
18939   __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18940   __pyx_L3_error:;
18941   __Pyx_AddTraceback("cvcf.VCF.parse");
18942   __Pyx_RefNannyFinishContext();
18943   return NULL;
18944   __pyx_L4_argument_unpacking_done:;
18945   __pyx_v_last_line = Py_None; __Pyx_INCREF(Py_None);
18946
18947   /* "cvcf.pyx":941
18948  *     def parse(self, stream):
18949  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
18950  *         last_line = self._parse_header(stream)             # <<<<<<<<<<<<<<
18951  *         # now return a generator that does the actual work.  In this way the pre-processing is done
18952  *         # before the first piece of data is yielded
18953  */
18954   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parse_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18955   __Pyx_GOTREF(__pyx_t_1);
18956   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18957   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
18958   __Pyx_INCREF(__pyx_v_stream);
18959   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
18960   __Pyx_GIVEREF(__pyx_v_stream);
18961   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18962   __Pyx_GOTREF(__pyx_t_3);
18963   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18964   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
18965   __Pyx_DECREF(__pyx_v_last_line);
18966   __pyx_v_last_line = __pyx_t_3;
18967   __pyx_t_3 = 0;
18968
18969   /* "cvcf.pyx":944
18970  *         # now return a generator that does the actual work.  In this way the pre-processing is done
18971  *         # before the first piece of data is yielded
18972  *         return self._parse(last_line, stream)             # <<<<<<<<<<<<<<
18973  * 
18974  *     def write(self, stream, datagenerator):
18975  */
18976   __Pyx_XDECREF(__pyx_r);
18977   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18978   __Pyx_GOTREF(__pyx_t_3);
18979   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18980   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
18981   __Pyx_INCREF(__pyx_v_last_line);
18982   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_last_line);
18983   __Pyx_GIVEREF(__pyx_v_last_line);
18984   __Pyx_INCREF(__pyx_v_stream);
18985   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_stream);
18986   __Pyx_GIVEREF(__pyx_v_stream);
18987   __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18988   __Pyx_GOTREF(__pyx_t_1);
18989   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18990   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
18991   __pyx_r = __pyx_t_1;
18992   __pyx_t_1 = 0;
18993   goto __pyx_L0;
18994
18995   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18996   goto __pyx_L0;
18997   __pyx_L1_error:;
18998   __Pyx_XDECREF(__pyx_t_1);
18999   __Pyx_XDECREF(__pyx_t_2);
19000   __Pyx_XDECREF(__pyx_t_3);
19001   __Pyx_AddTraceback("cvcf.VCF.parse");
19002   __pyx_r = NULL;
19003   __pyx_L0:;
19004   __Pyx_DECREF(__pyx_v_last_line);
19005   __Pyx_XGIVEREF(__pyx_r);
19006   __Pyx_RefNannyFinishContext();
19007   return __pyx_r;
19008 }
19009
19010 /* "cvcf.pyx":946
19011  *         return self._parse(last_line, stream)
19012  * 
19013  *     def write(self, stream, datagenerator):             # <<<<<<<<<<<<<<
19014  *         """ Writes a VCF file to a stream, using a data generator (or list) """
19015  *         self.write_header(stream)
19016  */
19017
19018 static PyObject *__pyx_pf_4cvcf_3VCF_36write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19019 static char __pyx_doc_4cvcf_3VCF_36write[] = " Writes a VCF file to a stream, using a data generator (or list) ";
19020 static PyMethodDef __pyx_mdef_4cvcf_3VCF_36write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_4cvcf_3VCF_36write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_36write)};
19021 static PyObject *__pyx_pf_4cvcf_3VCF_36write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19022   PyObject *__pyx_v_self = 0;
19023   PyObject *__pyx_v_stream = 0;
19024   PyObject *__pyx_v_datagenerator = 0;
19025   PyObject *__pyx_v_data;
19026   PyObject *__pyx_r = NULL;
19027   PyObject *__pyx_t_1 = NULL;
19028   PyObject *__pyx_t_2 = NULL;
19029   PyObject *__pyx_t_3 = NULL;
19030   Py_ssize_t __pyx_t_4;
19031   PyObject *__pyx_t_5 = NULL;
19032   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,&__pyx_n_s__datagenerator,0};
19033   __Pyx_RefNannySetupContext("write");
19034   __pyx_self = __pyx_self;
19035   if (unlikely(__pyx_kwds)) {
19036     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19037     PyObject* values[3] = {0,0,0};
19038     switch (PyTuple_GET_SIZE(__pyx_args)) {
19039       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19040       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19041       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19042       case  0: break;
19043       default: goto __pyx_L5_argtuple_error;
19044     }
19045     switch (PyTuple_GET_SIZE(__pyx_args)) {
19046       case  0:
19047       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19048       if (likely(values[0])) kw_args--;
19049       else goto __pyx_L5_argtuple_error;
19050       case  1:
19051       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
19052       if (likely(values[1])) kw_args--;
19053       else {
19054         __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19055       }
19056       case  2:
19057       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__datagenerator);
19058       if (likely(values[2])) kw_args--;
19059       else {
19060         __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19061       }
19062     }
19063     if (unlikely(kw_args > 0)) {
19064       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19065     }
19066     __pyx_v_self = values[0];
19067     __pyx_v_stream = values[1];
19068     __pyx_v_datagenerator = values[2];
19069   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
19070     goto __pyx_L5_argtuple_error;
19071   } else {
19072     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19073     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
19074     __pyx_v_datagenerator = PyTuple_GET_ITEM(__pyx_args, 2);
19075   }
19076   goto __pyx_L4_argument_unpacking_done;
19077   __pyx_L5_argtuple_error:;
19078   __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19079   __pyx_L3_error:;
19080   __Pyx_AddTraceback("cvcf.VCF.write");
19081   __Pyx_RefNannyFinishContext();
19082   return NULL;
19083   __pyx_L4_argument_unpacking_done:;
19084   __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
19085
19086   /* "cvcf.pyx":948
19087  *     def write(self, stream, datagenerator):
19088  *         """ Writes a VCF file to a stream, using a data generator (or list) """
19089  *         self.write_header(stream)             # <<<<<<<<<<<<<<
19090  *         self.write_heading(stream)
19091  *         for data in datagenerator: self.write_data(stream,data)
19092  */
19093   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__write_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19094   __Pyx_GOTREF(__pyx_t_1);
19095   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19096   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
19097   __Pyx_INCREF(__pyx_v_stream);
19098   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
19099   __Pyx_GIVEREF(__pyx_v_stream);
19100   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19101   __Pyx_GOTREF(__pyx_t_3);
19102   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19103   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
19104   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19105
19106   /* "cvcf.pyx":949
19107  *         """ Writes a VCF file to a stream, using a data generator (or list) """
19108  *         self.write_header(stream)
19109  *         self.write_heading(stream)             # <<<<<<<<<<<<<<
19110  *         for data in datagenerator: self.write_data(stream,data)
19111  * 
19112  */
19113   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__write_heading); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19114   __Pyx_GOTREF(__pyx_t_3);
19115   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19116   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
19117   __Pyx_INCREF(__pyx_v_stream);
19118   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
19119   __Pyx_GIVEREF(__pyx_v_stream);
19120   __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19121   __Pyx_GOTREF(__pyx_t_1);
19122   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19123   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
19124   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19125
19126   /* "cvcf.pyx":950
19127  *         self.write_header(stream)
19128  *         self.write_heading(stream)
19129  *         for data in datagenerator: self.write_data(stream,data)             # <<<<<<<<<<<<<<
19130  * 
19131  *     def writeheader(self, stream):
19132  */
19133   if (PyList_CheckExact(__pyx_v_datagenerator) || PyTuple_CheckExact(__pyx_v_datagenerator)) {
19134     __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_datagenerator; __Pyx_INCREF(__pyx_t_1);
19135   } else {
19136     __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_datagenerator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19137     __Pyx_GOTREF(__pyx_t_1);
19138   }
19139   for (;;) {
19140     if (likely(PyList_CheckExact(__pyx_t_1))) {
19141       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
19142       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
19143     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
19144       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
19145       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
19146     } else {
19147       __pyx_t_2 = PyIter_Next(__pyx_t_1);
19148       if (!__pyx_t_2) {
19149         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19150         break;
19151       }
19152       __Pyx_GOTREF(__pyx_t_2);
19153     }
19154     __Pyx_DECREF(__pyx_v_data);
19155     __pyx_v_data = __pyx_t_2;
19156     __pyx_t_2 = 0;
19157     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__write_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19158     __Pyx_GOTREF(__pyx_t_2);
19159     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19160     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
19161     __Pyx_INCREF(__pyx_v_stream);
19162     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_stream);
19163     __Pyx_GIVEREF(__pyx_v_stream);
19164     __Pyx_INCREF(__pyx_v_data);
19165     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_data);
19166     __Pyx_GIVEREF(__pyx_v_data);
19167     __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19168     __Pyx_GOTREF(__pyx_t_5);
19169     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19170     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
19171     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19172   }
19173   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19174
19175   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19176   goto __pyx_L0;
19177   __pyx_L1_error:;
19178   __Pyx_XDECREF(__pyx_t_1);
19179   __Pyx_XDECREF(__pyx_t_2);
19180   __Pyx_XDECREF(__pyx_t_3);
19181   __Pyx_XDECREF(__pyx_t_5);
19182   __Pyx_AddTraceback("cvcf.VCF.write");
19183   __pyx_r = NULL;
19184   __pyx_L0:;
19185   __Pyx_DECREF(__pyx_v_data);
19186   __Pyx_XGIVEREF(__pyx_r);
19187   __Pyx_RefNannyFinishContext();
19188   return __pyx_r;
19189 }
19190
19191 /* "cvcf.pyx":952
19192  *         for data in datagenerator: self.write_data(stream,data)
19193  * 
19194  *     def writeheader(self, stream):             # <<<<<<<<<<<<<<
19195  *         """ Writes a VCF header """
19196  *         self.write_header(stream)
19197  */
19198
19199 static PyObject *__pyx_pf_4cvcf_3VCF_37writeheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19200 static char __pyx_doc_4cvcf_3VCF_37writeheader[] = " Writes a VCF header ";
19201 static PyMethodDef __pyx_mdef_4cvcf_3VCF_37writeheader = {__Pyx_NAMESTR("writeheader"), (PyCFunction)__pyx_pf_4cvcf_3VCF_37writeheader, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_37writeheader)};
19202 static PyObject *__pyx_pf_4cvcf_3VCF_37writeheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19203   PyObject *__pyx_v_self = 0;
19204   PyObject *__pyx_v_stream = 0;
19205   PyObject *__pyx_r = NULL;
19206   PyObject *__pyx_t_1 = NULL;
19207   PyObject *__pyx_t_2 = NULL;
19208   PyObject *__pyx_t_3 = NULL;
19209   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
19210   __Pyx_RefNannySetupContext("writeheader");
19211   __pyx_self = __pyx_self;
19212   if (unlikely(__pyx_kwds)) {
19213     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19214     PyObject* values[2] = {0,0};
19215     switch (PyTuple_GET_SIZE(__pyx_args)) {
19216       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19217       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19218       case  0: break;
19219       default: goto __pyx_L5_argtuple_error;
19220     }
19221     switch (PyTuple_GET_SIZE(__pyx_args)) {
19222       case  0:
19223       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19224       if (likely(values[0])) kw_args--;
19225       else goto __pyx_L5_argtuple_error;
19226       case  1:
19227       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
19228       if (likely(values[1])) kw_args--;
19229       else {
19230         __Pyx_RaiseArgtupleInvalid("writeheader", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19231       }
19232     }
19233     if (unlikely(kw_args > 0)) {
19234       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "writeheader") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19235     }
19236     __pyx_v_self = values[0];
19237     __pyx_v_stream = values[1];
19238   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
19239     goto __pyx_L5_argtuple_error;
19240   } else {
19241     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19242     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
19243   }
19244   goto __pyx_L4_argument_unpacking_done;
19245   __pyx_L5_argtuple_error:;
19246   __Pyx_RaiseArgtupleInvalid("writeheader", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19247   __pyx_L3_error:;
19248   __Pyx_AddTraceback("cvcf.VCF.writeheader");
19249   __Pyx_RefNannyFinishContext();
19250   return NULL;
19251   __pyx_L4_argument_unpacking_done:;
19252
19253   /* "cvcf.pyx":954
19254  *     def writeheader(self, stream):
19255  *         """ Writes a VCF header """
19256  *         self.write_header(stream)             # <<<<<<<<<<<<<<
19257  *         self.write_heading(stream)
19258  * 
19259  */
19260   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__write_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19261   __Pyx_GOTREF(__pyx_t_1);
19262   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19263   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
19264   __Pyx_INCREF(__pyx_v_stream);
19265   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
19266   __Pyx_GIVEREF(__pyx_v_stream);
19267   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19268   __Pyx_GOTREF(__pyx_t_3);
19269   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19270   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
19271   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19272
19273   /* "cvcf.pyx":955
19274  *         """ Writes a VCF header """
19275  *         self.write_header(stream)
19276  *         self.write_heading(stream)             # <<<<<<<<<<<<<<
19277  * 
19278  *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):
19279  */
19280   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__write_heading); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19281   __Pyx_GOTREF(__pyx_t_3);
19282   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19283   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
19284   __Pyx_INCREF(__pyx_v_stream);
19285   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
19286   __Pyx_GIVEREF(__pyx_v_stream);
19287   __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19288   __Pyx_GOTREF(__pyx_t_1);
19289   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19290   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
19291   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19292
19293   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19294   goto __pyx_L0;
19295   __pyx_L1_error:;
19296   __Pyx_XDECREF(__pyx_t_1);
19297   __Pyx_XDECREF(__pyx_t_2);
19298   __Pyx_XDECREF(__pyx_t_3);
19299   __Pyx_AddTraceback("cvcf.VCF.writeheader");
19300   __pyx_r = NULL;
19301   __pyx_L0:;
19302   __Pyx_XGIVEREF(__pyx_r);
19303   __Pyx_RefNannyFinishContext();
19304   return __pyx_r;
19305 }
19306
19307 /* "cvcf.pyx":957
19308  *         self.write_heading(stream)
19309  * 
19310  *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):             # <<<<<<<<<<<<<<
19311  *         """ Utility function: compares two calls for equality """
19312  *         # a variant should always be assigned to a unique position, one base before
19313  */
19314
19315 static PyObject *__pyx_pf_4cvcf_3VCF_38compare_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19316 static char __pyx_doc_4cvcf_3VCF_38compare_calls[] = " Utility function: compares two calls for equality ";
19317 static PyMethodDef __pyx_mdef_4cvcf_3VCF_38compare_calls = {__Pyx_NAMESTR("compare_calls"), (PyCFunction)__pyx_pf_4cvcf_3VCF_38compare_calls, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_38compare_calls)};
19318 static PyObject *__pyx_pf_4cvcf_3VCF_38compare_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19319   PyObject *__pyx_v_self = 0;
19320   PyObject *__pyx_v_pos1 = 0;
19321   PyObject *__pyx_v_ref1 = 0;
19322   PyObject *__pyx_v_alt1 = 0;
19323   PyObject *__pyx_v_pos2 = 0;
19324   PyObject *__pyx_v_ref2 = 0;
19325   PyObject *__pyx_v_alt2 = 0;
19326   PyObject *__pyx_r = NULL;
19327   PyObject *__pyx_t_1 = NULL;
19328   int __pyx_t_2;
19329   Py_ssize_t __pyx_t_3;
19330   int __pyx_t_4;
19331   PyObject *__pyx_t_5 = NULL;
19332   PyObject *__pyx_t_6 = NULL;
19333   int __pyx_t_7;
19334   int __pyx_t_8;
19335   static 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};
19336   __Pyx_RefNannySetupContext("compare_calls");
19337   __pyx_self = __pyx_self;
19338   if (unlikely(__pyx_kwds)) {
19339     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19340     PyObject* values[7] = {0,0,0,0,0,0,0};
19341     switch (PyTuple_GET_SIZE(__pyx_args)) {
19342       case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19343       case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19344       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19345       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19346       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19347       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19348       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19349       case  0: break;
19350       default: goto __pyx_L5_argtuple_error;
19351     }
19352     switch (PyTuple_GET_SIZE(__pyx_args)) {
19353       case  0:
19354       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19355       if (likely(values[0])) kw_args--;
19356       else goto __pyx_L5_argtuple_error;
19357       case  1:
19358       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
19359       if (likely(values[1])) kw_args--;
19360       else {
19361         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19362       }
19363       case  2:
19364       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ref1);
19365       if (likely(values[2])) kw_args--;
19366       else {
19367         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19368       }
19369       case  3:
19370       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alt1);
19371       if (likely(values[3])) kw_args--;
19372       else {
19373         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19374       }
19375       case  4:
19376       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos2);
19377       if (likely(values[4])) kw_args--;
19378       else {
19379         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19380       }
19381       case  5:
19382       values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ref2);
19383       if (likely(values[5])) kw_args--;
19384       else {
19385         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19386       }
19387       case  6:
19388       values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alt2);
19389       if (likely(values[6])) kw_args--;
19390       else {
19391         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19392       }
19393     }
19394     if (unlikely(kw_args > 0)) {
19395       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "compare_calls") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19396     }
19397     __pyx_v_self = values[0];
19398     __pyx_v_pos1 = values[1];
19399     __pyx_v_ref1 = values[2];
19400     __pyx_v_alt1 = values[3];
19401     __pyx_v_pos2 = values[4];
19402     __pyx_v_ref2 = values[5];
19403     __pyx_v_alt2 = values[6];
19404   } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
19405     goto __pyx_L5_argtuple_error;
19406   } else {
19407     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19408     __pyx_v_pos1 = PyTuple_GET_ITEM(__pyx_args, 1);
19409     __pyx_v_ref1 = PyTuple_GET_ITEM(__pyx_args, 2);
19410     __pyx_v_alt1 = PyTuple_GET_ITEM(__pyx_args, 3);
19411     __pyx_v_pos2 = PyTuple_GET_ITEM(__pyx_args, 4);
19412     __pyx_v_ref2 = PyTuple_GET_ITEM(__pyx_args, 5);
19413     __pyx_v_alt2 = PyTuple_GET_ITEM(__pyx_args, 6);
19414   }
19415   goto __pyx_L4_argument_unpacking_done;
19416   __pyx_L5_argtuple_error:;
19417   __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19418   __pyx_L3_error:;
19419   __Pyx_AddTraceback("cvcf.VCF.compare_calls");
19420   __Pyx_RefNannyFinishContext();
19421   return NULL;
19422   __pyx_L4_argument_unpacking_done:;
19423   __Pyx_INCREF(__pyx_v_ref1);
19424   __Pyx_INCREF(__pyx_v_alt1);
19425   __Pyx_INCREF(__pyx_v_ref2);
19426   __Pyx_INCREF(__pyx_v_alt2);
19427
19428   /* "cvcf.pyx":962
19429  *         # the leftmost position of the alignment gap.  If this rule is implemented
19430  *         # correctly, the two positions must be equal for the calls to be identical.
19431  *         if pos1 != pos2: return False             # <<<<<<<<<<<<<<
19432  *         # from both calls, trim rightmost bases when identical.  Do this safely, i.e.
19433  *         # only when the reference bases are not Ns
19434  */
19435   __pyx_t_1 = PyObject_RichCompare(__pyx_v_pos1, __pyx_v_pos2, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19436   __Pyx_GOTREF(__pyx_t_1);
19437   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19438   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19439   if (__pyx_t_2) {
19440     __Pyx_XDECREF(__pyx_r);
19441     __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19442     __Pyx_GOTREF(__pyx_t_1);
19443     __pyx_r = __pyx_t_1;
19444     __pyx_t_1 = 0;
19445     goto __pyx_L0;
19446     goto __pyx_L6;
19447   }
19448   __pyx_L6:;
19449
19450   /* "cvcf.pyx":965
19451  *         # from both calls, trim rightmost bases when identical.  Do this safely, i.e.
19452  *         # only when the reference bases are not Ns
19453  *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:             # <<<<<<<<<<<<<<
19454  *             ref1 = ref1[:-1]
19455  *             alt1 = alt1[:-1]
19456  */
19457   while (1) {
19458     __pyx_t_3 = PyObject_Length(__pyx_v_ref1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19459     __pyx_t_2 = (__pyx_t_3 > 0);
19460     if (__pyx_t_2) {
19461       __pyx_t_3 = PyObject_Length(__pyx_v_alt1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19462       __pyx_t_4 = (__pyx_t_3 > 0);
19463       if (__pyx_t_4) {
19464         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ref1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19465         __Pyx_GOTREF(__pyx_t_1);
19466         __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alt1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19467         __Pyx_GOTREF(__pyx_t_5);
19468         __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19469         __Pyx_GOTREF(__pyx_t_6);
19470         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19471         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19472         __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19473         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19474         __pyx_t_8 = __pyx_t_7;
19475       } else {
19476         __pyx_t_8 = __pyx_t_4;
19477       }
19478       __pyx_t_4 = __pyx_t_8;
19479     } else {
19480       __pyx_t_4 = __pyx_t_2;
19481     }
19482     if (!__pyx_t_4) break;
19483
19484     /* "cvcf.pyx":966
19485  *         # only when the reference bases are not Ns
19486  *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:
19487  *             ref1 = ref1[:-1]             # <<<<<<<<<<<<<<
19488  *             alt1 = alt1[:-1]
19489  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
19490  */
19491     __pyx_t_6 = __Pyx_PySequence_GetSlice(__pyx_v_ref1, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19492     __Pyx_GOTREF(__pyx_t_6);
19493     __Pyx_DECREF(__pyx_v_ref1);
19494     __pyx_v_ref1 = __pyx_t_6;
19495     __pyx_t_6 = 0;
19496
19497     /* "cvcf.pyx":967
19498  *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:
19499  *             ref1 = ref1[:-1]
19500  *             alt1 = alt1[:-1]             # <<<<<<<<<<<<<<
19501  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
19502  *             ref2 = ref2[:-1]
19503  */
19504     __pyx_t_6 = __Pyx_PySequence_GetSlice(__pyx_v_alt1, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19505     __Pyx_GOTREF(__pyx_t_6);
19506     __Pyx_DECREF(__pyx_v_alt1);
19507     __pyx_v_alt1 = __pyx_t_6;
19508     __pyx_t_6 = 0;
19509   }
19510
19511   /* "cvcf.pyx":968
19512  *             ref1 = ref1[:-1]
19513  *             alt1 = alt1[:-1]
19514  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:             # <<<<<<<<<<<<<<
19515  *             ref2 = ref2[:-1]
19516  *             alt2 = alt2[:-1]
19517  */
19518   while (1) {
19519     __pyx_t_3 = PyObject_Length(__pyx_v_ref2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19520     __pyx_t_4 = (__pyx_t_3 > 0);
19521     if (__pyx_t_4) {
19522       __pyx_t_3 = PyObject_Length(__pyx_v_alt2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19523       __pyx_t_2 = (__pyx_t_3 > 0);
19524       if (__pyx_t_2) {
19525         __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_ref2, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19526         __Pyx_GOTREF(__pyx_t_6);
19527         __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alt2, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19528         __Pyx_GOTREF(__pyx_t_5);
19529         __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19530         __Pyx_GOTREF(__pyx_t_1);
19531         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19532         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19533         __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19534         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19535         __pyx_t_7 = __pyx_t_8;
19536       } else {
19537         __pyx_t_7 = __pyx_t_2;
19538       }
19539       __pyx_t_2 = __pyx_t_7;
19540     } else {
19541       __pyx_t_2 = __pyx_t_4;
19542     }
19543     if (!__pyx_t_2) break;
19544
19545     /* "cvcf.pyx":969
19546  *             alt1 = alt1[:-1]
19547  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
19548  *             ref2 = ref2[:-1]             # <<<<<<<<<<<<<<
19549  *             alt2 = alt2[:-1]
19550  *         # now, the alternative alleles must be identical
19551  */
19552     __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_ref2, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19553     __Pyx_GOTREF(__pyx_t_1);
19554     __Pyx_DECREF(__pyx_v_ref2);
19555     __pyx_v_ref2 = __pyx_t_1;
19556     __pyx_t_1 = 0;
19557
19558     /* "cvcf.pyx":970
19559  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
19560  *             ref2 = ref2[:-1]
19561  *             alt2 = alt2[:-1]             # <<<<<<<<<<<<<<
19562  *         # now, the alternative alleles must be identical
19563  *         return alt1 == alt2
19564  */
19565     __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_alt2, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19566     __Pyx_GOTREF(__pyx_t_1);
19567     __Pyx_DECREF(__pyx_v_alt2);
19568     __pyx_v_alt2 = __pyx_t_1;
19569     __pyx_t_1 = 0;
19570   }
19571
19572   /* "cvcf.pyx":972
19573  *             alt2 = alt2[:-1]
19574  *         # now, the alternative alleles must be identical
19575  *         return alt1 == alt2             # <<<<<<<<<<<<<<
19576  * 
19577  * ###########################################################################################################
19578  */
19579   __Pyx_XDECREF(__pyx_r);
19580   __pyx_t_1 = PyObject_RichCompare(__pyx_v_alt1, __pyx_v_alt2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19581   __Pyx_GOTREF(__pyx_t_1);
19582   __pyx_r = __pyx_t_1;
19583   __pyx_t_1 = 0;
19584   goto __pyx_L0;
19585
19586   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19587   goto __pyx_L0;
19588   __pyx_L1_error:;
19589   __Pyx_XDECREF(__pyx_t_1);
19590   __Pyx_XDECREF(__pyx_t_5);
19591   __Pyx_XDECREF(__pyx_t_6);
19592   __Pyx_AddTraceback("cvcf.VCF.compare_calls");
19593   __pyx_r = NULL;
19594   __pyx_L0:;
19595   __Pyx_DECREF(__pyx_v_ref1);
19596   __Pyx_DECREF(__pyx_v_alt1);
19597   __Pyx_DECREF(__pyx_v_ref2);
19598   __Pyx_DECREF(__pyx_v_alt2);
19599   __Pyx_XGIVEREF(__pyx_r);
19600   __Pyx_RefNannyFinishContext();
19601   return __pyx_r;
19602 }
19603
19604 /* "cvcf.pyx":979
19605  * ###########################################################################################################
19606  * 
19607  *     def connect( self, filename ):             # <<<<<<<<<<<<<<
19608  *         '''connect to tabix file.'''
19609  *         self.tabixfile = pysam.Tabixfile( filename )
19610  */
19611
19612 static PyObject *__pyx_pf_4cvcf_3VCF_39connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19613 static char __pyx_doc_4cvcf_3VCF_39connect[] = "connect to tabix file.";
19614 static PyMethodDef __pyx_mdef_4cvcf_3VCF_39connect = {__Pyx_NAMESTR("connect"), (PyCFunction)__pyx_pf_4cvcf_3VCF_39connect, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_39connect)};
19615 static PyObject *__pyx_pf_4cvcf_3VCF_39connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19616   PyObject *__pyx_v_self = 0;
19617   PyObject *__pyx_v_filename = 0;
19618   PyObject *__pyx_r = NULL;
19619   PyObject *__pyx_t_1 = NULL;
19620   PyObject *__pyx_t_2 = NULL;
19621   PyObject *__pyx_t_3 = NULL;
19622   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__filename,0};
19623   __Pyx_RefNannySetupContext("connect");
19624   __pyx_self = __pyx_self;
19625   if (unlikely(__pyx_kwds)) {
19626     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19627     PyObject* values[2] = {0,0};
19628     switch (PyTuple_GET_SIZE(__pyx_args)) {
19629       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19630       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19631       case  0: break;
19632       default: goto __pyx_L5_argtuple_error;
19633     }
19634     switch (PyTuple_GET_SIZE(__pyx_args)) {
19635       case  0:
19636       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19637       if (likely(values[0])) kw_args--;
19638       else goto __pyx_L5_argtuple_error;
19639       case  1:
19640       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
19641       if (likely(values[1])) kw_args--;
19642       else {
19643         __Pyx_RaiseArgtupleInvalid("connect", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19644       }
19645     }
19646     if (unlikely(kw_args > 0)) {
19647       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "connect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19648     }
19649     __pyx_v_self = values[0];
19650     __pyx_v_filename = values[1];
19651   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
19652     goto __pyx_L5_argtuple_error;
19653   } else {
19654     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19655     __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 1);
19656   }
19657   goto __pyx_L4_argument_unpacking_done;
19658   __pyx_L5_argtuple_error:;
19659   __Pyx_RaiseArgtupleInvalid("connect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19660   __pyx_L3_error:;
19661   __Pyx_AddTraceback("cvcf.VCF.connect");
19662   __Pyx_RefNannyFinishContext();
19663   return NULL;
19664   __pyx_L4_argument_unpacking_done:;
19665
19666   /* "cvcf.pyx":981
19667  *     def connect( self, filename ):
19668  *         '''connect to tabix file.'''
19669  *         self.tabixfile = pysam.Tabixfile( filename )             # <<<<<<<<<<<<<<
19670  *         self._parse_header(self.tabixfile.header)
19671  * 
19672  */
19673   __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pysam); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19674   __Pyx_GOTREF(__pyx_t_1);
19675   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__Tabixfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19676   __Pyx_GOTREF(__pyx_t_2);
19677   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19678   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19679   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
19680   __Pyx_INCREF(__pyx_v_filename);
19681   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
19682   __Pyx_GIVEREF(__pyx_v_filename);
19683   __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19684   __Pyx_GOTREF(__pyx_t_3);
19685   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19686   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
19687   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__tabixfile, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19688   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19689
19690   /* "cvcf.pyx":982
19691  *         '''connect to tabix file.'''
19692  *         self.tabixfile = pysam.Tabixfile( filename )
19693  *         self._parse_header(self.tabixfile.header)             # <<<<<<<<<<<<<<
19694  * 
19695  *     def fetch(self,
19696  */
19697   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parse_header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19698   __Pyx_GOTREF(__pyx_t_3);
19699   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tabixfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19700   __Pyx_GOTREF(__pyx_t_1);
19701   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__header); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19702   __Pyx_GOTREF(__pyx_t_2);
19703   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19704   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19705   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
19706   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
19707   __Pyx_GIVEREF(__pyx_t_2);
19708   __pyx_t_2 = 0;
19709   __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19710   __Pyx_GOTREF(__pyx_t_2);
19711   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19712   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
19713   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19714
19715   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19716   goto __pyx_L0;
19717   __pyx_L1_error:;
19718   __Pyx_XDECREF(__pyx_t_1);
19719   __Pyx_XDECREF(__pyx_t_2);
19720   __Pyx_XDECREF(__pyx_t_3);
19721   __Pyx_AddTraceback("cvcf.VCF.connect");
19722   __pyx_r = NULL;
19723   __pyx_L0:;
19724   __Pyx_XGIVEREF(__pyx_r);
19725   __Pyx_RefNannyFinishContext();
19726   return __pyx_r;
19727 }
19728
19729 /* "cvcf.pyx":984
19730  *         self._parse_header(self.tabixfile.header)
19731  * 
19732  *     def fetch(self,             # <<<<<<<<<<<<<<
19733  *               reference = None,
19734  *               start = None,
19735  */
19736
19737 static PyObject *__pyx_pf_4cvcf_3VCF_40fetch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19738 static char __pyx_doc_4cvcf_3VCF_40fetch[] = " Parse a stream of VCF-formatted lines.  Initializes class instance and return generator ";
19739 static PyMethodDef __pyx_mdef_4cvcf_3VCF_40fetch = {__Pyx_NAMESTR("fetch"), (PyCFunction)__pyx_pf_4cvcf_3VCF_40fetch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_40fetch)};
19740 static PyObject *__pyx_pf_4cvcf_3VCF_40fetch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19741   PyObject *__pyx_v_self = 0;
19742   PyObject *__pyx_v_reference = 0;
19743   PyObject *__pyx_v_start = 0;
19744   PyObject *__pyx_v_end = 0;
19745   PyObject *__pyx_v_region = 0;
19746   PyObject *__pyx_r = NULL;
19747   PyObject *__pyx_t_1 = NULL;
19748   PyObject *__pyx_t_2 = NULL;
19749   PyObject *__pyx_t_3 = NULL;
19750   PyObject *__pyx_t_4 = NULL;
19751   PyObject *__pyx_t_5 = NULL;
19752   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__reference,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__region,0};
19753   __Pyx_RefNannySetupContext("fetch");
19754   __pyx_self = __pyx_self;
19755   if (unlikely(__pyx_kwds)) {
19756     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19757     PyObject* values[5] = {0,0,0,0,0};
19758
19759     /* "cvcf.pyx":985
19760  * 
19761  *     def fetch(self,
19762  *               reference = None,             # <<<<<<<<<<<<<<
19763  *               start = None,
19764  *               end = None,
19765  */
19766     values[1] = ((PyObject *)Py_None);
19767
19768     /* "cvcf.pyx":986
19769  *     def fetch(self,
19770  *               reference = None,
19771  *               start = None,             # <<<<<<<<<<<<<<
19772  *               end = None,
19773  *               region = None ):
19774  */
19775     values[2] = ((PyObject *)Py_None);
19776
19777     /* "cvcf.pyx":987
19778  *               reference = None,
19779  *               start = None,
19780  *               end = None,             # <<<<<<<<<<<<<<
19781  *               region = None ):
19782  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
19783  */
19784     values[3] = ((PyObject *)Py_None);
19785
19786     /* "cvcf.pyx":988
19787  *               start = None,
19788  *               end = None,
19789  *               region = None ):             # <<<<<<<<<<<<<<
19790  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
19791  * 
19792  */
19793     values[4] = ((PyObject *)Py_None);
19794     switch (PyTuple_GET_SIZE(__pyx_args)) {
19795       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19796       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19797       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19798       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19799       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19800       case  0: break;
19801       default: goto __pyx_L5_argtuple_error;
19802     }
19803     switch (PyTuple_GET_SIZE(__pyx_args)) {
19804       case  0:
19805       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19806       if (likely(values[0])) kw_args--;
19807       else goto __pyx_L5_argtuple_error;
19808       case  1:
19809       if (kw_args > 0) {
19810         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
19811         if (value) { values[1] = value; kw_args--; }
19812       }
19813       case  2:
19814       if (kw_args > 0) {
19815         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
19816         if (value) { values[2] = value; kw_args--; }
19817       }
19818       case  3:
19819       if (kw_args > 0) {
19820         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
19821         if (value) { values[3] = value; kw_args--; }
19822       }
19823       case  4:
19824       if (kw_args > 0) {
19825         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__region);
19826         if (value) { values[4] = value; kw_args--; }
19827       }
19828     }
19829     if (unlikely(kw_args > 0)) {
19830       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fetch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19831     }
19832     __pyx_v_self = values[0];
19833     __pyx_v_reference = values[1];
19834     __pyx_v_start = values[2];
19835     __pyx_v_end = values[3];
19836     __pyx_v_region = values[4];
19837   } else {
19838
19839     /* "cvcf.pyx":985
19840  * 
19841  *     def fetch(self,
19842  *               reference = None,             # <<<<<<<<<<<<<<
19843  *               start = None,
19844  *               end = None,
19845  */
19846     __pyx_v_reference = ((PyObject *)Py_None);
19847
19848     /* "cvcf.pyx":986
19849  *     def fetch(self,
19850  *               reference = None,
19851  *               start = None,             # <<<<<<<<<<<<<<
19852  *               end = None,
19853  *               region = None ):
19854  */
19855     __pyx_v_start = ((PyObject *)Py_None);
19856
19857     /* "cvcf.pyx":987
19858  *               reference = None,
19859  *               start = None,
19860  *               end = None,             # <<<<<<<<<<<<<<
19861  *               region = None ):
19862  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
19863  */
19864     __pyx_v_end = ((PyObject *)Py_None);
19865
19866     /* "cvcf.pyx":988
19867  *               start = None,
19868  *               end = None,
19869  *               region = None ):             # <<<<<<<<<<<<<<
19870  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
19871  * 
19872  */
19873     __pyx_v_region = ((PyObject *)Py_None);
19874     switch (PyTuple_GET_SIZE(__pyx_args)) {
19875       case  5: __pyx_v_region = PyTuple_GET_ITEM(__pyx_args, 4);
19876       case  4: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 3);
19877       case  3: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 2);
19878       case  2: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 1);
19879       case  1: __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19880       break;
19881       default: goto __pyx_L5_argtuple_error;
19882     }
19883   }
19884   goto __pyx_L4_argument_unpacking_done;
19885   __pyx_L5_argtuple_error:;
19886   __Pyx_RaiseArgtupleInvalid("fetch", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19887   __pyx_L3_error:;
19888   __Pyx_AddTraceback("cvcf.VCF.fetch");
19889   __Pyx_RefNannyFinishContext();
19890   return NULL;
19891   __pyx_L4_argument_unpacking_done:;
19892
19893   /* "cvcf.pyx":991
19894  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
19895  * 
19896  *         return self.tabixfile.fetch( reference, start, end, region, parser = asVCFRecord( self ) )             # <<<<<<<<<<<<<<
19897  * 
19898  *     def validate( self, record ):
19899  */
19900   __Pyx_XDECREF(__pyx_r);
19901   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tabixfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19902   __Pyx_GOTREF(__pyx_t_1);
19903   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__fetch); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19904   __Pyx_GOTREF(__pyx_t_2);
19905   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19906   __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19907   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
19908   __Pyx_INCREF(__pyx_v_reference);
19909   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_reference);
19910   __Pyx_GIVEREF(__pyx_v_reference);
19911   __Pyx_INCREF(__pyx_v_start);
19912   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start);
19913   __Pyx_GIVEREF(__pyx_v_start);
19914   __Pyx_INCREF(__pyx_v_end);
19915   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
19916   __Pyx_GIVEREF(__pyx_v_end);
19917   __Pyx_INCREF(__pyx_v_region);
19918   PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_region);
19919   __Pyx_GIVEREF(__pyx_v_region);
19920   __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19921   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
19922   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19923   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
19924   __Pyx_INCREF(__pyx_v_self);
19925   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self);
19926   __Pyx_GIVEREF(__pyx_v_self);
19927   __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cvcf_asVCFRecord)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19928   __Pyx_GOTREF(__pyx_t_5);
19929   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
19930   if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__parser), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19931   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19932   __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19933   __Pyx_GOTREF(__pyx_t_5);
19934   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19935   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
19936   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
19937   __pyx_r = __pyx_t_5;
19938   __pyx_t_5 = 0;
19939   goto __pyx_L0;
19940
19941   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19942   goto __pyx_L0;
19943   __pyx_L1_error:;
19944   __Pyx_XDECREF(__pyx_t_1);
19945   __Pyx_XDECREF(__pyx_t_2);
19946   __Pyx_XDECREF(__pyx_t_3);
19947   __Pyx_XDECREF(__pyx_t_4);
19948   __Pyx_XDECREF(__pyx_t_5);
19949   __Pyx_AddTraceback("cvcf.VCF.fetch");
19950   __pyx_r = NULL;
19951   __pyx_L0:;
19952   __Pyx_XGIVEREF(__pyx_r);
19953   __Pyx_RefNannyFinishContext();
19954   return __pyx_r;
19955 }
19956
19957 /* "cvcf.pyx":993
19958  *         return self.tabixfile.fetch( reference, start, end, region, parser = asVCFRecord( self ) )
19959  * 
19960  *     def validate( self, record ):             # <<<<<<<<<<<<<<
19961  *         '''validate vcf record.
19962  * 
19963  */
19964
19965 static PyObject *__pyx_pf_4cvcf_3VCF_41validate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19966 static char __pyx_doc_4cvcf_3VCF_41validate[] = "validate vcf record.\n\n        returns a validated record.\n        ";
19967 static PyMethodDef __pyx_mdef_4cvcf_3VCF_41validate = {__Pyx_NAMESTR("validate"), (PyCFunction)__pyx_pf_4cvcf_3VCF_41validate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_41validate)};
19968 static PyObject *__pyx_pf_4cvcf_3VCF_41validate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19969   PyObject *__pyx_v_self = 0;
19970   PyObject *__pyx_v_record = 0;
19971   PyObject *__pyx_v_chrom;
19972   PyObject *__pyx_v_pos;
19973   PyObject *__pyx_v_ref;
19974   PyObject *__pyx_v_c;
19975   PyObject *__pyx_v_left;
19976   PyObject *__pyx_v_faref_leftflank;
19977   PyObject *__pyx_v_faref;
19978   PyObject *__pyx_v_f;
19979   PyObject *__pyx_v_newalts;
19980   int __pyx_v_have_deletions;
19981   PyObject *__pyx_v_a;
19982   PyObject *__pyx_v_l;
19983   PyObject *__pyx_v_addns;
19984   PyObject *__pyx_v_i;
19985   PyObject *__pyx_v_na;
19986   PyObject *__pyx_v_s;
19987   PyObject *__pyx_v_alt;
19988   PyObject *__pyx_v_addn;
19989   PyObject *__pyx_v_allele;
19990   int __pyx_v_movable;
19991   PyObject *__pyx_v_longest;
19992   PyObject *__pyx_v_shortest;
19993   PyObject *__pyx_r = NULL;
19994   PyObject *__pyx_t_1 = NULL;
19995   PyObject *__pyx_t_2 = NULL;
19996   int __pyx_t_3;
19997   PyObject *__pyx_t_4 = NULL;
19998   PyObject *__pyx_t_5 = NULL;
19999   Py_ssize_t __pyx_t_6;
20000   PyObject *__pyx_t_7 = NULL;
20001   Py_ssize_t __pyx_t_8;
20002   long __pyx_t_9;
20003   PyObject *__pyx_t_10 = NULL;
20004   int __pyx_t_11;
20005   Py_ssize_t __pyx_t_12;
20006   PyObject *__pyx_t_13 = NULL;
20007   PyObject *__pyx_t_14 = NULL;
20008   PyObject *__pyx_t_15 = NULL;
20009   int __pyx_t_16;
20010   int __pyx_t_17;
20011   PyObject *__pyx_t_18 = NULL;
20012   PyObject *__pyx_t_19 = NULL;
20013   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__record,0};
20014   __Pyx_RefNannySetupContext("validate");
20015   __pyx_self = __pyx_self;
20016   if (unlikely(__pyx_kwds)) {
20017     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
20018     PyObject* values[2] = {0,0};
20019     switch (PyTuple_GET_SIZE(__pyx_args)) {
20020       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20021       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20022       case  0: break;
20023       default: goto __pyx_L5_argtuple_error;
20024     }
20025     switch (PyTuple_GET_SIZE(__pyx_args)) {
20026       case  0:
20027       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
20028       if (likely(values[0])) kw_args--;
20029       else goto __pyx_L5_argtuple_error;
20030       case  1:
20031       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__record);
20032       if (likely(values[1])) kw_args--;
20033       else {
20034         __Pyx_RaiseArgtupleInvalid("validate", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
20035       }
20036     }
20037     if (unlikely(kw_args > 0)) {
20038       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "validate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
20039     }
20040     __pyx_v_self = values[0];
20041     __pyx_v_record = values[1];
20042   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
20043     goto __pyx_L5_argtuple_error;
20044   } else {
20045     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
20046     __pyx_v_record = PyTuple_GET_ITEM(__pyx_args, 1);
20047   }
20048   goto __pyx_L4_argument_unpacking_done;
20049   __pyx_L5_argtuple_error:;
20050   __Pyx_RaiseArgtupleInvalid("validate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
20051   __pyx_L3_error:;
20052   __Pyx_AddTraceback("cvcf.VCF.validate");
20053   __Pyx_RefNannyFinishContext();
20054   return NULL;
20055   __pyx_L4_argument_unpacking_done:;
20056   __pyx_v_chrom = Py_None; __Pyx_INCREF(Py_None);
20057   __pyx_v_pos = Py_None; __Pyx_INCREF(Py_None);
20058   __pyx_v_ref = Py_None; __Pyx_INCREF(Py_None);
20059   __pyx_v_c = Py_None; __Pyx_INCREF(Py_None);
20060   __pyx_v_left = Py_None; __Pyx_INCREF(Py_None);
20061   __pyx_v_faref_leftflank = Py_None; __Pyx_INCREF(Py_None);
20062   __pyx_v_faref = Py_None; __Pyx_INCREF(Py_None);
20063   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
20064   __pyx_v_newalts = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
20065   __pyx_v_a = Py_None; __Pyx_INCREF(Py_None);
20066   __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
20067   __pyx_v_addns = Py_None; __Pyx_INCREF(Py_None);
20068   __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
20069   __pyx_v_na = Py_None; __Pyx_INCREF(Py_None);
20070   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
20071   __pyx_v_alt = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
20072   __pyx_v_addn = Py_None; __Pyx_INCREF(Py_None);
20073   __pyx_v_allele = Py_None; __Pyx_INCREF(Py_None);
20074   __pyx_v_longest = Py_None; __Pyx_INCREF(Py_None);
20075   __pyx_v_shortest = Py_None; __Pyx_INCREF(Py_None);
20076
20077   /* "cvcf.pyx":999
20078  *         '''
20079  * 
20080  *         raise NotImplementedError( "needs to be checked" )             # <<<<<<<<<<<<<<
20081  * 
20082  *         chrom, pos = record.chrom, record.pos
20083  */
20084   __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_k_tuple_123), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20085   __Pyx_GOTREF(__pyx_t_1);
20086   __Pyx_Raise(__pyx_t_1, 0, 0);
20087   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20088   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20089
20090   /* "cvcf.pyx":1001
20091  *         raise NotImplementedError( "needs to be checked" )
20092  * 
20093  *         chrom, pos = record.chrom, record.pos             # <<<<<<<<<<<<<<
20094  * 
20095  *         # check reference
20096  */
20097   __pyx_t_1 = PyObject_GetAttr(__pyx_v_record, __pyx_n_s__chrom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20098   __Pyx_GOTREF(__pyx_t_1);
20099   __pyx_t_2 = PyObject_GetAttr(__pyx_v_record, __pyx_n_s__pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20100   __Pyx_GOTREF(__pyx_t_2);
20101   __Pyx_DECREF(__pyx_v_chrom);
20102   __pyx_v_chrom = __pyx_t_1;
20103   __pyx_t_1 = 0;
20104   __Pyx_DECREF(__pyx_v_pos);
20105   __pyx_v_pos = __pyx_t_2;
20106   __pyx_t_2 = 0;
20107
20108   /* "cvcf.pyx":1004
20109  * 
20110  *         # check reference
20111  *         ref = record.ref             # <<<<<<<<<<<<<<
20112  *         if ref == ".":
20113  *             self.error(str(record),self.MISSING_REF)
20114  */
20115   __pyx_t_2 = PyObject_GetAttr(__pyx_v_record, __pyx_n_s__ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20116   __Pyx_GOTREF(__pyx_t_2);
20117   __Pyx_DECREF(__pyx_v_ref);
20118   __pyx_v_ref = __pyx_t_2;
20119   __pyx_t_2 = 0;
20120
20121   /* "cvcf.pyx":1005
20122  *         # check reference
20123  *         ref = record.ref
20124  *         if ref == ".":             # <<<<<<<<<<<<<<
20125  *             self.error(str(record),self.MISSING_REF)
20126  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
20127  */
20128   __pyx_t_2 = PyObject_RichCompare(__pyx_v_ref, ((PyObject *)__pyx_kp_s_9), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20129   __Pyx_GOTREF(__pyx_t_2);
20130   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20131   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20132   if (__pyx_t_3) {
20133
20134     /* "cvcf.pyx":1006
20135  *         ref = record.ref
20136  *         if ref == ".":
20137  *             self.error(str(record),self.MISSING_REF)             # <<<<<<<<<<<<<<
20138  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
20139  *             else:                   ref = ""
20140  */
20141     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20142     __Pyx_GOTREF(__pyx_t_2);
20143     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20144     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
20145     __Pyx_INCREF(__pyx_v_record);
20146     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_record);
20147     __Pyx_GIVEREF(__pyx_v_record);
20148     __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20149     __Pyx_GOTREF(__pyx_t_4);
20150     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
20151     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__MISSING_REF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20152     __Pyx_GOTREF(__pyx_t_1);
20153     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20154     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
20155     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
20156     __Pyx_GIVEREF(__pyx_t_4);
20157     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
20158     __Pyx_GIVEREF(__pyx_t_1);
20159     __pyx_t_4 = 0;
20160     __pyx_t_1 = 0;
20161     __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20162     __Pyx_GOTREF(__pyx_t_1);
20163     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20164     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
20165     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20166
20167     /* "cvcf.pyx":1007
20168  *         if ref == ".":
20169  *             self.error(str(record),self.MISSING_REF)
20170  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)             # <<<<<<<<<<<<<<
20171  *             else:                   ref = ""
20172  *         else:
20173  */
20174     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20175     __Pyx_GOTREF(__pyx_t_1);
20176     __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_33, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20177     __Pyx_GOTREF(__pyx_t_5);
20178     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20179     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20180     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20181     if (__pyx_t_3) {
20182       __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20183       __Pyx_GOTREF(__pyx_t_5);
20184       __pyx_t_1 = PyNumber_Add(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20185       __Pyx_GOTREF(__pyx_t_1);
20186       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20187       __Pyx_GOTREF(__pyx_t_2);
20188       __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20189       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
20190       __Pyx_INCREF(__pyx_v_chrom);
20191       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
20192       __Pyx_GIVEREF(__pyx_v_chrom);
20193       __Pyx_INCREF(__pyx_v_pos);
20194       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_pos);
20195       __Pyx_GIVEREF(__pyx_v_pos);
20196       PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
20197       __Pyx_GIVEREF(__pyx_t_1);
20198       PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2);
20199       __Pyx_GIVEREF(__pyx_t_2);
20200       __pyx_t_1 = 0;
20201       __pyx_t_2 = 0;
20202       __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20203       __Pyx_GOTREF(__pyx_t_2);
20204       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20205       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
20206       __Pyx_DECREF(__pyx_v_ref);
20207       __pyx_v_ref = __pyx_t_2;
20208       __pyx_t_2 = 0;
20209       goto __pyx_L7;
20210     }
20211     /*else*/ {
20212
20213       /* "cvcf.pyx":1008
20214  *             self.error(str(record),self.MISSING_REF)
20215  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
20216  *             else:                   ref = ""             # <<<<<<<<<<<<<<
20217  *         else:
20218  *             for c in ref:
20219  */
20220       __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
20221       __Pyx_DECREF(__pyx_v_ref);
20222       __pyx_v_ref = ((PyObject *)__pyx_kp_s_1);
20223     }
20224     __pyx_L7:;
20225     goto __pyx_L6;
20226   }
20227   /*else*/ {
20228
20229     /* "cvcf.pyx":1010
20230  *             else:                   ref = ""
20231  *         else:
20232  *             for c in ref:             # <<<<<<<<<<<<<<
20233  *                 if c not in "ACGTN": self.error(str(record),self.UNKNOWN_CHAR_IN_REF)
20234  *                 if "N" in ref: ref = get_sequence(chrom,
20235  */
20236     if (PyList_CheckExact(__pyx_v_ref) || PyTuple_CheckExact(__pyx_v_ref)) {
20237       __pyx_t_6 = 0; __pyx_t_2 = __pyx_v_ref; __Pyx_INCREF(__pyx_t_2);
20238     } else {
20239       __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20240       __Pyx_GOTREF(__pyx_t_2);
20241     }
20242     for (;;) {
20243       if (likely(PyList_CheckExact(__pyx_t_2))) {
20244         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
20245         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
20246       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
20247         if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
20248         __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
20249       } else {
20250         __pyx_t_4 = PyIter_Next(__pyx_t_2);
20251         if (!__pyx_t_4) {
20252           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20253           break;
20254         }
20255         __Pyx_GOTREF(__pyx_t_4);
20256       }
20257       __Pyx_DECREF(__pyx_v_c);
20258       __pyx_v_c = __pyx_t_4;
20259       __pyx_t_4 = 0;
20260
20261       /* "cvcf.pyx":1011
20262  *         else:
20263  *             for c in ref:
20264  *                 if c not in "ACGTN": self.error(str(record),self.UNKNOWN_CHAR_IN_REF)             # <<<<<<<<<<<<<<
20265  *                 if "N" in ref: ref = get_sequence(chrom,
20266  *                                                   pos,
20267  */
20268       __pyx_t_3 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_n_s__ACGTN), __pyx_v_c))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20269       if (__pyx_t_3) {
20270         __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20271         __Pyx_GOTREF(__pyx_t_4);
20272         __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20273         __Pyx_GOTREF(((PyObject *)__pyx_t_5));
20274         __Pyx_INCREF(__pyx_v_record);
20275         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_record);
20276         __Pyx_GIVEREF(__pyx_v_record);
20277         __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20278         __Pyx_GOTREF(__pyx_t_1);
20279         __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
20280         __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__UNKNOWN_CHAR_IN_REF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20281         __Pyx_GOTREF(__pyx_t_5);
20282         __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20283         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
20284         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
20285         __Pyx_GIVEREF(__pyx_t_1);
20286         PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
20287         __Pyx_GIVEREF(__pyx_t_5);
20288         __pyx_t_1 = 0;
20289         __pyx_t_5 = 0;
20290         __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20291         __Pyx_GOTREF(__pyx_t_5);
20292         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20293         __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
20294         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20295         goto __pyx_L10;
20296       }
20297       __pyx_L10:;
20298
20299       /* "cvcf.pyx":1012
20300  *             for c in ref:
20301  *                 if c not in "ACGTN": self.error(str(record),self.UNKNOWN_CHAR_IN_REF)
20302  *                 if "N" in ref: ref = get_sequence(chrom,             # <<<<<<<<<<<<<<
20303  *                                                   pos,
20304  *                                                   pos+len(ref),
20305  */
20306       __pyx_t_3 = ((PySequence_Contains(__pyx_v_ref, ((PyObject *)__pyx_n_s__N)))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20307       if (__pyx_t_3) {
20308         __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20309         __Pyx_GOTREF(__pyx_t_5);
20310
20311         /* "cvcf.pyx":1014
20312  *                 if "N" in ref: ref = get_sequence(chrom,
20313  *                                                   pos,
20314  *                                                   pos+len(ref),             # <<<<<<<<<<<<<<
20315  *                                                   self._reference)
20316  * 
20317  */
20318         __pyx_t_8 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20319         __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20320         __Pyx_GOTREF(__pyx_t_7);
20321         __pyx_t_4 = PyNumber_Add(__pyx_v_pos, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20322         __Pyx_GOTREF(__pyx_t_4);
20323         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20324
20325         /* "cvcf.pyx":1015
20326  *                                                   pos,
20327  *                                                   pos+len(ref),
20328  *                                                   self._reference)             # <<<<<<<<<<<<<<
20329  * 
20330  *         # make sure reference is sane
20331  */
20332         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20333         __Pyx_GOTREF(__pyx_t_7);
20334         __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20335         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
20336         __Pyx_INCREF(__pyx_v_chrom);
20337         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
20338         __Pyx_GIVEREF(__pyx_v_chrom);
20339         __Pyx_INCREF(__pyx_v_pos);
20340         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_pos);
20341         __Pyx_GIVEREF(__pyx_v_pos);
20342         PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
20343         __Pyx_GIVEREF(__pyx_t_4);
20344         PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
20345         __Pyx_GIVEREF(__pyx_t_7);
20346         __pyx_t_4 = 0;
20347         __pyx_t_7 = 0;
20348         __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20349         __Pyx_GOTREF(__pyx_t_7);
20350         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20351         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
20352         __Pyx_DECREF(__pyx_v_ref);
20353         __pyx_v_ref = __pyx_t_7;
20354         __pyx_t_7 = 0;
20355         goto __pyx_L11;
20356       }
20357       __pyx_L11:;
20358     }
20359     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20360   }
20361   __pyx_L6:;
20362
20363   /* "cvcf.pyx":1018
20364  * 
20365  *         # make sure reference is sane
20366  *         if self._reference:             # <<<<<<<<<<<<<<
20367  *             left = max(0,self.pos-100)
20368  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)
20369  */
20370   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20371   __Pyx_GOTREF(__pyx_t_2);
20372   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20373   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20374   if (__pyx_t_3) {
20375
20376     /* "cvcf.pyx":1019
20377  *         # make sure reference is sane
20378  *         if self._reference:
20379  *             left = max(0,self.pos-100)             # <<<<<<<<<<<<<<
20380  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)
20381  *             faref = faref_leftflank[pos-left:]
20382  */
20383     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20384     __Pyx_GOTREF(__pyx_t_2);
20385     __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_int_100); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20386     __Pyx_GOTREF(__pyx_t_7);
20387     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20388     __pyx_t_9 = 0;
20389     __pyx_t_1 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20390     __Pyx_GOTREF(__pyx_t_1);
20391     __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20392     __Pyx_GOTREF(__pyx_t_5);
20393     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20394     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20395     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20396     if (__pyx_t_3) {
20397       __Pyx_INCREF(__pyx_t_7);
20398       __pyx_t_2 = __pyx_t_7;
20399     } else {
20400       __pyx_t_5 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20401       __Pyx_GOTREF(__pyx_t_5);
20402       __pyx_t_2 = __pyx_t_5;
20403       __pyx_t_5 = 0;
20404     }
20405     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20406     __Pyx_INCREF(__pyx_t_2);
20407     __Pyx_DECREF(__pyx_v_left);
20408     __pyx_v_left = __pyx_t_2;
20409     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20410
20411     /* "cvcf.pyx":1020
20412  *         if self._reference:
20413  *             left = max(0,self.pos-100)
20414  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)             # <<<<<<<<<<<<<<
20415  *             faref = faref_leftflank[pos-left:]
20416  *             if faref != ref: self.error(str(record),self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
20417  */
20418     __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20419     __Pyx_GOTREF(__pyx_t_2);
20420     __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20421     __Pyx_GOTREF(__pyx_t_7);
20422     __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20423     __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20424     __Pyx_GOTREF(__pyx_t_5);
20425     __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20426     __Pyx_GOTREF(__pyx_t_1);
20427     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20428     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20429     __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20430     __Pyx_GOTREF(__pyx_t_5);
20431     __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20432     __Pyx_GOTREF(((PyObject *)__pyx_t_7));
20433     __Pyx_INCREF(__pyx_v_chrom);
20434     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chrom);
20435     __Pyx_GIVEREF(__pyx_v_chrom);
20436     __Pyx_INCREF(__pyx_v_left);
20437     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_left);
20438     __Pyx_GIVEREF(__pyx_v_left);
20439     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_1);
20440     __Pyx_GIVEREF(__pyx_t_1);
20441     PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
20442     __Pyx_GIVEREF(__pyx_t_5);
20443     __pyx_t_1 = 0;
20444     __pyx_t_5 = 0;
20445     __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20446     __Pyx_GOTREF(__pyx_t_5);
20447     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20448     __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
20449     __Pyx_DECREF(__pyx_v_faref_leftflank);
20450     __pyx_v_faref_leftflank = __pyx_t_5;
20451     __pyx_t_5 = 0;
20452
20453     /* "cvcf.pyx":1021
20454  *             left = max(0,self.pos-100)
20455  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)
20456  *             faref = faref_leftflank[pos-left:]             # <<<<<<<<<<<<<<
20457  *             if faref != ref: self.error(str(record),self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
20458  *             ref = faref
20459  */
20460     __pyx_t_5 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20461     __Pyx_GOTREF(__pyx_t_5);
20462     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20463     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20464     __pyx_t_5 = __Pyx_PySequence_GetSlice(__pyx_v_faref_leftflank, __pyx_t_6, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20465     __Pyx_GOTREF(__pyx_t_5);
20466     __Pyx_DECREF(__pyx_v_faref);
20467     __pyx_v_faref = __pyx_t_5;
20468     __pyx_t_5 = 0;
20469
20470     /* "cvcf.pyx":1022
20471  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)
20472  *             faref = faref_leftflank[pos-left:]
20473  *             if faref != ref: self.error(str(record),self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))             # <<<<<<<<<<<<<<
20474  *             ref = faref
20475  * 
20476  */
20477     __pyx_t_5 = PyObject_RichCompare(__pyx_v_faref, __pyx_v_ref, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20478     __Pyx_GOTREF(__pyx_t_5);
20479     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20480     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20481     if (__pyx_t_3) {
20482       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20483       __Pyx_GOTREF(__pyx_t_5);
20484       __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20485       __Pyx_GOTREF(((PyObject *)__pyx_t_7));
20486       __Pyx_INCREF(__pyx_v_record);
20487       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_record);
20488       __Pyx_GIVEREF(__pyx_v_record);
20489       __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20490       __Pyx_GOTREF(__pyx_t_2);
20491       __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
20492       __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__WRONG_REF); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20493       __Pyx_GOTREF(__pyx_t_7);
20494       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20495       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
20496       __Pyx_INCREF(__pyx_v_faref);
20497       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_faref);
20498       __Pyx_GIVEREF(__pyx_v_faref);
20499       __Pyx_INCREF(__pyx_v_ref);
20500       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
20501       __Pyx_GIVEREF(__pyx_v_ref);
20502       __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_103), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20503       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
20504       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
20505       __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20506       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
20507       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
20508       __Pyx_GIVEREF(__pyx_t_2);
20509       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
20510       __Pyx_GIVEREF(__pyx_t_7);
20511       PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_4));
20512       __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
20513       __pyx_t_2 = 0;
20514       __pyx_t_7 = 0;
20515       __pyx_t_4 = 0;
20516       __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20517       __Pyx_GOTREF(__pyx_t_4);
20518       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20519       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
20520       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20521       goto __pyx_L13;
20522     }
20523     __pyx_L13:;
20524
20525     /* "cvcf.pyx":1023
20526  *             faref = faref_leftflank[pos-left:]
20527  *             if faref != ref: self.error(str(record),self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
20528  *             ref = faref             # <<<<<<<<<<<<<<
20529  * 
20530  *         # check: format fields are defined
20531  */
20532     __Pyx_INCREF(__pyx_v_faref);
20533     __Pyx_DECREF(__pyx_v_ref);
20534     __pyx_v_ref = __pyx_v_faref;
20535     goto __pyx_L12;
20536   }
20537   __pyx_L12:;
20538
20539   /* "cvcf.pyx":1026
20540  * 
20541  *         # check: format fields are defined
20542  *         for f in record.format:             # <<<<<<<<<<<<<<
20543  *             if f not in self._format: self.error(str(record),self.FORMAT_NOT_DEFINED, f)
20544  * 
20545  */
20546   __pyx_t_4 = PyObject_GetAttr(__pyx_v_record, __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20547   __Pyx_GOTREF(__pyx_t_4);
20548   if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
20549     __pyx_t_6 = 0; __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1);
20550   } else {
20551     __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20552     __Pyx_GOTREF(__pyx_t_1);
20553   }
20554   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20555   for (;;) {
20556     if (likely(PyList_CheckExact(__pyx_t_1))) {
20557       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
20558       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
20559     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
20560       if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
20561       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
20562     } else {
20563       __pyx_t_4 = PyIter_Next(__pyx_t_1);
20564       if (!__pyx_t_4) {
20565         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20566         break;
20567       }
20568       __Pyx_GOTREF(__pyx_t_4);
20569     }
20570     __Pyx_DECREF(__pyx_v_f);
20571     __pyx_v_f = __pyx_t_4;
20572     __pyx_t_4 = 0;
20573
20574     /* "cvcf.pyx":1027
20575  *         # check: format fields are defined
20576  *         for f in record.format:
20577  *             if f not in self._format: self.error(str(record),self.FORMAT_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
20578  * 
20579  *         # check: all filters are defined
20580  */
20581     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20582     __Pyx_GOTREF(__pyx_t_4);
20583     __pyx_t_3 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_4, __pyx_v_f))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20584     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20585     if (__pyx_t_3) {
20586       __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20587       __Pyx_GOTREF(__pyx_t_4);
20588       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20589       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
20590       __Pyx_INCREF(__pyx_v_record);
20591       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_record);
20592       __Pyx_GIVEREF(__pyx_v_record);
20593       __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20594       __Pyx_GOTREF(__pyx_t_7);
20595       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
20596       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__FORMAT_NOT_DEFINED); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20597       __Pyx_GOTREF(__pyx_t_5);
20598       __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20599       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
20600       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
20601       __Pyx_GIVEREF(__pyx_t_7);
20602       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
20603       __Pyx_GIVEREF(__pyx_t_5);
20604       __Pyx_INCREF(__pyx_v_f);
20605       PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_f);
20606       __Pyx_GIVEREF(__pyx_v_f);
20607       __pyx_t_7 = 0;
20608       __pyx_t_5 = 0;
20609       __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20610       __Pyx_GOTREF(__pyx_t_5);
20611       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20612       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
20613       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20614       goto __pyx_L16;
20615     }
20616     __pyx_L16:;
20617   }
20618   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20619
20620   /* "cvcf.pyx":1030
20621  * 
20622  *         # check: all filters are defined
20623  *         for f in record.filter:             # <<<<<<<<<<<<<<
20624  *             if f not in self._filter: self.error(str(record),self.FILTER_NOT_DEFINED, f)
20625  * 
20626  */
20627   __pyx_t_1 = PyObject_GetAttr(__pyx_v_record, __pyx_n_s__filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20628   __Pyx_GOTREF(__pyx_t_1);
20629   if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
20630     __pyx_t_6 = 0; __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5);
20631   } else {
20632     __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20633     __Pyx_GOTREF(__pyx_t_5);
20634   }
20635   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20636   for (;;) {
20637     if (likely(PyList_CheckExact(__pyx_t_5))) {
20638       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
20639       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
20640     } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
20641       if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
20642       __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
20643     } else {
20644       __pyx_t_1 = PyIter_Next(__pyx_t_5);
20645       if (!__pyx_t_1) {
20646         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20647         break;
20648       }
20649       __Pyx_GOTREF(__pyx_t_1);
20650     }
20651     __Pyx_DECREF(__pyx_v_f);
20652     __pyx_v_f = __pyx_t_1;
20653     __pyx_t_1 = 0;
20654
20655     /* "cvcf.pyx":1031
20656  *         # check: all filters are defined
20657  *         for f in record.filter:
20658  *             if f not in self._filter: self.error(str(record),self.FILTER_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
20659  * 
20660  *         # convert v3.3 alleles
20661  */
20662     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20663     __Pyx_GOTREF(__pyx_t_1);
20664     __pyx_t_3 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_1, __pyx_v_f))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20665     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20666     if (__pyx_t_3) {
20667       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20668       __Pyx_GOTREF(__pyx_t_1);
20669       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20670       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
20671       __Pyx_INCREF(__pyx_v_record);
20672       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_record);
20673       __Pyx_GIVEREF(__pyx_v_record);
20674       __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20675       __Pyx_GOTREF(__pyx_t_4);
20676       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
20677       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__FILTER_NOT_DEFINED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20678       __Pyx_GOTREF(__pyx_t_2);
20679       __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20680       __Pyx_GOTREF(((PyObject *)__pyx_t_7));
20681       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
20682       __Pyx_GIVEREF(__pyx_t_4);
20683       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
20684       __Pyx_GIVEREF(__pyx_t_2);
20685       __Pyx_INCREF(__pyx_v_f);
20686       PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_f);
20687       __Pyx_GIVEREF(__pyx_v_f);
20688       __pyx_t_4 = 0;
20689       __pyx_t_2 = 0;
20690       __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20691       __Pyx_GOTREF(__pyx_t_2);
20692       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20693       __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
20694       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20695       goto __pyx_L19;
20696     }
20697     __pyx_L19:;
20698   }
20699   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20700
20701   /* "cvcf.pyx":1034
20702  * 
20703  *         # convert v3.3 alleles
20704  *         if self._version == 33:             # <<<<<<<<<<<<<<
20705  *             if len(ref) != 1: self.error(str(record),self.V33_BAD_REF)
20706  *             newalts = []
20707  */
20708   __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20709   __Pyx_GOTREF(__pyx_t_5);
20710   __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_int_33, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20711   __Pyx_GOTREF(__pyx_t_2);
20712   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20713   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20714   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20715   if (__pyx_t_3) {
20716
20717     /* "cvcf.pyx":1035
20718  *         # convert v3.3 alleles
20719  *         if self._version == 33:
20720  *             if len(ref) != 1: self.error(str(record),self.V33_BAD_REF)             # <<<<<<<<<<<<<<
20721  *             newalts = []
20722  *             have_deletions = False
20723  */
20724     __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20725     __pyx_t_3 = (__pyx_t_6 != 1);
20726     if (__pyx_t_3) {
20727       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20728       __Pyx_GOTREF(__pyx_t_2);
20729       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20730       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
20731       __Pyx_INCREF(__pyx_v_record);
20732       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_record);
20733       __Pyx_GIVEREF(__pyx_v_record);
20734       __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20735       __Pyx_GOTREF(__pyx_t_7);
20736       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
20737       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__V33_BAD_REF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20738       __Pyx_GOTREF(__pyx_t_5);
20739       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20740       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
20741       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
20742       __Pyx_GIVEREF(__pyx_t_7);
20743       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
20744       __Pyx_GIVEREF(__pyx_t_5);
20745       __pyx_t_7 = 0;
20746       __pyx_t_5 = 0;
20747       __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20748       __Pyx_GOTREF(__pyx_t_5);
20749       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20750       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
20751       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20752       goto __pyx_L21;
20753     }
20754     __pyx_L21:;
20755
20756     /* "cvcf.pyx":1036
20757  *         if self._version == 33:
20758  *             if len(ref) != 1: self.error(str(record),self.V33_BAD_REF)
20759  *             newalts = []             # <<<<<<<<<<<<<<
20760  *             have_deletions = False
20761  *             for a in alt:
20762  */
20763     __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20764     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
20765     __Pyx_DECREF(((PyObject *)__pyx_v_newalts));
20766     __pyx_v_newalts = __pyx_t_5;
20767     __pyx_t_5 = 0;
20768
20769     /* "cvcf.pyx":1037
20770  *             if len(ref) != 1: self.error(str(record),self.V33_BAD_REF)
20771  *             newalts = []
20772  *             have_deletions = False             # <<<<<<<<<<<<<<
20773  *             for a in alt:
20774  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
20775  */
20776     __pyx_v_have_deletions = 0;
20777
20778     /* "cvcf.pyx":1038
20779  *             newalts = []
20780  *             have_deletions = False
20781  *             for a in alt:             # <<<<<<<<<<<<<<
20782  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
20783  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
20784  */
20785     if (unlikely(__pyx_v_alt == Py_None)) {
20786       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
20787     }
20788     __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
20789     for (;;) {
20790       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
20791       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
20792       __Pyx_DECREF(__pyx_v_a);
20793       __pyx_v_a = __pyx_t_1;
20794       __pyx_t_1 = 0;
20795
20796       /* "cvcf.pyx":1039
20797  *             have_deletions = False
20798  *             for a in alt:
20799  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference             # <<<<<<<<<<<<<<
20800  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
20801  *                 elif a.startswith('D'): # allow D<seq> and D<num>
20802  */
20803       __pyx_t_8 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20804       __pyx_t_3 = (__pyx_t_8 == 1);
20805       if (__pyx_t_3) {
20806         __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_ref, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20807         __Pyx_GOTREF(__pyx_t_1);
20808         __pyx_t_2 = PyNumber_Add(__pyx_v_a, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20809         __Pyx_GOTREF(__pyx_t_2);
20810         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20811         __Pyx_DECREF(__pyx_v_a);
20812         __pyx_v_a = __pyx_t_2;
20813         __pyx_t_2 = 0;
20814         goto __pyx_L24;
20815       }
20816
20817       /* "cvcf.pyx":1040
20818  *             for a in alt:
20819  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
20820  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference             # <<<<<<<<<<<<<<
20821  *                 elif a.startswith('D'): # allow D<seq> and D<num>
20822  *                     have_deletions = True
20823  */
20824       __pyx_t_2 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20825       __Pyx_GOTREF(__pyx_t_2);
20826       __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20827       __Pyx_GOTREF(__pyx_t_1);
20828       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20829       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20830       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20831       if (__pyx_t_3) {
20832         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20833         __Pyx_GOTREF(__pyx_t_1);
20834         __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20835         __Pyx_GOTREF(__pyx_t_2);
20836         __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20837         __Pyx_GOTREF(__pyx_t_7);
20838         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20839         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20840         __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_ref, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20841         __Pyx_GOTREF(__pyx_t_2);
20842         __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20843         __Pyx_GOTREF(__pyx_t_1);
20844         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20845         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20846         __Pyx_DECREF(__pyx_v_a);
20847         __pyx_v_a = __pyx_t_1;
20848         __pyx_t_1 = 0;
20849         goto __pyx_L24;
20850       }
20851
20852       /* "cvcf.pyx":1041
20853  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
20854  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
20855  *                 elif a.startswith('D'): # allow D<seq> and D<num>             # <<<<<<<<<<<<<<
20856  *                     have_deletions = True
20857  *                     try:
20858  */
20859       __pyx_t_1 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20860       __Pyx_GOTREF(__pyx_t_1);
20861       __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20862       __Pyx_GOTREF(__pyx_t_2);
20863       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20864       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20865       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20866       if (__pyx_t_3) {
20867
20868         /* "cvcf.pyx":1042
20869  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
20870  *                 elif a.startswith('D'): # allow D<seq> and D<num>
20871  *                     have_deletions = True             # <<<<<<<<<<<<<<
20872  *                     try:
20873  *                         l = int(a[1:])          # throws ValueError if sequence
20874  */
20875         __pyx_v_have_deletions = 1;
20876
20877         /* "cvcf.pyx":1043
20878  *                 elif a.startswith('D'): # allow D<seq> and D<num>
20879  *                     have_deletions = True
20880  *                     try:             # <<<<<<<<<<<<<<
20881  *                         l = int(a[1:])          # throws ValueError if sequence
20882  *                         if len(ref) < l:        # add to reference if necessary
20883  */
20884         {
20885           PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
20886           __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
20887           __Pyx_XGOTREF(__pyx_save_exc_type);
20888           __Pyx_XGOTREF(__pyx_save_exc_value);
20889           __Pyx_XGOTREF(__pyx_save_exc_tb);
20890           /*try:*/ {
20891
20892             /* "cvcf.pyx":1044
20893  *                     have_deletions = True
20894  *                     try:
20895  *                         l = int(a[1:])          # throws ValueError if sequence             # <<<<<<<<<<<<<<
20896  *                         if len(ref) < l:        # add to reference if necessary
20897  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
20898  */
20899             __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20900             __Pyx_GOTREF(__pyx_t_2);
20901             __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20902             __Pyx_GOTREF(((PyObject *)__pyx_t_1));
20903             PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
20904             __Pyx_GIVEREF(__pyx_t_2);
20905             __pyx_t_2 = 0;
20906             __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20907             __Pyx_GOTREF(__pyx_t_2);
20908             __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
20909             __Pyx_DECREF(__pyx_v_l);
20910             __pyx_v_l = __pyx_t_2;
20911             __pyx_t_2 = 0;
20912
20913             /* "cvcf.pyx":1045
20914  *                     try:
20915  *                         l = int(a[1:])          # throws ValueError if sequence
20916  *                         if len(ref) < l:        # add to reference if necessary             # <<<<<<<<<<<<<<
20917  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
20918  *                             ref += addns
20919  */
20920             __pyx_t_8 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20921             __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20922             __Pyx_GOTREF(__pyx_t_2);
20923             __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_l, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20924             __Pyx_GOTREF(__pyx_t_1);
20925             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20926             __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20927             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20928             if (__pyx_t_3) {
20929
20930               /* "cvcf.pyx":1046
20931  *                         l = int(a[1:])          # throws ValueError if sequence
20932  *                         if len(ref) < l:        # add to reference if necessary
20933  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)             # <<<<<<<<<<<<<<
20934  *                             ref += addns
20935  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
20936  */
20937               __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20938               __Pyx_GOTREF(__pyx_t_1);
20939               __pyx_t_8 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20940               __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20941               __Pyx_GOTREF(__pyx_t_2);
20942               __pyx_t_7 = PyNumber_Add(__pyx_v_pos, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20943               __Pyx_GOTREF(__pyx_t_7);
20944               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20945               __pyx_t_2 = PyNumber_Add(__pyx_v_pos, __pyx_v_l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20946               __Pyx_GOTREF(__pyx_t_2);
20947               __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20948               __Pyx_GOTREF(__pyx_t_4);
20949               __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20950               __Pyx_GOTREF(((PyObject *)__pyx_t_10));
20951               __Pyx_INCREF(__pyx_v_chrom);
20952               PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
20953               __Pyx_GIVEREF(__pyx_v_chrom);
20954               PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
20955               __Pyx_GIVEREF(__pyx_t_7);
20956               PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_2);
20957               __Pyx_GIVEREF(__pyx_t_2);
20958               PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
20959               __Pyx_GIVEREF(__pyx_t_4);
20960               __pyx_t_7 = 0;
20961               __pyx_t_2 = 0;
20962               __pyx_t_4 = 0;
20963               __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20964               __Pyx_GOTREF(__pyx_t_4);
20965               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20966               __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
20967               __Pyx_DECREF(__pyx_v_addns);
20968               __pyx_v_addns = __pyx_t_4;
20969               __pyx_t_4 = 0;
20970
20971               /* "cvcf.pyx":1047
20972  *                         if len(ref) < l:        # add to reference if necessary
20973  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
20974  *                             ref += addns             # <<<<<<<<<<<<<<
20975  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
20976  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
20977  */
20978               __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addns); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
20979               __Pyx_GOTREF(__pyx_t_4);
20980               __Pyx_DECREF(__pyx_v_ref);
20981               __pyx_v_ref = __pyx_t_4;
20982               __pyx_t_4 = 0;
20983
20984               /* "cvcf.pyx":1048
20985  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
20986  *                             ref += addns
20987  *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
20988  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
20989  *                     except ValueError:
20990  */
20991               __Pyx_INCREF(__pyx_int_0);
20992               __pyx_t_4 = __pyx_int_0;
20993               __pyx_t_8 = 0; __pyx_t_10 = ((PyObject *)__pyx_v_newalts); __Pyx_INCREF(__pyx_t_10);
20994               for (;;) {
20995                 if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break;
20996                 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++;
20997                 __Pyx_DECREF(__pyx_v_na);
20998                 __pyx_v_na = __pyx_t_1;
20999                 __pyx_t_1 = 0;
21000                 __Pyx_INCREF(__pyx_t_4);
21001                 __Pyx_DECREF(__pyx_v_i);
21002                 __pyx_v_i = __pyx_t_4;
21003                 __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21004                 __Pyx_GOTREF(__pyx_t_1);
21005                 __Pyx_DECREF(__pyx_t_4);
21006                 __pyx_t_4 = __pyx_t_1;
21007                 __pyx_t_1 = 0;
21008                 __pyx_t_1 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21009                 __Pyx_GOTREF(__pyx_t_1);
21010                 if (PyObject_SetItem(((PyObject *)__pyx_v_newalts), __pyx_v_i, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21011                 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21012               }
21013               __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21014               __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21015               goto __pyx_L33;
21016             }
21017             __pyx_L33:;
21018
21019             /* "cvcf.pyx":1049
21020  *                             ref += addns
21021  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21022  *                         a = ref[l:]             # new deletion, deleting pos...pos+l             # <<<<<<<<<<<<<<
21023  *                     except ValueError:
21024  *                         s = a[1:]
21025  */
21026             __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21027             __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_ref, __pyx_t_8, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21028             __Pyx_GOTREF(__pyx_t_4);
21029             __Pyx_DECREF(__pyx_v_a);
21030             __pyx_v_a = __pyx_t_4;
21031             __pyx_t_4 = 0;
21032           }
21033           __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
21034           __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
21035           __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
21036           goto __pyx_L32_try_end;
21037           __pyx_L25_error:;
21038           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
21039           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21040           __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21041           __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21042           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21043
21044           /* "cvcf.pyx":1050
21045  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21046  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
21047  *                     except ValueError:             # <<<<<<<<<<<<<<
21048  *                         s = a[1:]
21049  *                         if len(ref) < len(s):   # add Ns to reference if necessary
21050  */
21051           __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
21052           if (__pyx_t_11) {
21053             __Pyx_AddTraceback("cvcf.VCF.validate");
21054             if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21055             __Pyx_GOTREF(__pyx_t_4);
21056             __Pyx_GOTREF(__pyx_t_10);
21057             __Pyx_GOTREF(__pyx_t_1);
21058
21059             /* "cvcf.pyx":1051
21060  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
21061  *                     except ValueError:
21062  *                         s = a[1:]             # <<<<<<<<<<<<<<
21063  *                         if len(ref) < len(s):   # add Ns to reference if necessary
21064  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
21065  */
21066             __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21067             __Pyx_GOTREF(__pyx_t_2);
21068             __Pyx_DECREF(__pyx_v_s);
21069             __pyx_v_s = __pyx_t_2;
21070             __pyx_t_2 = 0;
21071
21072             /* "cvcf.pyx":1052
21073  *                     except ValueError:
21074  *                         s = a[1:]
21075  *                         if len(ref) < len(s):   # add Ns to reference if necessary             # <<<<<<<<<<<<<<
21076  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
21077  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
21078  */
21079             __pyx_t_8 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21080             __pyx_t_12 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21081             __pyx_t_3 = (__pyx_t_8 < __pyx_t_12);
21082             if (__pyx_t_3) {
21083
21084               /* "cvcf.pyx":1053
21085  *                         s = a[1:]
21086  *                         if len(ref) < len(s):   # add Ns to reference if necessary
21087  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)             # <<<<<<<<<<<<<<
21088  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
21089  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,
21090  */
21091               __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21092               __Pyx_GOTREF(__pyx_t_2);
21093               __pyx_t_12 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21094               __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21095               __Pyx_GOTREF(__pyx_t_7);
21096               __pyx_t_13 = PyNumber_Add(__pyx_v_pos, __pyx_t_7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21097               __Pyx_GOTREF(__pyx_t_13);
21098               __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21099               __pyx_t_12 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21100               __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21101               __Pyx_GOTREF(__pyx_t_7);
21102               __pyx_t_14 = PyNumber_Add(__pyx_v_pos, __pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21103               __Pyx_GOTREF(__pyx_t_14);
21104               __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21105               __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21106               __Pyx_GOTREF(__pyx_t_7);
21107               __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21108               __Pyx_GOTREF(((PyObject *)__pyx_t_15));
21109               __Pyx_INCREF(__pyx_v_chrom);
21110               PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_chrom);
21111               __Pyx_GIVEREF(__pyx_v_chrom);
21112               PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_13);
21113               __Pyx_GIVEREF(__pyx_t_13);
21114               PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_14);
21115               __Pyx_GIVEREF(__pyx_t_14);
21116               PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_7);
21117               __Pyx_GIVEREF(__pyx_t_7);
21118               __pyx_t_13 = 0;
21119               __pyx_t_14 = 0;
21120               __pyx_t_7 = 0;
21121               __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21122               __Pyx_GOTREF(__pyx_t_7);
21123               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21124               __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
21125               __Pyx_DECREF(__pyx_v_addns);
21126               __pyx_v_addns = __pyx_t_7;
21127               __pyx_t_7 = 0;
21128
21129               /* "cvcf.pyx":1054
21130  *                         if len(ref) < len(s):   # add Ns to reference if necessary
21131  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
21132  *                             if not s.endswith(addns) and addns != 'N'*len(addns):             # <<<<<<<<<<<<<<
21133  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,
21134  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
21135  */
21136               __pyx_t_7 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__endswith); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21137               __Pyx_GOTREF(__pyx_t_7);
21138               __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21139               __Pyx_GOTREF(((PyObject *)__pyx_t_15));
21140               __Pyx_INCREF(__pyx_v_addns);
21141               PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_addns);
21142               __Pyx_GIVEREF(__pyx_v_addns);
21143               __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21144               __Pyx_GOTREF(__pyx_t_2);
21145               __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21146               __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
21147               __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21148               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21149               __pyx_t_16 = (!__pyx_t_3);
21150               if (__pyx_t_16) {
21151                 __pyx_t_12 = PyObject_Length(__pyx_v_addns); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21152                 __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21153                 __Pyx_GOTREF(__pyx_t_2);
21154                 __pyx_t_15 = PyNumber_Multiply(((PyObject *)__pyx_n_s__N), __pyx_t_2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21155                 __Pyx_GOTREF(((PyObject *)__pyx_t_15));
21156                 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21157                 __pyx_t_2 = PyObject_RichCompare(__pyx_v_addns, ((PyObject *)__pyx_t_15), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21158                 __Pyx_GOTREF(__pyx_t_2);
21159                 __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
21160                 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21161                 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21162                 __pyx_t_17 = __pyx_t_3;
21163               } else {
21164                 __pyx_t_17 = __pyx_t_16;
21165               }
21166               if (__pyx_t_17) {
21167
21168                 /* "cvcf.pyx":1055
21169  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
21170  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
21171  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,             # <<<<<<<<<<<<<<
21172  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
21173  *                             ref += addns
21174  */
21175                 __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21176                 __Pyx_GOTREF(__pyx_t_2);
21177                 __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21178                 __Pyx_GOTREF(((PyObject *)__pyx_t_15));
21179                 __Pyx_INCREF(__pyx_v_record);
21180                 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_record);
21181                 __Pyx_GIVEREF(__pyx_v_record);
21182                 __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21183                 __Pyx_GOTREF(__pyx_t_7);
21184                 __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
21185                 __pyx_t_15 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_111); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21186                 __Pyx_GOTREF(__pyx_t_15);
21187
21188                 /* "cvcf.pyx":1056
21189  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
21190  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,
21191  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))             # <<<<<<<<<<<<<<
21192  *                             ref += addns
21193  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21194  */
21195                 __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21196                 __Pyx_GOTREF(__pyx_t_14);
21197                 __pyx_t_12 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21198                 __pyx_t_13 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21199                 __Pyx_GOTREF(__pyx_t_13);
21200                 __pyx_t_18 = PyNumber_Add(__pyx_v_pos, __pyx_t_13); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21201                 __Pyx_GOTREF(__pyx_t_18);
21202                 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21203                 __pyx_t_13 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21204                 __Pyx_GOTREF(__pyx_t_13);
21205                 __pyx_t_19 = PyTuple_New(4); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21206                 __Pyx_GOTREF(((PyObject *)__pyx_t_19));
21207                 __Pyx_INCREF(__pyx_v_chrom);
21208                 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_chrom);
21209                 __Pyx_GIVEREF(__pyx_v_chrom);
21210                 __Pyx_INCREF(__pyx_v_pos);
21211                 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_pos);
21212                 __Pyx_GIVEREF(__pyx_v_pos);
21213                 PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_18);
21214                 __Pyx_GIVEREF(__pyx_t_18);
21215                 PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_13);
21216                 __Pyx_GIVEREF(__pyx_t_13);
21217                 __pyx_t_18 = 0;
21218                 __pyx_t_13 = 0;
21219                 __pyx_t_13 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21220                 __Pyx_GOTREF(__pyx_t_13);
21221                 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
21222                 __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
21223                 __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21224                 __Pyx_GOTREF(((PyObject *)__pyx_t_19));
21225                 __Pyx_INCREF(__pyx_v_a);
21226                 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_a);
21227                 __Pyx_GIVEREF(__pyx_v_a);
21228                 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_13);
21229                 __Pyx_GIVEREF(__pyx_t_13);
21230                 __pyx_t_13 = 0;
21231                 __pyx_t_13 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21232                 __Pyx_GOTREF(((PyObject *)__pyx_t_13));
21233                 __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
21234                 __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21235                 __Pyx_GOTREF(((PyObject *)__pyx_t_19));
21236                 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_7);
21237                 __Pyx_GIVEREF(__pyx_t_7);
21238                 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_15);
21239                 __Pyx_GIVEREF(__pyx_t_15);
21240                 PyTuple_SET_ITEM(__pyx_t_19, 2, ((PyObject *)__pyx_t_13));
21241                 __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
21242                 __pyx_t_7 = 0;
21243                 __pyx_t_15 = 0;
21244                 __pyx_t_13 = 0;
21245                 __pyx_t_13 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21246                 __Pyx_GOTREF(__pyx_t_13);
21247                 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21248                 __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
21249                 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21250                 goto __pyx_L39;
21251               }
21252               __pyx_L39:;
21253
21254               /* "cvcf.pyx":1057
21255  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,
21256  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
21257  *                             ref += addns             # <<<<<<<<<<<<<<
21258  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21259  *                         a = ref[len(s):]        # new deletion, deleting from pos
21260  */
21261               __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addns); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21262               __Pyx_GOTREF(__pyx_t_13);
21263               __Pyx_DECREF(__pyx_v_ref);
21264               __pyx_v_ref = __pyx_t_13;
21265               __pyx_t_13 = 0;
21266
21267               /* "cvcf.pyx":1058
21268  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
21269  *                             ref += addns
21270  *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
21271  *                         a = ref[len(s):]        # new deletion, deleting from pos
21272  *                 else:
21273  */
21274               __Pyx_INCREF(__pyx_int_0);
21275               __pyx_t_13 = __pyx_int_0;
21276               __pyx_t_12 = 0; __pyx_t_19 = ((PyObject *)__pyx_v_newalts); __Pyx_INCREF(__pyx_t_19);
21277               for (;;) {
21278                 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_19)) break;
21279                 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
21280                 __Pyx_DECREF(__pyx_v_na);
21281                 __pyx_v_na = __pyx_t_2;
21282                 __pyx_t_2 = 0;
21283                 __Pyx_INCREF(__pyx_t_13);
21284                 __Pyx_DECREF(__pyx_v_i);
21285                 __pyx_v_i = __pyx_t_13;
21286                 __pyx_t_2 = PyNumber_Add(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21287                 __Pyx_GOTREF(__pyx_t_2);
21288                 __Pyx_DECREF(__pyx_t_13);
21289                 __pyx_t_13 = __pyx_t_2;
21290                 __pyx_t_2 = 0;
21291                 __pyx_t_2 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21292                 __Pyx_GOTREF(__pyx_t_2);
21293                 if (PyObject_SetItem(((PyObject *)__pyx_v_newalts), __pyx_v_i, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21294                 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21295               }
21296               __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
21297               __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21298               goto __pyx_L38;
21299             }
21300             __pyx_L38:;
21301
21302             /* "cvcf.pyx":1059
21303  *                             ref += addns
21304  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21305  *                         a = ref[len(s):]        # new deletion, deleting from pos             # <<<<<<<<<<<<<<
21306  *                 else:
21307  *                     self.error(str(record),self.V33_BAD_ALLELE)
21308  */
21309             __pyx_t_12 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21310             __pyx_t_13 = __Pyx_PySequence_GetSlice(__pyx_v_ref, __pyx_t_12, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21311             __Pyx_GOTREF(__pyx_t_13);
21312             __Pyx_DECREF(__pyx_v_a);
21313             __pyx_v_a = __pyx_t_13;
21314             __pyx_t_13 = 0;
21315             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21316             __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21317             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21318             goto __pyx_L26_exception_handled;
21319           }
21320           __pyx_L27_except_error:;
21321           __Pyx_XGIVEREF(__pyx_save_exc_type);
21322           __Pyx_XGIVEREF(__pyx_save_exc_value);
21323           __Pyx_XGIVEREF(__pyx_save_exc_tb);
21324           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
21325           goto __pyx_L1_error;
21326           __pyx_L26_exception_handled:;
21327           __Pyx_XGIVEREF(__pyx_save_exc_type);
21328           __Pyx_XGIVEREF(__pyx_save_exc_value);
21329           __Pyx_XGIVEREF(__pyx_save_exc_tb);
21330           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
21331           __pyx_L32_try_end:;
21332         }
21333         goto __pyx_L24;
21334       }
21335       /*else*/ {
21336
21337         /* "cvcf.pyx":1061
21338  *                         a = ref[len(s):]        # new deletion, deleting from pos
21339  *                 else:
21340  *                     self.error(str(record),self.V33_BAD_ALLELE)             # <<<<<<<<<<<<<<
21341  *                 newalts.append(a)
21342  *             alt = newalts
21343  */
21344         __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21345         __Pyx_GOTREF(__pyx_t_1);
21346         __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21347         __Pyx_GOTREF(((PyObject *)__pyx_t_10));
21348         __Pyx_INCREF(__pyx_v_record);
21349         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_record);
21350         __Pyx_GIVEREF(__pyx_v_record);
21351         __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21352         __Pyx_GOTREF(__pyx_t_4);
21353         __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
21354         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__V33_BAD_ALLELE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21355         __Pyx_GOTREF(__pyx_t_10);
21356         __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21357         __Pyx_GOTREF(((PyObject *)__pyx_t_13));
21358         PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4);
21359         __Pyx_GIVEREF(__pyx_t_4);
21360         PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10);
21361         __Pyx_GIVEREF(__pyx_t_10);
21362         __pyx_t_4 = 0;
21363         __pyx_t_10 = 0;
21364         __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21365         __Pyx_GOTREF(__pyx_t_10);
21366         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21367         __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
21368         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21369       }
21370       __pyx_L24:;
21371
21372       /* "cvcf.pyx":1062
21373  *                 else:
21374  *                     self.error(str(record),self.V33_BAD_ALLELE)
21375  *                 newalts.append(a)             # <<<<<<<<<<<<<<
21376  *             alt = newalts
21377  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
21378  */
21379       if (unlikely(__pyx_v_newalts == Py_None)) {
21380         PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
21381       }
21382       __pyx_t_11 = PyList_Append(__pyx_v_newalts, __pyx_v_a); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21383     }
21384     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21385
21386     /* "cvcf.pyx":1063
21387  *                     self.error(str(record),self.V33_BAD_ALLELE)
21388  *                 newalts.append(a)
21389  *             alt = newalts             # <<<<<<<<<<<<<<
21390  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
21391  *             if have_deletions:
21392  */
21393     __Pyx_INCREF(((PyObject *)__pyx_v_newalts));
21394     __Pyx_DECREF(((PyObject *)__pyx_v_alt));
21395     __pyx_v_alt = __pyx_v_newalts;
21396
21397     /* "cvcf.pyx":1065
21398  *             alt = newalts
21399  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
21400  *             if have_deletions:             # <<<<<<<<<<<<<<
21401  *                 if pos == 0:
21402  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
21403  */
21404     if (__pyx_v_have_deletions) {
21405
21406       /* "cvcf.pyx":1066
21407  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
21408  *             if have_deletions:
21409  *                 if pos == 0:             # <<<<<<<<<<<<<<
21410  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
21411  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
21412  */
21413       __pyx_t_5 = PyObject_RichCompare(__pyx_v_pos, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21414       __Pyx_GOTREF(__pyx_t_5);
21415       __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21416       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21417       if (__pyx_t_17) {
21418
21419         /* "cvcf.pyx":1068
21420  *                 if pos == 0:
21421  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
21422  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)             # <<<<<<<<<<<<<<
21423  *                     ref += addn
21424  *                     alt = [allele+addn for allele in alt]
21425  */
21426         __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21427         __Pyx_GOTREF(__pyx_t_5);
21428         __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21429         __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21430         __Pyx_GOTREF(__pyx_t_10);
21431         __pyx_t_13 = PyNumber_Add(__pyx_v_pos, __pyx_t_10); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21432         __Pyx_GOTREF(__pyx_t_13);
21433         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21434         __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21435         __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21436         __Pyx_GOTREF(__pyx_t_10);
21437         __pyx_t_1 = PyNumber_Add(__pyx_v_pos, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21438         __Pyx_GOTREF(__pyx_t_1);
21439         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21440         __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21441         __Pyx_GOTREF(__pyx_t_10);
21442         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21443         __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21444         __Pyx_GOTREF(__pyx_t_1);
21445         __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21446         __Pyx_GOTREF(((PyObject *)__pyx_t_4));
21447         __Pyx_INCREF(__pyx_v_chrom);
21448         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
21449         __Pyx_GIVEREF(__pyx_v_chrom);
21450         PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_13);
21451         __Pyx_GIVEREF(__pyx_t_13);
21452         PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10);
21453         __Pyx_GIVEREF(__pyx_t_10);
21454         PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1);
21455         __Pyx_GIVEREF(__pyx_t_1);
21456         __pyx_t_13 = 0;
21457         __pyx_t_10 = 0;
21458         __pyx_t_1 = 0;
21459         __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21460         __Pyx_GOTREF(__pyx_t_1);
21461         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21462         __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
21463         __Pyx_DECREF(__pyx_v_addn);
21464         __pyx_v_addn = __pyx_t_1;
21465         __pyx_t_1 = 0;
21466
21467         /* "cvcf.pyx":1069
21468  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
21469  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
21470  *                     ref += addn             # <<<<<<<<<<<<<<
21471  *                     alt = [allele+addn for allele in alt]
21472  *                 else:
21473  */
21474         __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21475         __Pyx_GOTREF(__pyx_t_1);
21476         __Pyx_DECREF(__pyx_v_ref);
21477         __pyx_v_ref = __pyx_t_1;
21478         __pyx_t_1 = 0;
21479
21480         /* "cvcf.pyx":1070
21481  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
21482  *                     ref += addn
21483  *                     alt = [allele+addn for allele in alt]             # <<<<<<<<<<<<<<
21484  *                 else:
21485  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
21486  */
21487         __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21488         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
21489         if (unlikely(__pyx_v_alt == Py_None)) {
21490           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
21491         }
21492         __pyx_t_6 = 0; __pyx_t_4 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_4);
21493         for (;;) {
21494           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
21495           __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
21496           __Pyx_DECREF(__pyx_v_allele);
21497           __pyx_v_allele = __pyx_t_5;
21498           __pyx_t_5 = 0;
21499           __pyx_t_5 = PyNumber_Add(__pyx_v_allele, __pyx_v_addn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21500           __Pyx_GOTREF(__pyx_t_5);
21501           if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21502           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21503         }
21504         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21505         __Pyx_INCREF(((PyObject *)__pyx_t_1));
21506         __Pyx_DECREF(((PyObject *)__pyx_v_alt));
21507         __pyx_v_alt = __pyx_t_1;
21508         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
21509         goto __pyx_L43;
21510       }
21511       /*else*/ {
21512
21513         /* "cvcf.pyx":1072
21514  *                     alt = [allele+addn for allele in alt]
21515  *                 else:
21516  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)             # <<<<<<<<<<<<<<
21517  *                     ref = addn + ref
21518  *                     alt = [addn + allele for allele in alt]
21519  */
21520         __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21521         __Pyx_GOTREF(__pyx_t_1);
21522         __pyx_t_4 = PyNumber_Subtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21523         __Pyx_GOTREF(__pyx_t_4);
21524         __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21525         __Pyx_GOTREF(__pyx_t_5);
21526         __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21527         __Pyx_GOTREF(((PyObject *)__pyx_t_10));
21528         __Pyx_INCREF(__pyx_v_chrom);
21529         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
21530         __Pyx_GIVEREF(__pyx_v_chrom);
21531         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
21532         __Pyx_GIVEREF(__pyx_t_4);
21533         __Pyx_INCREF(__pyx_v_pos);
21534         PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_pos);
21535         __Pyx_GIVEREF(__pyx_v_pos);
21536         PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_5);
21537         __Pyx_GIVEREF(__pyx_t_5);
21538         __pyx_t_4 = 0;
21539         __pyx_t_5 = 0;
21540         __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21541         __Pyx_GOTREF(__pyx_t_5);
21542         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21543         __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
21544         __Pyx_DECREF(__pyx_v_addn);
21545         __pyx_v_addn = __pyx_t_5;
21546         __pyx_t_5 = 0;
21547
21548         /* "cvcf.pyx":1073
21549  *                 else:
21550  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
21551  *                     ref = addn + ref             # <<<<<<<<<<<<<<
21552  *                     alt = [addn + allele for allele in alt]
21553  *                     pos -= 1
21554  */
21555         __pyx_t_5 = PyNumber_Add(__pyx_v_addn, __pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21556         __Pyx_GOTREF(__pyx_t_5);
21557         __Pyx_DECREF(__pyx_v_ref);
21558         __pyx_v_ref = __pyx_t_5;
21559         __pyx_t_5 = 0;
21560
21561         /* "cvcf.pyx":1074
21562  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
21563  *                     ref = addn + ref
21564  *                     alt = [addn + allele for allele in alt]             # <<<<<<<<<<<<<<
21565  *                     pos -= 1
21566  *         else:
21567  */
21568         __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21569         __Pyx_GOTREF(((PyObject *)__pyx_t_5));
21570         if (unlikely(__pyx_v_alt == Py_None)) {
21571           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
21572         }
21573         __pyx_t_6 = 0; __pyx_t_10 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_10);
21574         for (;;) {
21575           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break;
21576           __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
21577           __Pyx_DECREF(__pyx_v_allele);
21578           __pyx_v_allele = __pyx_t_1;
21579           __pyx_t_1 = 0;
21580           __pyx_t_1 = PyNumber_Add(__pyx_v_addn, __pyx_v_allele); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21581           __Pyx_GOTREF(__pyx_t_1);
21582           if (unlikely(PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21583           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21584         }
21585         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21586         __Pyx_INCREF(((PyObject *)__pyx_t_5));
21587         __Pyx_DECREF(((PyObject *)__pyx_v_alt));
21588         __pyx_v_alt = __pyx_t_5;
21589         __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
21590
21591         /* "cvcf.pyx":1075
21592  *                     ref = addn + ref
21593  *                     alt = [addn + allele for allele in alt]
21594  *                     pos -= 1             # <<<<<<<<<<<<<<
21595  *         else:
21596  *             # format v4.0 -- just check for nucleotides
21597  */
21598         __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21599         __Pyx_GOTREF(__pyx_t_5);
21600         __Pyx_DECREF(__pyx_v_pos);
21601         __pyx_v_pos = __pyx_t_5;
21602         __pyx_t_5 = 0;
21603       }
21604       __pyx_L43:;
21605       goto __pyx_L42;
21606     }
21607     __pyx_L42:;
21608     goto __pyx_L20;
21609   }
21610   /*else*/ {
21611
21612     /* "cvcf.pyx":1078
21613  *         else:
21614  *             # format v4.0 -- just check for nucleotides
21615  *             for allele in alt:             # <<<<<<<<<<<<<<
21616  *                 if not alleleRegEx.match(allele):
21617  *                     self.error(str(record),self.V40_BAD_ALLELE,allele)
21618  */
21619     if (unlikely(__pyx_v_alt == Py_None)) {
21620       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
21621     }
21622     __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
21623     for (;;) {
21624       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
21625       __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_10); __pyx_t_6++;
21626       __Pyx_DECREF(__pyx_v_allele);
21627       __pyx_v_allele = __pyx_t_10;
21628       __pyx_t_10 = 0;
21629
21630       /* "cvcf.pyx":1079
21631  *             # format v4.0 -- just check for nucleotides
21632  *             for allele in alt:
21633  *                 if not alleleRegEx.match(allele):             # <<<<<<<<<<<<<<
21634  *                     self.error(str(record),self.V40_BAD_ALLELE,allele)
21635  * 
21636  */
21637       __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__alleleRegEx); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21638       __Pyx_GOTREF(__pyx_t_10);
21639       __pyx_t_1 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__match); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21640       __Pyx_GOTREF(__pyx_t_1);
21641       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21642       __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21643       __Pyx_GOTREF(((PyObject *)__pyx_t_10));
21644       __Pyx_INCREF(__pyx_v_allele);
21645       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_allele);
21646       __Pyx_GIVEREF(__pyx_v_allele);
21647       __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21648       __Pyx_GOTREF(__pyx_t_4);
21649       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21650       __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
21651       __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21652       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21653       __pyx_t_16 = (!__pyx_t_17);
21654       if (__pyx_t_16) {
21655
21656         /* "cvcf.pyx":1080
21657  *             for allele in alt:
21658  *                 if not alleleRegEx.match(allele):
21659  *                     self.error(str(record),self.V40_BAD_ALLELE,allele)             # <<<<<<<<<<<<<<
21660  * 
21661  * 
21662  */
21663         __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21664         __Pyx_GOTREF(__pyx_t_4);
21665         __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21666         __Pyx_GOTREF(((PyObject *)__pyx_t_10));
21667         __Pyx_INCREF(__pyx_v_record);
21668         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_record);
21669         __Pyx_GIVEREF(__pyx_v_record);
21670         __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21671         __Pyx_GOTREF(__pyx_t_1);
21672         __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
21673         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__V40_BAD_ALLELE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21674         __Pyx_GOTREF(__pyx_t_10);
21675         __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21676         __Pyx_GOTREF(((PyObject *)__pyx_t_13));
21677         PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
21678         __Pyx_GIVEREF(__pyx_t_1);
21679         PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10);
21680         __Pyx_GIVEREF(__pyx_t_10);
21681         __Pyx_INCREF(__pyx_v_allele);
21682         PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_allele);
21683         __Pyx_GIVEREF(__pyx_v_allele);
21684         __pyx_t_1 = 0;
21685         __pyx_t_10 = 0;
21686         __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21687         __Pyx_GOTREF(__pyx_t_10);
21688         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21689         __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
21690         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21691         goto __pyx_L50;
21692       }
21693       __pyx_L50:;
21694     }
21695     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21696   }
21697   __pyx_L20:;
21698
21699   /* "cvcf.pyx":1084
21700  * 
21701  *         # check for leading nucleotide in indel calls
21702  *         for allele in alt:             # <<<<<<<<<<<<<<
21703  *             if len(allele) != len(ref):
21704  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)
21705  */
21706   if (unlikely(__pyx_v_alt == Py_None)) {
21707     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
21708   }
21709   __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
21710   for (;;) {
21711     if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
21712     __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_10); __pyx_t_6++;
21713     __Pyx_DECREF(__pyx_v_allele);
21714     __pyx_v_allele = __pyx_t_10;
21715     __pyx_t_10 = 0;
21716
21717     /* "cvcf.pyx":1085
21718  *         # check for leading nucleotide in indel calls
21719  *         for allele in alt:
21720  *             if len(allele) != len(ref):             # <<<<<<<<<<<<<<
21721  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)
21722  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
21723  */
21724     __pyx_t_12 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21725     __pyx_t_8 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21726     __pyx_t_16 = (__pyx_t_12 != __pyx_t_8);
21727     if (__pyx_t_16) {
21728
21729       /* "cvcf.pyx":1086
21730  *         for allele in alt:
21731  *             if len(allele) != len(ref):
21732  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)             # <<<<<<<<<<<<<<
21733  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
21734  *                     self.error(str(record),self.MISSING_INDEL_ALLELE_REF_BASE)
21735  */
21736       __pyx_t_8 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21737       __pyx_t_16 = (__pyx_t_8 == 0);
21738       if (__pyx_t_16) {
21739         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21740         __Pyx_GOTREF(__pyx_t_10);
21741         __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21742         __Pyx_GOTREF(((PyObject *)__pyx_t_13));
21743         __Pyx_INCREF(__pyx_v_record);
21744         PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_record);
21745         __Pyx_GIVEREF(__pyx_v_record);
21746         __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21747         __Pyx_GOTREF(__pyx_t_4);
21748         __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
21749         __pyx_t_13 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ZERO_LENGTH_ALLELE); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21750         __Pyx_GOTREF(__pyx_t_13);
21751         __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21752         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
21753         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
21754         __Pyx_GIVEREF(__pyx_t_4);
21755         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_13);
21756         __Pyx_GIVEREF(__pyx_t_13);
21757         __pyx_t_4 = 0;
21758         __pyx_t_13 = 0;
21759         __pyx_t_13 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21760         __Pyx_GOTREF(__pyx_t_13);
21761         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21762         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
21763         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21764         goto __pyx_L54;
21765       }
21766       __pyx_L54:;
21767
21768       /* "cvcf.pyx":1087
21769  *             if len(allele) != len(ref):
21770  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)
21771  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():             # <<<<<<<<<<<<<<
21772  *                     self.error(str(record),self.MISSING_INDEL_ALLELE_REF_BASE)
21773  * 
21774  */
21775       __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21776       __Pyx_GOTREF(__pyx_t_13);
21777       __pyx_t_1 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21778       __Pyx_GOTREF(__pyx_t_1);
21779       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21780       __pyx_t_13 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21781       __Pyx_GOTREF(__pyx_t_13);
21782       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21783       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_allele, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21784       __Pyx_GOTREF(__pyx_t_1);
21785       __pyx_t_10 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__upper); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21786       __Pyx_GOTREF(__pyx_t_10);
21787       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21788       __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21789       __Pyx_GOTREF(__pyx_t_1);
21790       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21791       __pyx_t_10 = PyObject_RichCompare(__pyx_t_13, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21792       __Pyx_GOTREF(__pyx_t_10);
21793       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21794       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21795       __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21796       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21797       if (__pyx_t_16) {
21798         __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21799         __Pyx_GOTREF(__pyx_t_10);
21800         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_allele, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21801         __Pyx_GOTREF(__pyx_t_1);
21802         __pyx_t_13 = PyNumber_Add(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21803         __Pyx_GOTREF(__pyx_t_13);
21804         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21805         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21806         __pyx_t_1 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21807         __Pyx_GOTREF(__pyx_t_1);
21808         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21809         __pyx_t_13 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21810         __Pyx_GOTREF(__pyx_t_13);
21811         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21812         __pyx_t_17 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_13, ((PyObject *)__pyx_n_s__N)))); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21813         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21814         __pyx_t_3 = __pyx_t_17;
21815       } else {
21816         __pyx_t_3 = __pyx_t_16;
21817       }
21818       if (__pyx_t_3) {
21819
21820         /* "cvcf.pyx":1088
21821  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)
21822  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
21823  *                     self.error(str(record),self.MISSING_INDEL_ALLELE_REF_BASE)             # <<<<<<<<<<<<<<
21824  * 
21825  *         # trim trailing bases in alleles
21826  */
21827         __pyx_t_13 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21828         __Pyx_GOTREF(__pyx_t_13);
21829         __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21830         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
21831         __Pyx_INCREF(__pyx_v_record);
21832         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_record);
21833         __Pyx_GIVEREF(__pyx_v_record);
21834         __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21835         __Pyx_GOTREF(__pyx_t_10);
21836         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
21837         __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_113); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21838         __Pyx_GOTREF(__pyx_t_1);
21839         __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21840         __Pyx_GOTREF(((PyObject *)__pyx_t_4));
21841         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10);
21842         __Pyx_GIVEREF(__pyx_t_10);
21843         PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
21844         __Pyx_GIVEREF(__pyx_t_1);
21845         __pyx_t_10 = 0;
21846         __pyx_t_1 = 0;
21847         __pyx_t_1 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21848         __Pyx_GOTREF(__pyx_t_1);
21849         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21850         __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
21851         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21852         goto __pyx_L55;
21853       }
21854       __pyx_L55:;
21855       goto __pyx_L53;
21856     }
21857     __pyx_L53:;
21858   }
21859   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21860
21861   /* "cvcf.pyx":1091
21862  * 
21863  *         # trim trailing bases in alleles
21864  *         for i in range(1,min(len(ref),min(map(len,alt)))):             # <<<<<<<<<<<<<<
21865  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
21866  *                 break
21867  */
21868   __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21869   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
21870   __Pyx_INCREF(__pyx_builtin_len);
21871   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_builtin_len);
21872   __Pyx_GIVEREF(__pyx_builtin_len);
21873   __Pyx_INCREF(((PyObject *)__pyx_v_alt));
21874   PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_alt));
21875   __Pyx_GIVEREF(((PyObject *)__pyx_v_alt));
21876   __pyx_t_1 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21877   __Pyx_GOTREF(__pyx_t_1);
21878   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
21879   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21880   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
21881   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
21882   __Pyx_GIVEREF(__pyx_t_1);
21883   __pyx_t_1 = 0;
21884   __pyx_t_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21885   __Pyx_GOTREF(__pyx_t_1);
21886   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
21887   __pyx_t_8 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21888   __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21889   __Pyx_GOTREF(__pyx_t_4);
21890   __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21891   __Pyx_GOTREF(__pyx_t_13);
21892   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21893   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21894   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21895   if (__pyx_t_3) {
21896     __Pyx_INCREF(__pyx_t_1);
21897     __pyx_t_5 = __pyx_t_1;
21898   } else {
21899     __pyx_t_13 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21900     __Pyx_GOTREF(__pyx_t_13);
21901     __pyx_t_5 = __pyx_t_13;
21902     __pyx_t_13 = 0;
21903   }
21904   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21905   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21906   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
21907   __Pyx_INCREF(__pyx_int_1);
21908   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_1);
21909   __Pyx_GIVEREF(__pyx_int_1);
21910   __Pyx_INCREF(__pyx_t_5);
21911   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
21912   __Pyx_GIVEREF(__pyx_t_5);
21913   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21914   __pyx_t_5 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21915   __Pyx_GOTREF(__pyx_t_5);
21916   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
21917   if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
21918     __pyx_t_6 = 0; __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1);
21919   } else {
21920     __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21921     __Pyx_GOTREF(__pyx_t_1);
21922   }
21923   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21924   for (;;) {
21925     if (likely(PyList_CheckExact(__pyx_t_1))) {
21926       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
21927       __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
21928     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
21929       if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
21930       __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
21931     } else {
21932       __pyx_t_5 = PyIter_Next(__pyx_t_1);
21933       if (!__pyx_t_5) {
21934         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21935         break;
21936       }
21937       __Pyx_GOTREF(__pyx_t_5);
21938     }
21939     __Pyx_DECREF(__pyx_v_i);
21940     __pyx_v_i = __pyx_t_5;
21941     __pyx_t_5 = 0;
21942
21943     /* "cvcf.pyx":1092
21944  *         # trim trailing bases in alleles
21945  *         for i in range(1,min(len(ref),min(map(len,alt)))):
21946  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():             # <<<<<<<<<<<<<<
21947  *                 break
21948  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]
21949  */
21950     { /* enter inner scope */
21951       PyObject *__pyx_8genexpr1__pyx_v_allele;
21952       __pyx_8genexpr1__pyx_v_allele = Py_None; __Pyx_INCREF(Py_None);
21953       __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L61_error;}
21954       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
21955       if (unlikely(__pyx_v_alt == Py_None)) {
21956         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L61_error;} 
21957       }
21958       __pyx_t_8 = 0; __pyx_t_13 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_13);
21959       for (;;) {
21960         if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_13)) break;
21961         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++;
21962         __Pyx_DECREF(__pyx_8genexpr1__pyx_v_allele);
21963         __pyx_8genexpr1__pyx_v_allele = __pyx_t_4;
21964         __pyx_t_4 = 0;
21965         __pyx_t_4 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_allele, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L61_error;}
21966         __Pyx_GOTREF(__pyx_t_4);
21967         __pyx_t_10 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__upper); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L61_error;}
21968         __Pyx_GOTREF(__pyx_t_10);
21969         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21970         __pyx_t_4 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L61_error;}
21971         __Pyx_GOTREF(__pyx_t_4);
21972         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21973         if (unlikely(PySet_Add(__pyx_t_5, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L61_error;}
21974         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21975       }
21976       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21977       __Pyx_DECREF(__pyx_8genexpr1__pyx_v_allele);
21978       goto __pyx_L64_exit_scope;
21979       __pyx_L61_error:;
21980       __Pyx_DECREF(__pyx_8genexpr1__pyx_v_allele);
21981       goto __pyx_L1_error;
21982       __pyx_L64_exit_scope:;
21983     } /* exit inner scope */
21984     __pyx_t_8 = PySet_Size(((PyObject *)__pyx_t_5)); 
21985     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
21986     __pyx_t_3 = (__pyx_t_8 > 1);
21987     if (!__pyx_t_3) {
21988       __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ref, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21989       __Pyx_GOTREF(__pyx_t_5);
21990       __pyx_t_13 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__upper); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21991       __Pyx_GOTREF(__pyx_t_13);
21992       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21993       __pyx_t_5 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21994       __Pyx_GOTREF(__pyx_t_5);
21995       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21996       __pyx_t_13 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_alt), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21997       __Pyx_GOTREF(__pyx_t_13);
21998       __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_13, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21999       __Pyx_GOTREF(__pyx_t_4);
22000       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22001       __pyx_t_13 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__upper); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22002       __Pyx_GOTREF(__pyx_t_13);
22003       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22004       __pyx_t_4 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22005       __Pyx_GOTREF(__pyx_t_4);
22006       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22007       __pyx_t_13 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22008       __Pyx_GOTREF(__pyx_t_13);
22009       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22010       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22011       __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22012       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22013       __pyx_t_17 = __pyx_t_16;
22014     } else {
22015       __pyx_t_17 = __pyx_t_3;
22016     }
22017     if (__pyx_t_17) {
22018
22019       /* "cvcf.pyx":1093
22020  *         for i in range(1,min(len(ref),min(map(len,alt)))):
22021  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
22022  *                 break             # <<<<<<<<<<<<<<
22023  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]
22024  * 
22025  */
22026       goto __pyx_L57_break;
22027       goto __pyx_L58;
22028     }
22029     __pyx_L58:;
22030
22031     /* "cvcf.pyx":1094
22032  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
22033  *                 break
22034  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
22035  * 
22036  *         # left-align alleles, if a reference is available
22037  */
22038     __pyx_t_13 = __Pyx_PySequence_GetSlice(__pyx_v_ref, 0, -1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22039     __Pyx_GOTREF(__pyx_t_13);
22040     __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22041     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
22042     if (unlikely(__pyx_v_alt == Py_None)) {
22043       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
22044     }
22045     __pyx_t_8 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
22046     for (;;) {
22047       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
22048       __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++;
22049       __Pyx_DECREF(__pyx_v_allele);
22050       __pyx_v_allele = __pyx_t_10;
22051       __pyx_t_10 = 0;
22052       __pyx_t_10 = __Pyx_PySequence_GetSlice(__pyx_v_allele, 0, -1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22053       __Pyx_GOTREF(__pyx_t_10);
22054       if (unlikely(PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22055       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22056     }
22057     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22058     __pyx_t_5 = ((PyObject *)__pyx_t_4);
22059     __Pyx_INCREF(__pyx_t_5);
22060     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
22061     __Pyx_DECREF(__pyx_v_ref);
22062     __pyx_v_ref = __pyx_t_13;
22063     __pyx_t_13 = 0;
22064     __Pyx_DECREF(((PyObject *)__pyx_v_alt));
22065     __pyx_v_alt = ((PyObject*)__pyx_t_5);
22066     __pyx_t_5 = 0;
22067   }
22068   __pyx_L57_break:;
22069   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22070
22071   /* "cvcf.pyx":1097
22072  * 
22073  *         # left-align alleles, if a reference is available
22074  *         if self._leftalign and self._reference:             # <<<<<<<<<<<<<<
22075  *             while left < pos:
22076  *                 movable = True
22077  */
22078   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___leftalign); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22079   __Pyx_GOTREF(__pyx_t_1);
22080   __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22081   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22082   if (__pyx_t_17) {
22083     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22084     __Pyx_GOTREF(__pyx_t_1);
22085     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22086     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22087     __pyx_t_16 = __pyx_t_3;
22088   } else {
22089     __pyx_t_16 = __pyx_t_17;
22090   }
22091   if (__pyx_t_16) {
22092
22093     /* "cvcf.pyx":1098
22094  *         # left-align alleles, if a reference is available
22095  *         if self._leftalign and self._reference:
22096  *             while left < pos:             # <<<<<<<<<<<<<<
22097  *                 movable = True
22098  *                 for allele in alt:
22099  */
22100     while (1) {
22101       __pyx_t_1 = PyObject_RichCompare(__pyx_v_left, __pyx_v_pos, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22102       __Pyx_GOTREF(__pyx_t_1);
22103       __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22104       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22105       if (!__pyx_t_16) break;
22106
22107       /* "cvcf.pyx":1099
22108  *         if self._leftalign and self._reference:
22109  *             while left < pos:
22110  *                 movable = True             # <<<<<<<<<<<<<<
22111  *                 for allele in alt:
22112  *                     if len(allele) > len(ref):
22113  */
22114       __pyx_v_movable = 1;
22115
22116       /* "cvcf.pyx":1100
22117  *             while left < pos:
22118  *                 movable = True
22119  *                 for allele in alt:             # <<<<<<<<<<<<<<
22120  *                     if len(allele) > len(ref):
22121  *                         longest, shortest = allele, ref
22122  */
22123       if (unlikely(__pyx_v_alt == Py_None)) {
22124         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
22125       }
22126       __pyx_t_6 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_1);
22127       for (;;) {
22128         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
22129         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
22130         __Pyx_DECREF(__pyx_v_allele);
22131         __pyx_v_allele = __pyx_t_5;
22132         __pyx_t_5 = 0;
22133
22134         /* "cvcf.pyx":1101
22135  *                 movable = True
22136  *                 for allele in alt:
22137  *                     if len(allele) > len(ref):             # <<<<<<<<<<<<<<
22138  *                         longest, shortest = allele, ref
22139  *                     else:
22140  */
22141         __pyx_t_8 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22142         __pyx_t_12 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22143         __pyx_t_16 = (__pyx_t_8 > __pyx_t_12);
22144         if (__pyx_t_16) {
22145
22146           /* "cvcf.pyx":1102
22147  *                 for allele in alt:
22148  *                     if len(allele) > len(ref):
22149  *                         longest, shortest = allele, ref             # <<<<<<<<<<<<<<
22150  *                     else:
22151  *                         longest, shortest = ref, allele
22152  */
22153           __pyx_t_5 = __pyx_v_allele;
22154           __Pyx_INCREF(__pyx_t_5);
22155           __pyx_t_13 = __pyx_v_ref;
22156           __Pyx_INCREF(__pyx_t_13);
22157           __Pyx_DECREF(__pyx_v_longest);
22158           __pyx_v_longest = __pyx_t_5;
22159           __pyx_t_5 = 0;
22160           __Pyx_DECREF(__pyx_v_shortest);
22161           __pyx_v_shortest = __pyx_t_13;
22162           __pyx_t_13 = 0;
22163           goto __pyx_L72;
22164         }
22165         /*else*/ {
22166
22167           /* "cvcf.pyx":1104
22168  *                         longest, shortest = allele, ref
22169  *                     else:
22170  *                         longest, shortest = ref, allele             # <<<<<<<<<<<<<<
22171  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
22172  *                         movable = False
22173  */
22174           __pyx_t_13 = __pyx_v_ref;
22175           __Pyx_INCREF(__pyx_t_13);
22176           __pyx_t_5 = __pyx_v_allele;
22177           __Pyx_INCREF(__pyx_t_5);
22178           __Pyx_DECREF(__pyx_v_longest);
22179           __pyx_v_longest = __pyx_t_13;
22180           __pyx_t_13 = 0;
22181           __Pyx_DECREF(__pyx_v_shortest);
22182           __pyx_v_shortest = __pyx_t_5;
22183           __pyx_t_5 = 0;
22184         }
22185         __pyx_L72:;
22186
22187         /* "cvcf.pyx":1105
22188  *                     else:
22189  *                         longest, shortest = ref, allele
22190  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():             # <<<<<<<<<<<<<<
22191  *                         movable = False
22192  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
22193  */
22194         __pyx_t_12 = PyObject_Length(__pyx_v_longest); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22195         __pyx_t_8 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22196         __pyx_t_16 = (__pyx_t_12 == __pyx_t_8);
22197         if (!__pyx_t_16) {
22198           __pyx_t_8 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22199           __pyx_t_5 = __Pyx_PySequence_GetSlice(__pyx_v_longest, 0, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22200           __Pyx_GOTREF(__pyx_t_5);
22201           __pyx_t_13 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__upper); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22202           __Pyx_GOTREF(__pyx_t_13);
22203           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22204           __pyx_t_5 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22205           __Pyx_GOTREF(__pyx_t_5);
22206           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22207           __pyx_t_13 = PyObject_GetAttr(__pyx_v_shortest, __pyx_n_s__upper); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22208           __Pyx_GOTREF(__pyx_t_13);
22209           __pyx_t_4 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22210           __Pyx_GOTREF(__pyx_t_4);
22211           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22212           __pyx_t_13 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22213           __Pyx_GOTREF(__pyx_t_13);
22214           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22215           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22216           __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22217           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22218           __pyx_t_3 = __pyx_t_17;
22219         } else {
22220           __pyx_t_3 = __pyx_t_16;
22221         }
22222         if (__pyx_t_3) {
22223
22224           /* "cvcf.pyx":1106
22225  *                         longest, shortest = ref, allele
22226  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
22227  *                         movable = False             # <<<<<<<<<<<<<<
22228  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
22229  *                         movable = False
22230  */
22231           __pyx_v_movable = 0;
22232           goto __pyx_L73;
22233         }
22234         __pyx_L73:;
22235
22236         /* "cvcf.pyx":1107
22237  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
22238  *                         movable = False
22239  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():             # <<<<<<<<<<<<<<
22240  *                         movable = False
22241  *                 if not movable:
22242  */
22243         __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_longest, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22244         __Pyx_GOTREF(__pyx_t_13);
22245         __pyx_t_4 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__upper); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22246         __Pyx_GOTREF(__pyx_t_4);
22247         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22248         __pyx_t_13 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22249         __Pyx_GOTREF(__pyx_t_13);
22250         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22251         __pyx_t_8 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22252         __pyx_t_12 = (__pyx_t_8 - 1);
22253         __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_longest, __pyx_t_12, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22254         __Pyx_GOTREF(__pyx_t_4);
22255         __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__upper); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22256         __Pyx_GOTREF(__pyx_t_5);
22257         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22258         __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22259         __Pyx_GOTREF(__pyx_t_4);
22260         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22261         __pyx_t_5 = PyObject_RichCompare(__pyx_t_13, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22262         __Pyx_GOTREF(__pyx_t_5);
22263         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22264         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22265         __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22266         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22267         if (__pyx_t_3) {
22268
22269           /* "cvcf.pyx":1108
22270  *                         movable = False
22271  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
22272  *                         movable = False             # <<<<<<<<<<<<<<
22273  *                 if not movable:
22274  *                     break
22275  */
22276           __pyx_v_movable = 0;
22277           goto __pyx_L74;
22278         }
22279         __pyx_L74:;
22280       }
22281       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22282
22283       /* "cvcf.pyx":1109
22284  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
22285  *                         movable = False
22286  *                 if not movable:             # <<<<<<<<<<<<<<
22287  *                     break
22288  *                 ref = ref[:-1]
22289  */
22290       __pyx_t_3 = (!__pyx_v_movable);
22291       if (__pyx_t_3) {
22292
22293         /* "cvcf.pyx":1110
22294  *                         movable = False
22295  *                 if not movable:
22296  *                     break             # <<<<<<<<<<<<<<
22297  *                 ref = ref[:-1]
22298  *                 alt = [allele[:-1] for allele in alt]
22299  */
22300         goto __pyx_L69_break;
22301         goto __pyx_L75;
22302       }
22303       __pyx_L75:;
22304
22305       /* "cvcf.pyx":1111
22306  *                 if not movable:
22307  *                     break
22308  *                 ref = ref[:-1]             # <<<<<<<<<<<<<<
22309  *                 alt = [allele[:-1] for allele in alt]
22310  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
22311  */
22312       __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_ref, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22313       __Pyx_GOTREF(__pyx_t_1);
22314       __Pyx_DECREF(__pyx_v_ref);
22315       __pyx_v_ref = __pyx_t_1;
22316       __pyx_t_1 = 0;
22317
22318       /* "cvcf.pyx":1112
22319  *                     break
22320  *                 ref = ref[:-1]
22321  *                 alt = [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
22322  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
22323  *                     ref = faref_leftflank[pos-left-1] + ref
22324  */
22325       __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22326       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
22327       if (unlikely(__pyx_v_alt == Py_None)) {
22328         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
22329       }
22330       __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
22331       for (;;) {
22332         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
22333         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
22334         __Pyx_DECREF(__pyx_v_allele);
22335         __pyx_v_allele = __pyx_t_4;
22336         __pyx_t_4 = 0;
22337         __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_allele, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22338         __Pyx_GOTREF(__pyx_t_4);
22339         if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22340         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22341       }
22342       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22343       __Pyx_INCREF(((PyObject *)__pyx_t_1));
22344       __Pyx_DECREF(((PyObject *)__pyx_v_alt));
22345       __pyx_v_alt = __pyx_t_1;
22346       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
22347
22348       /* "cvcf.pyx":1113
22349  *                 ref = ref[:-1]
22350  *                 alt = [allele[:-1] for allele in alt]
22351  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:             # <<<<<<<<<<<<<<
22352  *                     ref = faref_leftflank[pos-left-1] + ref
22353  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
22354  */
22355       __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22356       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
22357       if (unlikely(__pyx_v_alt == Py_None)) {
22358         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
22359       }
22360       __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
22361       for (;;) {
22362         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
22363         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
22364         __Pyx_DECREF(__pyx_v_allele);
22365         __pyx_v_allele = __pyx_t_4;
22366         __pyx_t_4 = 0;
22367         __pyx_t_12 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22368         __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22369         __Pyx_GOTREF(__pyx_t_4);
22370         if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22371         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22372       }
22373       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22374       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22375       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
22376       __Pyx_INCREF(((PyObject *)__pyx_t_1));
22377       PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
22378       __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
22379       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
22380       __pyx_t_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22381       __Pyx_GOTREF(__pyx_t_1);
22382       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
22383       __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22384       __Pyx_GOTREF(__pyx_t_5);
22385       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22386       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22387       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22388       if (!__pyx_t_3) {
22389         __pyx_t_6 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22390         __pyx_t_16 = (__pyx_t_6 == 0);
22391         __pyx_t_17 = __pyx_t_16;
22392       } else {
22393         __pyx_t_17 = __pyx_t_3;
22394       }
22395       if (__pyx_t_17) {
22396
22397         /* "cvcf.pyx":1114
22398  *                 alt = [allele[:-1] for allele in alt]
22399  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
22400  *                     ref = faref_leftflank[pos-left-1] + ref             # <<<<<<<<<<<<<<
22401  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
22402  *                     pos -= 1
22403  */
22404         __pyx_t_5 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22405         __Pyx_GOTREF(__pyx_t_5);
22406         __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22407         __Pyx_GOTREF(__pyx_t_1);
22408         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22409         __pyx_t_5 = PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22410         __Pyx_GOTREF(__pyx_t_5);
22411         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22412         __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_v_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22413         __Pyx_GOTREF(__pyx_t_1);
22414         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22415         __Pyx_DECREF(__pyx_v_ref);
22416         __pyx_v_ref = __pyx_t_1;
22417         __pyx_t_1 = 0;
22418
22419         /* "cvcf.pyx":1115
22420  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
22421  *                     ref = faref_leftflank[pos-left-1] + ref
22422  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]             # <<<<<<<<<<<<<<
22423  *                     pos -= 1
22424  * 
22425  */
22426         __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22427         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
22428         if (unlikely(__pyx_v_alt == Py_None)) {
22429           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
22430         }
22431         __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
22432         for (;;) {
22433           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
22434           __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
22435           __Pyx_DECREF(__pyx_v_allele);
22436           __pyx_v_allele = __pyx_t_4;
22437           __pyx_t_4 = 0;
22438           __pyx_t_4 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22439           __Pyx_GOTREF(__pyx_t_4);
22440           __pyx_t_13 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22441           __Pyx_GOTREF(__pyx_t_13);
22442           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22443           __pyx_t_4 = PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_13); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22444           __Pyx_GOTREF(__pyx_t_4);
22445           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22446           __pyx_t_13 = PyNumber_Add(__pyx_t_4, __pyx_v_allele); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22447           __Pyx_GOTREF(__pyx_t_13);
22448           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22449           if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_13))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22450           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22451         }
22452         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22453         __Pyx_INCREF(((PyObject *)__pyx_t_1));
22454         __Pyx_DECREF(((PyObject *)__pyx_v_alt));
22455         __pyx_v_alt = __pyx_t_1;
22456         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
22457
22458         /* "cvcf.pyx":1116
22459  *                     ref = faref_leftflank[pos-left-1] + ref
22460  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
22461  *                     pos -= 1             # <<<<<<<<<<<<<<
22462  * 
22463  * __all__ = [
22464  */
22465         __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22466         __Pyx_GOTREF(__pyx_t_1);
22467         __Pyx_DECREF(__pyx_v_pos);
22468         __pyx_v_pos = __pyx_t_1;
22469         __pyx_t_1 = 0;
22470         goto __pyx_L78;
22471       }
22472       __pyx_L78:;
22473     }
22474     __pyx_L69_break:;
22475     goto __pyx_L67;
22476   }
22477   __pyx_L67:;
22478
22479   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22480   goto __pyx_L0;
22481   __pyx_L1_error:;
22482   __Pyx_XDECREF(__pyx_t_1);
22483   __Pyx_XDECREF(__pyx_t_2);
22484   __Pyx_XDECREF(__pyx_t_4);
22485   __Pyx_XDECREF(__pyx_t_5);
22486   __Pyx_XDECREF(__pyx_t_7);
22487   __Pyx_XDECREF(__pyx_t_10);
22488   __Pyx_XDECREF(__pyx_t_13);
22489   __Pyx_XDECREF(__pyx_t_14);
22490   __Pyx_XDECREF(__pyx_t_15);
22491   __Pyx_XDECREF(__pyx_t_18);
22492   __Pyx_XDECREF(__pyx_t_19);
22493   __Pyx_AddTraceback("cvcf.VCF.validate");
22494   __pyx_r = NULL;
22495   __pyx_L0:;
22496   __Pyx_DECREF(__pyx_v_chrom);
22497   __Pyx_DECREF(__pyx_v_pos);
22498   __Pyx_DECREF(__pyx_v_ref);
22499   __Pyx_DECREF(__pyx_v_c);
22500   __Pyx_DECREF(__pyx_v_left);
22501   __Pyx_DECREF(__pyx_v_faref_leftflank);
22502   __Pyx_DECREF(__pyx_v_faref);
22503   __Pyx_DECREF(__pyx_v_f);
22504   __Pyx_DECREF(__pyx_v_newalts);
22505   __Pyx_DECREF(__pyx_v_a);
22506   __Pyx_DECREF(__pyx_v_l);
22507   __Pyx_DECREF(__pyx_v_addns);
22508   __Pyx_DECREF(__pyx_v_i);
22509   __Pyx_DECREF(__pyx_v_na);
22510   __Pyx_DECREF(__pyx_v_s);
22511   __Pyx_DECREF(__pyx_v_alt);
22512   __Pyx_DECREF(__pyx_v_addn);
22513   __Pyx_DECREF(__pyx_v_allele);
22514   __Pyx_DECREF(__pyx_v_longest);
22515   __Pyx_DECREF(__pyx_v_shortest);
22516   __Pyx_XGIVEREF(__pyx_r);
22517   __Pyx_RefNannyFinishContext();
22518   return __pyx_r;
22519 }
22520 static struct __pyx_vtabstruct_4cvcf_VCFRecord __pyx_vtable_4cvcf_VCFRecord;
22521
22522 static PyObject *__pyx_tp_new_4cvcf_VCFRecord(PyTypeObject *t, PyObject *a, PyObject *k) {
22523   struct __pyx_obj_4cvcf_VCFRecord *p;
22524   PyObject *o = __pyx_ptype_10TabProxies_TupleProxy->tp_new(t, a, k);
22525   if (!o) return 0;
22526   p = ((struct __pyx_obj_4cvcf_VCFRecord *)o);
22527   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10TabProxies_TupleProxy*)__pyx_vtabptr_4cvcf_VCFRecord;
22528   p->vcf = Py_None; Py_INCREF(Py_None);
22529   if (__pyx_pf_4cvcf_9VCFRecord_1__cinit__(o, a, k) < 0) {
22530     Py_DECREF(o); o = 0;
22531   }
22532   return o;
22533 }
22534
22535 static void __pyx_tp_dealloc_4cvcf_VCFRecord(PyObject *o) {
22536   struct __pyx_obj_4cvcf_VCFRecord *p = (struct __pyx_obj_4cvcf_VCFRecord *)o;
22537   Py_XDECREF(p->vcf);
22538   __pyx_ptype_10TabProxies_TupleProxy->tp_dealloc(o);
22539 }
22540
22541 static int __pyx_tp_traverse_4cvcf_VCFRecord(PyObject *o, visitproc v, void *a) {
22542   int e;
22543   struct __pyx_obj_4cvcf_VCFRecord *p = (struct __pyx_obj_4cvcf_VCFRecord *)o;
22544   if (__pyx_ptype_10TabProxies_TupleProxy->tp_traverse) {
22545     e = __pyx_ptype_10TabProxies_TupleProxy->tp_traverse(o, v, a); if (e) return e;
22546   }
22547   if (p->vcf) {
22548     e = (*v)(p->vcf, a); if (e) return e;
22549   }
22550   return 0;
22551 }
22552
22553 static int __pyx_tp_clear_4cvcf_VCFRecord(PyObject *o) {
22554   struct __pyx_obj_4cvcf_VCFRecord *p = (struct __pyx_obj_4cvcf_VCFRecord *)o;
22555   PyObject* tmp;
22556   if (__pyx_ptype_10TabProxies_TupleProxy->tp_clear) {
22557     __pyx_ptype_10TabProxies_TupleProxy->tp_clear(o);
22558   }
22559   tmp = ((PyObject*)p->vcf);
22560   p->vcf = Py_None; Py_INCREF(Py_None);
22561   Py_XDECREF(tmp);
22562   return 0;
22563 }
22564 static PyObject *__pyx_sq_item_4cvcf_VCFRecord(PyObject *o, Py_ssize_t i) {
22565   PyObject *r;
22566   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22567   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22568   Py_DECREF(x);
22569   return r;
22570 }
22571
22572 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_contig(PyObject *o, void *x) {
22573   return __pyx_pf_4cvcf_9VCFRecord_6contig___get__(o);
22574 }
22575
22576 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_pos(PyObject *o, void *x) {
22577   return __pyx_pf_4cvcf_9VCFRecord_3pos___get__(o);
22578 }
22579
22580 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_id(PyObject *o, void *x) {
22581   return __pyx_pf_4cvcf_9VCFRecord_2id___get__(o);
22582 }
22583
22584 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_ref(PyObject *o, void *x) {
22585   return __pyx_pf_4cvcf_9VCFRecord_3ref___get__(o);
22586 }
22587
22588 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_alt(PyObject *o, void *x) {
22589   return __pyx_pf_4cvcf_9VCFRecord_3alt___get__(o);
22590 }
22591
22592 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_qual(PyObject *o, void *x) {
22593   return __pyx_pf_4cvcf_9VCFRecord_4qual___get__(o);
22594 }
22595
22596 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_filter(PyObject *o, void *x) {
22597   return __pyx_pf_4cvcf_9VCFRecord_6filter___get__(o);
22598 }
22599
22600 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_info(PyObject *o, void *x) {
22601   return __pyx_pf_4cvcf_9VCFRecord_4info___get__(o);
22602 }
22603
22604 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_format(PyObject *o, void *x) {
22605   return __pyx_pf_4cvcf_9VCFRecord_6format___get__(o);
22606 }
22607
22608 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_samples(PyObject *o, void *x) {
22609   return __pyx_pf_4cvcf_9VCFRecord_7samples___get__(o);
22610 }
22611
22612 static PyMethodDef __pyx_methods_4cvcf_VCFRecord[] = {
22613   {0, 0, 0, 0}
22614 };
22615
22616 static struct PyGetSetDef __pyx_getsets_4cvcf_VCFRecord[] = {
22617   {(char *)"contig", __pyx_getprop_4cvcf_9VCFRecord_contig, 0, 0, 0},
22618   {(char *)"pos", __pyx_getprop_4cvcf_9VCFRecord_pos, 0, 0, 0},
22619   {(char *)"id", __pyx_getprop_4cvcf_9VCFRecord_id, 0, 0, 0},
22620   {(char *)"ref", __pyx_getprop_4cvcf_9VCFRecord_ref, 0, 0, 0},
22621   {(char *)"alt", __pyx_getprop_4cvcf_9VCFRecord_alt, 0, 0, 0},
22622   {(char *)"qual", __pyx_getprop_4cvcf_9VCFRecord_qual, 0, 0, 0},
22623   {(char *)"filter", __pyx_getprop_4cvcf_9VCFRecord_filter, 0, 0, 0},
22624   {(char *)"info", __pyx_getprop_4cvcf_9VCFRecord_info, 0, 0, 0},
22625   {(char *)"format", __pyx_getprop_4cvcf_9VCFRecord_format, 0, 0, 0},
22626   {(char *)"samples", __pyx_getprop_4cvcf_9VCFRecord_samples, 0, 0, 0},
22627   {0, 0, 0, 0, 0}
22628 };
22629
22630 static PyNumberMethods __pyx_tp_as_number_VCFRecord = {
22631   0, /*nb_add*/
22632   0, /*nb_subtract*/
22633   0, /*nb_multiply*/
22634   #if PY_MAJOR_VERSION < 3
22635   0, /*nb_divide*/
22636   #endif
22637   0, /*nb_remainder*/
22638   0, /*nb_divmod*/
22639   0, /*nb_power*/
22640   0, /*nb_negative*/
22641   0, /*nb_positive*/
22642   0, /*nb_absolute*/
22643   0, /*nb_nonzero*/
22644   0, /*nb_invert*/
22645   0, /*nb_lshift*/
22646   0, /*nb_rshift*/
22647   0, /*nb_and*/
22648   0, /*nb_xor*/
22649   0, /*nb_or*/
22650   #if PY_MAJOR_VERSION < 3
22651   0, /*nb_coerce*/
22652   #endif
22653   0, /*nb_int*/
22654   #if PY_MAJOR_VERSION < 3
22655   0, /*nb_long*/
22656   #else
22657   0, /*reserved*/
22658   #endif
22659   0, /*nb_float*/
22660   #if PY_MAJOR_VERSION < 3
22661   0, /*nb_oct*/
22662   #endif
22663   #if PY_MAJOR_VERSION < 3
22664   0, /*nb_hex*/
22665   #endif
22666   0, /*nb_inplace_add*/
22667   0, /*nb_inplace_subtract*/
22668   0, /*nb_inplace_multiply*/
22669   #if PY_MAJOR_VERSION < 3
22670   0, /*nb_inplace_divide*/
22671   #endif
22672   0, /*nb_inplace_remainder*/
22673   0, /*nb_inplace_power*/
22674   0, /*nb_inplace_lshift*/
22675   0, /*nb_inplace_rshift*/
22676   0, /*nb_inplace_and*/
22677   0, /*nb_inplace_xor*/
22678   0, /*nb_inplace_or*/
22679   0, /*nb_floor_divide*/
22680   0, /*nb_true_divide*/
22681   0, /*nb_inplace_floor_divide*/
22682   0, /*nb_inplace_true_divide*/
22683   #if PY_VERSION_HEX >= 0x02050000
22684   0, /*nb_index*/
22685   #endif
22686 };
22687
22688 static PySequenceMethods __pyx_tp_as_sequence_VCFRecord = {
22689   __pyx_pf_4cvcf_9VCFRecord_2__len__, /*sq_length*/
22690   0, /*sq_concat*/
22691   0, /*sq_repeat*/
22692   __pyx_sq_item_4cvcf_VCFRecord, /*sq_item*/
22693   0, /*sq_slice*/
22694   0, /*sq_ass_item*/
22695   0, /*sq_ass_slice*/
22696   0, /*sq_contains*/
22697   0, /*sq_inplace_concat*/
22698   0, /*sq_inplace_repeat*/
22699 };
22700
22701 static PyMappingMethods __pyx_tp_as_mapping_VCFRecord = {
22702   __pyx_pf_4cvcf_9VCFRecord_2__len__, /*mp_length*/
22703   __pyx_pf_4cvcf_9VCFRecord_3__getitem__, /*mp_subscript*/
22704   0, /*mp_ass_subscript*/
22705 };
22706
22707 static PyBufferProcs __pyx_tp_as_buffer_VCFRecord = {
22708   #if PY_MAJOR_VERSION < 3
22709   0, /*bf_getreadbuffer*/
22710   #endif
22711   #if PY_MAJOR_VERSION < 3
22712   0, /*bf_getwritebuffer*/
22713   #endif
22714   #if PY_MAJOR_VERSION < 3
22715   0, /*bf_getsegcount*/
22716   #endif
22717   #if PY_MAJOR_VERSION < 3
22718   0, /*bf_getcharbuffer*/
22719   #endif
22720   #if PY_VERSION_HEX >= 0x02060000
22721   0, /*bf_getbuffer*/
22722   #endif
22723   #if PY_VERSION_HEX >= 0x02060000
22724   0, /*bf_releasebuffer*/
22725   #endif
22726 };
22727
22728 static PyTypeObject __pyx_type_4cvcf_VCFRecord = {
22729   PyVarObject_HEAD_INIT(0, 0)
22730   __Pyx_NAMESTR("cvcf.VCFRecord"), /*tp_name*/
22731   sizeof(struct __pyx_obj_4cvcf_VCFRecord), /*tp_basicsize*/
22732   0, /*tp_itemsize*/
22733   __pyx_tp_dealloc_4cvcf_VCFRecord, /*tp_dealloc*/
22734   0, /*tp_print*/
22735   0, /*tp_getattr*/
22736   0, /*tp_setattr*/
22737   #if PY_MAJOR_VERSION < 3
22738   0, /*tp_compare*/
22739   #else
22740   0, /*reserved*/
22741   #endif
22742   0, /*tp_repr*/
22743   &__pyx_tp_as_number_VCFRecord, /*tp_as_number*/
22744   &__pyx_tp_as_sequence_VCFRecord, /*tp_as_sequence*/
22745   &__pyx_tp_as_mapping_VCFRecord, /*tp_as_mapping*/
22746   0, /*tp_hash*/
22747   0, /*tp_call*/
22748   0, /*tp_str*/
22749   0, /*tp_getattro*/
22750   0, /*tp_setattro*/
22751   &__pyx_tp_as_buffer_VCFRecord, /*tp_as_buffer*/
22752   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22753   __Pyx_DOCSTR("vcf record.\n\n    initialized from data and vcf meta \n    "), /*tp_doc*/
22754   __pyx_tp_traverse_4cvcf_VCFRecord, /*tp_traverse*/
22755   __pyx_tp_clear_4cvcf_VCFRecord, /*tp_clear*/
22756   0, /*tp_richcompare*/
22757   0, /*tp_weaklistoffset*/
22758   0, /*tp_iter*/
22759   0, /*tp_iternext*/
22760   __pyx_methods_4cvcf_VCFRecord, /*tp_methods*/
22761   0, /*tp_members*/
22762   __pyx_getsets_4cvcf_VCFRecord, /*tp_getset*/
22763   0, /*tp_base*/
22764   0, /*tp_dict*/
22765   0, /*tp_descr_get*/
22766   0, /*tp_descr_set*/
22767   0, /*tp_dictoffset*/
22768   __pyx_pf_4cvcf_9VCFRecord___init__, /*tp_init*/
22769   0, /*tp_alloc*/
22770   __pyx_tp_new_4cvcf_VCFRecord, /*tp_new*/
22771   0, /*tp_free*/
22772   0, /*tp_is_gc*/
22773   0, /*tp_bases*/
22774   0, /*tp_mro*/
22775   0, /*tp_cache*/
22776   0, /*tp_subclasses*/
22777   0, /*tp_weaklist*/
22778   0, /*tp_del*/
22779   #if PY_VERSION_HEX >= 0x02060000
22780   0, /*tp_version_tag*/
22781   #endif
22782 };
22783
22784 static PyObject *__pyx_tp_new_4cvcf_asVCFRecord(PyTypeObject *t, PyObject *a, PyObject *k) {
22785   struct __pyx_obj_4cvcf_asVCFRecord *p;
22786   PyObject *o = __pyx_ptype_6ctabix_Parser->tp_new(t, a, k);
22787   if (!o) return 0;
22788   p = ((struct __pyx_obj_4cvcf_asVCFRecord *)o);
22789   p->vcffile = Py_None; Py_INCREF(Py_None);
22790   return o;
22791 }
22792
22793 static void __pyx_tp_dealloc_4cvcf_asVCFRecord(PyObject *o) {
22794   struct __pyx_obj_4cvcf_asVCFRecord *p = (struct __pyx_obj_4cvcf_asVCFRecord *)o;
22795   Py_XDECREF(p->vcffile);
22796   __pyx_ptype_6ctabix_Parser->tp_dealloc(o);
22797 }
22798
22799 static int __pyx_tp_traverse_4cvcf_asVCFRecord(PyObject *o, visitproc v, void *a) {
22800   int e;
22801   struct __pyx_obj_4cvcf_asVCFRecord *p = (struct __pyx_obj_4cvcf_asVCFRecord *)o;
22802   if (__pyx_ptype_6ctabix_Parser->tp_traverse) {
22803     e = __pyx_ptype_6ctabix_Parser->tp_traverse(o, v, a); if (e) return e;
22804   }
22805   if (p->vcffile) {
22806     e = (*v)(p->vcffile, a); if (e) return e;
22807   }
22808   return 0;
22809 }
22810
22811 static int __pyx_tp_clear_4cvcf_asVCFRecord(PyObject *o) {
22812   struct __pyx_obj_4cvcf_asVCFRecord *p = (struct __pyx_obj_4cvcf_asVCFRecord *)o;
22813   PyObject* tmp;
22814   if (__pyx_ptype_6ctabix_Parser->tp_clear) {
22815     __pyx_ptype_6ctabix_Parser->tp_clear(o);
22816   }
22817   tmp = ((PyObject*)p->vcffile);
22818   p->vcffile = Py_None; Py_INCREF(Py_None);
22819   Py_XDECREF(tmp);
22820   return 0;
22821 }
22822
22823 static PyMethodDef __pyx_methods_4cvcf_asVCFRecord[] = {
22824   {0, 0, 0, 0}
22825 };
22826
22827 static PyNumberMethods __pyx_tp_as_number_asVCFRecord = {
22828   0, /*nb_add*/
22829   0, /*nb_subtract*/
22830   0, /*nb_multiply*/
22831   #if PY_MAJOR_VERSION < 3
22832   0, /*nb_divide*/
22833   #endif
22834   0, /*nb_remainder*/
22835   0, /*nb_divmod*/
22836   0, /*nb_power*/
22837   0, /*nb_negative*/
22838   0, /*nb_positive*/
22839   0, /*nb_absolute*/
22840   0, /*nb_nonzero*/
22841   0, /*nb_invert*/
22842   0, /*nb_lshift*/
22843   0, /*nb_rshift*/
22844   0, /*nb_and*/
22845   0, /*nb_xor*/
22846   0, /*nb_or*/
22847   #if PY_MAJOR_VERSION < 3
22848   0, /*nb_coerce*/
22849   #endif
22850   0, /*nb_int*/
22851   #if PY_MAJOR_VERSION < 3
22852   0, /*nb_long*/
22853   #else
22854   0, /*reserved*/
22855   #endif
22856   0, /*nb_float*/
22857   #if PY_MAJOR_VERSION < 3
22858   0, /*nb_oct*/
22859   #endif
22860   #if PY_MAJOR_VERSION < 3
22861   0, /*nb_hex*/
22862   #endif
22863   0, /*nb_inplace_add*/
22864   0, /*nb_inplace_subtract*/
22865   0, /*nb_inplace_multiply*/
22866   #if PY_MAJOR_VERSION < 3
22867   0, /*nb_inplace_divide*/
22868   #endif
22869   0, /*nb_inplace_remainder*/
22870   0, /*nb_inplace_power*/
22871   0, /*nb_inplace_lshift*/
22872   0, /*nb_inplace_rshift*/
22873   0, /*nb_inplace_and*/
22874   0, /*nb_inplace_xor*/
22875   0, /*nb_inplace_or*/
22876   0, /*nb_floor_divide*/
22877   0, /*nb_true_divide*/
22878   0, /*nb_inplace_floor_divide*/
22879   0, /*nb_inplace_true_divide*/
22880   #if PY_VERSION_HEX >= 0x02050000
22881   0, /*nb_index*/
22882   #endif
22883 };
22884
22885 static PySequenceMethods __pyx_tp_as_sequence_asVCFRecord = {
22886   0, /*sq_length*/
22887   0, /*sq_concat*/
22888   0, /*sq_repeat*/
22889   0, /*sq_item*/
22890   0, /*sq_slice*/
22891   0, /*sq_ass_item*/
22892   0, /*sq_ass_slice*/
22893   0, /*sq_contains*/
22894   0, /*sq_inplace_concat*/
22895   0, /*sq_inplace_repeat*/
22896 };
22897
22898 static PyMappingMethods __pyx_tp_as_mapping_asVCFRecord = {
22899   0, /*mp_length*/
22900   0, /*mp_subscript*/
22901   0, /*mp_ass_subscript*/
22902 };
22903
22904 static PyBufferProcs __pyx_tp_as_buffer_asVCFRecord = {
22905   #if PY_MAJOR_VERSION < 3
22906   0, /*bf_getreadbuffer*/
22907   #endif
22908   #if PY_MAJOR_VERSION < 3
22909   0, /*bf_getwritebuffer*/
22910   #endif
22911   #if PY_MAJOR_VERSION < 3
22912   0, /*bf_getsegcount*/
22913   #endif
22914   #if PY_MAJOR_VERSION < 3
22915   0, /*bf_getcharbuffer*/
22916   #endif
22917   #if PY_VERSION_HEX >= 0x02060000
22918   0, /*bf_getbuffer*/
22919   #endif
22920   #if PY_VERSION_HEX >= 0x02060000
22921   0, /*bf_releasebuffer*/
22922   #endif
22923 };
22924
22925 static PyTypeObject __pyx_type_4cvcf_asVCFRecord = {
22926   PyVarObject_HEAD_INIT(0, 0)
22927   __Pyx_NAMESTR("cvcf.asVCFRecord"), /*tp_name*/
22928   sizeof(struct __pyx_obj_4cvcf_asVCFRecord), /*tp_basicsize*/
22929   0, /*tp_itemsize*/
22930   __pyx_tp_dealloc_4cvcf_asVCFRecord, /*tp_dealloc*/
22931   0, /*tp_print*/
22932   0, /*tp_getattr*/
22933   0, /*tp_setattr*/
22934   #if PY_MAJOR_VERSION < 3
22935   0, /*tp_compare*/
22936   #else
22937   0, /*reserved*/
22938   #endif
22939   0, /*tp_repr*/
22940   &__pyx_tp_as_number_asVCFRecord, /*tp_as_number*/
22941   &__pyx_tp_as_sequence_asVCFRecord, /*tp_as_sequence*/
22942   &__pyx_tp_as_mapping_asVCFRecord, /*tp_as_mapping*/
22943   0, /*tp_hash*/
22944   __pyx_pf_4cvcf_11asVCFRecord_1__call__, /*tp_call*/
22945   0, /*tp_str*/
22946   0, /*tp_getattro*/
22947   0, /*tp_setattro*/
22948   &__pyx_tp_as_buffer_asVCFRecord, /*tp_as_buffer*/
22949   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22950   __Pyx_DOCSTR("converts a :term:`tabix row` into a VCF record."), /*tp_doc*/
22951   __pyx_tp_traverse_4cvcf_asVCFRecord, /*tp_traverse*/
22952   __pyx_tp_clear_4cvcf_asVCFRecord, /*tp_clear*/
22953   0, /*tp_richcompare*/
22954   0, /*tp_weaklistoffset*/
22955   0, /*tp_iter*/
22956   0, /*tp_iternext*/
22957   __pyx_methods_4cvcf_asVCFRecord, /*tp_methods*/
22958   0, /*tp_members*/
22959   0, /*tp_getset*/
22960   0, /*tp_base*/
22961   0, /*tp_dict*/
22962   0, /*tp_descr_get*/
22963   0, /*tp_descr_set*/
22964   0, /*tp_dictoffset*/
22965   __pyx_pf_4cvcf_11asVCFRecord___init__, /*tp_init*/
22966   0, /*tp_alloc*/
22967   __pyx_tp_new_4cvcf_asVCFRecord, /*tp_new*/
22968   0, /*tp_free*/
22969   0, /*tp_is_gc*/
22970   0, /*tp_bases*/
22971   0, /*tp_mro*/
22972   0, /*tp_cache*/
22973   0, /*tp_subclasses*/
22974   0, /*tp_weaklist*/
22975   0, /*tp_del*/
22976   #if PY_VERSION_HEX >= 0x02060000
22977   0, /*tp_version_tag*/
22978   #endif
22979 };
22980
22981 static PyMethodDef __pyx_methods[] = {
22982   {0, 0, 0, 0}
22983 };
22984
22985 #if PY_MAJOR_VERSION >= 3
22986 static struct PyModuleDef __pyx_moduledef = {
22987     PyModuleDef_HEAD_INIT,
22988     __Pyx_NAMESTR("cvcf"),
22989     0, /* m_doc */
22990     -1, /* m_size */
22991     __pyx_methods /* m_methods */,
22992     NULL, /* m_reload */
22993     NULL, /* m_traverse */
22994     NULL, /* m_clear */
22995     NULL /* m_free */
22996 };
22997 #endif
22998
22999 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23000   {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
23001   {&__pyx_n_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 1},
23002   {&__pyx_kp_s_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 1, 0},
23003   {&__pyx_kp_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 0},
23004   {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
23005   {&__pyx_n_s_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 1, 1},
23006   {&__pyx_kp_s_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 1, 0},
23007   {&__pyx_n_s_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 1, 1},
23008   {&__pyx_kp_s_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 0, 1, 0},
23009   {&__pyx_n_s_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 0, 1, 1},
23010   {&__pyx_kp_s_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 1, 0},
23011   {&__pyx_kp_s_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 1, 0},
23012   {&__pyx_kp_s_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 1, 0},
23013   {&__pyx_kp_s_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 1, 0},
23014   {&__pyx_kp_s_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 1, 0},
23015   {&__pyx_kp_s_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 0, 1, 0},
23016   {&__pyx_kp_s_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 1, 0},
23017   {&__pyx_kp_s_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 1, 0},
23018   {&__pyx_kp_s_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 0, 1, 0},
23019   {&__pyx_kp_s_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 1, 0},
23020   {&__pyx_kp_s_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 0, 1, 0},
23021   {&__pyx_kp_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 0},
23022   {&__pyx_kp_s_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 0, 1, 0},
23023   {&__pyx_kp_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 0},
23024   {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
23025   {&__pyx_kp_s_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 1, 0},
23026   {&__pyx_kp_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 0},
23027   {&__pyx_kp_s_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 0},
23028   {&__pyx_kp_s_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 1, 0},
23029   {&__pyx_kp_s_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 0, 1, 0},
23030   {&__pyx_kp_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 0},
23031   {&__pyx_kp_s_146, __pyx_k_146, sizeof(__pyx_k_146), 0, 0, 1, 0},
23032   {&__pyx_kp_s_147, __pyx_k_147, sizeof(__pyx_k_147), 0, 0, 1, 0},
23033   {&__pyx_kp_s_148, __pyx_k_148, sizeof(__pyx_k_148), 0, 0, 1, 0},
23034   {&__pyx_kp_s_149, __pyx_k_149, sizeof(__pyx_k_149), 0, 0, 1, 0},
23035   {&__pyx_kp_s_150, __pyx_k_150, sizeof(__pyx_k_150), 0, 0, 1, 0},
23036   {&__pyx_kp_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 0},
23037   {&__pyx_kp_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 0},
23038   {&__pyx_kp_s_153, __pyx_k_153, sizeof(__pyx_k_153), 0, 0, 1, 0},
23039   {&__pyx_kp_s_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 0, 1, 0},
23040   {&__pyx_kp_s_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 1, 0},
23041   {&__pyx_kp_s_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 1, 0},
23042   {&__pyx_kp_s_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 1, 0},
23043   {&__pyx_kp_s_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 0, 1, 0},
23044   {&__pyx_kp_s_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 0, 1, 0},
23045   {&__pyx_kp_s_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 1, 0},
23046   {&__pyx_kp_s_161, __pyx_k_161, sizeof(__pyx_k_161), 0, 0, 1, 0},
23047   {&__pyx_kp_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 0},
23048   {&__pyx_n_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 1},
23049   {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
23050   {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
23051   {&__pyx_n_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 1},
23052   {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
23053   {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
23054   {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
23055   {&__pyx_n_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 1},
23056   {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
23057   {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
23058   {&__pyx_n_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 1},
23059   {&__pyx_n_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 1},
23060   {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
23061   {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
23062   {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
23063   {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
23064   {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
23065   {&__pyx_n_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 1},
23066   {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
23067   {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
23068   {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 0},
23069   {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0},
23070   {&__pyx_kp_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 0},
23071   {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
23072   {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0},
23073   {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0},
23074   {&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
23075   {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
23076   {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0},
23077   {&__pyx_kp_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 0},
23078   {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
23079   {&__pyx_kp_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 0},
23080   {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0},
23081   {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0},
23082   {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
23083   {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0},
23084   {&__pyx_n_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 1},
23085   {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
23086   {&__pyx_kp_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 0},
23087   {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
23088   {&__pyx_kp_s_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 1, 0},
23089   {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0},
23090   {&__pyx_n_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 1},
23091   {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0},
23092   {&__pyx_kp_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 0},
23093   {&__pyx_kp_b_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 0, 0},
23094   {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
23095   {&__pyx_n_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 1},
23096   {&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0},
23097   {&__pyx_kp_s_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 1, 0},
23098   {&__pyx_n_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 1},
23099   {&__pyx_n_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 1},
23100   {&__pyx_n_s_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 1, 1},
23101   {&__pyx_kp_b__0, __pyx_k__0, sizeof(__pyx_k__0), 0, 0, 0, 0},
23102   {&__pyx_kp_s__0, __pyx_k__0, sizeof(__pyx_k__0), 0, 0, 1, 0},
23103   {&__pyx_n_s__ACGTN, __pyx_k__ACGTN, sizeof(__pyx_k__ACGTN), 0, 0, 1, 1},
23104   {&__pyx_n_s__ALT, __pyx_k__ALT, sizeof(__pyx_k__ALT), 0, 0, 1, 1},
23105   {&__pyx_n_s__BAD_GENOTYPE, __pyx_k__BAD_GENOTYPE, sizeof(__pyx_k__BAD_GENOTYPE), 0, 0, 1, 1},
23106   {&__pyx_n_s__CHROM, __pyx_k__CHROM, sizeof(__pyx_k__CHROM), 0, 0, 1, 1},
23107   {&__pyx_n_s__Character, __pyx_k__Character, sizeof(__pyx_k__Character), 0, 0, 1, 1},
23108   {&__pyx_n_s__D, __pyx_k__D, sizeof(__pyx_k__D), 0, 0, 1, 1},
23109   {&__pyx_n_s__DP, __pyx_k__DP, sizeof(__pyx_k__DP), 0, 0, 1, 1},
23110   {&__pyx_n_s__Description, __pyx_k__Description, sizeof(__pyx_k__Description), 0, 0, 1, 1},
23111   {&__pyx_n_s__ERROR_INFO_STRING, __pyx_k__ERROR_INFO_STRING, sizeof(__pyx_k__ERROR_INFO_STRING), 0, 0, 1, 1},
23112   {&__pyx_n_s__ERROR_TRAILING_DATA, __pyx_k__ERROR_TRAILING_DATA, sizeof(__pyx_k__ERROR_TRAILING_DATA), 0, 0, 1, 1},
23113   {&__pyx_n_s__ERROR_UNKNOWN_KEY, __pyx_k__ERROR_UNKNOWN_KEY, sizeof(__pyx_k__ERROR_UNKNOWN_KEY), 0, 0, 1, 1},
23114   {&__pyx_n_s__Error, __pyx_k__Error, sizeof(__pyx_k__Error), 0, 0, 1, 1},
23115   {&__pyx_n_s__FILTER, __pyx_k__FILTER, sizeof(__pyx_k__FILTER), 0, 0, 1, 1},
23116   {&__pyx_n_s__FILTER_NOT_DEFINED, __pyx_k__FILTER_NOT_DEFINED, sizeof(__pyx_k__FILTER_NOT_DEFINED), 0, 0, 1, 1},
23117   {&__pyx_n_s__FORMAT, __pyx_k__FORMAT, sizeof(__pyx_k__FORMAT), 0, 0, 1, 1},
23118   {&__pyx_n_s__FORMAT_NOT_DEFINED, __pyx_k__FORMAT_NOT_DEFINED, sizeof(__pyx_k__FORMAT_NOT_DEFINED), 0, 0, 1, 1},
23119   {&__pyx_n_s__FT, __pyx_k__FT, sizeof(__pyx_k__FT), 0, 0, 1, 1},
23120   {&__pyx_n_s__Flag, __pyx_k__Flag, sizeof(__pyx_k__Flag), 0, 0, 1, 1},
23121   {&__pyx_n_s__Float, __pyx_k__Float, sizeof(__pyx_k__Float), 0, 0, 1, 1},
23122   {&__pyx_n_s__GQ, __pyx_k__GQ, sizeof(__pyx_k__GQ), 0, 0, 1, 1},
23123   {&__pyx_n_s__GT, __pyx_k__GT, sizeof(__pyx_k__GT), 0, 0, 1, 1},
23124   {&__pyx_n_s__GTdata, __pyx_k__GTdata, sizeof(__pyx_k__GTdata), 0, 0, 1, 1},
23125   {&__pyx_n_s__GTstring, __pyx_k__GTstring, sizeof(__pyx_k__GTstring), 0, 0, 1, 1},
23126   {&__pyx_n_s__Genotype, __pyx_k__Genotype, sizeof(__pyx_k__Genotype), 0, 0, 1, 1},
23127   {&__pyx_n_s__HQ, __pyx_k__HQ, sizeof(__pyx_k__HQ), 0, 0, 1, 1},
23128   {&__pyx_n_s__I, __pyx_k__I, sizeof(__pyx_k__I), 0, 0, 1, 1},
23129   {&__pyx_n_s__ID, __pyx_k__ID, sizeof(__pyx_k__ID), 0, 0, 1, 1},
23130   {&__pyx_n_s__INFO, __pyx_k__INFO, sizeof(__pyx_k__INFO), 0, 0, 1, 1},
23131   {&__pyx_n_s__Integer, __pyx_k__Integer, sizeof(__pyx_k__Integer), 0, 0, 1, 1},
23132   {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
23133   {&__pyx_n_s__MISSING_REF, __pyx_k__MISSING_REF, sizeof(__pyx_k__MISSING_REF), 0, 0, 1, 1},
23134   {&__pyx_n_s__N, __pyx_k__N, sizeof(__pyx_k__N), 0, 0, 1, 1},
23135   {&__pyx_n_s__NT_ALLELES, __pyx_k__NT_ALLELES, sizeof(__pyx_k__NT_ALLELES), 0, 0, 1, 1},
23136   {&__pyx_n_s__NT_GENOTYPES, __pyx_k__NT_GENOTYPES, sizeof(__pyx_k__NT_GENOTYPES), 0, 0, 1, 1},
23137   {&__pyx_n_s__NT_NR_ALLELES, __pyx_k__NT_NR_ALLELES, sizeof(__pyx_k__NT_NR_ALLELES), 0, 0, 1, 1},
23138   {&__pyx_n_s__NT_NUMBER, __pyx_k__NT_NUMBER, sizeof(__pyx_k__NT_NUMBER), 0, 0, 1, 1},
23139   {&__pyx_n_s__NT_PHASED_GENOTYPES, __pyx_k__NT_PHASED_GENOTYPES, sizeof(__pyx_k__NT_PHASED_GENOTYPES), 0, 0, 1, 1},
23140   {&__pyx_n_s__NT_UNKNOWN, __pyx_k__NT_UNKNOWN, sizeof(__pyx_k__NT_UNKNOWN), 0, 0, 1, 1},
23141   {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
23142   {&__pyx_n_s__Number, __pyx_k__Number, sizeof(__pyx_k__Number), 0, 0, 1, 1},
23143   {&__pyx_n_b__PASS, __pyx_k__PASS, sizeof(__pyx_k__PASS), 0, 0, 0, 1},
23144   {&__pyx_n_s__PASS, __pyx_k__PASS, sizeof(__pyx_k__PASS), 0, 0, 1, 1},
23145   {&__pyx_n_s__POS, __pyx_k__POS, sizeof(__pyx_k__POS), 0, 0, 1, 1},
23146   {&__pyx_n_s__POS_NOT_NUMERICAL, __pyx_k__POS_NOT_NUMERICAL, sizeof(__pyx_k__POS_NOT_NUMERICAL), 0, 0, 1, 1},
23147   {&__pyx_n_s__POS_NOT_POSITIVE, __pyx_k__POS_NOT_POSITIVE, sizeof(__pyx_k__POS_NOT_POSITIVE), 0, 0, 1, 1},
23148   {&__pyx_n_s__QUAL, __pyx_k__QUAL, sizeof(__pyx_k__QUAL), 0, 0, 1, 1},
23149   {&__pyx_n_s__QUAL_NOT_NUMERICAL, __pyx_k__QUAL_NOT_NUMERICAL, sizeof(__pyx_k__QUAL_NOT_NUMERICAL), 0, 0, 1, 1},
23150   {&__pyx_n_s__REF, __pyx_k__REF, sizeof(__pyx_k__REF), 0, 0, 1, 1},
23151   {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
23152   {&__pyx_n_s__String, __pyx_k__String, sizeof(__pyx_k__String), 0, 0, 1, 1},
23153   {&__pyx_n_s__Tabixfile, __pyx_k__Tabixfile, sizeof(__pyx_k__Tabixfile), 0, 0, 1, 1},
23154   {&__pyx_n_s__Type, __pyx_k__Type, sizeof(__pyx_k__Type), 0, 0, 1, 1},
23155   {&__pyx_n_s__UNKNOWN_CHAR_IN_REF, __pyx_k__UNKNOWN_CHAR_IN_REF, sizeof(__pyx_k__UNKNOWN_CHAR_IN_REF), 0, 0, 1, 1},
23156   {&__pyx_n_s__V33_BAD_ALLELE, __pyx_k__V33_BAD_ALLELE, sizeof(__pyx_k__V33_BAD_ALLELE), 0, 0, 1, 1},
23157   {&__pyx_n_s__V33_BAD_REF, __pyx_k__V33_BAD_REF, sizeof(__pyx_k__V33_BAD_REF), 0, 0, 1, 1},
23158   {&__pyx_n_s__V40_BAD_ALLELE, __pyx_k__V40_BAD_ALLELE, sizeof(__pyx_k__V40_BAD_ALLELE), 0, 0, 1, 1},
23159   {&__pyx_n_s__VCF, __pyx_k__VCF, sizeof(__pyx_k__VCF), 0, 0, 1, 1},
23160   {&__pyx_n_s__VCFRecord, __pyx_k__VCFRecord, sizeof(__pyx_k__VCFRecord), 0, 0, 1, 1},
23161   {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
23162   {&__pyx_n_s__WRONG_REF, __pyx_k__WRONG_REF, sizeof(__pyx_k__WRONG_REF), 0, 0, 1, 1},
23163   {&__pyx_n_s__Warning, __pyx_k__Warning, sizeof(__pyx_k__Warning), 0, 0, 1, 1},
23164   {&__pyx_n_s__ZERO_LENGTH_ALLELE, __pyx_k__ZERO_LENGTH_ALLELE, sizeof(__pyx_k__ZERO_LENGTH_ALLELE), 0, 0, 1, 1},
23165   {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
23166   {&__pyx_n_s____dict__, __pyx_k____dict__, sizeof(__pyx_k____dict__), 0, 0, 1, 1},
23167   {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
23168   {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
23169   {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
23170   {&__pyx_n_s___add_definition, __pyx_k___add_definition, sizeof(__pyx_k___add_definition), 0, 0, 1, 1},
23171   {&__pyx_n_s___copy, __pyx_k___copy, sizeof(__pyx_k___copy), 0, 0, 1, 1},
23172   {&__pyx_n_s___errors, __pyx_k___errors, sizeof(__pyx_k___errors), 0, 0, 1, 1},
23173   {&__pyx_n_s___filter, __pyx_k___filter, sizeof(__pyx_k___filter), 0, 0, 1, 1},
23174   {&__pyx_n_s___format, __pyx_k___format, sizeof(__pyx_k___format), 0, 0, 1, 1},
23175   {&__pyx_n_s___header, __pyx_k___header, sizeof(__pyx_k___header), 0, 0, 1, 1},
23176   {&__pyx_n_s___ignored_errors, __pyx_k___ignored_errors, sizeof(__pyx_k___ignored_errors), 0, 0, 1, 1},
23177   {&__pyx_n_s___info, __pyx_k___info, sizeof(__pyx_k___info), 0, 0, 1, 1},
23178   {&__pyx_n_s___leftalign, __pyx_k___leftalign, sizeof(__pyx_k___leftalign), 0, 0, 1, 1},
23179   {&__pyx_n_s___line, __pyx_k___line, sizeof(__pyx_k___line), 0, 0, 1, 1},
23180   {&__pyx_n_s___lineno, __pyx_k___lineno, sizeof(__pyx_k___lineno), 0, 0, 1, 1},
23181   {&__pyx_n_s___lines, __pyx_k___lines, sizeof(__pyx_k___lines), 0, 0, 1, 1},
23182   {&__pyx_n_s___parse, __pyx_k___parse, sizeof(__pyx_k___parse), 0, 0, 1, 1},
23183   {&__pyx_n_s___parse_header, __pyx_k___parse_header, sizeof(__pyx_k___parse_header), 0, 0, 1, 1},
23184   {&__pyx_n_s___reference, __pyx_k___reference, sizeof(__pyx_k___reference), 0, 0, 1, 1},
23185   {&__pyx_n_s___regions, __pyx_k___regions, sizeof(__pyx_k___regions), 0, 0, 1, 1},
23186   {&__pyx_n_s___required, __pyx_k___required, sizeof(__pyx_k___required), 0, 0, 1, 1},
23187   {&__pyx_n_s___sample2column, __pyx_k___sample2column, sizeof(__pyx_k___sample2column), 0, 0, 1, 1},
23188   {&__pyx_n_s___samples, __pyx_k___samples, sizeof(__pyx_k___samples), 0, 0, 1, 1},
23189   {&__pyx_n_s___version, __pyx_k___version, sizeof(__pyx_k___version), 0, 0, 1, 1},
23190   {&__pyx_n_s___warn_errors, __pyx_k___warn_errors, sizeof(__pyx_k___warn_errors), 0, 0, 1, 1},
23191   {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1},
23192   {&__pyx_n_s__alleleRegEx, __pyx_k__alleleRegEx, sizeof(__pyx_k__alleleRegEx), 0, 0, 1, 1},
23193   {&__pyx_n_s__alt, __pyx_k__alt, sizeof(__pyx_k__alt), 0, 0, 1, 1},
23194   {&__pyx_n_s__alt1, __pyx_k__alt1, sizeof(__pyx_k__alt1), 0, 0, 1, 1},
23195   {&__pyx_n_s__alt2, __pyx_k__alt2, sizeof(__pyx_k__alt2), 0, 0, 1, 1},
23196   {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1},
23197   {&__pyx_n_s__bisect, __pyx_k__bisect, sizeof(__pyx_k__bisect), 0, 0, 1, 1},
23198   {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1},
23199   {&__pyx_n_s__chrom, __pyx_k__chrom, sizeof(__pyx_k__chrom), 0, 0, 1, 1},
23200   {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1},
23201   {&__pyx_n_s__compare_calls, __pyx_k__compare_calls, sizeof(__pyx_k__compare_calls), 0, 0, 1, 1},
23202   {&__pyx_n_s__compile, __pyx_k__compile, sizeof(__pyx_k__compile), 0, 0, 1, 1},
23203   {&__pyx_n_s__connect, __pyx_k__connect, sizeof(__pyx_k__connect), 0, 0, 1, 1},
23204   {&__pyx_n_s__contig, __pyx_k__contig, sizeof(__pyx_k__contig), 0, 0, 1, 1},
23205   {&__pyx_n_s__convertGT, __pyx_k__convertGT, sizeof(__pyx_k__convertGT), 0, 0, 1, 1},
23206   {&__pyx_n_s__convertGTback, __pyx_k__convertGTback, sizeof(__pyx_k__convertGTback), 0, 0, 1, 1},
23207   {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1},
23208   {&__pyx_n_s__cvcf, __pyx_k__cvcf, sizeof(__pyx_k__cvcf), 0, 0, 1, 1},
23209   {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
23210   {&__pyx_n_s__datagenerator, __pyx_k__datagenerator, sizeof(__pyx_k__datagenerator), 0, 0, 1, 1},
23211   {&__pyx_n_s__deepcopy, __pyx_k__deepcopy, sizeof(__pyx_k__deepcopy), 0, 0, 1, 1},
23212   {&__pyx_n_s__defaultdict, __pyx_k__defaultdict, sizeof(__pyx_k__defaultdict), 0, 0, 1, 1},
23213   {&__pyx_n_s__descr, __pyx_k__descr, sizeof(__pyx_k__descr), 0, 0, 1, 1},
23214   {&__pyx_n_s__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
23215   {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
23216   {&__pyx_n_s__endswith, __pyx_k__endswith, sizeof(__pyx_k__endswith), 0, 0, 1, 1},
23217   {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
23218   {&__pyx_n_s__error, __pyx_k__error, sizeof(__pyx_k__error), 0, 0, 1, 1},
23219   {&__pyx_n_s__errorstring, __pyx_k__errorstring, sizeof(__pyx_k__errorstring), 0, 0, 1, 1},
23220   {&__pyx_n_s__fa, __pyx_k__fa, sizeof(__pyx_k__fa), 0, 0, 1, 1},
23221   {&__pyx_n_s__fetch, __pyx_k__fetch, sizeof(__pyx_k__fetch), 0, 0, 1, 1},
23222   {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
23223   {&__pyx_n_s__fileformat, __pyx_k__fileformat, sizeof(__pyx_k__fileformat), 0, 0, 1, 1},
23224   {&__pyx_n_s__filename, __pyx_k__filename, sizeof(__pyx_k__filename), 0, 0, 1, 1},
23225   {&__pyx_n_s__filter, __pyx_k__filter, sizeof(__pyx_k__filter), 0, 0, 1, 1},
23226   {&__pyx_n_s__find, __pyx_k__find, sizeof(__pyx_k__find), 0, 0, 1, 1},
23227   {&__pyx_n_s__fmt, __pyx_k__fmt, sizeof(__pyx_k__fmt), 0, 0, 1, 1},
23228   {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
23229   {&__pyx_n_s__format_format, __pyx_k__format_format, sizeof(__pyx_k__format_format), 0, 0, 1, 1},
23230   {&__pyx_n_s__format_formatdata, __pyx_k__format_formatdata, sizeof(__pyx_k__format_formatdata), 0, 0, 1, 1},
23231   {&__pyx_n_s__formatdict, __pyx_k__formatdict, sizeof(__pyx_k__formatdict), 0, 0, 1, 1},
23232   {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
23233   {&__pyx_n_s__get_expected, __pyx_k__get_expected, sizeof(__pyx_k__get_expected), 0, 0, 1, 1},
23234   {&__pyx_n_s__get_sequence, __pyx_k__get_sequence, sizeof(__pyx_k__get_sequence), 0, 0, 1, 1},
23235   {&__pyx_n_s__getfilter, __pyx_k__getfilter, sizeof(__pyx_k__getfilter), 0, 0, 1, 1},
23236   {&__pyx_n_s__getformat, __pyx_k__getformat, sizeof(__pyx_k__getformat), 0, 0, 1, 1},
23237   {&__pyx_n_s__getheader, __pyx_k__getheader, sizeof(__pyx_k__getheader), 0, 0, 1, 1},
23238   {&__pyx_n_s__getinfo, __pyx_k__getinfo, sizeof(__pyx_k__getinfo), 0, 0, 1, 1},
23239   {&__pyx_n_s__getsamples, __pyx_k__getsamples, sizeof(__pyx_k__getsamples), 0, 0, 1, 1},
23240   {&__pyx_n_s__gtsRegEx, __pyx_k__gtsRegEx, sizeof(__pyx_k__gtsRegEx), 0, 0, 1, 1},
23241   {&__pyx_n_s__header, __pyx_k__header, sizeof(__pyx_k__header), 0, 0, 1, 1},
23242   {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
23243   {&__pyx_n_s__ignoreerror, __pyx_k__ignoreerror, sizeof(__pyx_k__ignoreerror), 0, 0, 1, 1},
23244   {&__pyx_n_s__info, __pyx_k__info, sizeof(__pyx_k__info), 0, 0, 1, 1},
23245   {&__pyx_n_s__inregion, __pyx_k__inregion, sizeof(__pyx_k__inregion), 0, 0, 1, 1},
23246   {&__pyx_n_s__itemgetter, __pyx_k__itemgetter, sizeof(__pyx_k__itemgetter), 0, 0, 1, 1},
23247   {&__pyx_n_s__itervalues, __pyx_k__itervalues, sizeof(__pyx_k__itervalues), 0, 0, 1, 1},
23248   {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
23249   {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
23250   {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
23251   {&__pyx_n_s__leftalign, __pyx_k__leftalign, sizeof(__pyx_k__leftalign), 0, 0, 1, 1},
23252   {&__pyx_n_s__len, __pyx_k__len, sizeof(__pyx_k__len), 0, 0, 1, 1},
23253   {&__pyx_n_s__line, __pyx_k__line, sizeof(__pyx_k__line), 0, 0, 1, 1},
23254   {&__pyx_n_s__lineparse, __pyx_k__lineparse, sizeof(__pyx_k__lineparse), 0, 0, 1, 1},
23255   {&__pyx_n_s__lines, __pyx_k__lines, sizeof(__pyx_k__lines), 0, 0, 1, 1},
23256   {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1},
23257   {&__pyx_n_s__match, __pyx_k__match, sizeof(__pyx_k__match), 0, 0, 1, 1},
23258   {&__pyx_n_s__min, __pyx_k__min, sizeof(__pyx_k__min), 0, 0, 1, 1},
23259   {&__pyx_n_s__missing, __pyx_k__missing, sizeof(__pyx_k__missing), 0, 0, 1, 1},
23260   {&__pyx_n_s__missingvalue, __pyx_k__missingvalue, sizeof(__pyx_k__missingvalue), 0, 0, 1, 1},
23261   {&__pyx_n_s__namedtuple, __pyx_k__namedtuple, sizeof(__pyx_k__namedtuple), 0, 0, 1, 1},
23262   {&__pyx_n_s__nfields, __pyx_k__nfields, sizeof(__pyx_k__nfields), 0, 0, 1, 1},
23263   {&__pyx_n_s__number, __pyx_k__number, sizeof(__pyx_k__number), 0, 0, 1, 1},
23264   {&__pyx_n_s__numbertype, __pyx_k__numbertype, sizeof(__pyx_k__numbertype), 0, 0, 1, 1},
23265   {&__pyx_n_s__object, __pyx_k__object, sizeof(__pyx_k__object), 0, 0, 1, 1},
23266   {&__pyx_n_s__offset, __pyx_k__offset, sizeof(__pyx_k__offset), 0, 0, 1, 1},
23267   {&__pyx_n_s__operator, __pyx_k__operator, sizeof(__pyx_k__operator), 0, 0, 1, 1},
23268   {&__pyx_n_s__opt, __pyx_k__opt, sizeof(__pyx_k__opt), 0, 0, 1, 1},
23269   {&__pyx_n_s__parse, __pyx_k__parse, sizeof(__pyx_k__parse), 0, 0, 1, 1},
23270   {&__pyx_n_s__parse_data, __pyx_k__parse_data, sizeof(__pyx_k__parse_data), 0, 0, 1, 1},
23271   {&__pyx_n_s__parse_format, __pyx_k__parse_format, sizeof(__pyx_k__parse_format), 0, 0, 1, 1},
23272   {&__pyx_n_s__parse_formatdata, __pyx_k__parse_formatdata, sizeof(__pyx_k__parse_formatdata), 0, 0, 1, 1},
23273   {&__pyx_n_s__parse_header, __pyx_k__parse_header, sizeof(__pyx_k__parse_header), 0, 0, 1, 1},
23274   {&__pyx_n_s__parse_heading, __pyx_k__parse_heading, sizeof(__pyx_k__parse_heading), 0, 0, 1, 1},
23275   {&__pyx_n_s__parse_regions, __pyx_k__parse_regions, sizeof(__pyx_k__parse_regions), 0, 0, 1, 1},
23276   {&__pyx_n_s__parser, __pyx_k__parser, sizeof(__pyx_k__parser), 0, 0, 1, 1},
23277   {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1},
23278   {&__pyx_n_s__pos1, __pyx_k__pos1, sizeof(__pyx_k__pos1), 0, 0, 1, 1},
23279   {&__pyx_n_s__pos2, __pyx_k__pos2, sizeof(__pyx_k__pos2), 0, 0, 1, 1},
23280   {&__pyx_n_s__pysam, __pyx_k__pysam, sizeof(__pyx_k__pysam), 0, 0, 1, 1},
23281   {&__pyx_n_s__qual, __pyx_k__qual, sizeof(__pyx_k__qual), 0, 0, 1, 1},
23282   {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
23283   {&__pyx_n_s__re, __pyx_k__re, sizeof(__pyx_k__re), 0, 0, 1, 1},
23284   {&__pyx_n_s__record, __pyx_k__record, sizeof(__pyx_k__record), 0, 0, 1, 1},
23285   {&__pyx_n_s__ref, __pyx_k__ref, sizeof(__pyx_k__ref), 0, 0, 1, 1},
23286   {&__pyx_n_s__ref1, __pyx_k__ref1, sizeof(__pyx_k__ref1), 0, 0, 1, 1},
23287   {&__pyx_n_s__ref2, __pyx_k__ref2, sizeof(__pyx_k__ref2), 0, 0, 1, 1},
23288   {&__pyx_n_s__reference, __pyx_k__reference, sizeof(__pyx_k__reference), 0, 0, 1, 1},
23289   {&__pyx_n_s__region, __pyx_k__region, sizeof(__pyx_k__region), 0, 0, 1, 1},
23290   {&__pyx_n_s__regions, __pyx_k__regions, sizeof(__pyx_k__regions), 0, 0, 1, 1},
23291   {&__pyx_n_s__replace, __pyx_k__replace, sizeof(__pyx_k__replace), 0, 0, 1, 1},
23292   {&__pyx_n_s__samples, __pyx_k__samples, sizeof(__pyx_k__samples), 0, 0, 1, 1},
23293   {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
23294   {&__pyx_n_s__separator, __pyx_k__separator, sizeof(__pyx_k__separator), 0, 0, 1, 1},
23295   {&__pyx_n_s__setfilter, __pyx_k__setfilter, sizeof(__pyx_k__setfilter), 0, 0, 1, 1},
23296   {&__pyx_n_s__setformat, __pyx_k__setformat, sizeof(__pyx_k__setformat), 0, 0, 1, 1},
23297   {&__pyx_n_s__setheader, __pyx_k__setheader, sizeof(__pyx_k__setheader), 0, 0, 1, 1},
23298   {&__pyx_n_s__setinfo, __pyx_k__setinfo, sizeof(__pyx_k__setinfo), 0, 0, 1, 1},
23299   {&__pyx_n_s__setreference, __pyx_k__setreference, sizeof(__pyx_k__setreference), 0, 0, 1, 1},
23300   {&__pyx_n_s__setregions, __pyx_k__setregions, sizeof(__pyx_k__setregions), 0, 0, 1, 1},
23301   {&__pyx_n_s__setsamples, __pyx_k__setsamples, sizeof(__pyx_k__setsamples), 0, 0, 1, 1},
23302   {&__pyx_n_s__setversion, __pyx_k__setversion, sizeof(__pyx_k__setversion), 0, 0, 1, 1},
23303   {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
23304   {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
23305   {&__pyx_n_s__startswith, __pyx_k__startswith, sizeof(__pyx_k__startswith), 0, 0, 1, 1},
23306   {&__pyx_n_s__stderr, __pyx_k__stderr, sizeof(__pyx_k__stderr), 0, 0, 1, 1},
23307   {&__pyx_n_s__stream, __pyx_k__stream, sizeof(__pyx_k__stream), 0, 0, 1, 1},
23308   {&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1},
23309   {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
23310   {&__pyx_n_s__tabixfile, __pyx_k__tabixfile, sizeof(__pyx_k__tabixfile), 0, 0, 1, 1},
23311   {&__pyx_n_s__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1},
23312   {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1},
23313   {&__pyx_n_s__validate, __pyx_k__validate, sizeof(__pyx_k__validate), 0, 0, 1, 1},
23314   {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
23315   {&__pyx_n_s__vcf, __pyx_k__vcf, sizeof(__pyx_k__vcf), 0, 0, 1, 1},
23316   {&__pyx_n_s__vcffile, __pyx_k__vcffile, sizeof(__pyx_k__vcffile), 0, 0, 1, 1},
23317   {&__pyx_n_s__version, __pyx_k__version, sizeof(__pyx_k__version), 0, 0, 1, 1},
23318   {&__pyx_n_s__warnerror, __pyx_k__warnerror, sizeof(__pyx_k__warnerror), 0, 0, 1, 1},
23319   {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
23320   {&__pyx_n_s__write_data, __pyx_k__write_data, sizeof(__pyx_k__write_data), 0, 0, 1, 1},
23321   {&__pyx_n_s__write_header, __pyx_k__write_header, sizeof(__pyx_k__write_header), 0, 0, 1, 1},
23322   {&__pyx_n_s__write_heading, __pyx_k__write_heading, sizeof(__pyx_k__write_heading), 0, 0, 1, 1},
23323   {&__pyx_n_s__writeheader, __pyx_k__writeheader, sizeof(__pyx_k__writeheader), 0, 0, 1, 1},
23324   {&__pyx_n_s__zip, __pyx_k__zip, sizeof(__pyx_k__zip), 0, 0, 1, 1},
23325   {0, 0, 0, 0, 0, 0, 0}
23326 };
23327 static int __Pyx_InitCachedBuiltins(void) {
23328   __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23329   __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23330   __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23331   __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23332   __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23333   __pyx_builtin_min = __Pyx_GetName(__pyx_b, __pyx_n_s__min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23334   __pyx_builtin_len = __Pyx_GetName(__pyx_b, __pyx_n_s__len); if (!__pyx_builtin_len) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23335   __pyx_builtin_zip = __Pyx_GetName(__pyx_b, __pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23336   __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23337   __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23338   __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23339   return 0;
23340   __pyx_L1_error:;
23341   return -1;
23342 }
23343
23344 static int __Pyx_InitCachedConstants(void) {
23345   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
23346
23347   /* "cvcf.pyx":70
23348  * def parse_regions( string ):
23349  *     result = []
23350  *     for r in string.split(','):             # <<<<<<<<<<<<<<
23351  *         elts = r.split(':')
23352  *         chrom, start, end = elts[0], 0, 3000000000
23353  */
23354   __pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23355   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_3));
23356   __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
23357   PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, ((PyObject *)__pyx_kp_s_2));
23358   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
23359   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
23360
23361   /* "cvcf.pyx":71
23362  *     result = []
23363  *     for r in string.split(','):
23364  *         elts = r.split(':')             # <<<<<<<<<<<<<<
23365  *         chrom, start, end = elts[0], 0, 3000000000
23366  *         if len(elts)==1: pass
23367  */
23368   __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23369   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5));
23370   __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
23371   PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_4));
23372   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
23373   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
23374
23375   /* "cvcf.pyx":76
23376  *         elif len(elts)==2:
23377  *             if len(elts[1])>0:
23378  *                 ielts = elts[1].split('-')             # <<<<<<<<<<<<<<
23379  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
23380  *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
23381  */
23382   __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23383   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7));
23384   __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
23385   PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_kp_s_6));
23386   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
23387   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
23388
23389   /* "cvcf.pyx":152
23390  *             alt = self.fields[4]
23391  *             if alt == ".": alt = []
23392  *             else: alt = alt.upper().split(',')             # <<<<<<<<<<<<<<
23393  *             return alt
23394  * 
23395  */
23396   __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23397   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10));
23398   __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
23399   PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_kp_s_2));
23400   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
23401   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
23402
23403   /* "cvcf.pyx":168
23404  *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
23405  *             if f == b"." or f == b"PASS" or f == b"0": return []
23406  *             else: return f.split(';')             # <<<<<<<<<<<<<<
23407  * 
23408  *     property info:
23409  */
23410   __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23411   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12));
23412   __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
23413   PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_11));
23414   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
23415   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
23416
23417   /* "cvcf.pyx":176
23418  *             info = {}
23419  *             if col != b".":
23420  *                 for blurp in col.split(';'):             # <<<<<<<<<<<<<<
23421  *                     elts = blurp.split('=')
23422  *                     if len(elts) == 1: v = None
23423  */
23424   __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23425   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_13));
23426   __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
23427   PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_11));
23428   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
23429   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
23430
23431   /* "cvcf.pyx":177
23432  *             if col != b".":
23433  *                 for blurp in col.split(';'):
23434  *                     elts = blurp.split('=')             # <<<<<<<<<<<<<<
23435  *                     if len(elts) == 1: v = None
23436  *                     elif len(elts) == 2: v = elts[1]
23437  */
23438   __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23439   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15));
23440   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
23441   PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14));
23442   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
23443   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));
23444
23445   /* "cvcf.pyx":186
23446  *     property format:
23447  *          def __get__(self):
23448  *              return self.fields[8].split(':')             # <<<<<<<<<<<<<<
23449  * 
23450  *     property samples:
23451  */
23452   __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23453   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_16));
23454   __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
23455   PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_4));
23456   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
23457   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
23458
23459   /* "cvcf.pyx":195
23460  * 
23461  *         # parse sample columns
23462  *         values = self.fields[self.vcf._sample2column[key]].split(':')             # <<<<<<<<<<<<<<
23463  *         alt = self.alt
23464  *         format = self.format
23465  */
23466   __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23467   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17));
23468   __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
23469   PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_4));
23470   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
23471   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
23472
23473   /* "cvcf.pyx":308
23474  *     def __init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False):
23475  *         # make error identifiers accessible by name
23476  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id             # <<<<<<<<<<<<<<
23477  *         if _copy != None:
23478  *             self._leftalign = _copy._leftalign
23479  */
23480   __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23481   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_23));
23482   __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
23483   PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_s_4));
23484   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
23485   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
23486
23487   /* "cvcf.pyx":329
23488  *     def error(self,line,error,opt=None):
23489  *         if error in self._ignored_errors: return
23490  *         errorlabel, errorstring = self._errors[error].split(':')             # <<<<<<<<<<<<<<
23491  *         if opt: errorstring = errorstring % opt
23492  *         errwarn = ["Error","Warning"][error in self._warn_errors]
23493  */
23494   __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23495   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_24));
23496   __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
23497   PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_4));
23498   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
23499   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
23500
23501   /* "cvcf.pyx":338
23502  *     def parse_format(self,line,format,filter=False):
23503  *         if self._version == 40:
23504  *             if not format.startswith('<'):             # <<<<<<<<<<<<<<
23505  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
23506  *                 format = "<"+format
23507  */
23508   __pyx_k_tuple_28 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23509   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_28));
23510   __Pyx_INCREF(((PyObject *)__pyx_kp_s_27));
23511   PyTuple_SET_ITEM(__pyx_k_tuple_28, 0, ((PyObject *)__pyx_kp_s_27));
23512   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27));
23513   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28));
23514
23515   /* "cvcf.pyx":341
23516  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
23517  *                 format = "<"+format
23518  *             if not format.endswith('>'):             # <<<<<<<<<<<<<<
23519  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
23520  *                 format += ">"
23521  */
23522   __pyx_k_tuple_31 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23523   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_31));
23524   __Pyx_INCREF(((PyObject *)__pyx_kp_s_30));
23525   PyTuple_SET_ITEM(__pyx_k_tuple_31, 0, ((PyObject *)__pyx_kp_s_30));
23526   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_30));
23527   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));
23528
23529   /* "cvcf.pyx":348
23530  *         idx = 0
23531  *         while len(format.strip())>0:
23532  *             elts = format.strip().split(',')             # <<<<<<<<<<<<<<
23533  *             first, rest = elts[0], ','.join(elts[1:])
23534  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
23535  */
23536   __pyx_k_tuple_32 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23537   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_32));
23538   __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
23539   PyTuple_SET_ITEM(__pyx_k_tuple_32, 0, ((PyObject *)__pyx_kp_s_2));
23540   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
23541   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));
23542
23543   /* "cvcf.pyx":350
23544  *             elts = format.strip().split(',')
23545  *             first, rest = elts[0], ','.join(elts[1:])
23546  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):             # <<<<<<<<<<<<<<
23547  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
23548  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
23549  */
23550   __pyx_k_tuple_33 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23551   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_33));
23552   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
23553   PyTuple_SET_ITEM(__pyx_k_tuple_33, 0, ((PyObject *)__pyx_kp_s_14));
23554   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
23555   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));
23556   __pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23557   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_35));
23558   __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
23559   PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_s_34));
23560   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
23561   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
23562   __pyx_k_tuple_36 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23563   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_36));
23564   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
23565   PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, ((PyObject *)__pyx_kp_s_14));
23566   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
23567   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));
23568   __pyx_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23569   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_37));
23570   __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
23571   PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_s_34));
23572   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
23573   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
23574
23575   /* "cvcf.pyx":354
23576  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
23577  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
23578  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]             # <<<<<<<<<<<<<<
23579  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
23580  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
23581  */
23582   __pyx_k_tuple_44 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23583   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_44));
23584   __Pyx_INCREF(((PyObject *)__pyx_kp_s_40));
23585   PyTuple_SET_ITEM(__pyx_k_tuple_44, 0, ((PyObject *)__pyx_kp_s_40));
23586   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40));
23587   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));
23588   __pyx_k_tuple_45 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23589   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_45));
23590   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
23591   PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, ((PyObject *)__pyx_kp_s_14));
23592   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
23593   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));
23594
23595   /* "cvcf.pyx":355
23596  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
23597  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
23598  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]             # <<<<<<<<<<<<<<
23599  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
23600  *             elif first.startswith('Description='):
23601  */
23602   __pyx_k_tuple_46 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23603   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_46));
23604   __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
23605   PyTuple_SET_ITEM(__pyx_k_tuple_46, 0, ((PyObject *)__pyx_kp_s_41));
23606   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41));
23607   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));
23608   __pyx_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23609   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_47));
23610   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
23611   PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_kp_s_14));
23612   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
23613   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));
23614
23615   /* "cvcf.pyx":356
23616  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
23617  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
23618  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]             # <<<<<<<<<<<<<<
23619  *             elif first.startswith('Description='):
23620  *                 elts = format.split('"')
23621  */
23622   __pyx_k_tuple_48 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23623   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_48));
23624   __Pyx_INCREF(((PyObject *)__pyx_kp_s_42));
23625   PyTuple_SET_ITEM(__pyx_k_tuple_48, 0, ((PyObject *)__pyx_kp_s_42));
23626   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42));
23627   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48));
23628   __pyx_k_tuple_49 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23629   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_49));
23630   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
23631   PyTuple_SET_ITEM(__pyx_k_tuple_49, 0, ((PyObject *)__pyx_kp_s_14));
23632   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
23633   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));
23634
23635   /* "cvcf.pyx":357
23636  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
23637  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
23638  *             elif first.startswith('Description='):             # <<<<<<<<<<<<<<
23639  *                 elts = format.split('"')
23640  *                 if len(elts)<3:
23641  */
23642   __pyx_k_tuple_50 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23643   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_50));
23644   __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
23645   PyTuple_SET_ITEM(__pyx_k_tuple_50, 0, ((PyObject *)__pyx_kp_s_43));
23646   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
23647   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));
23648
23649   /* "cvcf.pyx":358
23650  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
23651  *             elif first.startswith('Description='):
23652  *                 elts = format.split('"')             # <<<<<<<<<<<<<<
23653  *                 if len(elts)<3:
23654  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
23655  */
23656   __pyx_k_tuple_51 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23657   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_51));
23658   __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
23659   PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, ((PyObject *)__pyx_kp_s_34));
23660   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
23661   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));
23662
23663   /* "cvcf.pyx":361
23664  *                 if len(elts)<3:
23665  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
23666  *                     elts = first.split('=') + [rest]             # <<<<<<<<<<<<<<
23667  *                 data['descr'] = elts[1]
23668  *                 rest = '"'.join(elts[2:])
23669  */
23670   __pyx_k_tuple_53 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23671   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_53));
23672   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
23673   PyTuple_SET_ITEM(__pyx_k_tuple_53, 0, ((PyObject *)__pyx_kp_s_14));
23674   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
23675   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));
23676
23677   /* "cvcf.pyx":364
23678  *                 data['descr'] = elts[1]
23679  *                 rest = '"'.join(elts[2:])
23680  *                 if rest.startswith(','): rest = rest[1:]             # <<<<<<<<<<<<<<
23681  *             else:
23682  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
23683  */
23684   __pyx_k_tuple_54 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23685   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_54));
23686   __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
23687   PyTuple_SET_ITEM(__pyx_k_tuple_54, 0, ((PyObject *)__pyx_kp_s_2));
23688   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
23689   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
23690
23691   /* "cvcf.pyx":474
23692  *         # snip off trailing missing data
23693  *         while len(output) > 1:
23694  *             last = output[-1].replace(',','').replace('.','')             # <<<<<<<<<<<<<<
23695  *             if len(last)>0: break
23696  *             output = output[:-1]
23697  */
23698   __pyx_k_tuple_67 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23699   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_67));
23700   __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
23701   PyTuple_SET_ITEM(__pyx_k_tuple_67, 0, ((PyObject *)__pyx_kp_s_2));
23702   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
23703   __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
23704   PyTuple_SET_ITEM(__pyx_k_tuple_67, 1, ((PyObject *)__pyx_kp_s_1));
23705   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
23706   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));
23707   __pyx_k_tuple_68 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23708   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_68));
23709   __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
23710   PyTuple_SET_ITEM(__pyx_k_tuple_68, 0, ((PyObject *)__pyx_kp_s_9));
23711   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
23712   __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
23713   PyTuple_SET_ITEM(__pyx_k_tuple_68, 1, ((PyObject *)__pyx_kp_s_1));
23714   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
23715   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));
23716
23717   /* "cvcf.pyx":490
23718  * 
23719  *     def parse_header( self, line ):
23720  *         assert line.startswith('##')             # <<<<<<<<<<<<<<
23721  *         elts = line[2:].split('=')
23722  *         key = elts[0].strip()
23723  */
23724   __pyx_k_tuple_74 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23725   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_74));
23726   __Pyx_INCREF(((PyObject *)__pyx_kp_s_73));
23727   PyTuple_SET_ITEM(__pyx_k_tuple_74, 0, ((PyObject *)__pyx_kp_s_73));
23728   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_73));
23729   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));
23730
23731   /* "cvcf.pyx":491
23732  *     def parse_header( self, line ):
23733  *         assert line.startswith('##')
23734  *         elts = line[2:].split('=')             # <<<<<<<<<<<<<<
23735  *         key = elts[0].strip()
23736  *         value = '='.join(elts[1:]).strip()
23737  */
23738   __pyx_k_tuple_75 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23739   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_75));
23740   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
23741   PyTuple_SET_ITEM(__pyx_k_tuple_75, 0, ((PyObject *)__pyx_kp_s_14));
23742   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
23743   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75));
23744
23745   /* "cvcf.pyx":526
23746  * 
23747  *     def parse_heading( self, line ):
23748  *         assert line.startswith('#')             # <<<<<<<<<<<<<<
23749  *         assert not line.startswith('##')
23750  *         headings = line[1:].split('\t')
23751  */
23752   __pyx_k_tuple_83 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23753   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_83));
23754   __Pyx_INCREF(((PyObject *)__pyx_kp_s_82));
23755   PyTuple_SET_ITEM(__pyx_k_tuple_83, 0, ((PyObject *)__pyx_kp_s_82));
23756   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_82));
23757   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_83));
23758
23759   /* "cvcf.pyx":527
23760  *     def parse_heading( self, line ):
23761  *         assert line.startswith('#')
23762  *         assert not line.startswith('##')             # <<<<<<<<<<<<<<
23763  *         headings = line[1:].split('\t')
23764  *         if len(headings)==1 and len(line[1:].split()) >= 9:
23765  */
23766   __pyx_k_tuple_84 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23767   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_84));
23768   __Pyx_INCREF(((PyObject *)__pyx_kp_s_73));
23769   PyTuple_SET_ITEM(__pyx_k_tuple_84, 0, ((PyObject *)__pyx_kp_s_73));
23770   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_73));
23771   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84));
23772
23773   /* "cvcf.pyx":528
23774  *         assert line.startswith('#')
23775  *         assert not line.startswith('##')
23776  *         headings = line[1:].split('\t')             # <<<<<<<<<<<<<<
23777  *         if len(headings)==1 and len(line[1:].split()) >= 9:
23778  *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
23779  */
23780   __pyx_k_tuple_86 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23781   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_86));
23782   __Pyx_INCREF(((PyObject *)__pyx_kp_s_85));
23783   PyTuple_SET_ITEM(__pyx_k_tuple_86, 0, ((PyObject *)__pyx_kp_s_85));
23784   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_85));
23785   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_86));
23786
23787   /* "cvcf.pyx":581
23788  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
23789  *             return []
23790  *         values = value.split(',')             # <<<<<<<<<<<<<<
23791  *         # deal with trailing data in some early VCF files
23792  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
23793  */
23794   __pyx_k_tuple_94 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23795   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_94));
23796   __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
23797   PyTuple_SET_ITEM(__pyx_k_tuple_94, 0, ((PyObject *)__pyx_kp_s_2));
23798   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
23799   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));
23800
23801   /* "cvcf.pyx":583
23802  *         values = value.split(',')
23803  *         # deal with trailing data in some early VCF files
23804  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:             # <<<<<<<<<<<<<<
23805  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
23806  *             values[-1] = values[-1].split(';')[0]
23807  */
23808   __pyx_k_tuple_95 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23809   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_95));
23810   __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
23811   PyTuple_SET_ITEM(__pyx_k_tuple_95, 0, ((PyObject *)__pyx_kp_s_11));
23812   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
23813   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_95));
23814
23815   /* "cvcf.pyx":585
23816  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
23817  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
23818  *             values[-1] = values[-1].split(';')[0]             # <<<<<<<<<<<<<<
23819  *         if f.type == "Integer":
23820  *             for idx,v in enumerate(values):
23821  */
23822   __pyx_k_tuple_96 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23823   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_96));
23824   __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
23825   PyTuple_SET_ITEM(__pyx_k_tuple_96, 0, ((PyObject *)__pyx_kp_s_11));
23826   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
23827   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96));
23828
23829   /* "cvcf.pyx":623
23830  * 
23831  *     def parse_data( self, line, lineparse=False ):
23832  *         cols = line.split('\t')             # <<<<<<<<<<<<<<
23833  *         if len(cols) != len(self._samples)+9:
23834  *             # gracefully deal with absent FORMAT column
23835  */
23836   __pyx_k_tuple_100 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23837   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_100));
23838   __Pyx_INCREF(((PyObject *)__pyx_kp_s_85));
23839   PyTuple_SET_ITEM(__pyx_k_tuple_100, 0, ((PyObject *)__pyx_kp_s_85));
23840   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_85));
23841   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100));
23842
23843   /* "cvcf.pyx":668
23844  *         # convert v3.3 to v4.0 alleles below
23845  *         if cols[4] == ".": alt = []
23846  *         else: alt = cols[4].upper().split(',')             # <<<<<<<<<<<<<<
23847  * 
23848  *         if cols[5] == ".": qual = -1
23849  */
23850   __pyx_k_tuple_104 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23851   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_104));
23852   __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
23853   PyTuple_SET_ITEM(__pyx_k_tuple_104, 0, ((PyObject *)__pyx_kp_s_2));
23854   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
23855   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));
23856
23857   /* "cvcf.pyx":677
23858  *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
23859  *         if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = []
23860  *         else: filter = cols[6].split(';')             # <<<<<<<<<<<<<<
23861  * 
23862  *         # dictionary of keys, and list of values
23863  */
23864   __pyx_k_tuple_105 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23865   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_105));
23866   __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
23867   PyTuple_SET_ITEM(__pyx_k_tuple_105, 0, ((PyObject *)__pyx_kp_s_11));
23868   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
23869   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_105));
23870
23871   /* "cvcf.pyx":682
23872  *         info = {}
23873  *         if cols[7] != ".":
23874  *             for blurp in cols[7].split(';'):             # <<<<<<<<<<<<<<
23875  *                 elts = blurp.split('=')
23876  *                 if len(elts) == 1: v = None
23877  */
23878   __pyx_k_tuple_106 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23879   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_106));
23880   __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
23881   PyTuple_SET_ITEM(__pyx_k_tuple_106, 0, ((PyObject *)__pyx_kp_s_11));
23882   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
23883   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_106));
23884
23885   /* "cvcf.pyx":683
23886  *         if cols[7] != ".":
23887  *             for blurp in cols[7].split(';'):
23888  *                 elts = blurp.split('=')             # <<<<<<<<<<<<<<
23889  *                 if len(elts) == 1: v = None
23890  *                 elif len(elts) == 2: v = elts[1]
23891  */
23892   __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23893   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_107));
23894   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
23895   PyTuple_SET_ITEM(__pyx_k_tuple_107, 0, ((PyObject *)__pyx_kp_s_14));
23896   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
23897   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107));
23898
23899   /* "cvcf.pyx":691
23900  *         # Gracefully deal with absent FORMAT column
23901  *         if cols[8] == "": format = []
23902  *         else: format = cols[8].split(':')             # <<<<<<<<<<<<<<
23903  * 
23904  *         # check: all filters are defined
23905  */
23906   __pyx_k_tuple_108 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23907   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_108));
23908   __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
23909   PyTuple_SET_ITEM(__pyx_k_tuple_108, 0, ((PyObject *)__pyx_kp_s_4));
23910   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
23911   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));
23912
23913   /* "cvcf.pyx":708
23914  *             for a in alt:
23915  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
23916  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference             # <<<<<<<<<<<<<<
23917  *                 elif a.startswith('D'): # allow D<seq> and D<num>
23918  *                     have_deletions = True
23919  */
23920   __pyx_k_tuple_109 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23921   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_109));
23922   __Pyx_INCREF(((PyObject *)__pyx_n_s__I));
23923   PyTuple_SET_ITEM(__pyx_k_tuple_109, 0, ((PyObject *)__pyx_n_s__I));
23924   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__I));
23925   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_109));
23926
23927   /* "cvcf.pyx":709
23928  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
23929  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
23930  *                 elif a.startswith('D'): # allow D<seq> and D<num>             # <<<<<<<<<<<<<<
23931  *                     have_deletions = True
23932  *                     try:
23933  */
23934   __pyx_k_tuple_110 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23935   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_110));
23936   __Pyx_INCREF(((PyObject *)__pyx_n_s__D));
23937   PyTuple_SET_ITEM(__pyx_k_tuple_110, 0, ((PyObject *)__pyx_n_s__D));
23938   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__D));
23939   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_110));
23940
23941   /* "cvcf.pyx":789
23942  *         for sample in cols[9:]:
23943  *             dict = {}
23944  *             values = sample.split(':')             # <<<<<<<<<<<<<<
23945  *             if len(values) > len(format):
23946  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
23947  */
23948   __pyx_k_tuple_114 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23949   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_114));
23950   __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
23951   PyTuple_SET_ITEM(__pyx_k_tuple_114, 0, ((PyObject *)__pyx_kp_s_4));
23952   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
23953   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_114));
23954
23955   /* "cvcf.pyx":855
23956  *         for line in stream:
23957  *             self._lineno += 1
23958  *             if line.startswith('##'):             # <<<<<<<<<<<<<<
23959  *                 self.parse_header( line.strip() )
23960  *             elif line.startswith('#'):
23961  */
23962   __pyx_k_tuple_116 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23963   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_116));
23964   __Pyx_INCREF(((PyObject *)__pyx_kp_s_73));
23965   PyTuple_SET_ITEM(__pyx_k_tuple_116, 0, ((PyObject *)__pyx_kp_s_73));
23966   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_73));
23967   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_116));
23968
23969   /* "cvcf.pyx":857
23970  *             if line.startswith('##'):
23971  *                 self.parse_header( line.strip() )
23972  *             elif line.startswith('#'):             # <<<<<<<<<<<<<<
23973  *                 self.parse_heading( line.strip() )
23974  *                 self.enter_default_format()
23975  */
23976   __pyx_k_tuple_117 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23977   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_117));
23978   __Pyx_INCREF(((PyObject *)__pyx_kp_s_82));
23979   PyTuple_SET_ITEM(__pyx_k_tuple_117, 0, ((PyObject *)__pyx_kp_s_82));
23980   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_82));
23981   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_117));
23982
23983   /* "cvcf.pyx":921
23984  * 
23985  *     def setversion(self, version):
23986  *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")             # <<<<<<<<<<<<<<
23987  *         self._version = version
23988  * 
23989  */
23990   __pyx_k_tuple_120 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23991   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_120));
23992   __Pyx_INCREF(((PyObject *)__pyx_kp_s_119));
23993   PyTuple_SET_ITEM(__pyx_k_tuple_120, 0, ((PyObject *)__pyx_kp_s_119));
23994   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_119));
23995   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_120));
23996
23997   /* "cvcf.pyx":999
23998  *         '''
23999  * 
24000  *         raise NotImplementedError( "needs to be checked" )             # <<<<<<<<<<<<<<
24001  * 
24002  *         chrom, pos = record.chrom, record.pos
24003  */
24004   __pyx_k_tuple_123 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24005   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_123));
24006   __Pyx_INCREF(((PyObject *)__pyx_kp_s_122));
24007   PyTuple_SET_ITEM(__pyx_k_tuple_123, 0, ((PyObject *)__pyx_kp_s_122));
24008   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_122));
24009   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_123));
24010
24011   /* "cvcf.pyx":1040
24012  *             for a in alt:
24013  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
24014  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference             # <<<<<<<<<<<<<<
24015  *                 elif a.startswith('D'): # allow D<seq> and D<num>
24016  *                     have_deletions = True
24017  */
24018   __pyx_k_tuple_124 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24019   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_124));
24020   __Pyx_INCREF(((PyObject *)__pyx_n_s__I));
24021   PyTuple_SET_ITEM(__pyx_k_tuple_124, 0, ((PyObject *)__pyx_n_s__I));
24022   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__I));
24023   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_124));
24024
24025   /* "cvcf.pyx":1041
24026  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
24027  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
24028  *                 elif a.startswith('D'): # allow D<seq> and D<num>             # <<<<<<<<<<<<<<
24029  *                     have_deletions = True
24030  *                     try:
24031  */
24032   __pyx_k_tuple_125 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24033   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_125));
24034   __Pyx_INCREF(((PyObject *)__pyx_n_s__D));
24035   PyTuple_SET_ITEM(__pyx_k_tuple_125, 0, ((PyObject *)__pyx_n_s__D));
24036   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__D));
24037   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_125));
24038
24039   /* "cvcf.pyx":54
24040  * import pysam
24041  * 
24042  * gtsRegEx = re.compile("[|/\\\\]")             # <<<<<<<<<<<<<<
24043  * alleleRegEx = re.compile('^[ACGTN]+$')
24044  * 
24045  */
24046   __pyx_k_tuple_127 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24047   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_127));
24048   __Pyx_INCREF(((PyObject *)__pyx_kp_s_126));
24049   PyTuple_SET_ITEM(__pyx_k_tuple_127, 0, ((PyObject *)__pyx_kp_s_126));
24050   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_126));
24051   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_127));
24052
24053   /* "cvcf.pyx":55
24054  * 
24055  * gtsRegEx = re.compile("[|/\\\\]")
24056  * alleleRegEx = re.compile('^[ACGTN]+$')             # <<<<<<<<<<<<<<
24057  * 
24058  * # Utility function.  Uses 0-based coordinates
24059  */
24060   __pyx_k_tuple_129 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24061   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_129));
24062   __Pyx_INCREF(((PyObject *)__pyx_kp_s_128));
24063   PyTuple_SET_ITEM(__pyx_k_tuple_129, 0, ((PyObject *)__pyx_kp_s_128));
24064   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_128));
24065   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_129));
24066
24067   /* "cvcf.pyx":86
24068  * 
24069  * 
24070  * FORMAT = namedtuple('FORMAT','id numbertype number type description missingvalue')             # <<<<<<<<<<<<<<
24071  * 
24072  * ###########################################################################################################
24073  */
24074   __pyx_k_tuple_131 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24075   __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_131));
24076   __Pyx_INCREF(((PyObject *)__pyx_n_s__FORMAT));
24077   PyTuple_SET_ITEM(__pyx_k_tuple_131, 0, ((PyObject *)__pyx_n_s__FORMAT));
24078   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FORMAT));
24079   __Pyx_INCREF(((PyObject *)__pyx_kp_s_130));
24080   PyTuple_SET_ITEM(__pyx_k_tuple_131, 1, ((PyObject *)__pyx_kp_s_130));
24081   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_130));
24082   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_131));
24083   __Pyx_RefNannyFinishContext();
24084   return 0;
24085   __pyx_L1_error:;
24086   __Pyx_RefNannyFinishContext();
24087   return -1;
24088 }
24089
24090 static int __Pyx_InitGlobals(void) {
24091   #if PY_VERSION_HEX < 0x02040000
24092   if (unlikely(__Pyx_Py23SetsImport() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24093   #endif
24094   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24095   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24096   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24097   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24098   __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24099   __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24100   __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24101   __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24102   __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24103   __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24104   __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24105   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24106   __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24107   __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24108   __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24109   __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24110   __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24111   __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24112   __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24113   __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24114   __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24115   __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24116   __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24117   __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24118   __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24119   __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24120   __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24121   __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24122   __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24123   __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24124   __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24125   __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24126   __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24127   __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24128   __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24129   __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24130   __pyx_int_3000000000 = PyInt_FromString((char *)"3000000000", 0, 0); if (unlikely(!__pyx_int_3000000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24131   return 0;
24132   __pyx_L1_error:;
24133   return -1;
24134 }
24135
24136 #if PY_MAJOR_VERSION < 3
24137 PyMODINIT_FUNC initcvcf(void); /*proto*/
24138 PyMODINIT_FUNC initcvcf(void)
24139 #else
24140 PyMODINIT_FUNC PyInit_cvcf(void); /*proto*/
24141 PyMODINIT_FUNC PyInit_cvcf(void)
24142 #endif
24143 {
24144   PyObject *__pyx_t_1 = NULL;
24145   PyObject *__pyx_t_2 = NULL;
24146   PyObject *__pyx_t_3 = NULL;
24147   #if CYTHON_REFNANNY
24148   void* __pyx_refnanny = NULL;
24149   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
24150   if (!__Pyx_RefNanny) {
24151       PyErr_Clear();
24152       __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
24153       if (!__Pyx_RefNanny)
24154           Py_FatalError("failed to import 'refnanny' module");
24155   }
24156   __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_cvcf(void)", __LINE__, __FILE__);
24157   #endif
24158   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24159   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24160   #ifdef __pyx_binding_PyCFunctionType_USED
24161   if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24162   #endif
24163   /*--- Library function declarations ---*/
24164   /*--- Threads initialization code ---*/
24165   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
24166   #ifdef WITH_THREAD /* Python build with threading support? */
24167   PyEval_InitThreads();
24168   #endif
24169   #endif
24170   /*--- Module creation code ---*/
24171   #if PY_MAJOR_VERSION < 3
24172   __pyx_m = Py_InitModule4(__Pyx_NAMESTR("cvcf"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
24173   #else
24174   __pyx_m = PyModule_Create(&__pyx_moduledef);
24175   #endif
24176   if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24177   #if PY_MAJOR_VERSION < 3
24178   Py_INCREF(__pyx_m);
24179   #endif
24180   __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
24181   if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24182   if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24183   /*--- Initialize various global constants etc. ---*/
24184   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24185   if (__pyx_module_is_main_cvcf) {
24186     if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
24187   }
24188   /*--- Builtin init code ---*/
24189   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24190   /*--- Constants init code ---*/
24191   if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24192   /*--- Global init code ---*/
24193   /*--- Function export code ---*/
24194   /*--- Type init code ---*/
24195   __pyx_ptype_10TabProxies_TupleProxy = __Pyx_ImportType("TabProxies", "TupleProxy", sizeof(struct __pyx_obj_10TabProxies_TupleProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_TupleProxy)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24196   __pyx_vtabptr_10TabProxies_TupleProxy = (struct __pyx_vtabstruct_10TabProxies_TupleProxy*)__Pyx_GetVtable(__pyx_ptype_10TabProxies_TupleProxy->tp_dict); if (unlikely(!__pyx_vtabptr_10TabProxies_TupleProxy)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24197   __pyx_vtabptr_4cvcf_VCFRecord = &__pyx_vtable_4cvcf_VCFRecord;
24198   __pyx_vtable_4cvcf_VCFRecord.__pyx_base = *__pyx_vtabptr_10TabProxies_TupleProxy;
24199   __pyx_vtable_4cvcf_VCFRecord.__pyx_base.update = (PyObject *(*)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t))__pyx_f_4cvcf_9VCFRecord_update;
24200   __pyx_type_4cvcf_VCFRecord.tp_base = __pyx_ptype_10TabProxies_TupleProxy;
24201   if (PyType_Ready(&__pyx_type_4cvcf_VCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24202   if (__Pyx_SetVtable(__pyx_type_4cvcf_VCFRecord.tp_dict, __pyx_vtabptr_4cvcf_VCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24203   if (__Pyx_SetAttrString(__pyx_m, "VCFRecord", (PyObject *)&__pyx_type_4cvcf_VCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24204   __pyx_ptype_4cvcf_VCFRecord = &__pyx_type_4cvcf_VCFRecord;
24205   __pyx_ptype_6ctabix_Parser = __Pyx_ImportType("ctabix", "Parser", sizeof(struct __pyx_obj_6ctabix_Parser), 1); if (unlikely(!__pyx_ptype_6ctabix_Parser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24206   __pyx_type_4cvcf_asVCFRecord.tp_base = __pyx_ptype_6ctabix_Parser;
24207   if (PyType_Ready(&__pyx_type_4cvcf_asVCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24208   if (__Pyx_SetAttrString(__pyx_m, "asVCFRecord", (PyObject *)&__pyx_type_4cvcf_asVCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24209   __pyx_ptype_4cvcf_asVCFRecord = &__pyx_type_4cvcf_asVCFRecord;
24210   /*--- Type import code ---*/
24211   __pyx_ptype_6ctabix_Tabixfile = __Pyx_ImportType("ctabix", "Tabixfile", sizeof(struct __pyx_obj_6ctabix_Tabixfile), 1); if (unlikely(!__pyx_ptype_6ctabix_Tabixfile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24212   __pyx_ptype_10TabProxies_GTFProxy = __Pyx_ImportType("TabProxies", "GTFProxy", sizeof(struct __pyx_obj_10TabProxies_GTFProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_GTFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24213   __pyx_vtabptr_10TabProxies_GTFProxy = (struct __pyx_vtabstruct_10TabProxies_GTFProxy*)__Pyx_GetVtable(__pyx_ptype_10TabProxies_GTFProxy->tp_dict); if (unlikely(!__pyx_vtabptr_10TabProxies_GTFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24214   __pyx_ptype_10TabProxies_NamedTupleProxy = __Pyx_ImportType("TabProxies", "NamedTupleProxy", sizeof(struct __pyx_obj_10TabProxies_NamedTupleProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_NamedTupleProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24215   __pyx_vtabptr_10TabProxies_NamedTupleProxy = (struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy*)__Pyx_GetVtable(__pyx_ptype_10TabProxies_NamedTupleProxy->tp_dict); if (unlikely(!__pyx_vtabptr_10TabProxies_NamedTupleProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24216   __pyx_ptype_10TabProxies_BedProxy = __Pyx_ImportType("TabProxies", "BedProxy", sizeof(struct __pyx_obj_10TabProxies_BedProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_BedProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24217   __pyx_vtabptr_10TabProxies_BedProxy = (struct __pyx_vtabstruct_10TabProxies_BedProxy*)__Pyx_GetVtable(__pyx_ptype_10TabProxies_BedProxy->tp_dict); if (unlikely(!__pyx_vtabptr_10TabProxies_BedProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24218   __pyx_ptype_10TabProxies_VCFProxy = __Pyx_ImportType("TabProxies", "VCFProxy", sizeof(struct __pyx_obj_10TabProxies_VCFProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_VCFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24219   __pyx_vtabptr_10TabProxies_VCFProxy = (struct __pyx_vtabstruct_10TabProxies_VCFProxy*)__Pyx_GetVtable(__pyx_ptype_10TabProxies_VCFProxy->tp_dict); if (unlikely(!__pyx_vtabptr_10TabProxies_VCFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24220   /*--- Function import code ---*/
24221   /*--- Execution code ---*/
24222
24223   /* "cvcf.pyx":46
24224  * #
24225  * 
24226  * from collections import namedtuple, defaultdict             # <<<<<<<<<<<<<<
24227  * from operator import itemgetter
24228  * import sys, re, copy, bisect
24229  */
24230   __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24231   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24232   __Pyx_INCREF(((PyObject *)__pyx_n_s__namedtuple));
24233   PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__namedtuple));
24234   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__namedtuple));
24235   __Pyx_INCREF(((PyObject *)__pyx_n_s__defaultdict));
24236   PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__defaultdict));
24237   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__defaultdict));
24238   __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24239   __Pyx_GOTREF(__pyx_t_2);
24240   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24241   __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__namedtuple); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24242   __Pyx_GOTREF(__pyx_t_1);
24243   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__namedtuple, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24244   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24245   __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24246   __Pyx_GOTREF(__pyx_t_1);
24247   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__defaultdict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24248   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24249   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24250
24251   /* "cvcf.pyx":47
24252  * 
24253  * from collections import namedtuple, defaultdict
24254  * from operator import itemgetter             # <<<<<<<<<<<<<<
24255  * import sys, re, copy, bisect
24256  * 
24257  */
24258   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24259   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
24260   __Pyx_INCREF(((PyObject *)__pyx_n_s__itemgetter));
24261   PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__itemgetter));
24262   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__itemgetter));
24263   __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__operator), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24264   __Pyx_GOTREF(__pyx_t_1);
24265   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
24266   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24267   __Pyx_GOTREF(__pyx_t_2);
24268   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__itemgetter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24269   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24270   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24271
24272   /* "cvcf.pyx":48
24273  * from collections import namedtuple, defaultdict
24274  * from operator import itemgetter
24275  * import sys, re, copy, bisect             # <<<<<<<<<<<<<<
24276  * 
24277  * cimport ctabix
24278  */
24279   __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24280   __Pyx_GOTREF(__pyx_t_1);
24281   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24282   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24283   __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__re), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24284   __Pyx_GOTREF(__pyx_t_1);
24285   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24286   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24287   __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__copy), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24288   __Pyx_GOTREF(__pyx_t_1);
24289   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__copy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24290   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24291   __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__bisect), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24292   __Pyx_GOTREF(__pyx_t_1);
24293   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bisect, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24294   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24295
24296   /* "cvcf.pyx":52
24297  * cimport ctabix
24298  * cimport TabProxies
24299  * import pysam             # <<<<<<<<<<<<<<
24300  * 
24301  * gtsRegEx = re.compile("[|/\\\\]")
24302  */
24303   __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__pysam), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24304   __Pyx_GOTREF(__pyx_t_1);
24305   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pysam, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24306   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24307
24308   /* "cvcf.pyx":54
24309  * import pysam
24310  * 
24311  * gtsRegEx = re.compile("[|/\\\\]")             # <<<<<<<<<<<<<<
24312  * alleleRegEx = re.compile('^[ACGTN]+$')
24313  * 
24314  */
24315   __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24316   __Pyx_GOTREF(__pyx_t_1);
24317   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24318   __Pyx_GOTREF(__pyx_t_2);
24319   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24320   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24321   __Pyx_GOTREF(__pyx_t_1);
24322   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24323   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gtsRegEx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24324   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24325
24326   /* "cvcf.pyx":55
24327  * 
24328  * gtsRegEx = re.compile("[|/\\\\]")
24329  * alleleRegEx = re.compile('^[ACGTN]+$')             # <<<<<<<<<<<<<<
24330  * 
24331  * # Utility function.  Uses 0-based coordinates
24332  */
24333   __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24334   __Pyx_GOTREF(__pyx_t_1);
24335   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24336   __Pyx_GOTREF(__pyx_t_2);
24337   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24338   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24339   __Pyx_GOTREF(__pyx_t_1);
24340   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24341   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__alleleRegEx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24342   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24343
24344   /* "cvcf.pyx":58
24345  * 
24346  * # Utility function.  Uses 0-based coordinates
24347  * def get_sequence(chrom, start, end, fa):             # <<<<<<<<<<<<<<
24348  *     # obtain sequence from .fa file, without truncation
24349  *     if end<=start: return ""
24350  */
24351   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cvcf_get_sequence, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24352   __Pyx_GOTREF(__pyx_t_1);
24353   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_sequence, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24354   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24355
24356   /* "cvcf.pyx":68
24357  * 
24358  * # Utility function.  Parses a region string
24359  * def parse_regions( string ):             # <<<<<<<<<<<<<<
24360  *     result = []
24361  *     for r in string.split(','):
24362  */
24363   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cvcf_1parse_regions, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24364   __Pyx_GOTREF(__pyx_t_1);
24365   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__parse_regions, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24366   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24367
24368   /* "cvcf.pyx":86
24369  * 
24370  * 
24371  * FORMAT = namedtuple('FORMAT','id numbertype number type description missingvalue')             # <<<<<<<<<<<<<<
24372  * 
24373  * ###########################################################################################################
24374  */
24375   __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__namedtuple); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24376   __Pyx_GOTREF(__pyx_t_1);
24377   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_131), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24378   __Pyx_GOTREF(__pyx_t_2);
24379   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24380   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FORMAT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24381   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24382
24383   /* "cvcf.pyx":232
24384  *         return r
24385  * 
24386  * class VCF(object):             # <<<<<<<<<<<<<<
24387  * 
24388  *     # types
24389  */
24390   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24391   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
24392
24393   /* "cvcf.pyx":235
24394  * 
24395  *     # types
24396  *     NT_UNKNOWN = 0             # <<<<<<<<<<<<<<
24397  *     NT_NUMBER = 1
24398  *     NT_ALLELES = 2
24399  */
24400   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__NT_UNKNOWN, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24401
24402   /* "cvcf.pyx":236
24403  *     # types
24404  *     NT_UNKNOWN = 0
24405  *     NT_NUMBER = 1             # <<<<<<<<<<<<<<
24406  *     NT_ALLELES = 2
24407  *     NT_NR_ALLELES = 3
24408  */
24409   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__NT_NUMBER, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24410
24411   /* "cvcf.pyx":237
24412  *     NT_UNKNOWN = 0
24413  *     NT_NUMBER = 1
24414  *     NT_ALLELES = 2             # <<<<<<<<<<<<<<
24415  *     NT_NR_ALLELES = 3
24416  *     NT_GENOTYPES = 4
24417  */
24418   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__NT_ALLELES, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24419
24420   /* "cvcf.pyx":238
24421  *     NT_NUMBER = 1
24422  *     NT_ALLELES = 2
24423  *     NT_NR_ALLELES = 3             # <<<<<<<<<<<<<<
24424  *     NT_GENOTYPES = 4
24425  *     NT_PHASED_GENOTYPES = 5
24426  */
24427   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__NT_NR_ALLELES, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24428
24429   /* "cvcf.pyx":239
24430  *     NT_ALLELES = 2
24431  *     NT_NR_ALLELES = 3
24432  *     NT_GENOTYPES = 4             # <<<<<<<<<<<<<<
24433  *     NT_PHASED_GENOTYPES = 5
24434  * 
24435  */
24436   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__NT_GENOTYPES, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24437
24438   /* "cvcf.pyx":240
24439  *     NT_NR_ALLELES = 3
24440  *     NT_GENOTYPES = 4
24441  *     NT_PHASED_GENOTYPES = 5             # <<<<<<<<<<<<<<
24442  * 
24443  *     _errors = { 0:"UNKNOWN_FORMAT_STRING:Unknown file format identifier",
24444  */
24445   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__NT_PHASED_GENOTYPES, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24446
24447   /* "cvcf.pyx":242
24448  *     NT_PHASED_GENOTYPES = 5
24449  * 
24450  *     _errors = { 0:"UNKNOWN_FORMAT_STRING:Unknown file format identifier",             # <<<<<<<<<<<<<<
24451  *                 1:"BADLY_FORMATTED_FORMAT_STRING:Formatting error in the format string",
24452  *                 2:"BADLY_FORMATTED_HEADING:Did not find 9 required headings (CHROM, POS, ..., FORMAT) %s",
24453  */
24454   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24455   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24456   if (PyDict_SetItem(__pyx_t_1, __pyx_int_0, ((PyObject *)__pyx_kp_s_132)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24457   if (PyDict_SetItem(__pyx_t_1, __pyx_int_1, ((PyObject *)__pyx_kp_s_133)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24458   if (PyDict_SetItem(__pyx_t_1, __pyx_int_2, ((PyObject *)__pyx_kp_s_134)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24459   if (PyDict_SetItem(__pyx_t_1, __pyx_int_3, ((PyObject *)__pyx_kp_s_135)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24460   if (PyDict_SetItem(__pyx_t_1, __pyx_int_4, ((PyObject *)__pyx_kp_s_136)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24461   if (PyDict_SetItem(__pyx_t_1, __pyx_int_5, ((PyObject *)__pyx_kp_s_137)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24462   if (PyDict_SetItem(__pyx_t_1, __pyx_int_6, ((PyObject *)__pyx_kp_s_138)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24463   if (PyDict_SetItem(__pyx_t_1, __pyx_int_7, ((PyObject *)__pyx_kp_s_139)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24464   if (PyDict_SetItem(__pyx_t_1, __pyx_int_8, ((PyObject *)__pyx_kp_s_140)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24465   if (PyDict_SetItem(__pyx_t_1, __pyx_int_9, ((PyObject *)__pyx_kp_s_141)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24466   if (PyDict_SetItem(__pyx_t_1, __pyx_int_10, ((PyObject *)__pyx_kp_s_142)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24467   if (PyDict_SetItem(__pyx_t_1, __pyx_int_11, ((PyObject *)__pyx_kp_s_143)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24468   if (PyDict_SetItem(__pyx_t_1, __pyx_int_12, ((PyObject *)__pyx_kp_s_144)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24469   if (PyDict_SetItem(__pyx_t_1, __pyx_int_13, ((PyObject *)__pyx_kp_s_145)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24470   if (PyDict_SetItem(__pyx_t_1, __pyx_int_14, ((PyObject *)__pyx_kp_s_146)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24471   if (PyDict_SetItem(__pyx_t_1, __pyx_int_15, ((PyObject *)__pyx_kp_s_147)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24472   if (PyDict_SetItem(__pyx_t_1, __pyx_int_16, ((PyObject *)__pyx_kp_s_148)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24473   if (PyDict_SetItem(__pyx_t_1, __pyx_int_17, ((PyObject *)__pyx_kp_s_149)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24474   if (PyDict_SetItem(__pyx_t_1, __pyx_int_18, ((PyObject *)__pyx_kp_s_150)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24475   if (PyDict_SetItem(__pyx_t_1, __pyx_int_19, ((PyObject *)__pyx_kp_s_151)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24476   if (PyDict_SetItem(__pyx_t_1, __pyx_int_20, ((PyObject *)__pyx_kp_s_152)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24477   if (PyDict_SetItem(__pyx_t_1, __pyx_int_21, ((PyObject *)__pyx_kp_s_153)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24478   if (PyDict_SetItem(__pyx_t_1, __pyx_int_22, ((PyObject *)__pyx_kp_s_154)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24479   if (PyDict_SetItem(__pyx_t_1, __pyx_int_23, ((PyObject *)__pyx_kp_s_155)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24480   if (PyDict_SetItem(__pyx_t_1, __pyx_int_24, ((PyObject *)__pyx_kp_s_156)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24481   if (PyDict_SetItem(__pyx_t_1, __pyx_int_25, ((PyObject *)__pyx_kp_s_157)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24482   if (PyDict_SetItem(__pyx_t_1, __pyx_int_26, ((PyObject *)__pyx_kp_s_158)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24483   if (PyDict_SetItem(__pyx_t_1, __pyx_int_27, ((PyObject *)__pyx_kp_s_159)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24484   if (PyDict_SetItem(__pyx_t_1, __pyx_int_28, ((PyObject *)__pyx_kp_s_160)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24485   if (PyDict_SetItem(__pyx_t_1, __pyx_int_29, ((PyObject *)__pyx_kp_s_161)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24486   if (PyDict_SetItem(__pyx_t_1, __pyx_int_30, ((PyObject *)__pyx_kp_s_162)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24487   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___errors, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24488   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24489
24490   /* "cvcf.pyx":276
24491  * 
24492  *     # tag-value pairs; tags are not unique; does not include fileformat, INFO, FILTER or FORMAT fields
24493  *     _header = []             # <<<<<<<<<<<<<<
24494  * 
24495  *     # version number; 33=v3.3; 40=v4.0
24496  */
24497   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24498   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24499   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___header, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24500   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24501
24502   /* "cvcf.pyx":279
24503  * 
24504  *     # version number; 33=v3.3; 40=v4.0
24505  *     _version = 40             # <<<<<<<<<<<<<<
24506  * 
24507  *     # info, filter and format data
24508  */
24509   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___version, __pyx_int_40) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24510
24511   /* "cvcf.pyx":282
24512  * 
24513  *     # info, filter and format data
24514  *     _info = {}             # <<<<<<<<<<<<<<
24515  *     _filter = {}
24516  *     _format = {}
24517  */
24518   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24519   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24520   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___info, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24521   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24522
24523   /* "cvcf.pyx":283
24524  *     # info, filter and format data
24525  *     _info = {}
24526  *     _filter = {}             # <<<<<<<<<<<<<<
24527  *     _format = {}
24528  * 
24529  */
24530   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24531   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24532   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___filter, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24533   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24534
24535   /* "cvcf.pyx":284
24536  *     _info = {}
24537  *     _filter = {}
24538  *     _format = {}             # <<<<<<<<<<<<<<
24539  * 
24540  *     # header; and required columns
24541  */
24542   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24543   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24544   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___format, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24545   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24546
24547   /* "cvcf.pyx":287
24548  * 
24549  *     # header; and required columns
24550  *     _required = ["CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO","FORMAT"]             # <<<<<<<<<<<<<<
24551  *     _samples = []
24552  * 
24553  */
24554   __pyx_t_1 = PyList_New(9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24555   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24556   __Pyx_INCREF(((PyObject *)__pyx_n_s__CHROM));
24557   PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__CHROM));
24558   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CHROM));
24559   __Pyx_INCREF(((PyObject *)__pyx_n_s__POS));
24560   PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__POS));
24561   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__POS));
24562   __Pyx_INCREF(((PyObject *)__pyx_n_s__ID));
24563   PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__ID));
24564   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ID));
24565   __Pyx_INCREF(((PyObject *)__pyx_n_s__REF));
24566   PyList_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__REF));
24567   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__REF));
24568   __Pyx_INCREF(((PyObject *)__pyx_n_s__ALT));
24569   PyList_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_s__ALT));
24570   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ALT));
24571   __Pyx_INCREF(((PyObject *)__pyx_n_s__QUAL));
24572   PyList_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_n_s__QUAL));
24573   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__QUAL));
24574   __Pyx_INCREF(((PyObject *)__pyx_n_s__FILTER));
24575   PyList_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_n_s__FILTER));
24576   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FILTER));
24577   __Pyx_INCREF(((PyObject *)__pyx_n_s__INFO));
24578   PyList_SET_ITEM(__pyx_t_1, 7, ((PyObject *)__pyx_n_s__INFO));
24579   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__INFO));
24580   __Pyx_INCREF(((PyObject *)__pyx_n_s__FORMAT));
24581   PyList_SET_ITEM(__pyx_t_1, 8, ((PyObject *)__pyx_n_s__FORMAT));
24582   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FORMAT));
24583   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___required, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24584   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24585
24586   /* "cvcf.pyx":288
24587  *     # header; and required columns
24588  *     _required = ["CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO","FORMAT"]
24589  *     _samples = []             # <<<<<<<<<<<<<<
24590  * 
24591  *     # control behaviour
24592  */
24593   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24594   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24595   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___samples, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24596   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24597
24598   /* "cvcf.pyx":291
24599  * 
24600  *     # control behaviour
24601  *     _ignored_errors = set([11])   # ERROR_UNKNOWN_KEY             # <<<<<<<<<<<<<<
24602  *     _warn_errors = set([])
24603  *     _leftalign = False
24604  */
24605   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24606   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24607   __Pyx_INCREF(__pyx_int_11);
24608   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_11);
24609   __Pyx_GIVEREF(__pyx_int_11);
24610   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24611   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24612   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
24613   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
24614   __pyx_t_1 = 0;
24615   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24616   __Pyx_GOTREF(__pyx_t_1);
24617   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24618   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___ignored_errors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24619   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24620
24621   /* "cvcf.pyx":292
24622  *     # control behaviour
24623  *     _ignored_errors = set([11])   # ERROR_UNKNOWN_KEY
24624  *     _warn_errors = set([])             # <<<<<<<<<<<<<<
24625  *     _leftalign = False
24626  * 
24627  */
24628   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24629   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24630   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24631   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24632   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
24633   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
24634   __pyx_t_1 = 0;
24635   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24636   __Pyx_GOTREF(__pyx_t_1);
24637   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24638   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___warn_errors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24639   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24640
24641   /* "cvcf.pyx":293
24642  *     _ignored_errors = set([11])   # ERROR_UNKNOWN_KEY
24643  *     _warn_errors = set([])
24644  *     _leftalign = False             # <<<<<<<<<<<<<<
24645  * 
24646  *     # reference sequence
24647  */
24648   __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24649   __Pyx_GOTREF(__pyx_t_1);
24650   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___leftalign, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24651   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24652
24653   /* "cvcf.pyx":296
24654  * 
24655  *     # reference sequence
24656  *     _reference = None             # <<<<<<<<<<<<<<
24657  * 
24658  *     # regions to include; None includes everything
24659  */
24660   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___reference, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24661
24662   /* "cvcf.pyx":299
24663  * 
24664  *     # regions to include; None includes everything
24665  *     _regions = None             # <<<<<<<<<<<<<<
24666  * 
24667  *     # statefull stuff
24668  */
24669   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___regions, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24670
24671   /* "cvcf.pyx":302
24672  * 
24673  *     # statefull stuff
24674  *     _lineno = -1             # <<<<<<<<<<<<<<
24675  *     _line = None
24676  *     _lines = None
24677  */
24678   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___lineno, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24679
24680   /* "cvcf.pyx":303
24681  *     # statefull stuff
24682  *     _lineno = -1
24683  *     _line = None             # <<<<<<<<<<<<<<
24684  *     _lines = None
24685  * 
24686  */
24687   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___line, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24688
24689   /* "cvcf.pyx":304
24690  *     _lineno = -1
24691  *     _line = None
24692  *     _lines = None             # <<<<<<<<<<<<<<
24693  * 
24694  *     def __init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False):
24695  */
24696   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___lines, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24697
24698   /* "cvcf.pyx":306
24699  *     _lines = None
24700  * 
24701  *     def __init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False):             # <<<<<<<<<<<<<<
24702  *         # make error identifiers accessible by name
24703  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id
24704  */
24705   __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24706   __Pyx_GOTREF(__pyx_t_1);
24707   __pyx_k_22 = __pyx_t_1;
24708   __Pyx_GIVEREF(__pyx_t_1);
24709   __pyx_t_1 = 0;
24710   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF___init__, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24711   __Pyx_GOTREF(__pyx_t_1);
24712   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____init__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24713   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24714
24715   /* "cvcf.pyx":327
24716  *         self._lines = lines
24717  * 
24718  *     def error(self,line,error,opt=None):             # <<<<<<<<<<<<<<
24719  *         if error in self._ignored_errors: return
24720  *         errorlabel, errorstring = self._errors[error].split(':')
24721  */
24722   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_1error, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24723   __Pyx_GOTREF(__pyx_t_1);
24724   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24725   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24726
24727   /* "cvcf.pyx":336
24728  *         raise ValueError(errorstring)
24729  * 
24730  *     def parse_format(self,line,format,filter=False):             # <<<<<<<<<<<<<<
24731  *         if self._version == 40:
24732  *             if not format.startswith('<'):
24733  */
24734   __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24735   __Pyx_GOTREF(__pyx_t_1);
24736   __pyx_k_26 = __pyx_t_1;
24737   __Pyx_GIVEREF(__pyx_t_1);
24738   __pyx_t_1 = 0;
24739   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_2parse_format, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24740   __Pyx_GOTREF(__pyx_t_1);
24741   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__parse_format, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24742   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24743
24744   /* "cvcf.pyx":398
24745  * 
24746  * 
24747  *     def format_format( self, fmt, filter=False ):             # <<<<<<<<<<<<<<
24748  *         values = [('ID',fmt.id)]
24749  *         if fmt.number != None and not filter:
24750  */
24751   __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24752   __Pyx_GOTREF(__pyx_t_1);
24753   __pyx_k_60 = __pyx_t_1;
24754   __Pyx_GIVEREF(__pyx_t_1);
24755   __pyx_t_1 = 0;
24756   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_3format_format, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24757   __Pyx_GOTREF(__pyx_t_1);
24758   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__format_format, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24759   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24760
24761   /* "cvcf.pyx":418
24762  *         return format
24763  * 
24764  *     def get_expected(self, format, formatdict, alt):             # <<<<<<<<<<<<<<
24765  *         fmt = formatdict[format]
24766  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
24767  */
24768   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_4get_expected, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24769   __Pyx_GOTREF(__pyx_t_1);
24770   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__get_expected, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24771   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24772
24773   /* "cvcf.pyx":429
24774  * 
24775  * 
24776  *     def _add_definition(self, formatdict, key, data, line ):             # <<<<<<<<<<<<<<
24777  *         if key in formatdict: return
24778  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
24779  */
24780   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_5_add_definition, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24781   __Pyx_GOTREF(__pyx_t_1);
24782   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___add_definition, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24783   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24784
24785   /* "cvcf.pyx":446
24786  * 
24787  *     # todo: trim trailing missing values
24788  *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):             # <<<<<<<<<<<<<<
24789  *         output, sdata = [], []
24790  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
24791  */
24792   __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24793   __Pyx_GOTREF(__pyx_t_1);
24794   __pyx_k_64 = __pyx_t_1;
24795   __Pyx_GIVEREF(__pyx_t_1);
24796   __pyx_t_1 = 0;
24797   __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24798   __Pyx_GOTREF(__pyx_t_1);
24799   __pyx_k_65 = __pyx_t_1;
24800   __Pyx_GIVEREF(__pyx_t_1);
24801   __pyx_t_1 = 0;
24802   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_6format_formatdata, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24803   __Pyx_GOTREF(__pyx_t_1);
24804   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__format_formatdata, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24805   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24806
24807   /* "cvcf.pyx":480
24808  * 
24809  * 
24810  *     def enter_default_format(self):             # <<<<<<<<<<<<<<
24811  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
24812  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
24813  */
24814   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_7enter_default_format, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24815   __Pyx_GOTREF(__pyx_t_1);
24816   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_118, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24817   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24818
24819   /* "cvcf.pyx":489
24820  *                 self._format[f.id] = f
24821  * 
24822  *     def parse_header( self, line ):             # <<<<<<<<<<<<<<
24823  *         assert line.startswith('##')
24824  *         elts = line[2:].split('=')
24825  */
24826   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_8parse_header, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24827   __Pyx_GOTREF(__pyx_t_1);
24828   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__parse_header, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24829   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24830
24831   /* "cvcf.pyx":518
24832  * 
24833  * 
24834  *     def write_header( self, stream ):             # <<<<<<<<<<<<<<
24835  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
24836  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
24837  */
24838   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_9write_header, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24839   __Pyx_GOTREF(__pyx_t_1);
24840   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__write_header, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24841   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24842
24843   /* "cvcf.pyx":525
24844  * 
24845  * 
24846  *     def parse_heading( self, line ):             # <<<<<<<<<<<<<<
24847  *         assert line.startswith('#')
24848  *         assert not line.startswith('##')
24849  */
24850   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_10parse_heading, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24851   __Pyx_GOTREF(__pyx_t_1);
24852   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__parse_heading, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24853   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24854
24855   /* "cvcf.pyx":553
24856  *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
24857  * 
24858  *     def write_heading( self, stream ):             # <<<<<<<<<<<<<<
24859  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
24860  * 
24861  */
24862   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_11write_heading, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24863   __Pyx_GOTREF(__pyx_t_1);
24864   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__write_heading, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24865   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24866
24867   /* "cvcf.pyx":556
24868  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
24869  * 
24870  *     def convertGT(self, GTstring):             # <<<<<<<<<<<<<<
24871  *         if GTstring == ".": return ["."]
24872  *         try:
24873  */
24874   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_12convertGT, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24875   __Pyx_GOTREF(__pyx_t_1);
24876   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__convertGT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24877   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24878
24879   /* "cvcf.pyx":569
24880  * 
24881  * 
24882  *     def convertGTback(self, GTdata):             # <<<<<<<<<<<<<<
24883  *         return ''.join(map(str,GTdata))
24884  * 
24885  */
24886   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_13convertGTback, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24887   __Pyx_GOTREF(__pyx_t_1);
24888   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__convertGTback, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24889   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24890
24891   /* "cvcf.pyx":572
24892  *         return ''.join(map(str,GTdata))
24893  * 
24894  *     def parse_formatdata( self, key, value, formatdict, line ):             # <<<<<<<<<<<<<<
24895  *         # To do: check that the right number of values is present
24896  *         f = formatdict.get(key,None)
24897  */
24898   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_14parse_formatdata, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24899   __Pyx_GOTREF(__pyx_t_1);
24900   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__parse_formatdata, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24901   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24902
24903   /* "cvcf.pyx":615
24904  * 
24905  * 
24906  *     def inregion(self, chrom, pos):             # <<<<<<<<<<<<<<
24907  *         if not self._regions: return True
24908  *         for r in self._regions:
24909  */
24910   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_15inregion, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24911   __Pyx_GOTREF(__pyx_t_1);
24912   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__inregion, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24913   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24914
24915   /* "cvcf.pyx":622
24916  * 
24917  * 
24918  *     def parse_data( self, line, lineparse=False ):             # <<<<<<<<<<<<<<
24919  *         cols = line.split('\t')
24920  *         if len(cols) != len(self._samples)+9:
24921  */
24922   __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24923   __Pyx_GOTREF(__pyx_t_1);
24924   __pyx_k_99 = __pyx_t_1;
24925   __Pyx_GIVEREF(__pyx_t_1);
24926   __pyx_t_1 = 0;
24927   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_16parse_data, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24928   __Pyx_GOTREF(__pyx_t_1);
24929   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__parse_data, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24930   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24931
24932   /* "cvcf.pyx":822
24933  * 
24934  * 
24935  *     def write_data(self, stream, data):             # <<<<<<<<<<<<<<
24936  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
24937  *         for k in required:
24938  */
24939   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_17write_data, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24940   __Pyx_GOTREF(__pyx_t_1);
24941   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__write_data, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24942   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24943
24944   /* "cvcf.pyx":851
24945  *         stream.write( "\t".join(output) + "\n" )
24946  * 
24947  *     def _parse_header(self, stream):             # <<<<<<<<<<<<<<
24948  *         self._lineno = 0
24949  *         for line in stream:
24950  */
24951   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_18_parse_header, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24952   __Pyx_GOTREF(__pyx_t_1);
24953   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___parse_header, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24954   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24955
24956   /* "cvcf.pyx":864
24957  *         return line
24958  * 
24959  *     def _parse(self, line, stream):             # <<<<<<<<<<<<<<
24960  *         if len(line.strip()) > 0:
24961  *             d = self.parse_data( line.strip() )
24962  */
24963   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_19_parse, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24964   __Pyx_GOTREF(__pyx_t_1);
24965   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s___parse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24966   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24967
24968   /* "cvcf.pyx":880
24969  *     ######################################################################################################
24970  * 
24971  *     def getsamples(self):             # <<<<<<<<<<<<<<
24972  *         """ List of samples in VCF file """
24973  *         return self._samples
24974  */
24975   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_20getsamples, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24976   __Pyx_GOTREF(__pyx_t_1);
24977   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__getsamples, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24978   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24979
24980   /* "cvcf.pyx":884
24981  *         return self._samples
24982  * 
24983  *     def setsamples(self,samples):             # <<<<<<<<<<<<<<
24984  *         """ List of samples in VCF file """
24985  *         self._samples = samples
24986  */
24987   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_21setsamples, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24988   __Pyx_GOTREF(__pyx_t_1);
24989   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__setsamples, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24990   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24991
24992   /* "cvcf.pyx":888
24993  *         self._samples = samples
24994  * 
24995  *     def getheader(self):             # <<<<<<<<<<<<<<
24996  *         """ List of header key-value pairs (strings) """
24997  *         return self._header
24998  */
24999   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_22getheader, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25000   __Pyx_GOTREF(__pyx_t_1);
25001   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__getheader, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25002   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25003
25004   /* "cvcf.pyx":892
25005  *         return self._header
25006  * 
25007  *     def setheader(self,header):             # <<<<<<<<<<<<<<
25008  *         """ List of header key-value pairs (strings) """
25009  *         self._header = header
25010  */
25011   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_23setheader, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25012   __Pyx_GOTREF(__pyx_t_1);
25013   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__setheader, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25014   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25015
25016   /* "cvcf.pyx":896
25017  *         self._header = header
25018  * 
25019  *     def getinfo(self):             # <<<<<<<<<<<<<<
25020  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
25021  *         return self._info
25022  */
25023   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_24getinfo, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25024   __Pyx_GOTREF(__pyx_t_1);
25025   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__getinfo, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25026   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25027
25028   /* "cvcf.pyx":900
25029  *         return self._info
25030  * 
25031  *     def setinfo(self,info):             # <<<<<<<<<<<<<<
25032  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
25033  *         self._info = info
25034  */
25035   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_25setinfo, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25036   __Pyx_GOTREF(__pyx_t_1);
25037   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__setinfo, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25038   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25039
25040   /* "cvcf.pyx":904
25041  *         self._info = info
25042  * 
25043  *     def getformat(self):             # <<<<<<<<<<<<<<
25044  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
25045  *         return self._format
25046  */
25047   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_26getformat, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25048   __Pyx_GOTREF(__pyx_t_1);
25049   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__getformat, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25050   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25051
25052   /* "cvcf.pyx":908
25053  *         return self._format
25054  * 
25055  *     def setformat(self,format):             # <<<<<<<<<<<<<<
25056  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
25057  *         self._format = format
25058  */
25059   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_27setformat, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25060   __Pyx_GOTREF(__pyx_t_1);
25061   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__setformat, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25062   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25063
25064   /* "cvcf.pyx":912
25065  *         self._format = format
25066  * 
25067  *     def getfilter(self):             # <<<<<<<<<<<<<<
25068  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
25069  *         return self._filter
25070  */
25071   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_28getfilter, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25072   __Pyx_GOTREF(__pyx_t_1);
25073   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__getfilter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25074   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25075
25076   /* "cvcf.pyx":916
25077  *         return self._filter
25078  * 
25079  *     def setfilter(self,filter):             # <<<<<<<<<<<<<<
25080  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
25081  *         self._filter = filter
25082  */
25083   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_29setfilter, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25084   __Pyx_GOTREF(__pyx_t_1);
25085   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__setfilter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25086   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25087
25088   /* "cvcf.pyx":920
25089  *         self._filter = filter
25090  * 
25091  *     def setversion(self, version):             # <<<<<<<<<<<<<<
25092  *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
25093  *         self._version = version
25094  */
25095   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_30setversion, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25096   __Pyx_GOTREF(__pyx_t_1);
25097   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__setversion, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25098   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25099
25100   /* "cvcf.pyx":924
25101  *         self._version = version
25102  * 
25103  *     def setregions(self, regions):             # <<<<<<<<<<<<<<
25104  *         self._regions = regions
25105  * 
25106  */
25107   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_31setregions, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25108   __Pyx_GOTREF(__pyx_t_1);
25109   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__setregions, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25110   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25111
25112   /* "cvcf.pyx":927
25113  *         self._regions = regions
25114  * 
25115  *     def setreference(self, ref):             # <<<<<<<<<<<<<<
25116  *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
25117  *         self._reference = ref
25118  */
25119   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_32setreference, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25120   __Pyx_GOTREF(__pyx_t_1);
25121   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__setreference, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25122   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25123
25124   /* "cvcf.pyx":931
25125  *         self._reference = ref
25126  * 
25127  *     def ignoreerror(self, errorstring):             # <<<<<<<<<<<<<<
25128  *         try:             self._ignored_errors.add(self.__dict__[errorstring])
25129  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
25130  */
25131   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_33ignoreerror, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25132   __Pyx_GOTREF(__pyx_t_1);
25133   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__ignoreerror, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25134   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25135
25136   /* "cvcf.pyx":935
25137  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
25138  * 
25139  *     def warnerror(self, errorstring):             # <<<<<<<<<<<<<<
25140  *         try:             self._warn_errors.add(self.__dict__[errorstring])
25141  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
25142  */
25143   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_34warnerror, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25144   __Pyx_GOTREF(__pyx_t_1);
25145   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__warnerror, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25146   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25147
25148   /* "cvcf.pyx":939
25149  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
25150  * 
25151  *     def parse(self, stream):             # <<<<<<<<<<<<<<
25152  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
25153  *         last_line = self._parse_header(stream)
25154  */
25155   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_35parse, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25156   __Pyx_GOTREF(__pyx_t_1);
25157   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__parse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25158   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25159
25160   /* "cvcf.pyx":946
25161  *         return self._parse(last_line, stream)
25162  * 
25163  *     def write(self, stream, datagenerator):             # <<<<<<<<<<<<<<
25164  *         """ Writes a VCF file to a stream, using a data generator (or list) """
25165  *         self.write_header(stream)
25166  */
25167   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_36write, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25168   __Pyx_GOTREF(__pyx_t_1);
25169   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__write, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25170   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25171
25172   /* "cvcf.pyx":952
25173  *         for data in datagenerator: self.write_data(stream,data)
25174  * 
25175  *     def writeheader(self, stream):             # <<<<<<<<<<<<<<
25176  *         """ Writes a VCF header """
25177  *         self.write_header(stream)
25178  */
25179   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_37writeheader, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25180   __Pyx_GOTREF(__pyx_t_1);
25181   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__writeheader, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25182   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25183
25184   /* "cvcf.pyx":957
25185  *         self.write_heading(stream)
25186  * 
25187  *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):             # <<<<<<<<<<<<<<
25188  *         """ Utility function: compares two calls for equality """
25189  *         # a variant should always be assigned to a unique position, one base before
25190  */
25191   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_38compare_calls, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25192   __Pyx_GOTREF(__pyx_t_1);
25193   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__compare_calls, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25194   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25195
25196   /* "cvcf.pyx":979
25197  * ###########################################################################################################
25198  * 
25199  *     def connect( self, filename ):             # <<<<<<<<<<<<<<
25200  *         '''connect to tabix file.'''
25201  *         self.tabixfile = pysam.Tabixfile( filename )
25202  */
25203   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_39connect, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25204   __Pyx_GOTREF(__pyx_t_1);
25205   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__connect, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25206   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25207
25208   /* "cvcf.pyx":984
25209  *         self._parse_header(self.tabixfile.header)
25210  * 
25211  *     def fetch(self,             # <<<<<<<<<<<<<<
25212  *               reference = None,
25213  *               start = None,
25214  */
25215   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_40fetch, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25216   __Pyx_GOTREF(__pyx_t_1);
25217   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__fetch, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25218   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25219
25220   /* "cvcf.pyx":993
25221  *         return self.tabixfile.fetch( reference, start, end, region, parser = asVCFRecord( self ) )
25222  * 
25223  *     def validate( self, record ):             # <<<<<<<<<<<<<<
25224  *         '''validate vcf record.
25225  * 
25226  */
25227   __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_4cvcf_3VCF_41validate, NULL, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25228   __Pyx_GOTREF(__pyx_t_1);
25229   if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__validate, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25230   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25231
25232   /* "cvcf.pyx":232
25233  *         return r
25234  * 
25235  * class VCF(object):             # <<<<<<<<<<<<<<
25236  * 
25237  *     # types
25238  */
25239   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25240   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25241   __Pyx_INCREF(__pyx_builtin_object);
25242   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
25243   __Pyx_GIVEREF(__pyx_builtin_object);
25244   __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2), __pyx_n_s__VCF, __pyx_n_s__cvcf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25245   __Pyx_GOTREF(__pyx_t_3);
25246   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
25247   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VCF, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25248   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25249   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
25250
25251   /* "cvcf.pyx":1118
25252  *                     pos -= 1
25253  * 
25254  * __all__ = [             # <<<<<<<<<<<<<<
25255  *     "VCF", "VCFRecord", ]
25256  * 
25257  */
25258   __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25259   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
25260   __Pyx_INCREF(((PyObject *)__pyx_n_s__VCF));
25261   PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__VCF));
25262   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__VCF));
25263   __Pyx_INCREF(((PyObject *)__pyx_n_s__VCFRecord));
25264   PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__VCFRecord));
25265   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__VCFRecord));
25266   if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25267   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
25268
25269   /* "cvcf.pyx":1
25270  * #             # <<<<<<<<<<<<<<
25271  * # Code to read, write and edit VCF files
25272  * #
25273  */
25274   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25275   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
25276   if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25277   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
25278
25279   /* "ctabix.pxd":2
25280  * 
25281  * cdef extern from "string.h":             # <<<<<<<<<<<<<<
25282  *   ctypedef int size_t
25283  *   void *memcpy(void *dst,void *src,size_t len)
25284  */
25285   goto __pyx_L0;
25286   __pyx_L1_error:;
25287   __Pyx_XDECREF(__pyx_t_1);
25288   __Pyx_XDECREF(__pyx_t_2);
25289   __Pyx_XDECREF(__pyx_t_3);
25290   if (__pyx_m) {
25291     __Pyx_AddTraceback("init cvcf");
25292     Py_DECREF(__pyx_m); __pyx_m = 0;
25293   } else if (!PyErr_Occurred()) {
25294     PyErr_SetString(PyExc_ImportError, "init cvcf");
25295   }
25296   __pyx_L0:;
25297   __Pyx_RefNannyFinishContext();
25298   #if PY_MAJOR_VERSION < 3
25299   return;
25300   #else
25301   return __pyx_m;
25302   #endif
25303 }
25304
25305 /* Runtime support code */
25306
25307 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
25308     PyObject *result;
25309     result = PyObject_GetAttr(dict, name);
25310     if (!result)
25311         PyErr_SetObject(PyExc_NameError, name);
25312     return result;
25313 }
25314
25315 static void __Pyx_RaiseArgtupleInvalid(
25316     const char* func_name,
25317     int exact,
25318     Py_ssize_t num_min,
25319     Py_ssize_t num_max,
25320     Py_ssize_t num_found)
25321 {
25322     Py_ssize_t num_expected;
25323     const char *number, *more_or_less;
25324
25325     if (num_found < num_min) {
25326         num_expected = num_min;
25327         more_or_less = "at least";
25328     } else {
25329         num_expected = num_max;
25330         more_or_less = "at most";
25331     }
25332     if (exact) {
25333         more_or_less = "exactly";
25334     }
25335     number = (num_expected == 1) ? "" : "s";
25336     PyErr_Format(PyExc_TypeError,
25337         #if PY_VERSION_HEX < 0x02050000
25338             "%s() takes %s %d positional argument%s (%d given)",
25339         #else
25340             "%s() takes %s %zd positional argument%s (%zd given)",
25341         #endif
25342         func_name, more_or_less, num_expected, number, num_found);
25343 }
25344
25345 static void __Pyx_RaiseDoubleKeywordsError(
25346     const char* func_name,
25347     PyObject* kw_name)
25348 {
25349     PyErr_Format(PyExc_TypeError,
25350         #if PY_MAJOR_VERSION >= 3
25351         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
25352         #else
25353         "%s() got multiple values for keyword argument '%s'", func_name,
25354         PyString_AS_STRING(kw_name));
25355         #endif
25356 }
25357
25358 static int __Pyx_ParseOptionalKeywords(
25359     PyObject *kwds,
25360     PyObject **argnames[],
25361     PyObject *kwds2,
25362     PyObject *values[],
25363     Py_ssize_t num_pos_args,
25364     const char* function_name)
25365 {
25366     PyObject *key = 0, *value = 0;
25367     Py_ssize_t pos = 0;
25368     PyObject*** name;
25369     PyObject*** first_kw_arg = argnames + num_pos_args;
25370
25371     while (PyDict_Next(kwds, &pos, &key, &value)) {
25372         name = first_kw_arg;
25373         while (*name && (**name != key)) name++;
25374         if (*name) {
25375             values[name-argnames] = value;
25376         } else {
25377             #if PY_MAJOR_VERSION < 3
25378             if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
25379             #else
25380             if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
25381             #endif
25382                 goto invalid_keyword_type;
25383             } else {
25384                 for (name = first_kw_arg; *name; name++) {
25385                     #if PY_MAJOR_VERSION >= 3
25386                     if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
25387                         PyUnicode_Compare(**name, key) == 0) break;
25388                     #else
25389                     if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
25390                         _PyString_Eq(**name, key)) break;
25391                     #endif
25392                 }
25393                 if (*name) {
25394                     values[name-argnames] = value;
25395                 } else {
25396                     /* unexpected keyword found */
25397                     for (name=argnames; name != first_kw_arg; name++) {
25398                         if (**name == key) goto arg_passed_twice;
25399                         #if PY_MAJOR_VERSION >= 3
25400                         if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
25401                             PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
25402                         #else
25403                         if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
25404                             _PyString_Eq(**name, key)) goto arg_passed_twice;
25405                         #endif
25406                     }
25407                     if (kwds2) {
25408                         if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
25409                     } else {
25410                         goto invalid_keyword;
25411                     }
25412                 }
25413             }
25414         }
25415     }
25416     return 0;
25417 arg_passed_twice:
25418     __Pyx_RaiseDoubleKeywordsError(function_name, **name);
25419     goto bad;
25420 invalid_keyword_type:
25421     PyErr_Format(PyExc_TypeError,
25422         "%s() keywords must be strings", function_name);
25423     goto bad;
25424 invalid_keyword:
25425     PyErr_Format(PyExc_TypeError,
25426     #if PY_MAJOR_VERSION < 3
25427         "%s() got an unexpected keyword argument '%s'",
25428         function_name, PyString_AsString(key));
25429     #else
25430         "%s() got an unexpected keyword argument '%U'",
25431         function_name, key);
25432     #endif
25433 bad:
25434     return -1;
25435 }
25436
25437
25438 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
25439     PyObject *local_type, *local_value, *local_tb;
25440     PyObject *tmp_type, *tmp_value, *tmp_tb;
25441     PyThreadState *tstate = PyThreadState_GET();
25442     local_type = tstate->curexc_type;
25443     local_value = tstate->curexc_value;
25444     local_tb = tstate->curexc_traceback;
25445     tstate->curexc_type = 0;
25446     tstate->curexc_value = 0;
25447     tstate->curexc_traceback = 0;
25448     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25449     if (unlikely(tstate->curexc_type))
25450         goto bad;
25451     #if PY_MAJOR_VERSION >= 3
25452     if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25453         goto bad;
25454     #endif
25455     *type = local_type;
25456     *value = local_value;
25457     *tb = local_tb;
25458     Py_INCREF(local_type);
25459     Py_INCREF(local_value);
25460     Py_INCREF(local_tb);
25461     tmp_type = tstate->exc_type;
25462     tmp_value = tstate->exc_value;
25463     tmp_tb = tstate->exc_traceback;
25464     tstate->exc_type = local_type;
25465     tstate->exc_value = local_value;
25466     tstate->exc_traceback = local_tb;
25467     /* Make sure tstate is in a consistent state when we XDECREF
25468        these objects (XDECREF may run arbitrary code). */
25469     Py_XDECREF(tmp_type);
25470     Py_XDECREF(tmp_value);
25471     Py_XDECREF(tmp_tb);
25472     return 0;
25473 bad:
25474     *type = 0;
25475     *value = 0;
25476     *tb = 0;
25477     Py_XDECREF(local_type);
25478     Py_XDECREF(local_value);
25479     Py_XDECREF(local_tb);
25480     return -1;
25481 }
25482
25483
25484 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
25485     PyObject *tmp_type, *tmp_value, *tmp_tb;
25486     PyThreadState *tstate = PyThreadState_GET();
25487
25488     tmp_type = tstate->curexc_type;
25489     tmp_value = tstate->curexc_value;
25490     tmp_tb = tstate->curexc_traceback;
25491     tstate->curexc_type = type;
25492     tstate->curexc_value = value;
25493     tstate->curexc_traceback = tb;
25494     Py_XDECREF(tmp_type);
25495     Py_XDECREF(tmp_value);
25496     Py_XDECREF(tmp_tb);
25497 }
25498
25499 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
25500     PyThreadState *tstate = PyThreadState_GET();
25501     *type = tstate->curexc_type;
25502     *value = tstate->curexc_value;
25503     *tb = tstate->curexc_traceback;
25504
25505     tstate->curexc_type = 0;
25506     tstate->curexc_value = 0;
25507     tstate->curexc_traceback = 0;
25508 }
25509
25510
25511 #if PY_MAJOR_VERSION < 3
25512 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
25513     Py_XINCREF(type);
25514     Py_XINCREF(value);
25515     Py_XINCREF(tb);
25516     /* First, check the traceback argument, replacing None with NULL. */
25517     if (tb == Py_None) {
25518         Py_DECREF(tb);
25519         tb = 0;
25520     }
25521     else if (tb != NULL && !PyTraceBack_Check(tb)) {
25522         PyErr_SetString(PyExc_TypeError,
25523             "raise: arg 3 must be a traceback or None");
25524         goto raise_error;
25525     }
25526     /* Next, replace a missing value with None */
25527     if (value == NULL) {
25528         value = Py_None;
25529         Py_INCREF(value);
25530     }
25531     #if PY_VERSION_HEX < 0x02050000
25532     if (!PyClass_Check(type))
25533     #else
25534     if (!PyType_Check(type))
25535     #endif
25536     {
25537         /* Raising an instance.  The value should be a dummy. */
25538         if (value != Py_None) {
25539             PyErr_SetString(PyExc_TypeError,
25540                 "instance exception may not have a separate value");
25541             goto raise_error;
25542         }
25543         /* Normalize to raise <class>, <instance> */
25544         Py_DECREF(value);
25545         value = type;
25546         #if PY_VERSION_HEX < 0x02050000
25547             if (PyInstance_Check(type)) {
25548                 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
25549                 Py_INCREF(type);
25550             }
25551             else {
25552                 type = 0;
25553                 PyErr_SetString(PyExc_TypeError,
25554                     "raise: exception must be an old-style class or instance");
25555                 goto raise_error;
25556             }
25557         #else
25558             type = (PyObject*) Py_TYPE(type);
25559             Py_INCREF(type);
25560             if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25561                 PyErr_SetString(PyExc_TypeError,
25562                     "raise: exception class must be a subclass of BaseException");
25563                 goto raise_error;
25564             }
25565         #endif
25566     }
25567
25568     __Pyx_ErrRestore(type, value, tb);
25569     return;
25570 raise_error:
25571     Py_XDECREF(value);
25572     Py_XDECREF(type);
25573     Py_XDECREF(tb);
25574     return;
25575 }
25576
25577 #else /* Python 3+ */
25578
25579 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
25580     if (tb == Py_None) {
25581         tb = 0;
25582     } else if (tb && !PyTraceBack_Check(tb)) {
25583         PyErr_SetString(PyExc_TypeError,
25584             "raise: arg 3 must be a traceback or None");
25585         goto bad;
25586     }
25587     if (value == Py_None)
25588         value = 0;
25589
25590     if (PyExceptionInstance_Check(type)) {
25591         if (value) {
25592             PyErr_SetString(PyExc_TypeError,
25593                 "instance exception may not have a separate value");
25594             goto bad;
25595         }
25596         value = type;
25597         type = (PyObject*) Py_TYPE(value);
25598     } else if (!PyExceptionClass_Check(type)) {
25599         PyErr_SetString(PyExc_TypeError,
25600             "raise: exception class must be a subclass of BaseException");
25601         goto bad;
25602     }
25603
25604     PyErr_SetObject(type, value);
25605
25606     if (tb) {
25607         PyThreadState *tstate = PyThreadState_GET();
25608         PyObject* tmp_tb = tstate->curexc_traceback;
25609         if (tb != tmp_tb) {
25610             Py_INCREF(tb);
25611             tstate->curexc_traceback = tb;
25612             Py_XDECREF(tmp_tb);
25613         }
25614     }
25615
25616 bad:
25617     return;
25618 }
25619 #endif
25620
25621 static double __Pyx__PyObject_AsDouble(PyObject* obj) {
25622     PyObject* float_value;
25623     if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) {
25624         return PyFloat_AsDouble(obj);
25625     } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
25626 #if PY_MAJOR_VERSION >= 3
25627         float_value = PyFloat_FromString(obj);
25628 #else
25629         float_value = PyFloat_FromString(obj, 0);
25630 #endif
25631     } else {
25632         PyObject* args = PyTuple_New(1);
25633         if (unlikely(!args)) goto bad;
25634         PyTuple_SET_ITEM(args, 0, obj);
25635         float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
25636         PyTuple_SET_ITEM(args, 0, 0);
25637         Py_DECREF(args);
25638     }
25639     if (likely(float_value)) {
25640         double value = PyFloat_AS_DOUBLE(float_value);
25641         Py_DECREF(float_value);
25642         return value;
25643     }
25644 bad:
25645     return (double)-1;
25646 }
25647
25648 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
25649     PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
25650 }
25651
25652 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25653     PyErr_Format(PyExc_ValueError,
25654         #if PY_VERSION_HEX < 0x02050000
25655                  "need more than %d value%s to unpack", (int)index,
25656         #else
25657                  "need more than %zd value%s to unpack", index,
25658         #endif
25659                  (index == 1) ? "" : "s");
25660 }
25661
25662 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25663     PyErr_Format(PyExc_ValueError,
25664         #if PY_VERSION_HEX < 0x02050000
25665             "too many values to unpack (expected %d)", (int)expected);
25666         #else
25667             "too many values to unpack (expected %zd)", expected);
25668         #endif
25669 }
25670
25671 static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
25672     PyObject *item;
25673     if (!(item = PyIter_Next(iter))) {
25674         if (!PyErr_Occurred()) {
25675             __Pyx_RaiseNeedMoreValuesError(index);
25676         }
25677     }
25678     return item;
25679 }
25680
25681 static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
25682     PyObject *item;
25683     if ((item = PyIter_Next(iter))) {
25684         Py_DECREF(item);
25685         __Pyx_RaiseTooManyValuesError(expected);
25686         return -1;
25687     }
25688     else if (!PyErr_Occurred())
25689         return 0;
25690     else
25691         return -1;
25692 }
25693
25694 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25695     Py_ssize_t q = a / b;
25696     Py_ssize_t r = a - q*b;
25697     q -= ((r != 0) & ((r ^ b) < 0));
25698     return q;
25699 }
25700
25701
25702 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
25703     PyThreadState *tstate = PyThreadState_GET();
25704     *type = tstate->exc_type;
25705     *value = tstate->exc_value;
25706     *tb = tstate->exc_traceback;
25707     Py_XINCREF(*type);
25708     Py_XINCREF(*value);
25709     Py_XINCREF(*tb);
25710 }
25711
25712 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
25713     PyObject *tmp_type, *tmp_value, *tmp_tb;
25714     PyThreadState *tstate = PyThreadState_GET();
25715     tmp_type = tstate->exc_type;
25716     tmp_value = tstate->exc_value;
25717     tmp_tb = tstate->exc_traceback;
25718     tstate->exc_type = type;
25719     tstate->exc_value = value;
25720     tstate->exc_traceback = tb;
25721     Py_XDECREF(tmp_type);
25722     Py_XDECREF(tmp_value);
25723     Py_XDECREF(tmp_tb);
25724 }
25725
25726 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
25727     PyObject *py_import = 0;
25728     PyObject *empty_list = 0;
25729     PyObject *module = 0;
25730     PyObject *global_dict = 0;
25731     PyObject *empty_dict = 0;
25732     PyObject *list;
25733     py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
25734     if (!py_import)
25735         goto bad;
25736     if (from_list)
25737         list = from_list;
25738     else {
25739         empty_list = PyList_New(0);
25740         if (!empty_list)
25741             goto bad;
25742         list = empty_list;
25743     }
25744     global_dict = PyModule_GetDict(__pyx_m);
25745     if (!global_dict)
25746         goto bad;
25747     empty_dict = PyDict_New();
25748     if (!empty_dict)
25749         goto bad;
25750     module = PyObject_CallFunctionObjArgs(py_import,
25751         name, global_dict, empty_dict, list, NULL);
25752 bad:
25753     Py_XDECREF(empty_list);
25754     Py_XDECREF(py_import);
25755     Py_XDECREF(empty_dict);
25756     return module;
25757 }
25758
25759 static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
25760     PyObject *metaclass;
25761     /* Default metaclass */
25762 #if PY_MAJOR_VERSION < 3
25763     if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
25764         PyObject *base = PyTuple_GET_ITEM(bases, 0);
25765         metaclass = PyObject_GetAttrString(base, "__class__");
25766         if (!metaclass) {
25767             PyErr_Clear();
25768             metaclass = (PyObject*) Py_TYPE(base);
25769         }
25770     } else {
25771         metaclass = (PyObject *) &PyClass_Type;
25772     }
25773 #else
25774     if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
25775         PyObject *base = PyTuple_GET_ITEM(bases, 0);
25776         metaclass = (PyObject*) Py_TYPE(base);
25777     } else {
25778         metaclass = (PyObject *) &PyType_Type;
25779     }
25780 #endif
25781     Py_INCREF(metaclass);
25782     return metaclass;
25783 }
25784
25785 static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
25786                                    PyObject *modname) {
25787     PyObject *result;
25788     PyObject *metaclass;
25789
25790     if (PyDict_SetItemString(dict, "__module__", modname) < 0)
25791         return NULL;
25792
25793     /* Python2 __metaclass__ */
25794     metaclass = PyDict_GetItemString(dict, "__metaclass__");
25795     if (metaclass) {
25796         Py_INCREF(metaclass);
25797     } else {
25798         metaclass = __Pyx_FindPy2Metaclass(bases);
25799     }
25800     result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
25801     Py_DECREF(metaclass);
25802     return result;
25803 }
25804
25805
25806 static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) {
25807         __pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType);
25808     if (op == NULL)
25809         return NULL;
25810         op->func.m_ml = ml;
25811         Py_XINCREF(self);
25812         op->func.m_self = self;
25813         Py_XINCREF(module);
25814         op->func.m_module = module;
25815         PyObject_GC_Track(op);
25816         return (PyObject *)op;
25817 }
25818
25819 static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) {
25820         PyObject_GC_UnTrack(m);
25821         Py_XDECREF(m->func.m_self);
25822         Py_XDECREF(m->func.m_module);
25823     PyObject_GC_Del(m);
25824 }
25825
25826 static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) {
25827         if (obj == Py_None)
25828                 obj = NULL;
25829         return PyMethod_New(func, obj, type);
25830 }
25831
25832 static int __pyx_binding_PyCFunctionType_init(void) {
25833     __pyx_binding_PyCFunctionType_type = PyCFunction_Type;
25834     __pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method");
25835     __pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc;
25836     __pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get;
25837     if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) {
25838         return -1;
25839     }
25840     __pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type;
25841     return 0;
25842
25843 }
25844
25845 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint32_t(uint32_t val) {
25846     const uint32_t neg_one = (uint32_t)-1, const_zero = (uint32_t)0;
25847     const int is_unsigned = const_zero < neg_one;
25848     if ((sizeof(uint32_t) == sizeof(char))  ||
25849         (sizeof(uint32_t) == sizeof(short))) {
25850         return PyInt_FromLong((long)val);
25851     } else if ((sizeof(uint32_t) == sizeof(int)) ||
25852                (sizeof(uint32_t) == sizeof(long))) {
25853         if (is_unsigned)
25854             return PyLong_FromUnsignedLong((unsigned long)val);
25855         else
25856             return PyInt_FromLong((long)val);
25857     } else if (sizeof(uint32_t) == sizeof(PY_LONG_LONG)) {
25858         if (is_unsigned)
25859             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
25860         else
25861             return PyLong_FromLongLong((PY_LONG_LONG)val);
25862     } else {
25863         int one = 1; int little = (int)*(unsigned char *)&one;
25864         unsigned char *bytes = (unsigned char *)&val;
25865         return _PyLong_FromByteArray(bytes, sizeof(uint32_t), 
25866                                      little, !is_unsigned);
25867     }
25868 }
25869
25870 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
25871     const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
25872     const int is_unsigned = neg_one > const_zero;
25873     if (sizeof(unsigned char) < sizeof(long)) {
25874         long val = __Pyx_PyInt_AsLong(x);
25875         if (unlikely(val != (long)(unsigned char)val)) {
25876             if (!unlikely(val == -1 && PyErr_Occurred())) {
25877                 PyErr_SetString(PyExc_OverflowError,
25878                     (is_unsigned && unlikely(val < 0)) ?
25879                     "can't convert negative value to unsigned char" :
25880                     "value too large to convert to unsigned char");
25881             }
25882             return (unsigned char)-1;
25883         }
25884         return (unsigned char)val;
25885     }
25886     return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
25887 }
25888
25889 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
25890     const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
25891     const int is_unsigned = neg_one > const_zero;
25892     if (sizeof(unsigned short) < sizeof(long)) {
25893         long val = __Pyx_PyInt_AsLong(x);
25894         if (unlikely(val != (long)(unsigned short)val)) {
25895             if (!unlikely(val == -1 && PyErr_Occurred())) {
25896                 PyErr_SetString(PyExc_OverflowError,
25897                     (is_unsigned && unlikely(val < 0)) ?
25898                     "can't convert negative value to unsigned short" :
25899                     "value too large to convert to unsigned short");
25900             }
25901             return (unsigned short)-1;
25902         }
25903         return (unsigned short)val;
25904     }
25905     return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
25906 }
25907
25908 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
25909     const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
25910     const int is_unsigned = neg_one > const_zero;
25911     if (sizeof(unsigned int) < sizeof(long)) {
25912         long val = __Pyx_PyInt_AsLong(x);
25913         if (unlikely(val != (long)(unsigned int)val)) {
25914             if (!unlikely(val == -1 && PyErr_Occurred())) {
25915                 PyErr_SetString(PyExc_OverflowError,
25916                     (is_unsigned && unlikely(val < 0)) ?
25917                     "can't convert negative value to unsigned int" :
25918                     "value too large to convert to unsigned int");
25919             }
25920             return (unsigned int)-1;
25921         }
25922         return (unsigned int)val;
25923     }
25924     return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
25925 }
25926
25927 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
25928     const char neg_one = (char)-1, const_zero = 0;
25929     const int is_unsigned = neg_one > const_zero;
25930     if (sizeof(char) < sizeof(long)) {
25931         long val = __Pyx_PyInt_AsLong(x);
25932         if (unlikely(val != (long)(char)val)) {
25933             if (!unlikely(val == -1 && PyErr_Occurred())) {
25934                 PyErr_SetString(PyExc_OverflowError,
25935                     (is_unsigned && unlikely(val < 0)) ?
25936                     "can't convert negative value to char" :
25937                     "value too large to convert to char");
25938             }
25939             return (char)-1;
25940         }
25941         return (char)val;
25942     }
25943     return (char)__Pyx_PyInt_AsLong(x);
25944 }
25945
25946 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
25947     const short neg_one = (short)-1, const_zero = 0;
25948     const int is_unsigned = neg_one > const_zero;
25949     if (sizeof(short) < sizeof(long)) {
25950         long val = __Pyx_PyInt_AsLong(x);
25951         if (unlikely(val != (long)(short)val)) {
25952             if (!unlikely(val == -1 && PyErr_Occurred())) {
25953                 PyErr_SetString(PyExc_OverflowError,
25954                     (is_unsigned && unlikely(val < 0)) ?
25955                     "can't convert negative value to short" :
25956                     "value too large to convert to short");
25957             }
25958             return (short)-1;
25959         }
25960         return (short)val;
25961     }
25962     return (short)__Pyx_PyInt_AsLong(x);
25963 }
25964
25965 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
25966     const int neg_one = (int)-1, const_zero = 0;
25967     const int is_unsigned = neg_one > const_zero;
25968     if (sizeof(int) < sizeof(long)) {
25969         long val = __Pyx_PyInt_AsLong(x);
25970         if (unlikely(val != (long)(int)val)) {
25971             if (!unlikely(val == -1 && PyErr_Occurred())) {
25972                 PyErr_SetString(PyExc_OverflowError,
25973                     (is_unsigned && unlikely(val < 0)) ?
25974                     "can't convert negative value to int" :
25975                     "value too large to convert to int");
25976             }
25977             return (int)-1;
25978         }
25979         return (int)val;
25980     }
25981     return (int)__Pyx_PyInt_AsLong(x);
25982 }
25983
25984 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
25985     const signed char neg_one = (signed char)-1, const_zero = 0;
25986     const int is_unsigned = neg_one > const_zero;
25987     if (sizeof(signed char) < sizeof(long)) {
25988         long val = __Pyx_PyInt_AsLong(x);
25989         if (unlikely(val != (long)(signed char)val)) {
25990             if (!unlikely(val == -1 && PyErr_Occurred())) {
25991                 PyErr_SetString(PyExc_OverflowError,
25992                     (is_unsigned && unlikely(val < 0)) ?
25993                     "can't convert negative value to signed char" :
25994                     "value too large to convert to signed char");
25995             }
25996             return (signed char)-1;
25997         }
25998         return (signed char)val;
25999     }
26000     return (signed char)__Pyx_PyInt_AsSignedLong(x);
26001 }
26002
26003 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
26004     const signed short neg_one = (signed short)-1, const_zero = 0;
26005     const int is_unsigned = neg_one > const_zero;
26006     if (sizeof(signed short) < sizeof(long)) {
26007         long val = __Pyx_PyInt_AsLong(x);
26008         if (unlikely(val != (long)(signed short)val)) {
26009             if (!unlikely(val == -1 && PyErr_Occurred())) {
26010                 PyErr_SetString(PyExc_OverflowError,
26011                     (is_unsigned && unlikely(val < 0)) ?
26012                     "can't convert negative value to signed short" :
26013                     "value too large to convert to signed short");
26014             }
26015             return (signed short)-1;
26016         }
26017         return (signed short)val;
26018     }
26019     return (signed short)__Pyx_PyInt_AsSignedLong(x);
26020 }
26021
26022 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
26023     const signed int neg_one = (signed int)-1, const_zero = 0;
26024     const int is_unsigned = neg_one > const_zero;
26025     if (sizeof(signed int) < sizeof(long)) {
26026         long val = __Pyx_PyInt_AsLong(x);
26027         if (unlikely(val != (long)(signed int)val)) {
26028             if (!unlikely(val == -1 && PyErr_Occurred())) {
26029                 PyErr_SetString(PyExc_OverflowError,
26030                     (is_unsigned && unlikely(val < 0)) ?
26031                     "can't convert negative value to signed int" :
26032                     "value too large to convert to signed int");
26033             }
26034             return (signed int)-1;
26035         }
26036         return (signed int)val;
26037     }
26038     return (signed int)__Pyx_PyInt_AsSignedLong(x);
26039 }
26040
26041 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
26042     const int neg_one = (int)-1, const_zero = 0;
26043     const int is_unsigned = neg_one > const_zero;
26044     if (sizeof(int) < sizeof(long)) {
26045         long val = __Pyx_PyInt_AsLong(x);
26046         if (unlikely(val != (long)(int)val)) {
26047             if (!unlikely(val == -1 && PyErr_Occurred())) {
26048                 PyErr_SetString(PyExc_OverflowError,
26049                     (is_unsigned && unlikely(val < 0)) ?
26050                     "can't convert negative value to int" :
26051                     "value too large to convert to int");
26052             }
26053             return (int)-1;
26054         }
26055         return (int)val;
26056     }
26057     return (int)__Pyx_PyInt_AsLong(x);
26058 }
26059
26060 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
26061     const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
26062     const int is_unsigned = neg_one > const_zero;
26063 #if PY_VERSION_HEX < 0x03000000
26064     if (likely(PyInt_Check(x))) {
26065         long val = PyInt_AS_LONG(x);
26066         if (is_unsigned && unlikely(val < 0)) {
26067             PyErr_SetString(PyExc_OverflowError,
26068                             "can't convert negative value to unsigned long");
26069             return (unsigned long)-1;
26070         }
26071         return (unsigned long)val;
26072     } else
26073 #endif
26074     if (likely(PyLong_Check(x))) {
26075         if (is_unsigned) {
26076             if (unlikely(Py_SIZE(x) < 0)) {
26077                 PyErr_SetString(PyExc_OverflowError,
26078                                 "can't convert negative value to unsigned long");
26079                 return (unsigned long)-1;
26080             }
26081             return PyLong_AsUnsignedLong(x);
26082         } else {
26083             return PyLong_AsLong(x);
26084         }
26085     } else {
26086         unsigned long val;
26087         PyObject *tmp = __Pyx_PyNumber_Int(x);
26088         if (!tmp) return (unsigned long)-1;
26089         val = __Pyx_PyInt_AsUnsignedLong(tmp);
26090         Py_DECREF(tmp);
26091         return val;
26092     }
26093 }
26094
26095 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
26096     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
26097     const int is_unsigned = neg_one > const_zero;
26098 #if PY_VERSION_HEX < 0x03000000
26099     if (likely(PyInt_Check(x))) {
26100         long val = PyInt_AS_LONG(x);
26101         if (is_unsigned && unlikely(val < 0)) {
26102             PyErr_SetString(PyExc_OverflowError,
26103                             "can't convert negative value to unsigned PY_LONG_LONG");
26104             return (unsigned PY_LONG_LONG)-1;
26105         }
26106         return (unsigned PY_LONG_LONG)val;
26107     } else
26108 #endif
26109     if (likely(PyLong_Check(x))) {
26110         if (is_unsigned) {
26111             if (unlikely(Py_SIZE(x) < 0)) {
26112                 PyErr_SetString(PyExc_OverflowError,
26113                                 "can't convert negative value to unsigned PY_LONG_LONG");
26114                 return (unsigned PY_LONG_LONG)-1;
26115             }
26116             return PyLong_AsUnsignedLongLong(x);
26117         } else {
26118             return PyLong_AsLongLong(x);
26119         }
26120     } else {
26121         unsigned PY_LONG_LONG val;
26122         PyObject *tmp = __Pyx_PyNumber_Int(x);
26123         if (!tmp) return (unsigned PY_LONG_LONG)-1;
26124         val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
26125         Py_DECREF(tmp);
26126         return val;
26127     }
26128 }
26129
26130 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
26131     const long neg_one = (long)-1, const_zero = 0;
26132     const int is_unsigned = neg_one > const_zero;
26133 #if PY_VERSION_HEX < 0x03000000
26134     if (likely(PyInt_Check(x))) {
26135         long val = PyInt_AS_LONG(x);
26136         if (is_unsigned && unlikely(val < 0)) {
26137             PyErr_SetString(PyExc_OverflowError,
26138                             "can't convert negative value to long");
26139             return (long)-1;
26140         }
26141         return (long)val;
26142     } else
26143 #endif
26144     if (likely(PyLong_Check(x))) {
26145         if (is_unsigned) {
26146             if (unlikely(Py_SIZE(x) < 0)) {
26147                 PyErr_SetString(PyExc_OverflowError,
26148                                 "can't convert negative value to long");
26149                 return (long)-1;
26150             }
26151             return PyLong_AsUnsignedLong(x);
26152         } else {
26153             return PyLong_AsLong(x);
26154         }
26155     } else {
26156         long val;
26157         PyObject *tmp = __Pyx_PyNumber_Int(x);
26158         if (!tmp) return (long)-1;
26159         val = __Pyx_PyInt_AsLong(tmp);
26160         Py_DECREF(tmp);
26161         return val;
26162     }
26163 }
26164
26165 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
26166     const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
26167     const int is_unsigned = neg_one > const_zero;
26168 #if PY_VERSION_HEX < 0x03000000
26169     if (likely(PyInt_Check(x))) {
26170         long val = PyInt_AS_LONG(x);
26171         if (is_unsigned && unlikely(val < 0)) {
26172             PyErr_SetString(PyExc_OverflowError,
26173                             "can't convert negative value to PY_LONG_LONG");
26174             return (PY_LONG_LONG)-1;
26175         }
26176         return (PY_LONG_LONG)val;
26177     } else
26178 #endif
26179     if (likely(PyLong_Check(x))) {
26180         if (is_unsigned) {
26181             if (unlikely(Py_SIZE(x) < 0)) {
26182                 PyErr_SetString(PyExc_OverflowError,
26183                                 "can't convert negative value to PY_LONG_LONG");
26184                 return (PY_LONG_LONG)-1;
26185             }
26186             return PyLong_AsUnsignedLongLong(x);
26187         } else {
26188             return PyLong_AsLongLong(x);
26189         }
26190     } else {
26191         PY_LONG_LONG val;
26192         PyObject *tmp = __Pyx_PyNumber_Int(x);
26193         if (!tmp) return (PY_LONG_LONG)-1;
26194         val = __Pyx_PyInt_AsLongLong(tmp);
26195         Py_DECREF(tmp);
26196         return val;
26197     }
26198 }
26199
26200 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
26201     const signed long neg_one = (signed long)-1, const_zero = 0;
26202     const int is_unsigned = neg_one > const_zero;
26203 #if PY_VERSION_HEX < 0x03000000
26204     if (likely(PyInt_Check(x))) {
26205         long val = PyInt_AS_LONG(x);
26206         if (is_unsigned && unlikely(val < 0)) {
26207             PyErr_SetString(PyExc_OverflowError,
26208                             "can't convert negative value to signed long");
26209             return (signed long)-1;
26210         }
26211         return (signed long)val;
26212     } else
26213 #endif
26214     if (likely(PyLong_Check(x))) {
26215         if (is_unsigned) {
26216             if (unlikely(Py_SIZE(x) < 0)) {
26217                 PyErr_SetString(PyExc_OverflowError,
26218                                 "can't convert negative value to signed long");
26219                 return (signed long)-1;
26220             }
26221             return PyLong_AsUnsignedLong(x);
26222         } else {
26223             return PyLong_AsLong(x);
26224         }
26225     } else {
26226         signed long val;
26227         PyObject *tmp = __Pyx_PyNumber_Int(x);
26228         if (!tmp) return (signed long)-1;
26229         val = __Pyx_PyInt_AsSignedLong(tmp);
26230         Py_DECREF(tmp);
26231         return val;
26232     }
26233 }
26234
26235 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
26236     const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
26237     const int is_unsigned = neg_one > const_zero;
26238 #if PY_VERSION_HEX < 0x03000000
26239     if (likely(PyInt_Check(x))) {
26240         long val = PyInt_AS_LONG(x);
26241         if (is_unsigned && unlikely(val < 0)) {
26242             PyErr_SetString(PyExc_OverflowError,
26243                             "can't convert negative value to signed PY_LONG_LONG");
26244             return (signed PY_LONG_LONG)-1;
26245         }
26246         return (signed PY_LONG_LONG)val;
26247     } else
26248 #endif
26249     if (likely(PyLong_Check(x))) {
26250         if (is_unsigned) {
26251             if (unlikely(Py_SIZE(x) < 0)) {
26252                 PyErr_SetString(PyExc_OverflowError,
26253                                 "can't convert negative value to signed PY_LONG_LONG");
26254                 return (signed PY_LONG_LONG)-1;
26255             }
26256             return PyLong_AsUnsignedLongLong(x);
26257         } else {
26258             return PyLong_AsLongLong(x);
26259         }
26260     } else {
26261         signed PY_LONG_LONG val;
26262         PyObject *tmp = __Pyx_PyNumber_Int(x);
26263         if (!tmp) return (signed PY_LONG_LONG)-1;
26264         val = __Pyx_PyInt_AsSignedLongLong(tmp);
26265         Py_DECREF(tmp);
26266         return val;
26267     }
26268 }
26269
26270 #ifndef __PYX_HAVE_RT_ImportType
26271 #define __PYX_HAVE_RT_ImportType
26272 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
26273     long size, int strict)
26274 {
26275     PyObject *py_module = 0;
26276     PyObject *result = 0;
26277     PyObject *py_name = 0;
26278     char warning[200];
26279
26280     py_module = __Pyx_ImportModule(module_name);
26281     if (!py_module)
26282         goto bad;
26283     #if PY_MAJOR_VERSION < 3
26284     py_name = PyString_FromString(class_name);
26285     #else
26286     py_name = PyUnicode_FromString(class_name);
26287     #endif
26288     if (!py_name)
26289         goto bad;
26290     result = PyObject_GetAttr(py_module, py_name);
26291     Py_DECREF(py_name);
26292     py_name = 0;
26293     Py_DECREF(py_module);
26294     py_module = 0;
26295     if (!result)
26296         goto bad;
26297     if (!PyType_Check(result)) {
26298         PyErr_Format(PyExc_TypeError,
26299             "%s.%s is not a type object",
26300             module_name, class_name);
26301         goto bad;
26302     }
26303     if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
26304         PyOS_snprintf(warning, sizeof(warning),
26305             "%s.%s size changed, may indicate binary incompatibility",
26306             module_name, class_name);
26307         #if PY_VERSION_HEX < 0x02050000
26308         PyErr_Warn(NULL, warning);
26309         #else
26310         PyErr_WarnEx(NULL, warning, 0);
26311         #endif
26312     }
26313     else if (((PyTypeObject *)result)->tp_basicsize != size) {
26314         PyErr_Format(PyExc_ValueError,
26315             "%s.%s has the wrong size, try recompiling",
26316             module_name, class_name);
26317         goto bad;
26318     }
26319     return (PyTypeObject *)result;
26320 bad:
26321     Py_XDECREF(py_module);
26322     Py_XDECREF(result);
26323     return 0;
26324 }
26325 #endif
26326
26327 #ifndef __PYX_HAVE_RT_ImportModule
26328 #define __PYX_HAVE_RT_ImportModule
26329 static PyObject *__Pyx_ImportModule(const char *name) {
26330     PyObject *py_name = 0;
26331     PyObject *py_module = 0;
26332
26333     #if PY_MAJOR_VERSION < 3
26334     py_name = PyString_FromString(name);
26335     #else
26336     py_name = PyUnicode_FromString(name);
26337     #endif
26338     if (!py_name)
26339         goto bad;
26340     py_module = PyImport_Import(py_name);
26341     Py_DECREF(py_name);
26342     return py_module;
26343 bad:
26344     Py_XDECREF(py_name);
26345     return 0;
26346 }
26347 #endif
26348
26349 static void* __Pyx_GetVtable(PyObject *dict) {
26350     void* ptr;
26351     PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
26352     if (!ob)
26353         goto bad;
26354 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
26355     ptr = PyCapsule_GetPointer(ob, 0);
26356 #else
26357     ptr = PyCObject_AsVoidPtr(ob);
26358 #endif
26359     if (!ptr && !PyErr_Occurred())
26360         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
26361     Py_DECREF(ob);
26362     return ptr;
26363 bad:
26364     Py_XDECREF(ob);
26365     return NULL;
26366 }
26367
26368 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
26369 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
26370     PyObject *ob = PyCapsule_New(vtable, 0, 0);
26371 #else
26372     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26373 #endif
26374     if (!ob)
26375         goto bad;
26376     if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
26377         goto bad;
26378     Py_DECREF(ob);
26379     return 0;
26380 bad:
26381     Py_XDECREF(ob);
26382     return -1;
26383 }
26384
26385 #include "compile.h"
26386 #include "frameobject.h"
26387 #include "traceback.h"
26388
26389 static void __Pyx_AddTraceback(const char *funcname) {
26390     PyObject *py_srcfile = 0;
26391     PyObject *py_funcname = 0;
26392     PyObject *py_globals = 0;
26393     PyCodeObject *py_code = 0;
26394     PyFrameObject *py_frame = 0;
26395
26396     #if PY_MAJOR_VERSION < 3
26397     py_srcfile = PyString_FromString(__pyx_filename);
26398     #else
26399     py_srcfile = PyUnicode_FromString(__pyx_filename);
26400     #endif
26401     if (!py_srcfile) goto bad;
26402     if (__pyx_clineno) {
26403         #if PY_MAJOR_VERSION < 3
26404         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
26405         #else
26406         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
26407         #endif
26408     }
26409     else {
26410         #if PY_MAJOR_VERSION < 3
26411         py_funcname = PyString_FromString(funcname);
26412         #else
26413         py_funcname = PyUnicode_FromString(funcname);
26414         #endif
26415     }
26416     if (!py_funcname) goto bad;
26417     py_globals = PyModule_GetDict(__pyx_m);
26418     if (!py_globals) goto bad;
26419     py_code = PyCode_New(
26420         0,            /*int argcount,*/
26421         #if PY_MAJOR_VERSION >= 3
26422         0,            /*int kwonlyargcount,*/
26423         #endif
26424         0,            /*int nlocals,*/
26425         0,            /*int stacksize,*/
26426         0,            /*int flags,*/
26427         __pyx_empty_bytes, /*PyObject *code,*/
26428         __pyx_empty_tuple,  /*PyObject *consts,*/
26429         __pyx_empty_tuple,  /*PyObject *names,*/
26430         __pyx_empty_tuple,  /*PyObject *varnames,*/
26431         __pyx_empty_tuple,  /*PyObject *freevars,*/
26432         __pyx_empty_tuple,  /*PyObject *cellvars,*/
26433         py_srcfile,   /*PyObject *filename,*/
26434         py_funcname,  /*PyObject *name,*/
26435         __pyx_lineno,   /*int firstlineno,*/
26436         __pyx_empty_bytes  /*PyObject *lnotab*/
26437     );
26438     if (!py_code) goto bad;
26439     py_frame = PyFrame_New(
26440         PyThreadState_GET(), /*PyThreadState *tstate,*/
26441         py_code,             /*PyCodeObject *code,*/
26442         py_globals,          /*PyObject *globals,*/
26443         0                    /*PyObject *locals*/
26444     );
26445     if (!py_frame) goto bad;
26446     py_frame->f_lineno = __pyx_lineno;
26447     PyTraceBack_Here(py_frame);
26448 bad:
26449     Py_XDECREF(py_srcfile);
26450     Py_XDECREF(py_funcname);
26451     Py_XDECREF(py_code);
26452     Py_XDECREF(py_frame);
26453 }
26454
26455 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
26456     while (t->p) {
26457         #if PY_MAJOR_VERSION < 3
26458         if (t->is_unicode) {
26459             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
26460         } else if (t->intern) {
26461             *t->p = PyString_InternFromString(t->s);
26462         } else {
26463             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
26464         }
26465         #else  /* Python 3+ has unicode identifiers */
26466         if (t->is_unicode | t->is_str) {
26467             if (t->intern) {
26468                 *t->p = PyUnicode_InternFromString(t->s);
26469             } else if (t->encoding) {
26470                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
26471             } else {
26472                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
26473             }
26474         } else {
26475             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
26476         }
26477         #endif
26478         if (!*t->p)
26479             return -1;
26480         ++t;
26481     }
26482     return 0;
26483 }
26484
26485 /* Type Conversion Functions */
26486
26487 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
26488    int is_true = x == Py_True;
26489    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
26490    else return PyObject_IsTrue(x);
26491 }
26492
26493 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
26494   PyNumberMethods *m;
26495   const char *name = NULL;
26496   PyObject *res = NULL;
26497 #if PY_VERSION_HEX < 0x03000000
26498   if (PyInt_Check(x) || PyLong_Check(x))
26499 #else
26500   if (PyLong_Check(x))
26501 #endif
26502     return Py_INCREF(x), x;
26503   m = Py_TYPE(x)->tp_as_number;
26504 #if PY_VERSION_HEX < 0x03000000
26505   if (m && m->nb_int) {
26506     name = "int";
26507     res = PyNumber_Int(x);
26508   }
26509   else if (m && m->nb_long) {
26510     name = "long";
26511     res = PyNumber_Long(x);
26512   }
26513 #else
26514   if (m && m->nb_int) {
26515     name = "int";
26516     res = PyNumber_Long(x);
26517   }
26518 #endif
26519   if (res) {
26520 #if PY_VERSION_HEX < 0x03000000
26521     if (!PyInt_Check(res) && !PyLong_Check(res)) {
26522 #else
26523     if (!PyLong_Check(res)) {
26524 #endif
26525       PyErr_Format(PyExc_TypeError,
26526                    "__%s__ returned non-%s (type %.200s)",
26527                    name, name, Py_TYPE(res)->tp_name);
26528       Py_DECREF(res);
26529       return NULL;
26530     }
26531   }
26532   else if (!PyErr_Occurred()) {
26533     PyErr_SetString(PyExc_TypeError,
26534                     "an integer is required");
26535   }
26536   return res;
26537 }
26538
26539 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
26540   Py_ssize_t ival;
26541   PyObject* x = PyNumber_Index(b);
26542   if (!x) return -1;
26543   ival = PyInt_AsSsize_t(x);
26544   Py_DECREF(x);
26545   return ival;
26546 }
26547
26548 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
26549 #if PY_VERSION_HEX < 0x02050000
26550    if (ival <= LONG_MAX)
26551        return PyInt_FromLong((long)ival);
26552    else {
26553        unsigned char *bytes = (unsigned char *) &ival;
26554        int one = 1; int little = (int)*(unsigned char*)&one;
26555        return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
26556    }
26557 #else
26558    return PyInt_FromSize_t(ival);
26559 #endif
26560 }
26561
26562 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
26563    unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
26564    if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
26565        return (size_t)-1;
26566    } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
26567        PyErr_SetString(PyExc_OverflowError,
26568                        "value too large to convert to size_t");
26569        return (size_t)-1;
26570    }
26571    return (size_t)val;
26572 }
26573
26574
26575 #endif /* Py_PYTHON_H */