Imported Upstream version 0.5
[pysam.git] / pysam / cvcf.c
1 /* Generated by Cython 0.13 on Thu May  5 15:40:49 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   #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
130   #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
131 #endif
132
133 #ifndef PySet_CheckExact
134 #  define PySet_CheckExact(obj)          (Py_TYPE(obj) == &PySet_Type)
135 #endif
136
137 #if PY_MAJOR_VERSION >= 3
138   #define PyInt_Type                   PyLong_Type
139   #define PyInt_Check(op)              PyLong_Check(op)
140   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
141   #define PyInt_FromString             PyLong_FromString
142   #define PyInt_FromUnicode            PyLong_FromUnicode
143   #define PyInt_FromLong               PyLong_FromLong
144   #define PyInt_FromSize_t             PyLong_FromSize_t
145   #define PyInt_FromSsize_t            PyLong_FromSsize_t
146   #define PyInt_AsLong                 PyLong_AsLong
147   #define PyInt_AS_LONG                PyLong_AS_LONG
148   #define PyInt_AsSsize_t              PyLong_AsSsize_t
149   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
150   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
151 #endif
152
153 #if PY_MAJOR_VERSION >= 3
154   #define PyBoolObject PyLongObject
155 #endif
156
157
158 #if PY_MAJOR_VERSION >= 3
159   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
160   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
161 #else
162   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
163   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
164 #endif
165
166 #if PY_MAJOR_VERSION >= 3
167   #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
168 #endif
169
170 #if PY_VERSION_HEX < 0x02050000
171   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
172   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
173   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
174 #else
175   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
176   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
177   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
178 #endif
179
180 #if PY_VERSION_HEX < 0x02050000
181   #define __Pyx_NAMESTR(n) ((char *)(n))
182   #define __Pyx_DOCSTR(n)  ((char *)(n))
183 #else
184   #define __Pyx_NAMESTR(n) (n)
185   #define __Pyx_DOCSTR(n)  (n)
186 #endif
187
188 #ifdef __cplusplus
189 #define __PYX_EXTERN_C extern "C"
190 #else
191 #define __PYX_EXTERN_C extern
192 #endif
193
194 #if defined(WIN32) || defined(MS_WINDOWS)
195 #define _USE_MATH_DEFINES
196 #endif
197 #include <math.h>
198 #define __PYX_HAVE_API__cvcf
199 #include "stdlib.h"
200 #include "string.h"
201 #include "stdint.h"
202 #include "stdio.h"
203 #include "ctype.h"
204 #include "sys/types.h"
205 #include "sys/stat.h"
206 #include "fcntl.h"
207 #include "unistd.h"
208 #include "bgzf.h"
209 #include "tabix.h"
210
211 /* inline attribute */
212 #ifndef CYTHON_INLINE
213   #if defined(__GNUC__)
214     #define CYTHON_INLINE __inline__
215   #elif defined(_MSC_VER)
216     #define CYTHON_INLINE __inline
217   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218     #define CYTHON_INLINE inline
219   #else
220     #define CYTHON_INLINE 
221   #endif
222 #endif
223
224 /* unused attribute */
225 #ifndef CYTHON_UNUSED
226 # if defined(__GNUC__)
227 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
228 #     define CYTHON_UNUSED __attribute__ ((__unused__)) 
229 #   else
230 #     define CYTHON_UNUSED
231 #   endif
232 # elif defined(__ICC) || defined(__INTEL_COMPILER)
233 #   define CYTHON_UNUSED __attribute__ ((__unused__)) 
234 # else
235 #   define CYTHON_UNUSED 
236 # endif
237 #endif
238
239 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*/
240
241
242 /* Type Conversion Predeclarations */
243
244 #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
245 #define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
246
247 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
248 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
249 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
250
251 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
252 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
253 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
254
255 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
256
257
258 #ifdef __GNUC__
259 /* Test for GCC > 2.95 */
260 #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
261 #define likely(x)   __builtin_expect(!!(x), 1)
262 #define unlikely(x) __builtin_expect(!!(x), 0)
263 #else /* __GNUC__ > 2 ... */
264 #define likely(x)   (x)
265 #define unlikely(x) (x)
266 #endif /* __GNUC__ > 2 ... */
267 #else /* __GNUC__ */
268 #define likely(x)   (x)
269 #define unlikely(x) (x)
270 #endif /* __GNUC__ */
271     
272 static PyObject *__pyx_m;
273 static PyObject *__pyx_b;
274 static PyObject *__pyx_empty_tuple;
275 static PyObject *__pyx_empty_bytes;
276 static int __pyx_lineno;
277 static int __pyx_clineno = 0;
278 static const char * __pyx_cfilenm= __FILE__;
279 static const char *__pyx_filename;
280
281
282 static const char *__pyx_f[] = {
283   "cvcf.pyx",
284   "ctabix.pxd",
285   "TabProxies.pxd",
286 };
287
288 /* Type declarations */
289
290 /* "pysam/TabProxies.pxd":42
291  *   ctypedef int uint64_t
292  * 
293  * cdef class TupleProxy:             # <<<<<<<<<<<<<<
294  * 
295  *     cdef:
296  */
297
298 struct __pyx_obj_10TabProxies_TupleProxy {
299   PyObject_HEAD
300   struct __pyx_vtabstruct_10TabProxies_TupleProxy *__pyx_vtab;
301   char *data;
302   char **fields;
303   int nfields;
304   int index;
305   int nbytes;
306   int offset;
307   int is_modified;
308 };
309
310 /* "pysam/TabProxies.pxd":77
311  *     cdef update( self, char * buffer, size_t nbytes )
312  * 
313  * cdef class NamedTupleProxy( TupleProxy) :             # <<<<<<<<<<<<<<
314  *     pass
315  * 
316  */
317
318 struct __pyx_obj_10TabProxies_NamedTupleProxy {
319   struct __pyx_obj_10TabProxies_TupleProxy __pyx_base;
320 };
321
322 /* "pysam/TabProxies.pxd":80
323  *     pass
324  * 
325  * cdef class BedProxy( NamedTupleProxy) :             # <<<<<<<<<<<<<<
326  * 
327  *     cdef:
328  */
329
330 struct __pyx_obj_10TabProxies_BedProxy {
331   struct __pyx_obj_10TabProxies_NamedTupleProxy __pyx_base;
332   char *contig;
333   uint32_t start;
334   uint32_t end;
335   int bedfields;
336 };
337
338 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":94
339  * ###########################################################################################################
340  * 
341  * cdef class VCFRecord( TabProxies.TupleProxy):             # <<<<<<<<<<<<<<
342  *     '''vcf record.
343  * 
344  */
345
346 struct __pyx_obj_4cvcf_VCFRecord {
347   struct __pyx_obj_10TabProxies_TupleProxy __pyx_base;
348   PyObject *vcf;
349   char *contig;
350   uint32_t pos;
351 };
352
353 /* "pysam/TabProxies.pxd":91
354  *     cdef update( self, char * buffer, size_t nbytes )
355  * 
356  * cdef class VCFProxy( NamedTupleProxy) :             # <<<<<<<<<<<<<<
357  * 
358  *     cdef:
359  */
360
361 struct __pyx_obj_10TabProxies_VCFProxy {
362   struct __pyx_obj_10TabProxies_NamedTupleProxy __pyx_base;
363   char *contig;
364   uint32_t pos;
365 };
366
367 /* "pysam/ctabix.pxd":178
368  *     cdef tabix_t * tabixfile
369  * 
370  * cdef class Parser:             # <<<<<<<<<<<<<<
371  *      pass
372  */
373
374 struct __pyx_obj_6ctabix_Parser {
375   PyObject_HEAD
376 };
377
378 /* "pysam/TabProxies.pxd":60
379  *     cdef update( self, char * buffer, size_t nbytes )
380  * 
381  * cdef class GTFProxy( TupleProxy) :             # <<<<<<<<<<<<<<
382  * 
383  *     cdef:
384  */
385
386 struct __pyx_obj_10TabProxies_GTFProxy {
387   struct __pyx_obj_10TabProxies_TupleProxy __pyx_base;
388   char *contig;
389   char *source;
390   char *feature;
391   uint32_t start;
392   uint32_t end;
393   char *score;
394   char *strand;
395   char *frame;
396   char *attributes;
397   int hasOwnAttributes;
398 };
399
400 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":221
401  * 
402  * 
403  * cdef class asVCFRecord( ctabix.Parser ):             # <<<<<<<<<<<<<<
404  *     '''converts a :term:`tabix row` into a VCF record.'''
405  *     cdef vcffile
406  */
407
408 struct __pyx_obj_4cvcf_asVCFRecord {
409   struct __pyx_obj_6ctabix_Parser __pyx_base;
410   PyObject *vcffile;
411 };
412
413 /* "pysam/ctabix.pxd":172
414  *   # char *ti_iter_read(BGZF *fp, ti_iter_t iter, int *len)
415  * 
416  * cdef class Tabixfile:             # <<<<<<<<<<<<<<
417  *     cdef char * filename
418  * 
419  */
420
421 struct __pyx_obj_6ctabix_Tabixfile {
422   PyObject_HEAD
423   char *filename;
424   tabix_t *tabixfile;
425 };
426
427
428 /* "pysam/TabProxies.pxd":42
429  *   ctypedef int uint64_t
430  * 
431  * cdef class TupleProxy:             # <<<<<<<<<<<<<<
432  * 
433  *     cdef:
434  */
435
436 struct __pyx_vtabstruct_10TabProxies_TupleProxy {
437   int (*getMaxFields)(struct __pyx_obj_10TabProxies_TupleProxy *, size_t);
438   PyObject *(*take)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
439   PyObject *(*present)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
440   PyObject *(*copy)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
441   PyObject *(*update)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
442 };
443 static struct __pyx_vtabstruct_10TabProxies_TupleProxy *__pyx_vtabptr_10TabProxies_TupleProxy;
444
445
446 /* "pysam/TabProxies.pxd":77
447  *     cdef update( self, char * buffer, size_t nbytes )
448  * 
449  * cdef class NamedTupleProxy( TupleProxy) :             # <<<<<<<<<<<<<<
450  *     pass
451  * 
452  */
453
454 struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy {
455   struct __pyx_vtabstruct_10TabProxies_TupleProxy __pyx_base;
456 };
457 static struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy *__pyx_vtabptr_10TabProxies_NamedTupleProxy;
458
459
460 /* "pysam/TabProxies.pxd":91
461  *     cdef update( self, char * buffer, size_t nbytes )
462  * 
463  * cdef class VCFProxy( NamedTupleProxy) :             # <<<<<<<<<<<<<<
464  * 
465  *     cdef:
466  */
467
468 struct __pyx_vtabstruct_10TabProxies_VCFProxy {
469   struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy __pyx_base;
470 };
471 static struct __pyx_vtabstruct_10TabProxies_VCFProxy *__pyx_vtabptr_10TabProxies_VCFProxy;
472
473
474 /* "pysam/TabProxies.pxd":60
475  *     cdef update( self, char * buffer, size_t nbytes )
476  * 
477  * cdef class GTFProxy( TupleProxy) :             # <<<<<<<<<<<<<<
478  * 
479  *     cdef:
480  */
481
482 struct __pyx_vtabstruct_10TabProxies_GTFProxy {
483   struct __pyx_vtabstruct_10TabProxies_TupleProxy __pyx_base;
484 };
485 static struct __pyx_vtabstruct_10TabProxies_GTFProxy *__pyx_vtabptr_10TabProxies_GTFProxy;
486
487
488 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":94
489  * ###########################################################################################################
490  * 
491  * cdef class VCFRecord( TabProxies.TupleProxy):             # <<<<<<<<<<<<<<
492  *     '''vcf record.
493  * 
494  */
495
496 struct __pyx_vtabstruct_4cvcf_VCFRecord {
497   struct __pyx_vtabstruct_10TabProxies_TupleProxy __pyx_base;
498 };
499 static struct __pyx_vtabstruct_4cvcf_VCFRecord *__pyx_vtabptr_4cvcf_VCFRecord;
500
501
502 /* "pysam/TabProxies.pxd":80
503  *     pass
504  * 
505  * cdef class BedProxy( NamedTupleProxy) :             # <<<<<<<<<<<<<<
506  * 
507  *     cdef:
508  */
509
510 struct __pyx_vtabstruct_10TabProxies_BedProxy {
511   struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy __pyx_base;
512 };
513 static struct __pyx_vtabstruct_10TabProxies_BedProxy *__pyx_vtabptr_10TabProxies_BedProxy;
514
515 #ifndef CYTHON_REFNANNY
516   #define CYTHON_REFNANNY 0
517 #endif
518
519 #if CYTHON_REFNANNY
520   typedef struct {
521     void (*INCREF)(void*, PyObject*, int);
522     void (*DECREF)(void*, PyObject*, int);
523     void (*GOTREF)(void*, PyObject*, int);
524     void (*GIVEREF)(void*, PyObject*, int);
525     void* (*SetupContext)(const char*, int, const char*);
526     void (*FinishContext)(void**);
527   } __Pyx_RefNannyAPIStruct;
528   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
529   static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
530     PyObject *m = NULL, *p = NULL;
531     void *r = NULL;
532     m = PyImport_ImportModule((char *)modname);
533     if (!m) goto end;
534     p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
535     if (!p) goto end;
536     r = PyLong_AsVoidPtr(p);
537   end:
538     Py_XDECREF(p);
539     Py_XDECREF(m);
540     return (__Pyx_RefNannyAPIStruct *)r;
541   }
542   #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
543   #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
544   #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
545   #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
546   #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
547   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
548   #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
549 #else
550   #define __Pyx_RefNannySetupContext(name)
551   #define __Pyx_RefNannyFinishContext()
552   #define __Pyx_INCREF(r) Py_INCREF(r)
553   #define __Pyx_DECREF(r) Py_DECREF(r)
554   #define __Pyx_GOTREF(r)
555   #define __Pyx_GIVEREF(r)
556   #define __Pyx_XDECREF(r) Py_XDECREF(r)
557 #endif /* CYTHON_REFNANNY */
558 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
559 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
560
561 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
562
563 static void __Pyx_RaiseDoubleKeywordsError(
564     const char* func_name, PyObject* kw_name); /*proto*/
565
566 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
567     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
568
569 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
570
571
572 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
573     PyObject *r;
574     if (!j) return NULL;
575     r = PyObject_GetItem(o, j);
576     Py_DECREF(j);
577     return r;
578 }
579
580
581 #define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
582                                                     __Pyx_GetItemInt_List_Fast(o, i) : \
583                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
584
585 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
586     if (likely(o != Py_None)) {
587         if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
588             PyObject *r = PyList_GET_ITEM(o, i);
589             Py_INCREF(r);
590             return r;
591         }
592         else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
593             PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
594             Py_INCREF(r);
595             return r;
596         }
597     }
598     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
599 }
600
601 #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
602                                                     __Pyx_GetItemInt_Tuple_Fast(o, i) : \
603                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
604
605 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
606     if (likely(o != Py_None)) {
607         if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
608             PyObject *r = PyTuple_GET_ITEM(o, i);
609             Py_INCREF(r);
610             return r;
611         }
612         else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
613             PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
614             Py_INCREF(r);
615             return r;
616         }
617     }
618     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
619 }
620
621
622 #define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
623                                                     __Pyx_GetItemInt_Fast(o, i) : \
624                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
625
626 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
627     PyObject *r;
628     if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
629         r = PyList_GET_ITEM(o, i);
630         Py_INCREF(r);
631     }
632     else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
633         r = PyTuple_GET_ITEM(o, i);
634         Py_INCREF(r);
635     }
636     else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
637         r = PySequence_GetItem(o, i);
638     }
639     else {
640         r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
641     }
642     return r;
643 }
644
645 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
646
647 static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
648
649 #define __Pyx_PyObject_AsDouble(obj) \
650     ((likely(PyFloat_CheckExact(obj))) ? \
651      PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
652
653 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);
654
655
656 #if PY_MAJOR_VERSION >= 3
657 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
658     PyObject *value;
659     if (unlikely(d == Py_None)) {
660         __Pyx_RaiseNoneIndexingError();
661         return NULL;
662     }
663     value = PyDict_GetItemWithError(d, key);
664     if (unlikely(!value)) {
665         if (!PyErr_Occurred())
666             PyErr_SetObject(PyExc_KeyError, key);
667         return NULL;
668     }
669     Py_INCREF(value);
670     return value;
671 }
672 #else
673     #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
674 #endif
675
676 static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
677 static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
678     return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
679 }
680
681 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
682
683 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
684
685 static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
686 static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/
687
688 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
689
690 static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
691     if (likely(PyList_CheckExact(L))) {
692         if (PyList_Append(L, x) < 0) return NULL;
693         Py_INCREF(Py_None);
694         return Py_None; /* this is just to have an accurate signature */
695     }
696     else {
697         PyObject *r, *m;
698         m = __Pyx_GetAttrString(L, "append");
699         if (!m) return NULL;
700         r = PyObject_CallFunctionObjArgs(m, x, NULL);
701         Py_DECREF(m);
702         return r;
703     }
704 }
705
706 #define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
707                                                     __Pyx_SetItemInt_Fast(o, i, v) : \
708                                                     __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
709
710 static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
711     int r;
712     if (!j) return -1;
713     r = PyObject_SetItem(o, j, v);
714     Py_DECREF(j);
715     return r;
716 }
717
718 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
719     if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
720         Py_INCREF(v);
721         Py_DECREF(PyList_GET_ITEM(o, i));
722         PyList_SET_ITEM(o, i, v);
723         return 1;
724     }
725     else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0)))
726         return PySequence_SetItem(o, i, v);
727     else {
728         PyObject *j = PyInt_FromSsize_t(i);
729         return __Pyx_SetItemInt_Generic(o, j, v);
730     }
731 }
732
733 #if PY_VERSION_HEX < 0x02050000
734 #ifndef PyAnySet_CheckExact
735
736 #define PyAnySet_CheckExact(ob) \
737     ((ob)->ob_type == &PySet_Type || \
738      (ob)->ob_type == &PyFrozenSet_Type)
739
740 #define PySet_New(iterable) \
741     PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL)
742
743 #define Pyx_PyFrozenSet_New(iterable) \
744     PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL)
745
746 #define PySet_Size(anyset) \
747     PyObject_Size((anyset))
748
749 #define PySet_Contains(anyset, key) \
750     PySequence_Contains((anyset), (key))
751
752 #define PySet_Pop(set) \
753     PyObject_CallMethod(set, (char *)"pop", NULL)
754
755 static CYTHON_INLINE int PySet_Clear(PyObject *set) {
756     PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL);
757     if (!ret) return -1;
758     Py_DECREF(ret); return 0;
759 }
760
761 static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) {
762     PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key);
763     if (!ret) return -1;
764     Py_DECREF(ret); return 0;
765 }
766
767 static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) {
768     PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key);
769     if (!ret) return -1;
770     Py_DECREF(ret); return 0;
771 }
772
773 #endif /* PyAnySet_CheckExact (<= Py2.4) */
774
775 #if PY_VERSION_HEX < 0x02040000
776 #ifndef Py_SETOBJECT_H
777 #define Py_SETOBJECT_H
778
779 static PyTypeObject *__Pyx_PySet_Type = NULL;
780 static PyTypeObject *__Pyx_PyFrozenSet_Type = NULL;
781
782 #define PySet_Type (*__Pyx_PySet_Type)
783 #define PyFrozenSet_Type (*__Pyx_PyFrozenSet_Type)
784
785 #define PyAnySet_Check(ob) \
786     (PyAnySet_CheckExact(ob) || \
787      PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \
788      PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type))
789
790 #define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type)
791
792 static int __Pyx_Py23SetsImport(void) {
793     PyObject *sets=0, *Set=0, *ImmutableSet=0;
794
795     sets = PyImport_ImportModule((char *)"sets");
796     if (!sets) goto bad;
797     Set = PyObject_GetAttrString(sets, (char *)"Set");
798     if (!Set) goto bad;
799     ImmutableSet = PyObject_GetAttrString(sets, (char *)"ImmutableSet");
800     if (!ImmutableSet) goto bad;
801     Py_DECREF(sets);
802
803     __Pyx_PySet_Type       = (PyTypeObject*) Set;
804     __Pyx_PyFrozenSet_Type = (PyTypeObject*) ImmutableSet;
805
806     return 0;
807
808  bad:
809     Py_XDECREF(sets);
810     Py_XDECREF(Set);
811     Py_XDECREF(ImmutableSet);
812     return -1;
813 }
814
815 #else
816 static int __Pyx_Py23SetsImport(void) { return 0; }
817 #endif /* !Py_SETOBJECT_H */
818 #endif /* < Py2.4  */
819 #endif /* < Py2.5  */
820
821 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
822 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
823
824 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
825
826 static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
827
828 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
829 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
830
831 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
832
833 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint32_t(uint32_t);
834
835 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
836
837 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
838
839 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
840
841 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
842
843 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
844
845 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
846
847 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
848
849 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
850
851 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
852
853 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
854
855 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
856
857 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
858
859 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
860
861 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
862
863 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
864
865 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
866
867 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict);  /*proto*/
868
869 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
870
871 static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
872
873 static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
874
875 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
876
877 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
878 /* Module declarations from ctabix */
879
880 static PyTypeObject *__pyx_ptype_6ctabix_Tabixfile = 0;
881 static PyTypeObject *__pyx_ptype_6ctabix_Parser = 0;
882 /* Module declarations from TabProxies */
883
884 static PyTypeObject *__pyx_ptype_10TabProxies_TupleProxy = 0;
885 static PyTypeObject *__pyx_ptype_10TabProxies_GTFProxy = 0;
886 static PyTypeObject *__pyx_ptype_10TabProxies_NamedTupleProxy = 0;
887 static PyTypeObject *__pyx_ptype_10TabProxies_BedProxy = 0;
888 static PyTypeObject *__pyx_ptype_10TabProxies_VCFProxy = 0;
889 /* Module declarations from cvcf */
890
891 static PyTypeObject *__pyx_ptype_4cvcf_VCFRecord = 0;
892 static PyTypeObject *__pyx_ptype_4cvcf_asVCFRecord = 0;
893 #define __Pyx_MODULE_NAME "cvcf"
894 int __pyx_module_is_main_cvcf = 0;
895
896 /* Implementation of cvcf */
897 static PyObject *__pyx_builtin_object;
898 static PyObject *__pyx_builtin_ValueError;
899 static PyObject *__pyx_builtin_range;
900 static PyObject *__pyx_builtin_enumerate;
901 static PyObject *__pyx_builtin_map;
902 static PyObject *__pyx_builtin_min;
903 static PyObject *__pyx_builtin_len;
904 static PyObject *__pyx_builtin_zip;
905 static PyObject *__pyx_builtin_StopIteration;
906 static PyObject *__pyx_builtin_KeyError;
907 static PyObject *__pyx_builtin_NotImplementedError;
908 static char __pyx_k_1[] = "";
909 static char __pyx_k_2[] = ",";
910 static char __pyx_k_3[] = ":";
911 static char __pyx_k_4[] = "-";
912 static char __pyx_k_5[] = "Don't understand region string '%s'";
913 static char __pyx_k_6[] = ".";
914 static char __pyx_k_7[] = ";";
915 static char __pyx_k_8[] = "=";
916 static char __pyx_k_9[] = "BAD_NUMBER_OF_VALUES";
917 static char __pyx_k_10[] = "(found %s values in element %s; expected %s)";
918 static char __pyx_k_11[] = "BAD_NUMBER_OF_PARAMETERS";
919 static char __pyx_k_12[] = "id=%s, expected %s parameters, got %s";
920 static char __pyx_k_14[] = "Line %s: '%s'\n%s %s: %s\n";
921 static char __pyx_k_16[] = "<";
922 static char __pyx_k_17[] = "V40_MISSING_ANGLE_BRACKETS";
923 static char __pyx_k_18[] = ">";
924 static char __pyx_k_19[] = "\"";
925 static char __pyx_k_20[] = "V40_FORMAT_MUST_HAVE_NAMED_FIELDS";
926 static char __pyx_k_21[] = "BADLY_FORMATTED_FORMAT_STRING";
927 static char __pyx_k_22[] = "ID=";
928 static char __pyx_k_23[] = "Number=";
929 static char __pyx_k_24[] = "Type=";
930 static char __pyx_k_25[] = "Description=";
931 static char __pyx_k_26[] = "FORMAT_MISSING_QUOTES";
932 static char __pyx_k_27[] = "<none>";
933 static char __pyx_k_28[] = "#alleles";
934 static char __pyx_k_29[] = "#nonref_alleles";
935 static char __pyx_k_30[] = "#genotypes";
936 static char __pyx_k_31[] = "#phased_genotypes";
937 static char __pyx_k_33[] = "Unknown number type encountered: %s";
938 static char __pyx_k_34[] = "%s=%s";
939 static char __pyx_k_35[] = "(Undefined tag)";
940 static char __pyx_k_38[] = "(output)";
941 static char __pyx_k_39[] = "Genotype Quality";
942 static char __pyx_k_40[] = "Read depth at this position for this sample";
943 static char __pyx_k_41[] = "Haplotype Quality";
944 static char __pyx_k_42[] = "Sample Genotype Filter";
945 static char __pyx_k_43[] = "##";
946 static char __pyx_k_44[] = "VCFv3.3";
947 static char __pyx_k_45[] = "VCFv4.0";
948 static char __pyx_k_46[] = "VCFv4.1";
949 static char __pyx_k_47[] = "UNKNOWN_FORMAT_STRING";
950 static char __pyx_k_48[] = "##fileformat=VCFv%s.%s\n";
951 static char __pyx_k_49[] = "##%s=%s\n";
952 static char __pyx_k_50[] = "#";
953 static char __pyx_k_51[] = "\t";
954 static char __pyx_k_52[] = "HEADING_NOT_SEPARATED_BY_TABS";
955 static char __pyx_k_53[] = "(%sth entry not found)";
956 static char __pyx_k_54[] = "(found %s, expected %s)";
957 static char __pyx_k_55[] = "BADLY_FORMATTED_HEADING";
958 static char __pyx_k_56[] = "\n";
959 static char __pyx_k_57[] = "|";
960 static char __pyx_k_58[] = "ERROR_FLAG_HAS_VALUE";
961 static char __pyx_k_59[] = "ERROR_FORMAT_NOT_NUMERICAL";
962 static char __pyx_k_60[] = "ERROR_FORMAT_NOT_CHAR";
963 static char __pyx_k_62[] = "BAD_NUMBER_OF_COLUMNS";
964 static char __pyx_k_63[] = "expected %s for %s samples (%s), got %s";
965 static char __pyx_k_64[] = "(reference is %s, VCF says %s)";
966 static char __pyx_k_65[] = "V33_UNMATCHED_DELETION";
967 static char __pyx_k_66[] = "(deletion is %s, reference is %s)";
968 static char __pyx_k_67[] = "MISSING_INDEL_ALLELE_REF_BASE";
969 static char __pyx_k_68[] = "Required key %s not found in data";
970 static char __pyx_k_69[] = "enter_default_format";
971 static char __pyx_k_70[] = "Can only handle v3.3 and v4.0 VCF files";
972 static char __pyx_k_71[] = "Invalid error string: %s";
973 static char __pyx_k_72[] = "needs to be checked";
974 static char __pyx_k_73[] = "[|/\\\\]";
975 static char __pyx_k_74[] = "^[ACGTN]+$";
976 static char __pyx_k_75[] = "id numbertype number type description missingvalue";
977 static char __pyx_k_76[] = "UNKNOWN_FORMAT_STRING:Unknown file format identifier";
978 static char __pyx_k_77[] = "BADLY_FORMATTED_FORMAT_STRING:Formatting error in the format string";
979 static char __pyx_k_78[] = "BADLY_FORMATTED_HEADING:Did not find 9 required headings (CHROM, POS, ..., FORMAT) %s";
980 static char __pyx_k_79[] = "BAD_NUMBER_OF_COLUMNS:Wrong number of columns found (%s)";
981 static char __pyx_k_80[] = "POS_NOT_NUMERICAL:Position column is not numerical";
982 static char __pyx_k_81[] = "UNKNOWN_CHAR_IN_REF:Unknown character in reference field";
983 static char __pyx_k_82[] = "V33_BAD_REF:Reference should be single-character in v3.3 VCF";
984 static char __pyx_k_83[] = "V33_BAD_ALLELE:Cannot interpret allele for v3.3 VCF";
985 static char __pyx_k_84[] = "POS_NOT_POSITIVE:Position field must be >0";
986 static char __pyx_k_85[] = "QUAL_NOT_NUMERICAL:Quality field must be numerical, or '.'";
987 static char __pyx_k_86[] = "ERROR_INFO_STRING:Error while parsing info field";
988 static char __pyx_k_87[] = "ERROR_UNKNOWN_KEY:Unknown key (%s) found in formatted field (info; format; or filter)";
989 static char __pyx_k_88[] = "ERROR_FORMAT_NOT_NUMERICAL:Expected integer or float in formatted field; got %s";
990 static char __pyx_k_89[] = "ERROR_FORMAT_NOT_CHAR:Eexpected character in formatted field; got string";
991 static char __pyx_k_90[] = "FILTER_NOT_DEFINED:Identifier (%s) in filter found which was not defined in header";
992 static char __pyx_k_91[] = "FORMAT_NOT_DEFINED:Identifier (%s) in format found which was not defined in header";
993 static char __pyx_k_92[] = "BAD_NUMBER_OF_VALUES:Found too many of values in sample column (%s)";
994 static char __pyx_k_93[] = "BAD_NUMBER_OF_PARAMETERS:Found unexpected number of parameters (%s)";
995 static char __pyx_k_94[] = "BAD_GENOTYPE:Cannot parse genotype (%s)";
996 static char __pyx_k_95[] = "V40_BAD_ALLELE:Bad allele found for v4.0 VCF (%s)";
997 static char __pyx_k_96[] = "MISSING_REF:Reference allele missing";
998 static char __pyx_k_97[] = "V33_UNMATCHED_DELETION:Deleted sequence does not match reference (%s)";
999 static char __pyx_k_98[] = "V40_MISSING_ANGLE_BRACKETS:Format definition is not deliminted by angular brackets";
1000 static char __pyx_k_99[] = "FORMAT_MISSING_QUOTES:Description field in format definition is not surrounded by quotes";
1001 static char __pyx_k__0[] = "0";
1002 static char __pyx_k__D[] = "D";
1003 static char __pyx_k__I[] = "I";
1004 static char __pyx_k__N[] = "N";
1005 static char __pyx_k_100[] = "V40_FORMAT_MUST_HAVE_NAMED_FIELDS:Fields in v4.0 VCF format definition must have named fields";
1006 static char __pyx_k_101[] = "HEADING_NOT_SEPARATED_BY_TABS:Heading line appears separated by spaces, not tabs";
1007 static char __pyx_k_102[] = "WRONG_REF:Wrong reference %s";
1008 static char __pyx_k_103[] = "ERROR_TRAILING_DATA:Numerical field ('%s') has semicolon-separated trailing data";
1009 static char __pyx_k_104[] = "BAD_CHR_TAG:Error calculating chr tag for %s";
1010 static char __pyx_k_105[] = "ZERO_LENGTH_ALLELE:Found zero-length allele";
1011 static char __pyx_k_106[] = "MISSING_INDEL_ALLELE_REF_BASE:Indel alleles must begin with single reference base";
1012 static char __pyx_k_107[] = "VCF.getsamples (line 880)";
1013 static char __pyx_k_108[] = "VCF.setsamples (line 884)";
1014 static char __pyx_k_109[] = "VCF.getheader (line 888)";
1015 static char __pyx_k_110[] = "VCF.setheader (line 892)";
1016 static char __pyx_k_111[] = "VCF.getinfo (line 896)";
1017 static char __pyx_k_112[] = "VCF.setinfo (line 900)";
1018 static char __pyx_k_113[] = "VCF.getformat (line 904)";
1019 static char __pyx_k_114[] = "VCF.setformat (line 908)";
1020 static char __pyx_k_115[] = "VCF.getfilter (line 912)";
1021 static char __pyx_k_116[] = "VCF.setfilter (line 916)";
1022 static char __pyx_k_117[] = "VCF.setreference (line 927)";
1023 static char __pyx_k_118[] = "VCF.parse (line 939)";
1024 static char __pyx_k_119[] = "VCF.write (line 946)";
1025 static char __pyx_k_120[] = "VCF.writeheader (line 952)";
1026 static char __pyx_k_121[] = "VCF.compare_calls (line 957)";
1027 static char __pyx_k_122[] = "VCF.connect (line 979)";
1028 static char __pyx_k_123[] = "VCF.fetch (line 984)";
1029 static char __pyx_k_124[] = "VCF.validate (line 993)";
1030 static char __pyx_k__DP[] = "DP";
1031 static char __pyx_k__FT[] = "FT";
1032 static char __pyx_k__GQ[] = "GQ";
1033 static char __pyx_k__GT[] = "GT";
1034 static char __pyx_k__HQ[] = "HQ";
1035 static char __pyx_k__ID[] = "ID";
1036 static char __pyx_k__fa[] = "fa";
1037 static char __pyx_k__id[] = "id";
1038 static char __pyx_k__re[] = "re";
1039 static char __pyx_k__ALT[] = "ALT";
1040 static char __pyx_k__POS[] = "POS";
1041 static char __pyx_k__REF[] = "REF";
1042 static char __pyx_k__VCF[] = "VCF";
1043 static char __pyx_k__add[] = "add";
1044 static char __pyx_k__alt[] = "alt";
1045 static char __pyx_k__end[] = "end";
1046 static char __pyx_k__fmt[] = "fmt";
1047 static char __pyx_k__get[] = "get";
1048 static char __pyx_k__key[] = "key";
1049 static char __pyx_k__len[] = "len";
1050 static char __pyx_k__map[] = "map";
1051 static char __pyx_k__min[] = "min";
1052 static char __pyx_k__opt[] = "opt";
1053 static char __pyx_k__pos[] = "pos";
1054 static char __pyx_k__ref[] = "ref";
1055 static char __pyx_k__sys[] = "sys";
1056 static char __pyx_k__vcf[] = "vcf";
1057 static char __pyx_k__zip[] = "zip";
1058 static char __pyx_k__Flag[] = "Flag";
1059 static char __pyx_k__INFO[] = "INFO";
1060 static char __pyx_k__PASS[] = "PASS";
1061 static char __pyx_k__QUAL[] = "QUAL";
1062 static char __pyx_k__Type[] = "Type";
1063 static char __pyx_k__alt1[] = "alt1";
1064 static char __pyx_k__alt2[] = "alt2";
1065 static char __pyx_k__copy[] = "copy";
1066 static char __pyx_k__data[] = "data";
1067 static char __pyx_k__find[] = "find";
1068 static char __pyx_k__info[] = "info";
1069 static char __pyx_k__join[] = "join";
1070 static char __pyx_k__keys[] = "keys";
1071 static char __pyx_k__line[] = "line";
1072 static char __pyx_k__pos1[] = "pos1";
1073 static char __pyx_k__pos2[] = "pos2";
1074 static char __pyx_k__qual[] = "qual";
1075 static char __pyx_k__ref1[] = "ref1";
1076 static char __pyx_k__ref2[] = "ref2";
1077 static char __pyx_k__self[] = "self";
1078 static char __pyx_k__type[] = "type";
1079 static char __pyx_k__ACGTN[] = "ACGTN";
1080 static char __pyx_k__CHROM[] = "CHROM";
1081 static char __pyx_k__Error[] = "Error";
1082 static char __pyx_k__Float[] = "Float";
1083 static char __pyx_k___copy[] = "_copy";
1084 static char __pyx_k___info[] = "_info";
1085 static char __pyx_k___line[] = "_line";
1086 static char __pyx_k__chrom[] = "chrom";
1087 static char __pyx_k__descr[] = "descr";
1088 static char __pyx_k__error[] = "error";
1089 static char __pyx_k__fetch[] = "fetch";
1090 static char __pyx_k__lines[] = "lines";
1091 static char __pyx_k__match[] = "match";
1092 static char __pyx_k__parse[] = "parse";
1093 static char __pyx_k__pysam[] = "pysam";
1094 static char __pyx_k__range[] = "range";
1095 static char __pyx_k__split[] = "split";
1096 static char __pyx_k__start[] = "start";
1097 static char __pyx_k__strip[] = "strip";
1098 static char __pyx_k__upper[] = "upper";
1099 static char __pyx_k__value[] = "value";
1100 static char __pyx_k__write[] = "write";
1101 static char __pyx_k__FILTER[] = "FILTER";
1102 static char __pyx_k__FORMAT[] = "FORMAT";
1103 static char __pyx_k__GTdata[] = "GTdata";
1104 static char __pyx_k__Number[] = "Number";
1105 static char __pyx_k__String[] = "String";
1106 static char __pyx_k___lines[] = "_lines";
1107 static char __pyx_k___parse[] = "_parse";
1108 static char __pyx_k__bisect[] = "bisect";
1109 static char __pyx_k__buffer[] = "buffer";
1110 static char __pyx_k__contig[] = "contig";
1111 static char __pyx_k__fields[] = "fields";
1112 static char __pyx_k__filter[] = "filter";
1113 static char __pyx_k__format[] = "format";
1114 static char __pyx_k__header[] = "header";
1115 static char __pyx_k__number[] = "number";
1116 static char __pyx_k__object[] = "object";
1117 static char __pyx_k__offset[] = "offset";
1118 static char __pyx_k__parser[] = "parser";
1119 static char __pyx_k__record[] = "record";
1120 static char __pyx_k__region[] = "region";
1121 static char __pyx_k__stderr[] = "stderr";
1122 static char __pyx_k__stream[] = "stream";
1123 static char __pyx_k__Integer[] = "Integer";
1124 static char __pyx_k__Warning[] = "Warning";
1125 static char __pyx_k____all__[] = "__all__";
1126 static char __pyx_k___errors[] = "_errors";
1127 static char __pyx_k___filter[] = "_filter";
1128 static char __pyx_k___format[] = "_format";
1129 static char __pyx_k___header[] = "_header";
1130 static char __pyx_k___lineno[] = "_lineno";
1131 static char __pyx_k__compile[] = "compile";
1132 static char __pyx_k__connect[] = "connect";
1133 static char __pyx_k__getinfo[] = "getinfo";
1134 static char __pyx_k__missing[] = "missing";
1135 static char __pyx_k__nfields[] = "nfields";
1136 static char __pyx_k__regions[] = "regions";
1137 static char __pyx_k__replace[] = "replace";
1138 static char __pyx_k__samples[] = "samples";
1139 static char __pyx_k__setinfo[] = "setinfo";
1140 static char __pyx_k__vcffile[] = "vcffile";
1141 static char __pyx_k__version[] = "version";
1142 static char __pyx_k__GTstring[] = "GTstring";
1143 static char __pyx_k__Genotype[] = "Genotype";
1144 static char __pyx_k__KeyError[] = "KeyError";
1145 static char __pyx_k____dict__[] = "__dict__";
1146 static char __pyx_k____init__[] = "__init__";
1147 static char __pyx_k____main__[] = "__main__";
1148 static char __pyx_k____test__[] = "__test__";
1149 static char __pyx_k___regions[] = "_regions";
1150 static char __pyx_k___samples[] = "_samples";
1151 static char __pyx_k___version[] = "_version";
1152 static char __pyx_k__deepcopy[] = "deepcopy";
1153 static char __pyx_k__endswith[] = "endswith";
1154 static char __pyx_k__filename[] = "filename";
1155 static char __pyx_k__gtsRegEx[] = "gtsRegEx";
1156 static char __pyx_k__inregion[] = "inregion";
1157 static char __pyx_k__operator[] = "operator";
1158 static char __pyx_k__validate[] = "validate";
1159 static char __pyx_k__Character[] = "Character";
1160 static char __pyx_k__NT_NUMBER[] = "NT_NUMBER";
1161 static char __pyx_k__Tabixfile[] = "Tabixfile";
1162 static char __pyx_k__VCFRecord[] = "VCFRecord";
1163 static char __pyx_k__WRONG_REF[] = "WRONG_REF";
1164 static char __pyx_k___required[] = "_required";
1165 static char __pyx_k__convertGT[] = "convertGT";
1166 static char __pyx_k__enumerate[] = "enumerate";
1167 static char __pyx_k__getfilter[] = "getfilter";
1168 static char __pyx_k__getformat[] = "getformat";
1169 static char __pyx_k__getheader[] = "getheader";
1170 static char __pyx_k__leftalign[] = "leftalign";
1171 static char __pyx_k__lineparse[] = "lineparse";
1172 static char __pyx_k__reference[] = "reference";
1173 static char __pyx_k__separator[] = "separator";
1174 static char __pyx_k__setfilter[] = "setfilter";
1175 static char __pyx_k__setformat[] = "setformat";
1176 static char __pyx_k__setheader[] = "setheader";
1177 static char __pyx_k__tabixfile[] = "tabixfile";
1178 static char __pyx_k__warnerror[] = "warnerror";
1179 static char __pyx_k__NT_ALLELES[] = "NT_ALLELES";
1180 static char __pyx_k__NT_UNKNOWN[] = "NT_UNKNOWN";
1181 static char __pyx_k__ValueError[] = "ValueError";
1182 static char __pyx_k___leftalign[] = "_leftalign";
1183 static char __pyx_k___reference[] = "_reference";
1184 static char __pyx_k__fileformat[] = "fileformat";
1185 static char __pyx_k__formatdict[] = "formatdict";
1186 static char __pyx_k__getsamples[] = "getsamples";
1187 static char __pyx_k__itemgetter[] = "itemgetter";
1188 static char __pyx_k__itervalues[] = "itervalues";
1189 static char __pyx_k__namedtuple[] = "namedtuple";
1190 static char __pyx_k__numbertype[] = "numbertype";
1191 static char __pyx_k__parse_data[] = "parse_data";
1192 static char __pyx_k__setregions[] = "setregions";
1193 static char __pyx_k__setsamples[] = "setsamples";
1194 static char __pyx_k__setversion[] = "setversion";
1195 static char __pyx_k__startswith[] = "startswith";
1196 static char __pyx_k__write_data[] = "write_data";
1197 static char __pyx_k__Description[] = "Description";
1198 static char __pyx_k__MISSING_REF[] = "MISSING_REF";
1199 static char __pyx_k__V33_BAD_REF[] = "V33_BAD_REF";
1200 static char __pyx_k__alleleRegEx[] = "alleleRegEx";
1201 static char __pyx_k__collections[] = "collections";
1202 static char __pyx_k__defaultdict[] = "defaultdict";
1203 static char __pyx_k__description[] = "description";
1204 static char __pyx_k__errorstring[] = "errorstring";
1205 static char __pyx_k__ignoreerror[] = "ignoreerror";
1206 static char __pyx_k__writeheader[] = "writeheader";
1207 static char __pyx_k__BAD_GENOTYPE[] = "BAD_GENOTYPE";
1208 static char __pyx_k__NT_GENOTYPES[] = "NT_GENOTYPES";
1209 static char __pyx_k___warn_errors[] = "_warn_errors";
1210 static char __pyx_k__get_expected[] = "get_expected";
1211 static char __pyx_k__get_sequence[] = "get_sequence";
1212 static char __pyx_k__missingvalue[] = "missingvalue";
1213 static char __pyx_k__parse_format[] = "parse_format";
1214 static char __pyx_k__parse_header[] = "parse_header";
1215 static char __pyx_k__setreference[] = "setreference";
1216 static char __pyx_k__write_header[] = "write_header";
1217 static char __pyx_k__NT_NR_ALLELES[] = "NT_NR_ALLELES";
1218 static char __pyx_k__StopIteration[] = "StopIteration";
1219 static char __pyx_k___parse_header[] = "_parse_header";
1220 static char __pyx_k__compare_calls[] = "compare_calls";
1221 static char __pyx_k__convertGTback[] = "convertGTback";
1222 static char __pyx_k__datagenerator[] = "datagenerator";
1223 static char __pyx_k__format_format[] = "format_format";
1224 static char __pyx_k__parse_heading[] = "parse_heading";
1225 static char __pyx_k__write_heading[] = "write_heading";
1226 static char __pyx_k__V33_BAD_ALLELE[] = "V33_BAD_ALLELE";
1227 static char __pyx_k__V40_BAD_ALLELE[] = "V40_BAD_ALLELE";
1228 static char __pyx_k___sample2column[] = "_sample2column";
1229 static char __pyx_k___add_definition[] = "_add_definition";
1230 static char __pyx_k___ignored_errors[] = "_ignored_errors";
1231 static char __pyx_k__POS_NOT_POSITIVE[] = "POS_NOT_POSITIVE";
1232 static char __pyx_k__parse_formatdata[] = "parse_formatdata";
1233 static char __pyx_k__ERROR_INFO_STRING[] = "ERROR_INFO_STRING";
1234 static char __pyx_k__ERROR_UNKNOWN_KEY[] = "ERROR_UNKNOWN_KEY";
1235 static char __pyx_k__POS_NOT_NUMERICAL[] = "POS_NOT_NUMERICAL";
1236 static char __pyx_k__format_formatdata[] = "format_formatdata";
1237 static char __pyx_k__FILTER_NOT_DEFINED[] = "FILTER_NOT_DEFINED";
1238 static char __pyx_k__FORMAT_NOT_DEFINED[] = "FORMAT_NOT_DEFINED";
1239 static char __pyx_k__QUAL_NOT_NUMERICAL[] = "QUAL_NOT_NUMERICAL";
1240 static char __pyx_k__ZERO_LENGTH_ALLELE[] = "ZERO_LENGTH_ALLELE";
1241 static char __pyx_k__ERROR_TRAILING_DATA[] = "ERROR_TRAILING_DATA";
1242 static char __pyx_k__NT_PHASED_GENOTYPES[] = "NT_PHASED_GENOTYPES";
1243 static char __pyx_k__NotImplementedError[] = "NotImplementedError";
1244 static char __pyx_k__UNKNOWN_CHAR_IN_REF[] = "UNKNOWN_CHAR_IN_REF";
1245 static PyObject *__pyx_kp_s_1;
1246 static PyObject *__pyx_kp_s_10;
1247 static PyObject *__pyx_kp_s_100;
1248 static PyObject *__pyx_kp_s_101;
1249 static PyObject *__pyx_kp_s_102;
1250 static PyObject *__pyx_kp_s_103;
1251 static PyObject *__pyx_kp_s_104;
1252 static PyObject *__pyx_kp_s_105;
1253 static PyObject *__pyx_kp_s_106;
1254 static PyObject *__pyx_kp_u_107;
1255 static PyObject *__pyx_kp_u_108;
1256 static PyObject *__pyx_kp_u_109;
1257 static PyObject *__pyx_n_s_11;
1258 static PyObject *__pyx_kp_u_110;
1259 static PyObject *__pyx_kp_u_111;
1260 static PyObject *__pyx_kp_u_112;
1261 static PyObject *__pyx_kp_u_113;
1262 static PyObject *__pyx_kp_u_114;
1263 static PyObject *__pyx_kp_u_115;
1264 static PyObject *__pyx_kp_u_116;
1265 static PyObject *__pyx_kp_u_117;
1266 static PyObject *__pyx_kp_u_118;
1267 static PyObject *__pyx_kp_u_119;
1268 static PyObject *__pyx_kp_s_12;
1269 static PyObject *__pyx_kp_u_120;
1270 static PyObject *__pyx_kp_u_121;
1271 static PyObject *__pyx_kp_u_122;
1272 static PyObject *__pyx_kp_u_123;
1273 static PyObject *__pyx_kp_u_124;
1274 static PyObject *__pyx_kp_s_14;
1275 static PyObject *__pyx_kp_s_16;
1276 static PyObject *__pyx_n_s_17;
1277 static PyObject *__pyx_kp_s_18;
1278 static PyObject *__pyx_kp_s_19;
1279 static PyObject *__pyx_kp_s_2;
1280 static PyObject *__pyx_n_s_20;
1281 static PyObject *__pyx_n_s_21;
1282 static PyObject *__pyx_kp_s_22;
1283 static PyObject *__pyx_kp_s_23;
1284 static PyObject *__pyx_kp_s_24;
1285 static PyObject *__pyx_kp_s_25;
1286 static PyObject *__pyx_n_s_26;
1287 static PyObject *__pyx_kp_s_27;
1288 static PyObject *__pyx_kp_s_28;
1289 static PyObject *__pyx_kp_s_29;
1290 static PyObject *__pyx_kp_s_3;
1291 static PyObject *__pyx_kp_s_30;
1292 static PyObject *__pyx_kp_s_31;
1293 static PyObject *__pyx_kp_s_33;
1294 static PyObject *__pyx_kp_s_34;
1295 static PyObject *__pyx_kp_s_35;
1296 static PyObject *__pyx_kp_s_38;
1297 static PyObject *__pyx_kp_s_39;
1298 static PyObject *__pyx_kp_s_4;
1299 static PyObject *__pyx_kp_s_40;
1300 static PyObject *__pyx_kp_s_41;
1301 static PyObject *__pyx_kp_s_42;
1302 static PyObject *__pyx_kp_s_43;
1303 static PyObject *__pyx_kp_s_44;
1304 static PyObject *__pyx_kp_s_45;
1305 static PyObject *__pyx_kp_s_46;
1306 static PyObject *__pyx_n_s_47;
1307 static PyObject *__pyx_kp_s_48;
1308 static PyObject *__pyx_kp_s_49;
1309 static PyObject *__pyx_kp_s_5;
1310 static PyObject *__pyx_kp_s_50;
1311 static PyObject *__pyx_kp_s_51;
1312 static PyObject *__pyx_n_s_52;
1313 static PyObject *__pyx_kp_s_53;
1314 static PyObject *__pyx_kp_s_54;
1315 static PyObject *__pyx_n_s_55;
1316 static PyObject *__pyx_kp_s_56;
1317 static PyObject *__pyx_kp_s_57;
1318 static PyObject *__pyx_n_s_58;
1319 static PyObject *__pyx_n_s_59;
1320 static PyObject *__pyx_kp_b_6;
1321 static PyObject *__pyx_kp_s_6;
1322 static PyObject *__pyx_n_s_60;
1323 static PyObject *__pyx_n_s_62;
1324 static PyObject *__pyx_kp_s_63;
1325 static PyObject *__pyx_kp_s_64;
1326 static PyObject *__pyx_n_s_65;
1327 static PyObject *__pyx_kp_s_66;
1328 static PyObject *__pyx_n_s_67;
1329 static PyObject *__pyx_kp_s_68;
1330 static PyObject *__pyx_n_s_69;
1331 static PyObject *__pyx_kp_s_7;
1332 static PyObject *__pyx_kp_s_70;
1333 static PyObject *__pyx_kp_s_71;
1334 static PyObject *__pyx_kp_s_72;
1335 static PyObject *__pyx_kp_s_73;
1336 static PyObject *__pyx_kp_s_74;
1337 static PyObject *__pyx_kp_s_75;
1338 static PyObject *__pyx_kp_s_76;
1339 static PyObject *__pyx_kp_s_77;
1340 static PyObject *__pyx_kp_s_78;
1341 static PyObject *__pyx_kp_s_79;
1342 static PyObject *__pyx_kp_s_8;
1343 static PyObject *__pyx_kp_s_80;
1344 static PyObject *__pyx_kp_s_81;
1345 static PyObject *__pyx_kp_s_82;
1346 static PyObject *__pyx_kp_s_83;
1347 static PyObject *__pyx_kp_s_84;
1348 static PyObject *__pyx_kp_s_85;
1349 static PyObject *__pyx_kp_s_86;
1350 static PyObject *__pyx_kp_s_87;
1351 static PyObject *__pyx_kp_s_88;
1352 static PyObject *__pyx_kp_s_89;
1353 static PyObject *__pyx_n_s_9;
1354 static PyObject *__pyx_kp_s_90;
1355 static PyObject *__pyx_kp_s_91;
1356 static PyObject *__pyx_kp_s_92;
1357 static PyObject *__pyx_kp_s_93;
1358 static PyObject *__pyx_kp_s_94;
1359 static PyObject *__pyx_kp_s_95;
1360 static PyObject *__pyx_kp_s_96;
1361 static PyObject *__pyx_kp_s_97;
1362 static PyObject *__pyx_kp_s_98;
1363 static PyObject *__pyx_kp_s_99;
1364 static PyObject *__pyx_kp_s__0;
1365 static PyObject *__pyx_n_s__ACGTN;
1366 static PyObject *__pyx_n_s__ALT;
1367 static PyObject *__pyx_n_s__BAD_GENOTYPE;
1368 static PyObject *__pyx_n_s__CHROM;
1369 static PyObject *__pyx_n_s__Character;
1370 static PyObject *__pyx_n_s__D;
1371 static PyObject *__pyx_n_s__DP;
1372 static PyObject *__pyx_n_s__Description;
1373 static PyObject *__pyx_n_s__ERROR_INFO_STRING;
1374 static PyObject *__pyx_n_s__ERROR_TRAILING_DATA;
1375 static PyObject *__pyx_n_s__ERROR_UNKNOWN_KEY;
1376 static PyObject *__pyx_n_s__Error;
1377 static PyObject *__pyx_n_s__FILTER;
1378 static PyObject *__pyx_n_s__FILTER_NOT_DEFINED;
1379 static PyObject *__pyx_n_s__FORMAT;
1380 static PyObject *__pyx_n_s__FORMAT_NOT_DEFINED;
1381 static PyObject *__pyx_n_s__FT;
1382 static PyObject *__pyx_n_s__Flag;
1383 static PyObject *__pyx_n_s__Float;
1384 static PyObject *__pyx_n_s__GQ;
1385 static PyObject *__pyx_n_s__GT;
1386 static PyObject *__pyx_n_s__GTdata;
1387 static PyObject *__pyx_n_s__GTstring;
1388 static PyObject *__pyx_n_s__Genotype;
1389 static PyObject *__pyx_n_s__HQ;
1390 static PyObject *__pyx_n_s__I;
1391 static PyObject *__pyx_n_s__ID;
1392 static PyObject *__pyx_n_s__INFO;
1393 static PyObject *__pyx_n_s__Integer;
1394 static PyObject *__pyx_n_s__KeyError;
1395 static PyObject *__pyx_n_s__MISSING_REF;
1396 static PyObject *__pyx_n_s__N;
1397 static PyObject *__pyx_n_s__NT_ALLELES;
1398 static PyObject *__pyx_n_s__NT_GENOTYPES;
1399 static PyObject *__pyx_n_s__NT_NR_ALLELES;
1400 static PyObject *__pyx_n_s__NT_NUMBER;
1401 static PyObject *__pyx_n_s__NT_PHASED_GENOTYPES;
1402 static PyObject *__pyx_n_s__NT_UNKNOWN;
1403 static PyObject *__pyx_n_s__NotImplementedError;
1404 static PyObject *__pyx_n_s__Number;
1405 static PyObject *__pyx_n_s__PASS;
1406 static PyObject *__pyx_n_s__POS;
1407 static PyObject *__pyx_n_s__POS_NOT_NUMERICAL;
1408 static PyObject *__pyx_n_s__POS_NOT_POSITIVE;
1409 static PyObject *__pyx_n_s__QUAL;
1410 static PyObject *__pyx_n_s__QUAL_NOT_NUMERICAL;
1411 static PyObject *__pyx_n_s__REF;
1412 static PyObject *__pyx_n_s__StopIteration;
1413 static PyObject *__pyx_n_s__String;
1414 static PyObject *__pyx_n_s__Tabixfile;
1415 static PyObject *__pyx_n_s__Type;
1416 static PyObject *__pyx_n_s__UNKNOWN_CHAR_IN_REF;
1417 static PyObject *__pyx_n_s__V33_BAD_ALLELE;
1418 static PyObject *__pyx_n_s__V33_BAD_REF;
1419 static PyObject *__pyx_n_s__V40_BAD_ALLELE;
1420 static PyObject *__pyx_n_s__VCF;
1421 static PyObject *__pyx_n_s__VCFRecord;
1422 static PyObject *__pyx_n_s__ValueError;
1423 static PyObject *__pyx_n_s__WRONG_REF;
1424 static PyObject *__pyx_n_s__Warning;
1425 static PyObject *__pyx_n_s__ZERO_LENGTH_ALLELE;
1426 static PyObject *__pyx_n_s____all__;
1427 static PyObject *__pyx_n_s____dict__;
1428 static PyObject *__pyx_n_s____init__;
1429 static PyObject *__pyx_n_s____main__;
1430 static PyObject *__pyx_n_s____test__;
1431 static PyObject *__pyx_n_s___add_definition;
1432 static PyObject *__pyx_n_s___copy;
1433 static PyObject *__pyx_n_s___errors;
1434 static PyObject *__pyx_n_s___filter;
1435 static PyObject *__pyx_n_s___format;
1436 static PyObject *__pyx_n_s___header;
1437 static PyObject *__pyx_n_s___ignored_errors;
1438 static PyObject *__pyx_n_s___info;
1439 static PyObject *__pyx_n_s___leftalign;
1440 static PyObject *__pyx_n_s___line;
1441 static PyObject *__pyx_n_s___lineno;
1442 static PyObject *__pyx_n_s___lines;
1443 static PyObject *__pyx_n_s___parse;
1444 static PyObject *__pyx_n_s___parse_header;
1445 static PyObject *__pyx_n_s___reference;
1446 static PyObject *__pyx_n_s___regions;
1447 static PyObject *__pyx_n_s___required;
1448 static PyObject *__pyx_n_s___sample2column;
1449 static PyObject *__pyx_n_s___samples;
1450 static PyObject *__pyx_n_s___version;
1451 static PyObject *__pyx_n_s___warn_errors;
1452 static PyObject *__pyx_n_s__add;
1453 static PyObject *__pyx_n_s__alleleRegEx;
1454 static PyObject *__pyx_n_s__alt;
1455 static PyObject *__pyx_n_s__alt1;
1456 static PyObject *__pyx_n_s__alt2;
1457 static PyObject *__pyx_n_s__bisect;
1458 static PyObject *__pyx_n_s__buffer;
1459 static PyObject *__pyx_n_s__chrom;
1460 static PyObject *__pyx_n_s__collections;
1461 static PyObject *__pyx_n_s__compare_calls;
1462 static PyObject *__pyx_n_s__compile;
1463 static PyObject *__pyx_n_s__connect;
1464 static PyObject *__pyx_n_s__contig;
1465 static PyObject *__pyx_n_s__convertGT;
1466 static PyObject *__pyx_n_s__convertGTback;
1467 static PyObject *__pyx_n_s__copy;
1468 static PyObject *__pyx_n_s__data;
1469 static PyObject *__pyx_n_s__datagenerator;
1470 static PyObject *__pyx_n_s__deepcopy;
1471 static PyObject *__pyx_n_s__defaultdict;
1472 static PyObject *__pyx_n_s__descr;
1473 static PyObject *__pyx_n_s__description;
1474 static PyObject *__pyx_n_s__end;
1475 static PyObject *__pyx_n_s__endswith;
1476 static PyObject *__pyx_n_s__enumerate;
1477 static PyObject *__pyx_n_s__error;
1478 static PyObject *__pyx_n_s__errorstring;
1479 static PyObject *__pyx_n_s__fa;
1480 static PyObject *__pyx_n_s__fetch;
1481 static PyObject *__pyx_n_s__fields;
1482 static PyObject *__pyx_n_s__fileformat;
1483 static PyObject *__pyx_n_s__filename;
1484 static PyObject *__pyx_n_s__filter;
1485 static PyObject *__pyx_n_s__find;
1486 static PyObject *__pyx_n_s__fmt;
1487 static PyObject *__pyx_n_s__format;
1488 static PyObject *__pyx_n_s__format_format;
1489 static PyObject *__pyx_n_s__format_formatdata;
1490 static PyObject *__pyx_n_s__formatdict;
1491 static PyObject *__pyx_n_s__get;
1492 static PyObject *__pyx_n_s__get_expected;
1493 static PyObject *__pyx_n_s__get_sequence;
1494 static PyObject *__pyx_n_s__getfilter;
1495 static PyObject *__pyx_n_s__getformat;
1496 static PyObject *__pyx_n_s__getheader;
1497 static PyObject *__pyx_n_s__getinfo;
1498 static PyObject *__pyx_n_s__getsamples;
1499 static PyObject *__pyx_n_s__gtsRegEx;
1500 static PyObject *__pyx_n_s__header;
1501 static PyObject *__pyx_n_s__id;
1502 static PyObject *__pyx_n_s__ignoreerror;
1503 static PyObject *__pyx_n_s__info;
1504 static PyObject *__pyx_n_s__inregion;
1505 static PyObject *__pyx_n_s__itemgetter;
1506 static PyObject *__pyx_n_s__itervalues;
1507 static PyObject *__pyx_n_s__join;
1508 static PyObject *__pyx_n_s__key;
1509 static PyObject *__pyx_n_s__keys;
1510 static PyObject *__pyx_n_s__leftalign;
1511 static PyObject *__pyx_n_s__len;
1512 static PyObject *__pyx_n_s__line;
1513 static PyObject *__pyx_n_s__lineparse;
1514 static PyObject *__pyx_n_s__lines;
1515 static PyObject *__pyx_n_s__map;
1516 static PyObject *__pyx_n_s__match;
1517 static PyObject *__pyx_n_s__min;
1518 static PyObject *__pyx_n_s__missing;
1519 static PyObject *__pyx_n_s__missingvalue;
1520 static PyObject *__pyx_n_s__namedtuple;
1521 static PyObject *__pyx_n_s__nfields;
1522 static PyObject *__pyx_n_s__number;
1523 static PyObject *__pyx_n_s__numbertype;
1524 static PyObject *__pyx_n_s__object;
1525 static PyObject *__pyx_n_s__offset;
1526 static PyObject *__pyx_n_s__operator;
1527 static PyObject *__pyx_n_s__opt;
1528 static PyObject *__pyx_n_s__parse;
1529 static PyObject *__pyx_n_s__parse_data;
1530 static PyObject *__pyx_n_s__parse_format;
1531 static PyObject *__pyx_n_s__parse_formatdata;
1532 static PyObject *__pyx_n_s__parse_header;
1533 static PyObject *__pyx_n_s__parse_heading;
1534 static PyObject *__pyx_n_s__parser;
1535 static PyObject *__pyx_n_s__pos;
1536 static PyObject *__pyx_n_s__pos1;
1537 static PyObject *__pyx_n_s__pos2;
1538 static PyObject *__pyx_n_s__pysam;
1539 static PyObject *__pyx_n_s__qual;
1540 static PyObject *__pyx_n_s__range;
1541 static PyObject *__pyx_n_s__re;
1542 static PyObject *__pyx_n_s__record;
1543 static PyObject *__pyx_n_s__ref;
1544 static PyObject *__pyx_n_s__ref1;
1545 static PyObject *__pyx_n_s__ref2;
1546 static PyObject *__pyx_n_s__reference;
1547 static PyObject *__pyx_n_s__region;
1548 static PyObject *__pyx_n_s__regions;
1549 static PyObject *__pyx_n_s__replace;
1550 static PyObject *__pyx_n_s__samples;
1551 static PyObject *__pyx_n_s__self;
1552 static PyObject *__pyx_n_s__separator;
1553 static PyObject *__pyx_n_s__setfilter;
1554 static PyObject *__pyx_n_s__setformat;
1555 static PyObject *__pyx_n_s__setheader;
1556 static PyObject *__pyx_n_s__setinfo;
1557 static PyObject *__pyx_n_s__setreference;
1558 static PyObject *__pyx_n_s__setregions;
1559 static PyObject *__pyx_n_s__setsamples;
1560 static PyObject *__pyx_n_s__setversion;
1561 static PyObject *__pyx_n_s__split;
1562 static PyObject *__pyx_n_s__start;
1563 static PyObject *__pyx_n_s__startswith;
1564 static PyObject *__pyx_n_s__stderr;
1565 static PyObject *__pyx_n_s__stream;
1566 static PyObject *__pyx_n_s__strip;
1567 static PyObject *__pyx_n_s__sys;
1568 static PyObject *__pyx_n_s__tabixfile;
1569 static PyObject *__pyx_n_s__type;
1570 static PyObject *__pyx_n_s__upper;
1571 static PyObject *__pyx_n_s__validate;
1572 static PyObject *__pyx_n_s__value;
1573 static PyObject *__pyx_n_s__vcf;
1574 static PyObject *__pyx_n_s__vcffile;
1575 static PyObject *__pyx_n_s__version;
1576 static PyObject *__pyx_n_s__warnerror;
1577 static PyObject *__pyx_n_s__write;
1578 static PyObject *__pyx_n_s__write_data;
1579 static PyObject *__pyx_n_s__write_header;
1580 static PyObject *__pyx_n_s__write_heading;
1581 static PyObject *__pyx_n_s__writeheader;
1582 static PyObject *__pyx_n_s__zip;
1583 static PyObject *__pyx_int_0;
1584 static PyObject *__pyx_int_1;
1585 static PyObject *__pyx_int_2;
1586 static PyObject *__pyx_int_3;
1587 static PyObject *__pyx_int_4;
1588 static PyObject *__pyx_int_5;
1589 static PyObject *__pyx_int_6;
1590 static PyObject *__pyx_int_7;
1591 static PyObject *__pyx_int_8;
1592 static PyObject *__pyx_int_9;
1593 static PyObject *__pyx_int_neg_1;
1594 static PyObject *__pyx_int_10;
1595 static PyObject *__pyx_int_11;
1596 static PyObject *__pyx_int_12;
1597 static PyObject *__pyx_int_13;
1598 static PyObject *__pyx_int_14;
1599 static PyObject *__pyx_int_15;
1600 static PyObject *__pyx_int_16;
1601 static PyObject *__pyx_int_17;
1602 static PyObject *__pyx_int_18;
1603 static PyObject *__pyx_int_19;
1604 static PyObject *__pyx_int_20;
1605 static PyObject *__pyx_int_21;
1606 static PyObject *__pyx_int_22;
1607 static PyObject *__pyx_int_23;
1608 static PyObject *__pyx_int_24;
1609 static PyObject *__pyx_int_25;
1610 static PyObject *__pyx_int_26;
1611 static PyObject *__pyx_int_27;
1612 static PyObject *__pyx_int_28;
1613 static PyObject *__pyx_int_29;
1614 static PyObject *__pyx_int_30;
1615 static PyObject *__pyx_int_33;
1616 static PyObject *__pyx_int_40;
1617 static PyObject *__pyx_int_100;
1618 static PyObject *__pyx_int_3000000000;
1619 static PyObject *__pyx_k_13;
1620 static PyObject *__pyx_k_15;
1621 static PyObject *__pyx_k_32;
1622 static PyObject *__pyx_k_36;
1623 static PyObject *__pyx_k_37;
1624 static PyObject *__pyx_k_61;
1625
1626 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":58
1627  * 
1628  * # Utility function.  Uses 0-based coordinates
1629  * def get_sequence(chrom, start, end, fa):             # <<<<<<<<<<<<<<
1630  *     # obtain sequence from .fa file, without truncation
1631  *     if end<=start: return ""
1632  */
1633
1634 static PyObject *__pyx_pf_4cvcf_get_sequence(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1635 static PyObject *__pyx_pf_4cvcf_get_sequence(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1636   PyObject *__pyx_v_chrom = 0;
1637   PyObject *__pyx_v_start = 0;
1638   PyObject *__pyx_v_end = 0;
1639   PyObject *__pyx_v_fa = 0;
1640   PyObject *__pyx_v_sequence;
1641   PyObject *__pyx_r = NULL;
1642   PyObject *__pyx_t_1 = NULL;
1643   int __pyx_t_2;
1644   int __pyx_t_3;
1645   PyObject *__pyx_t_4 = NULL;
1646   PyObject *__pyx_t_5 = NULL;
1647   PyObject *__pyx_t_6 = NULL;
1648   Py_ssize_t __pyx_t_7;
1649   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__chrom,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__fa,0};
1650   __Pyx_RefNannySetupContext("get_sequence");
1651   __pyx_self = __pyx_self;
1652   if (unlikely(__pyx_kwds)) {
1653     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
1654     PyObject* values[4] = {0,0,0,0};
1655     switch (PyTuple_GET_SIZE(__pyx_args)) {
1656       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1657       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1658       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1659       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1660       case  0: break;
1661       default: goto __pyx_L5_argtuple_error;
1662     }
1663     switch (PyTuple_GET_SIZE(__pyx_args)) {
1664       case  0:
1665       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom);
1666       if (likely(values[0])) kw_args--;
1667       else goto __pyx_L5_argtuple_error;
1668       case  1:
1669       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
1670       if (likely(values[1])) kw_args--;
1671       else {
1672         __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1673       }
1674       case  2:
1675       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
1676       if (likely(values[2])) kw_args--;
1677       else {
1678         __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1679       }
1680       case  3:
1681       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fa);
1682       if (likely(values[3])) kw_args--;
1683       else {
1684         __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1685       }
1686     }
1687     if (unlikely(kw_args > 0)) {
1688       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;}
1689     }
1690     __pyx_v_chrom = values[0];
1691     __pyx_v_start = values[1];
1692     __pyx_v_end = values[2];
1693     __pyx_v_fa = values[3];
1694   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
1695     goto __pyx_L5_argtuple_error;
1696   } else {
1697     __pyx_v_chrom = PyTuple_GET_ITEM(__pyx_args, 0);
1698     __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
1699     __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 2);
1700     __pyx_v_fa = PyTuple_GET_ITEM(__pyx_args, 3);
1701   }
1702   goto __pyx_L4_argument_unpacking_done;
1703   __pyx_L5_argtuple_error:;
1704   __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;}
1705   __pyx_L3_error:;
1706   __Pyx_AddTraceback("cvcf.get_sequence");
1707   __Pyx_RefNannyFinishContext();
1708   return NULL;
1709   __pyx_L4_argument_unpacking_done:;
1710   __pyx_v_sequence = Py_None; __Pyx_INCREF(Py_None);
1711
1712   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":60
1713  * def get_sequence(chrom, start, end, fa):
1714  *     # obtain sequence from .fa file, without truncation
1715  *     if end<=start: return ""             # <<<<<<<<<<<<<<
1716  *     if not fa: return "N"*(end-start)
1717  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
1718  */
1719   __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;}
1720   __Pyx_GOTREF(__pyx_t_1);
1721   __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;}
1722   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1723   if (__pyx_t_2) {
1724     __Pyx_XDECREF(__pyx_r);
1725     __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
1726     __pyx_r = ((PyObject *)__pyx_kp_s_1);
1727     goto __pyx_L0;
1728     goto __pyx_L6;
1729   }
1730   __pyx_L6:;
1731
1732   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":61
1733  *     # obtain sequence from .fa file, without truncation
1734  *     if end<=start: return ""
1735  *     if not fa: return "N"*(end-start)             # <<<<<<<<<<<<<<
1736  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
1737  *     sequence = fa.fetch(chrom, start, end).upper()
1738  */
1739   __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;}
1740   __pyx_t_3 = (!__pyx_t_2);
1741   if (__pyx_t_3) {
1742     __Pyx_XDECREF(__pyx_r);
1743     __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;}
1744     __Pyx_GOTREF(__pyx_t_1);
1745     __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;}
1746     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
1747     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1748     __pyx_r = ((PyObject *)__pyx_t_4);
1749     __pyx_t_4 = 0;
1750     goto __pyx_L0;
1751     goto __pyx_L7;
1752   }
1753   __pyx_L7:;
1754
1755   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":62
1756  *     if end<=start: return ""
1757  *     if not fa: return "N"*(end-start)
1758  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()             # <<<<<<<<<<<<<<
1759  *     sequence = fa.fetch(chrom, start, end).upper()
1760  *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))
1761  */
1762   __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;}
1763   __Pyx_GOTREF(__pyx_t_4);
1764   __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;}
1765   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1766   if (__pyx_t_3) {
1767     __Pyx_XDECREF(__pyx_r);
1768     __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;}
1769     __Pyx_GOTREF(__pyx_t_4);
1770     __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;}
1771     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
1772     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1773     __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;}
1774     __Pyx_GOTREF(__pyx_t_4);
1775     __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;}
1776     __Pyx_GOTREF(__pyx_t_5);
1777     __Pyx_INCREF(__pyx_v_chrom);
1778     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
1779     __Pyx_GIVEREF(__pyx_v_chrom);
1780     __Pyx_INCREF(__pyx_int_0);
1781     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
1782     __Pyx_GIVEREF(__pyx_int_0);
1783     __Pyx_INCREF(__pyx_v_end);
1784     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_end);
1785     __Pyx_GIVEREF(__pyx_v_end);
1786     __Pyx_INCREF(__pyx_v_fa);
1787     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_fa);
1788     __Pyx_GIVEREF(__pyx_v_fa);
1789     __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1790     __Pyx_GOTREF(__pyx_t_6);
1791     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1792     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1793     __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;}
1794     __Pyx_GOTREF(__pyx_t_5);
1795     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1796     __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;}
1797     __Pyx_GOTREF(__pyx_t_6);
1798     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1799     __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;}
1800     __Pyx_GOTREF(__pyx_t_5);
1801     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
1802     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1803     __pyx_r = __pyx_t_5;
1804     __pyx_t_5 = 0;
1805     goto __pyx_L0;
1806     goto __pyx_L8;
1807   }
1808   __pyx_L8:;
1809
1810   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":63
1811  *     if not fa: return "N"*(end-start)
1812  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
1813  *     sequence = fa.fetch(chrom, start, end).upper()             # <<<<<<<<<<<<<<
1814  *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))
1815  *     return sequence
1816  */
1817   __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;}
1818   __Pyx_GOTREF(__pyx_t_5);
1819   __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;}
1820   __Pyx_GOTREF(__pyx_t_6);
1821   __Pyx_INCREF(__pyx_v_chrom);
1822   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_chrom);
1823   __Pyx_GIVEREF(__pyx_v_chrom);
1824   __Pyx_INCREF(__pyx_v_start);
1825   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_start);
1826   __Pyx_GIVEREF(__pyx_v_start);
1827   __Pyx_INCREF(__pyx_v_end);
1828   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_end);
1829   __Pyx_GIVEREF(__pyx_v_end);
1830   __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1831   __Pyx_GOTREF(__pyx_t_1);
1832   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1833   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1834   __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;}
1835   __Pyx_GOTREF(__pyx_t_6);
1836   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1837   __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;}
1838   __Pyx_GOTREF(__pyx_t_1);
1839   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1840   __Pyx_DECREF(__pyx_v_sequence);
1841   __pyx_v_sequence = __pyx_t_1;
1842   __pyx_t_1 = 0;
1843
1844   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":64
1845  *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
1846  *     sequence = fa.fetch(chrom, start, end).upper()
1847  *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))             # <<<<<<<<<<<<<<
1848  *     return sequence
1849  * 
1850  */
1851   __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;}
1852   __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;}
1853   __Pyx_GOTREF(__pyx_t_1);
1854   __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;}
1855   __Pyx_GOTREF(__pyx_t_6);
1856   __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;}
1857   __Pyx_GOTREF(__pyx_t_5);
1858   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1859   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1860   __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;}
1861   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1862   if (__pyx_t_3) {
1863     __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;}
1864     __Pyx_GOTREF(__pyx_t_5);
1865     __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;}
1866     __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;}
1867     __Pyx_GOTREF(__pyx_t_6);
1868     __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;}
1869     __Pyx_GOTREF(__pyx_t_1);
1870     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1871     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1872     __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;}
1873     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
1874     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1875     __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;}
1876     __Pyx_GOTREF(__pyx_t_1);
1877     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
1878     __Pyx_DECREF(__pyx_v_sequence);
1879     __pyx_v_sequence = __pyx_t_1;
1880     __pyx_t_1 = 0;
1881     goto __pyx_L9;
1882   }
1883   __pyx_L9:;
1884
1885   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":65
1886  *     sequence = fa.fetch(chrom, start, end).upper()
1887  *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))
1888  *     return sequence             # <<<<<<<<<<<<<<
1889  * 
1890  * # Utility function.  Parses a region string
1891  */
1892   __Pyx_XDECREF(__pyx_r);
1893   __Pyx_INCREF(__pyx_v_sequence);
1894   __pyx_r = __pyx_v_sequence;
1895   goto __pyx_L0;
1896
1897   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1898   goto __pyx_L0;
1899   __pyx_L1_error:;
1900   __Pyx_XDECREF(__pyx_t_1);
1901   __Pyx_XDECREF(__pyx_t_4);
1902   __Pyx_XDECREF(__pyx_t_5);
1903   __Pyx_XDECREF(__pyx_t_6);
1904   __Pyx_AddTraceback("cvcf.get_sequence");
1905   __pyx_r = NULL;
1906   __pyx_L0:;
1907   __Pyx_DECREF(__pyx_v_sequence);
1908   __Pyx_XGIVEREF(__pyx_r);
1909   __Pyx_RefNannyFinishContext();
1910   return __pyx_r;
1911 }
1912
1913 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":68
1914  * 
1915  * # Utility function.  Parses a region string
1916  * def parse_regions( string ):             # <<<<<<<<<<<<<<
1917  *     result = []
1918  *     for r in string.split(','):
1919  */
1920
1921 static PyObject *__pyx_pf_4cvcf_parse_regions(PyObject *__pyx_self, PyObject *__pyx_v_string); /*proto*/
1922 static PyObject *__pyx_pf_4cvcf_parse_regions(PyObject *__pyx_self, PyObject *__pyx_v_string) {
1923   PyObject *__pyx_v_result;
1924   PyObject *__pyx_v_r;
1925   PyObject *__pyx_v_elts;
1926   PyObject *__pyx_v_chrom;
1927   PyObject *__pyx_v_start;
1928   PyObject *__pyx_v_end;
1929   PyObject *__pyx_v_ielts;
1930   PyObject *__pyx_r = NULL;
1931   PyObject *__pyx_t_1 = NULL;
1932   Py_ssize_t __pyx_t_2;
1933   PyObject *__pyx_t_3 = NULL;
1934   PyObject *__pyx_t_4 = NULL;
1935   PyObject *__pyx_t_5 = NULL;
1936   Py_ssize_t __pyx_t_6;
1937   int __pyx_t_7;
1938   PyObject *__pyx_t_8 = NULL;
1939   PyObject *__pyx_t_9 = NULL;
1940   int __pyx_t_10;
1941   __Pyx_RefNannySetupContext("parse_regions");
1942   __pyx_self = __pyx_self;
1943   __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
1944   __pyx_v_r = Py_None; __Pyx_INCREF(Py_None);
1945   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
1946   __pyx_v_chrom = Py_None; __Pyx_INCREF(Py_None);
1947   __pyx_v_start = Py_None; __Pyx_INCREF(Py_None);
1948   __pyx_v_end = Py_None; __Pyx_INCREF(Py_None);
1949   __pyx_v_ielts = Py_None; __Pyx_INCREF(Py_None);
1950
1951   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":69
1952  * # Utility function.  Parses a region string
1953  * def parse_regions( string ):
1954  *     result = []             # <<<<<<<<<<<<<<
1955  *     for r in string.split(','):
1956  *         elts = r.split(':')
1957  */
1958   __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;}
1959   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
1960   __Pyx_DECREF(((PyObject *)__pyx_v_result));
1961   __pyx_v_result = __pyx_t_1;
1962   __pyx_t_1 = 0;
1963
1964   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":70
1965  * def parse_regions( string ):
1966  *     result = []
1967  *     for r in string.split(','):             # <<<<<<<<<<<<<<
1968  *         elts = r.split(':')
1969  *         chrom, start, end = elts[0], 0, 3000000000
1970  */
1971   __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;}
1972   __Pyx_GOTREF(__pyx_t_1);
1973   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1974   __Pyx_GOTREF(__pyx_t_3);
1975   __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
1976   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2));
1977   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
1978   __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1979   __Pyx_GOTREF(__pyx_t_4);
1980   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1981   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1982   if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
1983     __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3);
1984   } else {
1985     __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1986     __Pyx_GOTREF(__pyx_t_3);
1987   }
1988   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1989   for (;;) {
1990     if (likely(PyList_CheckExact(__pyx_t_3))) {
1991       if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
1992       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1993     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
1994       if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
1995       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
1996     } else {
1997       __pyx_t_4 = PyIter_Next(__pyx_t_3);
1998       if (!__pyx_t_4) {
1999         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2000         break;
2001       }
2002       __Pyx_GOTREF(__pyx_t_4);
2003     }
2004     __Pyx_DECREF(__pyx_v_r);
2005     __pyx_v_r = __pyx_t_4;
2006     __pyx_t_4 = 0;
2007
2008     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":71
2009  *     result = []
2010  *     for r in string.split(','):
2011  *         elts = r.split(':')             # <<<<<<<<<<<<<<
2012  *         chrom, start, end = elts[0], 0, 3000000000
2013  *         if len(elts)==1: pass
2014  */
2015     __pyx_t_4 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2016     __Pyx_GOTREF(__pyx_t_4);
2017     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2018     __Pyx_GOTREF(__pyx_t_1);
2019     __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
2020     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3));
2021     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
2022     __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2023     __Pyx_GOTREF(__pyx_t_5);
2024     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2025     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2026     __Pyx_DECREF(__pyx_v_elts);
2027     __pyx_v_elts = __pyx_t_5;
2028     __pyx_t_5 = 0;
2029
2030     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":72
2031  *     for r in string.split(','):
2032  *         elts = r.split(':')
2033  *         chrom, start, end = elts[0], 0, 3000000000             # <<<<<<<<<<<<<<
2034  *         if len(elts)==1: pass
2035  *         elif len(elts)==2:
2036  */
2037     __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2038     __Pyx_GOTREF(__pyx_t_5);
2039     __pyx_t_1 = __pyx_int_0;
2040     __Pyx_INCREF(__pyx_t_1);
2041     __pyx_t_4 = __pyx_int_3000000000;
2042     __Pyx_INCREF(__pyx_t_4);
2043     __Pyx_DECREF(__pyx_v_chrom);
2044     __pyx_v_chrom = __pyx_t_5;
2045     __pyx_t_5 = 0;
2046     __Pyx_DECREF(__pyx_v_start);
2047     __pyx_v_start = __pyx_t_1;
2048     __pyx_t_1 = 0;
2049     __Pyx_DECREF(__pyx_v_end);
2050     __pyx_v_end = __pyx_t_4;
2051     __pyx_t_4 = 0;
2052
2053     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":73
2054  *         elts = r.split(':')
2055  *         chrom, start, end = elts[0], 0, 3000000000
2056  *         if len(elts)==1: pass             # <<<<<<<<<<<<<<
2057  *         elif len(elts)==2:
2058  *             if len(elts[1])>0:
2059  */
2060     __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;}
2061     __pyx_t_7 = (__pyx_t_6 == 1);
2062     if (__pyx_t_7) {
2063       goto __pyx_L7;
2064     }
2065
2066     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":74
2067  *         chrom, start, end = elts[0], 0, 3000000000
2068  *         if len(elts)==1: pass
2069  *         elif len(elts)==2:             # <<<<<<<<<<<<<<
2070  *             if len(elts[1])>0:
2071  *                 ielts = elts[1].split('-')
2072  */
2073     __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;}
2074     __pyx_t_7 = (__pyx_t_6 == 2);
2075     if (__pyx_t_7) {
2076
2077       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":75
2078  *         if len(elts)==1: pass
2079  *         elif len(elts)==2:
2080  *             if len(elts[1])>0:             # <<<<<<<<<<<<<<
2081  *                 ielts = elts[1].split('-')
2082  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
2083  */
2084       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2085       __Pyx_GOTREF(__pyx_t_4);
2086       __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2087       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2088       __pyx_t_7 = (__pyx_t_6 > 0);
2089       if (__pyx_t_7) {
2090
2091         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":76
2092  *         elif len(elts)==2:
2093  *             if len(elts[1])>0:
2094  *                 ielts = elts[1].split('-')             # <<<<<<<<<<<<<<
2095  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
2096  *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
2097  */
2098         __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2099         __Pyx_GOTREF(__pyx_t_4);
2100         __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2101         __Pyx_GOTREF(__pyx_t_1);
2102         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2103         __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2104         __Pyx_GOTREF(__pyx_t_4);
2105         __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
2106         PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_4));
2107         __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
2108         __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2109         __Pyx_GOTREF(__pyx_t_5);
2110         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2111         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2112         __Pyx_DECREF(__pyx_v_ielts);
2113         __pyx_v_ielts = __pyx_t_5;
2114         __pyx_t_5 = 0;
2115
2116         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":77
2117  *             if len(elts[1])>0:
2118  *                 ielts = elts[1].split('-')
2119  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)             # <<<<<<<<<<<<<<
2120  *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
2121  *                 except: raise ValueError("Don't understand region string '%s'" % r)
2122  */
2123         __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;}
2124         __pyx_t_7 = (__pyx_t_6 != 2);
2125         if (__pyx_t_7) {
2126           __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_v_r); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2127           __Pyx_GOTREF(((PyObject *)__pyx_t_5));
2128           __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2129           __Pyx_GOTREF(__pyx_t_4);
2130           PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
2131           __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
2132           __pyx_t_5 = 0;
2133           __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2134           __Pyx_GOTREF(__pyx_t_5);
2135           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2136           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2137           goto __pyx_L9;
2138         }
2139         __pyx_L9:;
2140
2141         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":78
2142  *                 ielts = elts[1].split('-')
2143  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
2144  *                 try:    start, end = int(ielts[0])-1, int(ielts[1])             # <<<<<<<<<<<<<<
2145  *                 except: raise ValueError("Don't understand region string '%s'" % r)
2146  *         else:
2147  */
2148         {
2149           PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
2150           __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
2151           __Pyx_XGOTREF(__pyx_save_exc_type);
2152           __Pyx_XGOTREF(__pyx_save_exc_value);
2153           __Pyx_XGOTREF(__pyx_save_exc_tb);
2154           /*try:*/ {
2155             __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;}
2156             __Pyx_GOTREF(__pyx_t_5);
2157             __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;}
2158             __Pyx_GOTREF(__pyx_t_4);
2159             PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
2160             __Pyx_GIVEREF(__pyx_t_5);
2161             __pyx_t_5 = 0;
2162             __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2163             __Pyx_GOTREF(__pyx_t_5);
2164             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2165             __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2166             __Pyx_GOTREF(__pyx_t_4);
2167             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2168             __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;}
2169             __Pyx_GOTREF(__pyx_t_5);
2170             __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2171             __Pyx_GOTREF(__pyx_t_1);
2172             PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
2173             __Pyx_GIVEREF(__pyx_t_5);
2174             __pyx_t_5 = 0;
2175             __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
2176             __Pyx_GOTREF(__pyx_t_5);
2177             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2178             __Pyx_DECREF(__pyx_v_start);
2179             __pyx_v_start = __pyx_t_4;
2180             __pyx_t_4 = 0;
2181             __Pyx_DECREF(__pyx_v_end);
2182             __pyx_v_end = __pyx_t_5;
2183             __pyx_t_5 = 0;
2184           }
2185           __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
2186           __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
2187           __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
2188           goto __pyx_L17_try_end;
2189           __pyx_L10_error:;
2190           __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2191           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2192           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2193
2194           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":79
2195  *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
2196  *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
2197  *                 except: raise ValueError("Don't understand region string '%s'" % r)             # <<<<<<<<<<<<<<
2198  *         else:
2199  *             raise ValueError("Don't understand region string '%s'" % r)
2200  */
2201           /*except:*/ {
2202             __Pyx_AddTraceback("cvcf.parse_regions");
2203             if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
2204             __Pyx_GOTREF(__pyx_t_5);
2205             __Pyx_GOTREF(__pyx_t_4);
2206             __Pyx_GOTREF(__pyx_t_1);
2207             __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_v_r); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
2208             __Pyx_GOTREF(((PyObject *)__pyx_t_8));
2209             __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;}
2210             __Pyx_GOTREF(__pyx_t_9);
2211             PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8));
2212             __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
2213             __pyx_t_8 = 0;
2214             __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, __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;}
2215             __Pyx_GOTREF(__pyx_t_8);
2216             __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2217             __Pyx_Raise(__pyx_t_8, 0, 0);
2218             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2219             {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
2220             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2221             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2222             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2223             goto __pyx_L11_exception_handled;
2224           }
2225           __pyx_L12_except_error:;
2226           __Pyx_XGIVEREF(__pyx_save_exc_type);
2227           __Pyx_XGIVEREF(__pyx_save_exc_value);
2228           __Pyx_XGIVEREF(__pyx_save_exc_tb);
2229           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
2230           goto __pyx_L1_error;
2231           __pyx_L11_exception_handled:;
2232           __Pyx_XGIVEREF(__pyx_save_exc_type);
2233           __Pyx_XGIVEREF(__pyx_save_exc_value);
2234           __Pyx_XGIVEREF(__pyx_save_exc_tb);
2235           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
2236           __pyx_L17_try_end:;
2237         }
2238         goto __pyx_L8;
2239       }
2240       __pyx_L8:;
2241       goto __pyx_L7;
2242     }
2243     /*else*/ {
2244
2245       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":81
2246  *                 except: raise ValueError("Don't understand region string '%s'" % r)
2247  *         else:
2248  *             raise ValueError("Don't understand region string '%s'" % r)             # <<<<<<<<<<<<<<
2249  *         result.append( (chrom,start,end) )
2250  *     return result
2251  */
2252       __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_v_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2253       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2254       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2255       __Pyx_GOTREF(__pyx_t_4);
2256       PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
2257       __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
2258       __pyx_t_1 = 0;
2259       __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2260       __Pyx_GOTREF(__pyx_t_1);
2261       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2262       __Pyx_Raise(__pyx_t_1, 0, 0);
2263       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2264       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2265     }
2266     __pyx_L7:;
2267
2268     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":82
2269  *         else:
2270  *             raise ValueError("Don't understand region string '%s'" % r)
2271  *         result.append( (chrom,start,end) )             # <<<<<<<<<<<<<<
2272  *     return result
2273  * 
2274  */
2275     if (unlikely(__pyx_v_result == Py_None)) {
2276       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;} 
2277     }
2278     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2279     __Pyx_GOTREF(__pyx_t_1);
2280     __Pyx_INCREF(__pyx_v_chrom);
2281     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
2282     __Pyx_GIVEREF(__pyx_v_chrom);
2283     __Pyx_INCREF(__pyx_v_start);
2284     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start);
2285     __Pyx_GIVEREF(__pyx_v_start);
2286     __Pyx_INCREF(__pyx_v_end);
2287     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
2288     __Pyx_GIVEREF(__pyx_v_end);
2289     __pyx_t_10 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2290     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2291   }
2292   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2293
2294   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":83
2295  *             raise ValueError("Don't understand region string '%s'" % r)
2296  *         result.append( (chrom,start,end) )
2297  *     return result             # <<<<<<<<<<<<<<
2298  * 
2299  * 
2300  */
2301   __Pyx_XDECREF(__pyx_r);
2302   __Pyx_INCREF(((PyObject *)__pyx_v_result));
2303   __pyx_r = ((PyObject *)__pyx_v_result);
2304   goto __pyx_L0;
2305
2306   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2307   goto __pyx_L0;
2308   __pyx_L1_error:;
2309   __Pyx_XDECREF(__pyx_t_1);
2310   __Pyx_XDECREF(__pyx_t_3);
2311   __Pyx_XDECREF(__pyx_t_4);
2312   __Pyx_XDECREF(__pyx_t_5);
2313   __Pyx_XDECREF(__pyx_t_8);
2314   __Pyx_XDECREF(__pyx_t_9);
2315   __Pyx_AddTraceback("cvcf.parse_regions");
2316   __pyx_r = NULL;
2317   __pyx_L0:;
2318   __Pyx_DECREF(__pyx_v_result);
2319   __Pyx_DECREF(__pyx_v_r);
2320   __Pyx_DECREF(__pyx_v_elts);
2321   __Pyx_DECREF(__pyx_v_chrom);
2322   __Pyx_DECREF(__pyx_v_start);
2323   __Pyx_DECREF(__pyx_v_end);
2324   __Pyx_DECREF(__pyx_v_ielts);
2325   __Pyx_XGIVEREF(__pyx_r);
2326   __Pyx_RefNannyFinishContext();
2327   return __pyx_r;
2328 }
2329
2330 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":104
2331  *     cdef uint32_t pos
2332  * 
2333  *     def __init__(self, vcf):             # <<<<<<<<<<<<<<
2334  *         self.vcf = vcf
2335  *         # if len(data) != len(self.vcf._samples):
2336  */
2337
2338 static int __pyx_pf_4cvcf_9VCFRecord___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2339 static int __pyx_pf_4cvcf_9VCFRecord___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2340   PyObject *__pyx_v_vcf = 0;
2341   int __pyx_r;
2342   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vcf,0};
2343   __Pyx_RefNannySetupContext("__init__");
2344   if (unlikely(__pyx_kwds)) {
2345     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2346     PyObject* values[1] = {0};
2347     switch (PyTuple_GET_SIZE(__pyx_args)) {
2348       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2349       case  0: break;
2350       default: goto __pyx_L5_argtuple_error;
2351     }
2352     switch (PyTuple_GET_SIZE(__pyx_args)) {
2353       case  0:
2354       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vcf);
2355       if (likely(values[0])) kw_args--;
2356       else goto __pyx_L5_argtuple_error;
2357     }
2358     if (unlikely(kw_args > 0)) {
2359       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;}
2360     }
2361     __pyx_v_vcf = values[0];
2362   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2363     goto __pyx_L5_argtuple_error;
2364   } else {
2365     __pyx_v_vcf = PyTuple_GET_ITEM(__pyx_args, 0);
2366   }
2367   goto __pyx_L4_argument_unpacking_done;
2368   __pyx_L5_argtuple_error:;
2369   __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;}
2370   __pyx_L3_error:;
2371   __Pyx_AddTraceback("cvcf.VCFRecord.__init__");
2372   __Pyx_RefNannyFinishContext();
2373   return -1;
2374   __pyx_L4_argument_unpacking_done:;
2375
2376   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":105
2377  * 
2378  *     def __init__(self, vcf):
2379  *         self.vcf = vcf             # <<<<<<<<<<<<<<
2380  *         # if len(data) != len(self.vcf._samples):
2381  *         #     self.error(str(data),
2382  */
2383   __Pyx_INCREF(__pyx_v_vcf);
2384   __Pyx_GIVEREF(__pyx_v_vcf);
2385   __Pyx_GOTREF(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf);
2386   __Pyx_DECREF(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf);
2387   ((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf = __pyx_v_vcf;
2388
2389   __pyx_r = 0;
2390   __Pyx_RefNannyFinishContext();
2391   return __pyx_r;
2392 }
2393
2394 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":115
2395  *         #                     len(data)))
2396  * 
2397  *     def __cinit__(self, vcf ):             # <<<<<<<<<<<<<<
2398  *         # start indexed access at genotypes
2399  *         self.offset = 9
2400  */
2401
2402 static int __pyx_pf_4cvcf_9VCFRecord___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2403 static int __pyx_pf_4cvcf_9VCFRecord___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2404   PyObject *__pyx_v_vcf = 0;
2405   int __pyx_r;
2406   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vcf,0};
2407   __Pyx_RefNannySetupContext("__cinit__");
2408   if (unlikely(__pyx_kwds)) {
2409     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2410     PyObject* values[1] = {0};
2411     switch (PyTuple_GET_SIZE(__pyx_args)) {
2412       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2413       case  0: break;
2414       default: goto __pyx_L5_argtuple_error;
2415     }
2416     switch (PyTuple_GET_SIZE(__pyx_args)) {
2417       case  0:
2418       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vcf);
2419       if (likely(values[0])) kw_args--;
2420       else goto __pyx_L5_argtuple_error;
2421     }
2422     if (unlikely(kw_args > 0)) {
2423       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;}
2424     }
2425     __pyx_v_vcf = values[0];
2426   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2427     goto __pyx_L5_argtuple_error;
2428   } else {
2429     __pyx_v_vcf = PyTuple_GET_ITEM(__pyx_args, 0);
2430   }
2431   goto __pyx_L4_argument_unpacking_done;
2432   __pyx_L5_argtuple_error:;
2433   __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;}
2434   __pyx_L3_error:;
2435   __Pyx_AddTraceback("cvcf.VCFRecord.__cinit__");
2436   __Pyx_RefNannyFinishContext();
2437   return -1;
2438   __pyx_L4_argument_unpacking_done:;
2439
2440   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":117
2441  *     def __cinit__(self, vcf ):
2442  *         # start indexed access at genotypes
2443  *         self.offset = 9             # <<<<<<<<<<<<<<
2444  * 
2445  *         self.vcf = vcf
2446  */
2447   ((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.offset = 9;
2448
2449   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":119
2450  *         self.offset = 9
2451  * 
2452  *         self.vcf = vcf             # <<<<<<<<<<<<<<
2453  * 
2454  *     cdef update( self, char * buffer, size_t nbytes ):
2455  */
2456   __Pyx_INCREF(__pyx_v_vcf);
2457   __Pyx_GIVEREF(__pyx_v_vcf);
2458   __Pyx_GOTREF(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf);
2459   __Pyx_DECREF(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf);
2460   ((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf = __pyx_v_vcf;
2461
2462   __pyx_r = 0;
2463   __Pyx_RefNannyFinishContext();
2464   return __pyx_r;
2465 }
2466
2467 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":121
2468  *         self.vcf = vcf
2469  * 
2470  *     cdef update( self, char * buffer, size_t nbytes ):             # <<<<<<<<<<<<<<
2471  *         '''update internal data.
2472  * 
2473  */
2474
2475 static  PyObject *__pyx_f_4cvcf_9VCFRecord_update(struct __pyx_obj_4cvcf_VCFRecord *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
2476   PyObject *__pyx_r = NULL;
2477   PyObject *__pyx_t_1 = NULL;
2478   __Pyx_RefNannySetupContext("update");
2479
2480   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":126
2481  *         nbytes does not include the terminal '\0'.
2482  *         '''
2483  *         TabProxies.TupleProxy.update( self, buffer, nbytes )             # <<<<<<<<<<<<<<
2484  * 
2485  *         self.contig = self.fields[0]
2486  */
2487   __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;}
2488   __Pyx_GOTREF(__pyx_t_1);
2489   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2490
2491   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":128
2492  *         TabProxies.TupleProxy.update( self, buffer, nbytes )
2493  * 
2494  *         self.contig = self.fields[0]             # <<<<<<<<<<<<<<
2495  *         # vcf counts from 1 - correct here
2496  *         self.pos = atoi( self.fields[1] ) - 1
2497  */
2498   __pyx_v_self->contig = (__pyx_v_self->__pyx_base.fields[0]);
2499
2500   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":130
2501  *         self.contig = self.fields[0]
2502  *         # vcf counts from 1 - correct here
2503  *         self.pos = atoi( self.fields[1] ) - 1             # <<<<<<<<<<<<<<
2504  * 
2505  *     def __len__(self):
2506  */
2507   __pyx_v_self->pos = (atoi((__pyx_v_self->__pyx_base.fields[1])) - 1);
2508
2509   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2510   goto __pyx_L0;
2511   __pyx_L1_error:;
2512   __Pyx_XDECREF(__pyx_t_1);
2513   __Pyx_AddTraceback("cvcf.VCFRecord.update");
2514   __pyx_r = 0;
2515   __pyx_L0:;
2516   __Pyx_XGIVEREF(__pyx_r);
2517   __Pyx_RefNannyFinishContext();
2518   return __pyx_r;
2519 }
2520
2521 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":132
2522  *         self.pos = atoi( self.fields[1] ) - 1
2523  * 
2524  *     def __len__(self):             # <<<<<<<<<<<<<<
2525  *         return max(0, self.nfields - 9)
2526  * 
2527  */
2528
2529 static Py_ssize_t __pyx_pf_4cvcf_9VCFRecord___len__(PyObject *__pyx_v_self); /*proto*/
2530 static Py_ssize_t __pyx_pf_4cvcf_9VCFRecord___len__(PyObject *__pyx_v_self) {
2531   Py_ssize_t __pyx_r;
2532   long __pyx_t_1;
2533   long __pyx_t_2;
2534   long __pyx_t_3;
2535   __Pyx_RefNannySetupContext("__len__");
2536
2537   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":133
2538  * 
2539  *     def __len__(self):
2540  *         return max(0, self.nfields - 9)             # <<<<<<<<<<<<<<
2541  * 
2542  *     property contig:
2543  */
2544   __pyx_t_1 = (((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.nfields - 9);
2545   __pyx_t_2 = 0;
2546   if ((__pyx_t_1 > __pyx_t_2)) {
2547     __pyx_t_3 = __pyx_t_1;
2548   } else {
2549     __pyx_t_3 = __pyx_t_2;
2550   }
2551   __pyx_r = __pyx_t_3;
2552   goto __pyx_L0;
2553
2554   __pyx_r = 0;
2555   __pyx_L0:;
2556   __Pyx_RefNannyFinishContext();
2557   return __pyx_r;
2558 }
2559
2560 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":136
2561  * 
2562  *     property contig:
2563  *         def __get__(self): return self.contig             # <<<<<<<<<<<<<<
2564  * 
2565  *     property pos:
2566  */
2567
2568 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6contig___get__(PyObject *__pyx_v_self); /*proto*/
2569 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6contig___get__(PyObject *__pyx_v_self) {
2570   PyObject *__pyx_r = NULL;
2571   PyObject *__pyx_t_1 = NULL;
2572   __Pyx_RefNannySetupContext("__get__");
2573   __Pyx_XDECREF(__pyx_r);
2574   __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;}
2575   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2576   __pyx_r = ((PyObject *)__pyx_t_1);
2577   __pyx_t_1 = 0;
2578   goto __pyx_L0;
2579
2580   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2581   goto __pyx_L0;
2582   __pyx_L1_error:;
2583   __Pyx_XDECREF(__pyx_t_1);
2584   __Pyx_AddTraceback("cvcf.VCFRecord.contig.__get__");
2585   __pyx_r = NULL;
2586   __pyx_L0:;
2587   __Pyx_XGIVEREF(__pyx_r);
2588   __Pyx_RefNannyFinishContext();
2589   return __pyx_r;
2590 }
2591
2592 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":139
2593  * 
2594  *     property pos:
2595  *         def __get__(self): return self.pos             # <<<<<<<<<<<<<<
2596  * 
2597  *     property id:
2598  */
2599
2600 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3pos___get__(PyObject *__pyx_v_self); /*proto*/
2601 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3pos___get__(PyObject *__pyx_v_self) {
2602   PyObject *__pyx_r = NULL;
2603   PyObject *__pyx_t_1 = NULL;
2604   __Pyx_RefNannySetupContext("__get__");
2605   __Pyx_XDECREF(__pyx_r);
2606   __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;}
2607   __Pyx_GOTREF(__pyx_t_1);
2608   __pyx_r = __pyx_t_1;
2609   __pyx_t_1 = 0;
2610   goto __pyx_L0;
2611
2612   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2613   goto __pyx_L0;
2614   __pyx_L1_error:;
2615   __Pyx_XDECREF(__pyx_t_1);
2616   __Pyx_AddTraceback("cvcf.VCFRecord.pos.__get__");
2617   __pyx_r = NULL;
2618   __pyx_L0:;
2619   __Pyx_XGIVEREF(__pyx_r);
2620   __Pyx_RefNannyFinishContext();
2621   return __pyx_r;
2622 }
2623
2624 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":142
2625  * 
2626  *     property id:
2627  *         def __get__(self): return self.fields[2]             # <<<<<<<<<<<<<<
2628  * 
2629  *     property ref:
2630  */
2631
2632 static PyObject *__pyx_pf_4cvcf_9VCFRecord_2id___get__(PyObject *__pyx_v_self); /*proto*/
2633 static PyObject *__pyx_pf_4cvcf_9VCFRecord_2id___get__(PyObject *__pyx_v_self) {
2634   PyObject *__pyx_r = NULL;
2635   PyObject *__pyx_t_1 = NULL;
2636   __Pyx_RefNannySetupContext("__get__");
2637   __Pyx_XDECREF(__pyx_r);
2638   __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;}
2639   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2640   __pyx_r = ((PyObject *)__pyx_t_1);
2641   __pyx_t_1 = 0;
2642   goto __pyx_L0;
2643
2644   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2645   goto __pyx_L0;
2646   __pyx_L1_error:;
2647   __Pyx_XDECREF(__pyx_t_1);
2648   __Pyx_AddTraceback("cvcf.VCFRecord.id.__get__");
2649   __pyx_r = NULL;
2650   __pyx_L0:;
2651   __Pyx_XGIVEREF(__pyx_r);
2652   __Pyx_RefNannyFinishContext();
2653   return __pyx_r;
2654 }
2655
2656 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":145
2657  * 
2658  *     property ref:
2659  *         def __get__(self): return self.fields[3]             # <<<<<<<<<<<<<<
2660  * 
2661  *     property alt:
2662  */
2663
2664 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3ref___get__(PyObject *__pyx_v_self); /*proto*/
2665 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3ref___get__(PyObject *__pyx_v_self) {
2666   PyObject *__pyx_r = NULL;
2667   PyObject *__pyx_t_1 = NULL;
2668   __Pyx_RefNannySetupContext("__get__");
2669   __Pyx_XDECREF(__pyx_r);
2670   __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;}
2671   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2672   __pyx_r = ((PyObject *)__pyx_t_1);
2673   __pyx_t_1 = 0;
2674   goto __pyx_L0;
2675
2676   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2677   goto __pyx_L0;
2678   __pyx_L1_error:;
2679   __Pyx_XDECREF(__pyx_t_1);
2680   __Pyx_AddTraceback("cvcf.VCFRecord.ref.__get__");
2681   __pyx_r = NULL;
2682   __pyx_L0:;
2683   __Pyx_XGIVEREF(__pyx_r);
2684   __Pyx_RefNannyFinishContext();
2685   return __pyx_r;
2686 }
2687
2688 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":148
2689  * 
2690  *     property alt:
2691  *         def __get__(self):             # <<<<<<<<<<<<<<
2692  *             # convert v3.3 to v4.0 alleles below
2693  *             alt = self.fields[4]
2694  */
2695
2696 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3alt___get__(PyObject *__pyx_v_self); /*proto*/
2697 static PyObject *__pyx_pf_4cvcf_9VCFRecord_3alt___get__(PyObject *__pyx_v_self) {
2698   PyObject *__pyx_v_alt;
2699   PyObject *__pyx_r = NULL;
2700   PyObject *__pyx_t_1 = NULL;
2701   int __pyx_t_2;
2702   PyObject *__pyx_t_3 = NULL;
2703   PyObject *__pyx_t_4 = NULL;
2704   __Pyx_RefNannySetupContext("__get__");
2705   __pyx_v_alt = Py_None; __Pyx_INCREF(Py_None);
2706
2707   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":150
2708  *         def __get__(self):
2709  *             # convert v3.3 to v4.0 alleles below
2710  *             alt = self.fields[4]             # <<<<<<<<<<<<<<
2711  *             if alt == ".": alt = []
2712  *             else: alt = alt.upper().split(',')
2713  */
2714   __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;}
2715   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2716   __Pyx_DECREF(__pyx_v_alt);
2717   __pyx_v_alt = ((PyObject *)__pyx_t_1);
2718   __pyx_t_1 = 0;
2719
2720   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":151
2721  *             # convert v3.3 to v4.0 alleles below
2722  *             alt = self.fields[4]
2723  *             if alt == ".": alt = []             # <<<<<<<<<<<<<<
2724  *             else: alt = alt.upper().split(',')
2725  *             return alt
2726  */
2727   __pyx_t_1 = PyObject_RichCompare(__pyx_v_alt, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2728   __Pyx_GOTREF(__pyx_t_1);
2729   __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;}
2730   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2731   if (__pyx_t_2) {
2732     __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;}
2733     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2734     __Pyx_DECREF(__pyx_v_alt);
2735     __pyx_v_alt = ((PyObject *)__pyx_t_1);
2736     __pyx_t_1 = 0;
2737     goto __pyx_L5;
2738   }
2739   /*else*/ {
2740
2741     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":152
2742  *             alt = self.fields[4]
2743  *             if alt == ".": alt = []
2744  *             else: alt = alt.upper().split(',')             # <<<<<<<<<<<<<<
2745  *             return alt
2746  * 
2747  */
2748     __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;}
2749     __Pyx_GOTREF(__pyx_t_1);
2750     __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;}
2751     __Pyx_GOTREF(__pyx_t_3);
2752     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2753     __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;}
2754     __Pyx_GOTREF(__pyx_t_1);
2755     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2756     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2757     __Pyx_GOTREF(__pyx_t_3);
2758     __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
2759     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2));
2760     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
2761     __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2762     __Pyx_GOTREF(__pyx_t_4);
2763     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2764     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2765     __Pyx_DECREF(__pyx_v_alt);
2766     __pyx_v_alt = __pyx_t_4;
2767     __pyx_t_4 = 0;
2768   }
2769   __pyx_L5:;
2770
2771   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":153
2772  *             if alt == ".": alt = []
2773  *             else: alt = alt.upper().split(',')
2774  *             return alt             # <<<<<<<<<<<<<<
2775  * 
2776  *     property qual:
2777  */
2778   __Pyx_XDECREF(__pyx_r);
2779   __Pyx_INCREF(__pyx_v_alt);
2780   __pyx_r = __pyx_v_alt;
2781   goto __pyx_L0;
2782
2783   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2784   goto __pyx_L0;
2785   __pyx_L1_error:;
2786   __Pyx_XDECREF(__pyx_t_1);
2787   __Pyx_XDECREF(__pyx_t_3);
2788   __Pyx_XDECREF(__pyx_t_4);
2789   __Pyx_AddTraceback("cvcf.VCFRecord.alt.__get__");
2790   __pyx_r = NULL;
2791   __pyx_L0:;
2792   __Pyx_DECREF(__pyx_v_alt);
2793   __Pyx_XGIVEREF(__pyx_r);
2794   __Pyx_RefNannyFinishContext();
2795   return __pyx_r;
2796 }
2797
2798 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":156
2799  * 
2800  *     property qual:
2801  *         def __get__(self):             # <<<<<<<<<<<<<<
2802  *             qual = self.fields[5]
2803  *             if qual == b".": qual = -1
2804  */
2805
2806 static PyObject *__pyx_pf_4cvcf_9VCFRecord_4qual___get__(PyObject *__pyx_v_self); /*proto*/
2807 static PyObject *__pyx_pf_4cvcf_9VCFRecord_4qual___get__(PyObject *__pyx_v_self) {
2808   PyObject *__pyx_v_qual;
2809   PyObject *__pyx_r = NULL;
2810   PyObject *__pyx_t_1 = NULL;
2811   int __pyx_t_2;
2812   double __pyx_t_3;
2813   PyObject *__pyx_t_4 = NULL;
2814   PyObject *__pyx_t_5 = NULL;
2815   PyObject *__pyx_t_6 = NULL;
2816   PyObject *__pyx_t_7 = NULL;
2817   PyObject *__pyx_t_8 = NULL;
2818   PyObject *__pyx_t_9 = NULL;
2819   __Pyx_RefNannySetupContext("__get__");
2820   __pyx_v_qual = Py_None; __Pyx_INCREF(Py_None);
2821
2822   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":157
2823  *     property qual:
2824  *         def __get__(self):
2825  *             qual = self.fields[5]             # <<<<<<<<<<<<<<
2826  *             if qual == b".": qual = -1
2827  *             else:
2828  */
2829   __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;}
2830   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2831   __Pyx_DECREF(__pyx_v_qual);
2832   __pyx_v_qual = ((PyObject *)__pyx_t_1);
2833   __pyx_t_1 = 0;
2834
2835   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":158
2836  *         def __get__(self):
2837  *             qual = self.fields[5]
2838  *             if qual == b".": qual = -1             # <<<<<<<<<<<<<<
2839  *             else:
2840  *                 try:    qual = float(qual)
2841  */
2842   __pyx_t_1 = PyObject_RichCompare(__pyx_v_qual, ((PyObject *)__pyx_kp_b_6), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2843   __Pyx_GOTREF(__pyx_t_1);
2844   __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;}
2845   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2846   if (__pyx_t_2) {
2847     __Pyx_INCREF(__pyx_int_neg_1);
2848     __Pyx_DECREF(__pyx_v_qual);
2849     __pyx_v_qual = __pyx_int_neg_1;
2850     goto __pyx_L5;
2851   }
2852   /*else*/ {
2853
2854     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":160
2855  *             if qual == b".": qual = -1
2856  *             else:
2857  *                 try:    qual = float(qual)             # <<<<<<<<<<<<<<
2858  *                 except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL)
2859  * 
2860  */
2861     {
2862       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
2863       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
2864       __Pyx_XGOTREF(__pyx_save_exc_type);
2865       __Pyx_XGOTREF(__pyx_save_exc_value);
2866       __Pyx_XGOTREF(__pyx_save_exc_tb);
2867       /*try:*/ {
2868         __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;}
2869         __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;}
2870         __Pyx_GOTREF(__pyx_t_1);
2871         __Pyx_DECREF(__pyx_v_qual);
2872         __pyx_v_qual = __pyx_t_1;
2873         __pyx_t_1 = 0;
2874       }
2875       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
2876       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
2877       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
2878       goto __pyx_L13_try_end;
2879       __pyx_L6_error:;
2880       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2881
2882       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":161
2883  *             else:
2884  *                 try:    qual = float(qual)
2885  *                 except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL)             # <<<<<<<<<<<<<<
2886  * 
2887  *     property filter:
2888  */
2889       /*except:*/ {
2890         __Pyx_AddTraceback("cvcf.VCFRecord.qual.__get__");
2891         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;}
2892         __Pyx_GOTREF(__pyx_t_1);
2893         __Pyx_GOTREF(__pyx_t_4);
2894         __Pyx_GOTREF(__pyx_t_5);
2895         __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;}
2896         __Pyx_GOTREF(__pyx_t_6);
2897         __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;}
2898         __Pyx_GOTREF(__pyx_t_7);
2899         __Pyx_INCREF(__pyx_v_self);
2900         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self);
2901         __Pyx_GIVEREF(__pyx_v_self);
2902         __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __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;}
2903         __Pyx_GOTREF(__pyx_t_8);
2904         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2905         __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;}
2906         __Pyx_GOTREF(__pyx_t_7);
2907         __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;}
2908         __Pyx_GOTREF(__pyx_t_9);
2909         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
2910         __Pyx_GIVEREF(__pyx_t_8);
2911         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
2912         __Pyx_GIVEREF(__pyx_t_7);
2913         __pyx_t_8 = 0;
2914         __pyx_t_7 = 0;
2915         __pyx_t_7 = PyObject_Call(__pyx_t_6, __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;}
2916         __Pyx_GOTREF(__pyx_t_7);
2917         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2918         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2919         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2920         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2921         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2922         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2923         goto __pyx_L7_exception_handled;
2924       }
2925       __pyx_L8_except_error:;
2926       __Pyx_XGIVEREF(__pyx_save_exc_type);
2927       __Pyx_XGIVEREF(__pyx_save_exc_value);
2928       __Pyx_XGIVEREF(__pyx_save_exc_tb);
2929       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
2930       goto __pyx_L1_error;
2931       __pyx_L7_exception_handled:;
2932       __Pyx_XGIVEREF(__pyx_save_exc_type);
2933       __Pyx_XGIVEREF(__pyx_save_exc_value);
2934       __Pyx_XGIVEREF(__pyx_save_exc_tb);
2935       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
2936       __pyx_L13_try_end:;
2937     }
2938   }
2939   __pyx_L5:;
2940
2941   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2942   goto __pyx_L0;
2943   __pyx_L1_error:;
2944   __Pyx_XDECREF(__pyx_t_1);
2945   __Pyx_XDECREF(__pyx_t_4);
2946   __Pyx_XDECREF(__pyx_t_5);
2947   __Pyx_XDECREF(__pyx_t_6);
2948   __Pyx_XDECREF(__pyx_t_7);
2949   __Pyx_XDECREF(__pyx_t_8);
2950   __Pyx_XDECREF(__pyx_t_9);
2951   __Pyx_AddTraceback("cvcf.VCFRecord.qual.__get__");
2952   __pyx_r = NULL;
2953   __pyx_L0:;
2954   __Pyx_DECREF(__pyx_v_qual);
2955   __Pyx_XGIVEREF(__pyx_r);
2956   __Pyx_RefNannyFinishContext();
2957   return __pyx_r;
2958 }
2959
2960 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":164
2961  * 
2962  *     property filter:
2963  *         def __get__(self):             # <<<<<<<<<<<<<<
2964  *             f = self.fields[6]
2965  *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
2966  */
2967
2968 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6filter___get__(PyObject *__pyx_v_self); /*proto*/
2969 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6filter___get__(PyObject *__pyx_v_self) {
2970   char *__pyx_v_f;
2971   PyObject *__pyx_r = NULL;
2972   int __pyx_t_1;
2973   int __pyx_t_2;
2974   int __pyx_t_3;
2975   int __pyx_t_4;
2976   PyObject *__pyx_t_5 = NULL;
2977   PyObject *__pyx_t_6 = NULL;
2978   PyObject *__pyx_t_7 = NULL;
2979   __Pyx_RefNannySetupContext("__get__");
2980
2981   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":165
2982  *     property filter:
2983  *         def __get__(self):
2984  *             f = self.fields[6]             # <<<<<<<<<<<<<<
2985  *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
2986  *             if f == b"." or f == b"PASS" or f == b"0": return []
2987  */
2988   __pyx_v_f = (((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[6]);
2989
2990   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":167
2991  *             f = self.fields[6]
2992  *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
2993  *             if f == b"." or f == b"PASS" or f == b"0": return []             # <<<<<<<<<<<<<<
2994  *             else: return f.split(';')
2995  * 
2996  */
2997   __pyx_t_1 = (__pyx_v_f == __pyx_k_6);
2998   if (!__pyx_t_1) {
2999     __pyx_t_2 = (__pyx_v_f == __pyx_k__PASS);
3000     if (!__pyx_t_2) {
3001       __pyx_t_3 = (__pyx_v_f == __pyx_k__0);
3002       __pyx_t_4 = __pyx_t_3;
3003     } else {
3004       __pyx_t_4 = __pyx_t_2;
3005     }
3006     __pyx_t_2 = __pyx_t_4;
3007   } else {
3008     __pyx_t_2 = __pyx_t_1;
3009   }
3010   if (__pyx_t_2) {
3011     __Pyx_XDECREF(__pyx_r);
3012     __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3013     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3014     __pyx_r = ((PyObject *)__pyx_t_5);
3015     __pyx_t_5 = 0;
3016     goto __pyx_L0;
3017     goto __pyx_L5;
3018   }
3019   /*else*/ {
3020
3021     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":168
3022  *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
3023  *             if f == b"." or f == b"PASS" or f == b"0": return []
3024  *             else: return f.split(';')             # <<<<<<<<<<<<<<
3025  * 
3026  *     property info:
3027  */
3028     __Pyx_XDECREF(__pyx_r);
3029     __pyx_t_5 = PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3030     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3031     __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_t_5), __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3032     __Pyx_GOTREF(__pyx_t_6);
3033     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3034     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3035     __Pyx_GOTREF(__pyx_t_5);
3036     __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
3037     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_7));
3038     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
3039     __pyx_t_7 = PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3040     __Pyx_GOTREF(__pyx_t_7);
3041     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3042     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3043     __pyx_r = __pyx_t_7;
3044     __pyx_t_7 = 0;
3045     goto __pyx_L0;
3046   }
3047   __pyx_L5:;
3048
3049   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3050   goto __pyx_L0;
3051   __pyx_L1_error:;
3052   __Pyx_XDECREF(__pyx_t_5);
3053   __Pyx_XDECREF(__pyx_t_6);
3054   __Pyx_XDECREF(__pyx_t_7);
3055   __Pyx_AddTraceback("cvcf.VCFRecord.filter.__get__");
3056   __pyx_r = NULL;
3057   __pyx_L0:;
3058   __Pyx_XGIVEREF(__pyx_r);
3059   __Pyx_RefNannyFinishContext();
3060   return __pyx_r;
3061 }
3062
3063 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":171
3064  * 
3065  *     property info:
3066  *         def __get__(self):             # <<<<<<<<<<<<<<
3067  *             col = self.fields[7]
3068  *             # dictionary of keys, and list of values
3069  */
3070
3071 static PyObject *__pyx_pf_4cvcf_9VCFRecord_4info___get__(PyObject *__pyx_v_self); /*proto*/
3072 static PyObject *__pyx_pf_4cvcf_9VCFRecord_4info___get__(PyObject *__pyx_v_self) {
3073   char *__pyx_v_col;
3074   PyObject *__pyx_v_info;
3075   PyObject *__pyx_v_blurp;
3076   PyObject *__pyx_v_elts;
3077   PyObject *__pyx_v_v;
3078   PyObject *__pyx_r = NULL;
3079   PyObject *__pyx_t_1 = NULL;
3080   int __pyx_t_2;
3081   Py_ssize_t __pyx_t_3;
3082   PyObject *__pyx_t_4 = NULL;
3083   PyObject *__pyx_t_5 = NULL;
3084   PyObject *__pyx_t_6 = NULL;
3085   Py_ssize_t __pyx_t_7;
3086   PyObject *__pyx_t_8 = NULL;
3087   PyObject *__pyx_t_9 = NULL;
3088   __Pyx_RefNannySetupContext("__get__");
3089   __pyx_v_info = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
3090   __pyx_v_blurp = Py_None; __Pyx_INCREF(Py_None);
3091   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
3092   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
3093
3094   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":172
3095  *     property info:
3096  *         def __get__(self):
3097  *             col = self.fields[7]             # <<<<<<<<<<<<<<
3098  *             # dictionary of keys, and list of values
3099  *             info = {}
3100  */
3101   __pyx_v_col = (((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.fields[7]);
3102
3103   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":174
3104  *             col = self.fields[7]
3105  *             # dictionary of keys, and list of values
3106  *             info = {}             # <<<<<<<<<<<<<<
3107  *             if col != b".":
3108  *                 for blurp in col.split(';'):
3109  */
3110   __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;}
3111   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3112   __Pyx_DECREF(((PyObject *)__pyx_v_info));
3113   __pyx_v_info = __pyx_t_1;
3114   __pyx_t_1 = 0;
3115
3116   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":175
3117  *             # dictionary of keys, and list of values
3118  *             info = {}
3119  *             if col != b".":             # <<<<<<<<<<<<<<
3120  *                 for blurp in col.split(';'):
3121  *                     elts = blurp.split('=')
3122  */
3123   __pyx_t_2 = (__pyx_v_col != __pyx_k_6);
3124   if (__pyx_t_2) {
3125
3126     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":176
3127  *             info = {}
3128  *             if col != b".":
3129  *                 for blurp in col.split(';'):             # <<<<<<<<<<<<<<
3130  *                     elts = blurp.split('=')
3131  *                     if len(elts) == 1: v = None
3132  */
3133     __pyx_t_1 = PyBytes_FromString(__pyx_v_col); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3134     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3135     __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_t_1), __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3136     __Pyx_GOTREF(__pyx_t_4);
3137     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3138     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3139     __Pyx_GOTREF(__pyx_t_1);
3140     __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
3141     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_7));
3142     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
3143     __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3144     __Pyx_GOTREF(__pyx_t_5);
3145     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3146     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3147     if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
3148       __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1);
3149     } else {
3150       __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3151       __Pyx_GOTREF(__pyx_t_1);
3152     }
3153     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3154     for (;;) {
3155       if (likely(PyList_CheckExact(__pyx_t_1))) {
3156         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
3157         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
3158       } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
3159         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
3160         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
3161       } else {
3162         __pyx_t_5 = PyIter_Next(__pyx_t_1);
3163         if (!__pyx_t_5) {
3164           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3165           break;
3166         }
3167         __Pyx_GOTREF(__pyx_t_5);
3168       }
3169       __Pyx_DECREF(__pyx_v_blurp);
3170       __pyx_v_blurp = __pyx_t_5;
3171       __pyx_t_5 = 0;
3172
3173       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":177
3174  *             if col != b".":
3175  *                 for blurp in col.split(';'):
3176  *                     elts = blurp.split('=')             # <<<<<<<<<<<<<<
3177  *                     if len(elts) == 1: v = None
3178  *                     elif len(elts) == 2: v = elts[1]
3179  */
3180       __pyx_t_5 = PyObject_GetAttr(__pyx_v_blurp, __pyx_n_s__split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3181       __Pyx_GOTREF(__pyx_t_5);
3182       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3183       __Pyx_GOTREF(__pyx_t_4);
3184       __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
3185       PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_8));
3186       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
3187       __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3188       __Pyx_GOTREF(__pyx_t_6);
3189       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3190       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3191       __Pyx_DECREF(__pyx_v_elts);
3192       __pyx_v_elts = __pyx_t_6;
3193       __pyx_t_6 = 0;
3194
3195       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":178
3196  *                 for blurp in col.split(';'):
3197  *                     elts = blurp.split('=')
3198  *                     if len(elts) == 1: v = None             # <<<<<<<<<<<<<<
3199  *                     elif len(elts) == 2: v = elts[1]
3200  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
3201  */
3202       __pyx_t_7 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3203       __pyx_t_2 = (__pyx_t_7 == 1);
3204       if (__pyx_t_2) {
3205         __Pyx_INCREF(Py_None);
3206         __Pyx_DECREF(__pyx_v_v);
3207         __pyx_v_v = Py_None;
3208         goto __pyx_L8;
3209       }
3210
3211       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":179
3212  *                     elts = blurp.split('=')
3213  *                     if len(elts) == 1: v = None
3214  *                     elif len(elts) == 2: v = elts[1]             # <<<<<<<<<<<<<<
3215  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
3216  *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))
3217  */
3218       __pyx_t_7 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3219       __pyx_t_2 = (__pyx_t_7 == 2);
3220       if (__pyx_t_2) {
3221         __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3222         __Pyx_GOTREF(__pyx_t_6);
3223         __Pyx_DECREF(__pyx_v_v);
3224         __pyx_v_v = __pyx_t_6;
3225         __pyx_t_6 = 0;
3226         goto __pyx_L8;
3227       }
3228       /*else*/ {
3229
3230         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":180
3231  *                     if len(elts) == 1: v = None
3232  *                     elif len(elts) == 2: v = elts[1]
3233  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)             # <<<<<<<<<<<<<<
3234  *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))
3235  *             return info
3236  */
3237         __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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3238         __Pyx_GOTREF(__pyx_t_6);
3239         __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3240         __Pyx_GOTREF(__pyx_t_4);
3241         __Pyx_INCREF(__pyx_v_self);
3242         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self);
3243         __Pyx_GIVEREF(__pyx_v_self);
3244         __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3245         __Pyx_GOTREF(__pyx_t_5);
3246         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3247         __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ERROR_INFO_STRING); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3248         __Pyx_GOTREF(__pyx_t_4);
3249         __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;}
3250         __Pyx_GOTREF(__pyx_t_8);
3251         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
3252         __Pyx_GIVEREF(__pyx_t_5);
3253         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
3254         __Pyx_GIVEREF(__pyx_t_4);
3255         __pyx_t_5 = 0;
3256         __pyx_t_4 = 0;
3257         __pyx_t_4 = PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3258         __Pyx_GOTREF(__pyx_t_4);
3259         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3260         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3261         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3262       }
3263       __pyx_L8:;
3264
3265       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":181
3266  *                     elif len(elts) == 2: v = elts[1]
3267  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
3268  *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))             # <<<<<<<<<<<<<<
3269  *             return info
3270  * 
3271  */
3272       __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s__parse_formatdata); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3273       __Pyx_GOTREF(__pyx_t_4);
3274       __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;}
3275       __Pyx_GOTREF(__pyx_t_8);
3276       __pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s___info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3277       __Pyx_GOTREF(__pyx_t_6);
3278       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3279       __Pyx_GOTREF(__pyx_t_5);
3280       __Pyx_INCREF(__pyx_v_self);
3281       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
3282       __Pyx_GIVEREF(__pyx_v_self);
3283       __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3284       __Pyx_GOTREF(__pyx_t_9);
3285       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3286       __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3287       __Pyx_GOTREF(__pyx_t_5);
3288       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
3289       __Pyx_GIVEREF(__pyx_t_8);
3290       __Pyx_INCREF(__pyx_v_v);
3291       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_v);
3292       __Pyx_GIVEREF(__pyx_v_v);
3293       PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
3294       __Pyx_GIVEREF(__pyx_t_6);
3295       PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_9);
3296       __Pyx_GIVEREF(__pyx_t_9);
3297       __pyx_t_8 = 0;
3298       __pyx_t_6 = 0;
3299       __pyx_t_9 = 0;
3300       __pyx_t_9 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3301       __Pyx_GOTREF(__pyx_t_9);
3302       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3303       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3304       __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3305       __Pyx_GOTREF(__pyx_t_5);
3306       if (PyDict_SetItem(((PyObject *)__pyx_v_info), __pyx_t_5, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3307       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3308       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3309     }
3310     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3311     goto __pyx_L5;
3312   }
3313   __pyx_L5:;
3314
3315   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":182
3316  *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
3317  *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))
3318  *             return info             # <<<<<<<<<<<<<<
3319  * 
3320  *     property format:
3321  */
3322   __Pyx_XDECREF(__pyx_r);
3323   __Pyx_INCREF(((PyObject *)__pyx_v_info));
3324   __pyx_r = ((PyObject *)__pyx_v_info);
3325   goto __pyx_L0;
3326
3327   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3328   goto __pyx_L0;
3329   __pyx_L1_error:;
3330   __Pyx_XDECREF(__pyx_t_1);
3331   __Pyx_XDECREF(__pyx_t_4);
3332   __Pyx_XDECREF(__pyx_t_5);
3333   __Pyx_XDECREF(__pyx_t_6);
3334   __Pyx_XDECREF(__pyx_t_8);
3335   __Pyx_XDECREF(__pyx_t_9);
3336   __Pyx_AddTraceback("cvcf.VCFRecord.info.__get__");
3337   __pyx_r = NULL;
3338   __pyx_L0:;
3339   __Pyx_DECREF(__pyx_v_info);
3340   __Pyx_DECREF(__pyx_v_blurp);
3341   __Pyx_DECREF(__pyx_v_elts);
3342   __Pyx_DECREF(__pyx_v_v);
3343   __Pyx_XGIVEREF(__pyx_r);
3344   __Pyx_RefNannyFinishContext();
3345   return __pyx_r;
3346 }
3347
3348 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":185
3349  * 
3350  *     property format:
3351  *          def __get__(self):             # <<<<<<<<<<<<<<
3352  *              return self.fields[8].split(':')
3353  * 
3354  */
3355
3356 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6format___get__(PyObject *__pyx_v_self); /*proto*/
3357 static PyObject *__pyx_pf_4cvcf_9VCFRecord_6format___get__(PyObject *__pyx_v_self) {
3358   PyObject *__pyx_r = NULL;
3359   PyObject *__pyx_t_1 = NULL;
3360   PyObject *__pyx_t_2 = NULL;
3361   PyObject *__pyx_t_3 = NULL;
3362   __Pyx_RefNannySetupContext("__get__");
3363
3364   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":186
3365  *     property format:
3366  *          def __get__(self):
3367  *              return self.fields[8].split(':')             # <<<<<<<<<<<<<<
3368  * 
3369  *     property samples:
3370  */
3371   __Pyx_XDECREF(__pyx_r);
3372   __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;}
3373   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3374   __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;}
3375   __Pyx_GOTREF(__pyx_t_2);
3376   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3377   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3378   __Pyx_GOTREF(__pyx_t_1);
3379   __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
3380   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3));
3381   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
3382   __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3383   __Pyx_GOTREF(__pyx_t_3);
3384   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3385   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3386   __pyx_r = __pyx_t_3;
3387   __pyx_t_3 = 0;
3388   goto __pyx_L0;
3389
3390   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3391   goto __pyx_L0;
3392   __pyx_L1_error:;
3393   __Pyx_XDECREF(__pyx_t_1);
3394   __Pyx_XDECREF(__pyx_t_2);
3395   __Pyx_XDECREF(__pyx_t_3);
3396   __Pyx_AddTraceback("cvcf.VCFRecord.format.__get__");
3397   __pyx_r = NULL;
3398   __pyx_L0:;
3399   __Pyx_XGIVEREF(__pyx_r);
3400   __Pyx_RefNannyFinishContext();
3401   return __pyx_r;
3402 }
3403
3404 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":189
3405  * 
3406  *     property samples:
3407  *         def __get__(self):             # <<<<<<<<<<<<<<
3408  *             return self.vcf._samples
3409  * 
3410  */
3411
3412 static PyObject *__pyx_pf_4cvcf_9VCFRecord_7samples___get__(PyObject *__pyx_v_self); /*proto*/
3413 static PyObject *__pyx_pf_4cvcf_9VCFRecord_7samples___get__(PyObject *__pyx_v_self) {
3414   PyObject *__pyx_r = NULL;
3415   PyObject *__pyx_t_1 = NULL;
3416   __Pyx_RefNannySetupContext("__get__");
3417
3418   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":190
3419  *     property samples:
3420  *         def __get__(self):
3421  *             return self.vcf._samples             # <<<<<<<<<<<<<<
3422  * 
3423  *     def __getitem__(self, key):
3424  */
3425   __Pyx_XDECREF(__pyx_r);
3426   __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;}
3427   __Pyx_GOTREF(__pyx_t_1);
3428   __pyx_r = __pyx_t_1;
3429   __pyx_t_1 = 0;
3430   goto __pyx_L0;
3431
3432   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3433   goto __pyx_L0;
3434   __pyx_L1_error:;
3435   __Pyx_XDECREF(__pyx_t_1);
3436   __Pyx_AddTraceback("cvcf.VCFRecord.samples.__get__");
3437   __pyx_r = NULL;
3438   __pyx_L0:;
3439   __Pyx_XGIVEREF(__pyx_r);
3440   __Pyx_RefNannyFinishContext();
3441   return __pyx_r;
3442 }
3443
3444 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":192
3445  *             return self.vcf._samples
3446  * 
3447  *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
3448  * 
3449  *         # parse sample columns
3450  */
3451
3452 static PyObject *__pyx_pf_4cvcf_9VCFRecord___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
3453 static PyObject *__pyx_pf_4cvcf_9VCFRecord___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
3454   PyObject *__pyx_v_values;
3455   PyObject *__pyx_v_alt;
3456   PyObject *__pyx_v_format;
3457   PyObject *__pyx_v_result;
3458   Py_ssize_t __pyx_v_idx;
3459   PyObject *__pyx_v_expected;
3460   PyObject *__pyx_v_value;
3461   PyObject *__pyx_r = NULL;
3462   PyObject *__pyx_t_1 = NULL;
3463   PyObject *__pyx_t_2 = NULL;
3464   Py_ssize_t __pyx_t_3;
3465   PyObject *__pyx_t_4 = NULL;
3466   Py_ssize_t __pyx_t_5;
3467   int __pyx_t_6;
3468   PyObject *__pyx_t_7 = NULL;
3469   PyObject *__pyx_t_8 = NULL;
3470   PyObject *__pyx_t_9 = NULL;
3471   Py_ssize_t __pyx_t_10;
3472   int __pyx_t_11;
3473   int __pyx_t_12;
3474   __Pyx_RefNannySetupContext("__getitem__");
3475   __pyx_v_values = Py_None; __Pyx_INCREF(Py_None);
3476   __pyx_v_alt = Py_None; __Pyx_INCREF(Py_None);
3477   __pyx_v_format = Py_None; __Pyx_INCREF(Py_None);
3478   __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
3479   __pyx_v_expected = Py_None; __Pyx_INCREF(Py_None);
3480   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
3481
3482   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":195
3483  * 
3484  *         # parse sample columns
3485  *         values = self.fields[self.vcf._sample2column[key]].split(':')             # <<<<<<<<<<<<<<
3486  *         alt = self.alt
3487  *         format = self.format
3488  */
3489   __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;}
3490   __Pyx_GOTREF(__pyx_t_1);
3491   __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;}
3492   __Pyx_GOTREF(__pyx_t_2);
3493   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3494   __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;}
3495   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3496   __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;}
3497   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3498   __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;}
3499   __Pyx_GOTREF(__pyx_t_1);
3500   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3501   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3502   __Pyx_GOTREF(__pyx_t_2);
3503   __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
3504   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_3));
3505   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
3506   __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3507   __Pyx_GOTREF(__pyx_t_4);
3508   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3509   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3510   __Pyx_DECREF(__pyx_v_values);
3511   __pyx_v_values = __pyx_t_4;
3512   __pyx_t_4 = 0;
3513
3514   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":196
3515  *         # parse sample columns
3516  *         values = self.fields[self.vcf._sample2column[key]].split(':')
3517  *         alt = self.alt             # <<<<<<<<<<<<<<
3518  *         format = self.format
3519  * 
3520  */
3521   __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__alt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3522   __Pyx_GOTREF(__pyx_t_4);
3523   __Pyx_DECREF(__pyx_v_alt);
3524   __pyx_v_alt = __pyx_t_4;
3525   __pyx_t_4 = 0;
3526
3527   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":197
3528  *         values = self.fields[self.vcf._sample2column[key]].split(':')
3529  *         alt = self.alt
3530  *         format = self.format             # <<<<<<<<<<<<<<
3531  * 
3532  *         if len(values) > len(format):
3533  */
3534   __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3535   __Pyx_GOTREF(__pyx_t_4);
3536   __Pyx_DECREF(__pyx_v_format);
3537   __pyx_v_format = __pyx_t_4;
3538   __pyx_t_4 = 0;
3539
3540   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":199
3541  *         format = self.format
3542  * 
3543  *         if len(values) > len(format):             # <<<<<<<<<<<<<<
3544  *             self.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\
3545  *                            (len(values),key,len(format)))
3546  */
3547   __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;}
3548   __pyx_t_5 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3549   __pyx_t_6 = (__pyx_t_3 > __pyx_t_5);
3550   if (__pyx_t_6) {
3551
3552     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":200
3553  * 
3554  *         if len(values) > len(format):
3555  *             self.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\             # <<<<<<<<<<<<<<
3556  *                            (len(values),key,len(format)))
3557  * 
3558  */
3559     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3560     __Pyx_GOTREF(__pyx_t_4);
3561     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__line); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3562     __Pyx_GOTREF(__pyx_t_2);
3563     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3564     __Pyx_GOTREF(__pyx_t_1);
3565     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3566     __Pyx_GIVEREF(__pyx_t_2);
3567     __pyx_t_2 = 0;
3568     __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3569     __Pyx_GOTREF(__pyx_t_2);
3570     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3571     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3572     __Pyx_GOTREF(__pyx_t_1);
3573
3574     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":201
3575  *         if len(values) > len(format):
3576  *             self.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\
3577  *                            (len(values),key,len(format)))             # <<<<<<<<<<<<<<
3578  * 
3579  *         result = {}
3580  */
3581     __pyx_t_5 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3582     __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3583     __Pyx_GOTREF(__pyx_t_7);
3584     __pyx_t_5 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3585     __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3586     __Pyx_GOTREF(__pyx_t_8);
3587     __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;}
3588     __Pyx_GOTREF(__pyx_t_9);
3589     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
3590     __Pyx_GIVEREF(__pyx_t_7);
3591     __Pyx_INCREF(__pyx_v_key);
3592     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_key);
3593     __Pyx_GIVEREF(__pyx_v_key);
3594     PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
3595     __Pyx_GIVEREF(__pyx_t_8);
3596     __pyx_t_7 = 0;
3597     __pyx_t_8 = 0;
3598     __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3599     __Pyx_GOTREF(((PyObject *)__pyx_t_8));
3600     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3601     __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;}
3602     __Pyx_GOTREF(__pyx_t_9);
3603     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
3604     __Pyx_GIVEREF(__pyx_t_2);
3605     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
3606     __Pyx_GIVEREF(__pyx_t_1);
3607     PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_t_8));
3608     __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
3609     __pyx_t_2 = 0;
3610     __pyx_t_1 = 0;
3611     __pyx_t_8 = 0;
3612     __pyx_t_8 = PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3613     __Pyx_GOTREF(__pyx_t_8);
3614     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3615     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3616     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3617     goto __pyx_L5;
3618   }
3619   __pyx_L5:;
3620
3621   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":203
3622  *                            (len(values),key,len(format)))
3623  * 
3624  *         result = {}             # <<<<<<<<<<<<<<
3625  *         for idx in range(len(format)):
3626  *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)
3627  */
3628   __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;}
3629   __Pyx_GOTREF(((PyObject *)__pyx_t_8));
3630   __Pyx_DECREF(((PyObject *)__pyx_v_result));
3631   __pyx_v_result = __pyx_t_8;
3632   __pyx_t_8 = 0;
3633
3634   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":204
3635  * 
3636  *         result = {}
3637  *         for idx in range(len(format)):             # <<<<<<<<<<<<<<
3638  *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)
3639  *             if idx < len(values): value = values[idx]
3640  */
3641   __pyx_t_5 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3642   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
3643     __pyx_v_idx = __pyx_t_3;
3644
3645     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":205
3646  *         result = {}
3647  *         for idx in range(len(format)):
3648  *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)             # <<<<<<<<<<<<<<
3649  *             if idx < len(values): value = values[idx]
3650  *             else:
3651  */
3652     __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;}
3653     __Pyx_GOTREF(__pyx_t_8);
3654     __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;}
3655     __Pyx_GOTREF(__pyx_t_9);
3656     __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s___format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3657     __Pyx_GOTREF(__pyx_t_4);
3658     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3659     __Pyx_GOTREF(__pyx_t_1);
3660     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
3661     __Pyx_GIVEREF(__pyx_t_9);
3662     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
3663     __Pyx_GIVEREF(__pyx_t_4);
3664     __Pyx_INCREF(__pyx_v_alt);
3665     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_alt);
3666     __Pyx_GIVEREF(__pyx_v_alt);
3667     __pyx_t_9 = 0;
3668     __pyx_t_4 = 0;
3669     __pyx_t_4 = PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3670     __Pyx_GOTREF(__pyx_t_4);
3671     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3672     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3673     __Pyx_DECREF(__pyx_v_expected);
3674     __pyx_v_expected = __pyx_t_4;
3675     __pyx_t_4 = 0;
3676
3677     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":206
3678  *         for idx in range(len(format)):
3679  *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)
3680  *             if idx < len(values): value = values[idx]             # <<<<<<<<<<<<<<
3681  *             else:
3682  *                 if expected == -1: value = "."
3683  */
3684     __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;}
3685     __pyx_t_6 = (__pyx_v_idx < __pyx_t_10);
3686     if (__pyx_t_6) {
3687       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3688       __Pyx_GOTREF(__pyx_t_4);
3689       __Pyx_DECREF(__pyx_v_value);
3690       __pyx_v_value = __pyx_t_4;
3691       __pyx_t_4 = 0;
3692       goto __pyx_L8;
3693     }
3694     /*else*/ {
3695
3696       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":208
3697  *             if idx < len(values): value = values[idx]
3698  *             else:
3699  *                 if expected == -1: value = "."             # <<<<<<<<<<<<<<
3700  *                 else: value = ",".join(["."]*expected)
3701  * 
3702  */
3703       __pyx_t_4 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3704       __Pyx_GOTREF(__pyx_t_4);
3705       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3706       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3707       if (__pyx_t_6) {
3708         __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
3709         __Pyx_DECREF(__pyx_v_value);
3710         __pyx_v_value = ((PyObject *)__pyx_kp_s_6);
3711         goto __pyx_L9;
3712       }
3713       /*else*/ {
3714
3715         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":209
3716  *             else:
3717  *                 if expected == -1: value = "."
3718  *                 else: value = ",".join(["."]*expected)             # <<<<<<<<<<<<<<
3719  * 
3720  *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
3721  */
3722         __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3723         __Pyx_GOTREF(__pyx_t_4);
3724         __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3725         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3726         __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
3727         PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_6));
3728         __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
3729         __pyx_t_8 = PyNumber_Multiply(((PyObject *)__pyx_t_1), __pyx_v_expected); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3730         __Pyx_GOTREF(__pyx_t_8);
3731         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3732         __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3733         __Pyx_GOTREF(__pyx_t_1);
3734         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
3735         __Pyx_GIVEREF(__pyx_t_8);
3736         __pyx_t_8 = 0;
3737         __pyx_t_8 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3738         __Pyx_GOTREF(__pyx_t_8);
3739         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3740         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3741         __Pyx_DECREF(__pyx_v_value);
3742         __pyx_v_value = __pyx_t_8;
3743         __pyx_t_8 = 0;
3744       }
3745       __pyx_L9:;
3746     }
3747     __pyx_L8:;
3748
3749     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":211
3750  *                 else: value = ",".join(["."]*expected)
3751  * 
3752  *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))             # <<<<<<<<<<<<<<
3753  *             if expected != -1 and len(result[format[idx]]) != expected:
3754  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
3755  */
3756     __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;}
3757     __Pyx_GOTREF(__pyx_t_8);
3758     __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;}
3759     __Pyx_GOTREF(__pyx_t_1);
3760     __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->vcf, __pyx_n_s___format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3761     __Pyx_GOTREF(__pyx_t_4);
3762     __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;}
3763     __Pyx_GOTREF(((PyObject *)__pyx_t_9));
3764     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3765     __Pyx_GOTREF(__pyx_t_2);
3766     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_9));
3767     __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
3768     __pyx_t_9 = 0;
3769     __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3770     __Pyx_GOTREF(__pyx_t_9);
3771     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3772     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3773     __Pyx_GOTREF(__pyx_t_2);
3774     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3775     __Pyx_GIVEREF(__pyx_t_1);
3776     __Pyx_INCREF(__pyx_v_value);
3777     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
3778     __Pyx_GIVEREF(__pyx_v_value);
3779     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
3780     __Pyx_GIVEREF(__pyx_t_4);
3781     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_9);
3782     __Pyx_GIVEREF(__pyx_t_9);
3783     __pyx_t_1 = 0;
3784     __pyx_t_4 = 0;
3785     __pyx_t_9 = 0;
3786     __pyx_t_9 = PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3787     __Pyx_GOTREF(__pyx_t_9);
3788     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3789     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3790     __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 = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3791     __Pyx_GOTREF(__pyx_t_2);
3792     if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_t_2, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3793     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3794     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3795
3796     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":212
3797  * 
3798  *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
3799  *             if expected != -1 and len(result[format[idx]]) != expected:             # <<<<<<<<<<<<<<
3800  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
3801  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
3802  */
3803     __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;}
3804     __Pyx_GOTREF(__pyx_t_9);
3805     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3806     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3807     if (__pyx_t_6) {
3808       __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;}
3809       __Pyx_GOTREF(__pyx_t_9);
3810       __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_9); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3811       __Pyx_GOTREF(__pyx_t_2);
3812       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3813       __pyx_t_10 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3814       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3815       __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3816       __Pyx_GOTREF(__pyx_t_2);
3817       __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __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;}
3818       __Pyx_GOTREF(__pyx_t_9);
3819       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3820       __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;}
3821       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3822       __pyx_t_12 = __pyx_t_11;
3823     } else {
3824       __pyx_t_12 = __pyx_t_6;
3825     }
3826     if (__pyx_t_12) {
3827
3828       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":213
3829  *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
3830  *             if expected != -1 and len(result[format[idx]]) != expected:
3831  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,             # <<<<<<<<<<<<<<
3832  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
3833  *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
3834  */
3835       __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;}
3836       __Pyx_GOTREF(__pyx_t_9);
3837       __pyx_t_2 = PyBytes_FromString(((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_v_self)->__pyx_base.data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3838       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3839       __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;}
3840       __Pyx_GOTREF(__pyx_t_8);
3841       PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_2));
3842       __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
3843       __pyx_t_2 = 0;
3844       __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3845       __Pyx_GOTREF(__pyx_t_2);
3846       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3847       __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3848       __Pyx_GOTREF(__pyx_t_8);
3849
3850       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":214
3851  *             if expected != -1 and len(result[format[idx]]) != expected:
3852  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
3853  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))             # <<<<<<<<<<<<<<
3854  *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
3855  *                 result[format[idx]] = result[format[idx]][:expected]
3856  */
3857       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3858       __Pyx_GOTREF(__pyx_t_4);
3859       __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 = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3860       __Pyx_GOTREF(__pyx_t_1);
3861       __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3862       __Pyx_GOTREF(__pyx_t_7);
3863       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3864       __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3865       __Pyx_GOTREF(__pyx_t_1);
3866       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
3867       __Pyx_GIVEREF(__pyx_t_4);
3868       __Pyx_INCREF(__pyx_v_expected);
3869       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_expected);
3870       __Pyx_GIVEREF(__pyx_v_expected);
3871       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7);
3872       __Pyx_GIVEREF(__pyx_t_7);
3873       __pyx_t_4 = 0;
3874       __pyx_t_7 = 0;
3875       __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3876       __Pyx_GOTREF(((PyObject *)__pyx_t_7));
3877       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3878       __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3879       __Pyx_GOTREF(__pyx_t_1);
3880       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3881       __Pyx_GIVEREF(__pyx_t_2);
3882       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8);
3883       __Pyx_GIVEREF(__pyx_t_8);
3884       PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_7));
3885       __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
3886       __pyx_t_2 = 0;
3887       __pyx_t_8 = 0;
3888       __pyx_t_7 = 0;
3889       __pyx_t_7 = PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3890       __Pyx_GOTREF(__pyx_t_7);
3891       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3892       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3893       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3894
3895       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":215
3896  *                 self.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
3897  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
3898  *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))             # <<<<<<<<<<<<<<
3899  *                 result[format[idx]] = result[format[idx]][:expected]
3900  * 
3901  */
3902       __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;}
3903       __Pyx_GOTREF(__pyx_t_7);
3904       __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_7); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3905       __Pyx_GOTREF(__pyx_t_1);
3906       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3907       __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;}
3908       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3909       __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;}
3910       __Pyx_GOTREF(__pyx_t_1);
3911       __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __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;}
3912       __Pyx_GOTREF(__pyx_t_7);
3913       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3914       __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;}
3915       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3916       if (__pyx_t_12) {
3917         __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;}
3918         __Pyx_GOTREF(__pyx_t_7);
3919         __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_7); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3920         __Pyx_GOTREF(__pyx_t_1);
3921         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3922         __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3923         __Pyx_GOTREF(__pyx_t_7);
3924         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3925         __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3926         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3927         PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
3928         __Pyx_GIVEREF(__pyx_t_7);
3929         __pyx_t_7 = 0;
3930         __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;}
3931         __Pyx_GOTREF(__pyx_t_7);
3932         __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_7); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3933         __Pyx_GOTREF(__pyx_t_9);
3934         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3935         __pyx_t_10 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3936         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3937         __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3938         __Pyx_GOTREF(__pyx_t_9);
3939         __pyx_t_7 = PyNumber_Subtract(__pyx_v_expected, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3940         __Pyx_GOTREF(__pyx_t_7);
3941         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3942         __pyx_t_9 = PyNumber_Multiply(((PyObject *)__pyx_t_1), __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3943         __Pyx_GOTREF(__pyx_t_9);
3944         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3945         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3946         __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;}
3947         __Pyx_GOTREF(__pyx_t_7);
3948         __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_7); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3949         __Pyx_GOTREF(__pyx_t_1);
3950         __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3951         __Pyx_GOTREF(__pyx_t_8);
3952         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3953         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3954         if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_t_7, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3955         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3956         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3957         goto __pyx_L11;
3958       }
3959       __pyx_L11:;
3960
3961       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":216
3962  *                            "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
3963  *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
3964  *                 result[format[idx]] = result[format[idx]][:expected]             # <<<<<<<<<<<<<<
3965  * 
3966  *         return result
3967  */
3968       __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;}
3969       __Pyx_GOTREF(__pyx_t_7);
3970       __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_t_7); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3971       __Pyx_GOTREF(__pyx_t_8);
3972       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3973       __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;}
3974       __pyx_t_7 = PySequence_GetSlice(__pyx_t_8, 0, __pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3975       __Pyx_GOTREF(__pyx_t_7);
3976       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3977       __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3978       __Pyx_GOTREF(__pyx_t_8);
3979       if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_t_8, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3980       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3981       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3982       goto __pyx_L10;
3983     }
3984     __pyx_L10:;
3985   }
3986
3987   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":218
3988  *                 result[format[idx]] = result[format[idx]][:expected]
3989  * 
3990  *         return result             # <<<<<<<<<<<<<<
3991  * 
3992  * 
3993  */
3994   __Pyx_XDECREF(__pyx_r);
3995   __Pyx_INCREF(((PyObject *)__pyx_v_result));
3996   __pyx_r = ((PyObject *)__pyx_v_result);
3997   goto __pyx_L0;
3998
3999   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4000   goto __pyx_L0;
4001   __pyx_L1_error:;
4002   __Pyx_XDECREF(__pyx_t_1);
4003   __Pyx_XDECREF(__pyx_t_2);
4004   __Pyx_XDECREF(__pyx_t_4);
4005   __Pyx_XDECREF(__pyx_t_7);
4006   __Pyx_XDECREF(__pyx_t_8);
4007   __Pyx_XDECREF(__pyx_t_9);
4008   __Pyx_AddTraceback("cvcf.VCFRecord.__getitem__");
4009   __pyx_r = NULL;
4010   __pyx_L0:;
4011   __Pyx_DECREF(__pyx_v_values);
4012   __Pyx_DECREF(__pyx_v_alt);
4013   __Pyx_DECREF(__pyx_v_format);
4014   __Pyx_DECREF(__pyx_v_result);
4015   __Pyx_DECREF(__pyx_v_expected);
4016   __Pyx_DECREF(__pyx_v_value);
4017   __Pyx_XGIVEREF(__pyx_r);
4018   __Pyx_RefNannyFinishContext();
4019   return __pyx_r;
4020 }
4021
4022 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":224
4023  *     '''converts a :term:`tabix row` into a VCF record.'''
4024  *     cdef vcffile
4025  *     def __init__(self, vcffile ):             # <<<<<<<<<<<<<<
4026  *         self.vcffile = vcffile
4027  *     def __call__(self, char * buffer, int len ):
4028  */
4029
4030 static int __pyx_pf_4cvcf_11asVCFRecord___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4031 static int __pyx_pf_4cvcf_11asVCFRecord___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4032   PyObject *__pyx_v_vcffile = 0;
4033   int __pyx_r;
4034   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vcffile,0};
4035   __Pyx_RefNannySetupContext("__init__");
4036   if (unlikely(__pyx_kwds)) {
4037     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4038     PyObject* values[1] = {0};
4039     switch (PyTuple_GET_SIZE(__pyx_args)) {
4040       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4041       case  0: break;
4042       default: goto __pyx_L5_argtuple_error;
4043     }
4044     switch (PyTuple_GET_SIZE(__pyx_args)) {
4045       case  0:
4046       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vcffile);
4047       if (likely(values[0])) kw_args--;
4048       else goto __pyx_L5_argtuple_error;
4049     }
4050     if (unlikely(kw_args > 0)) {
4051       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;}
4052     }
4053     __pyx_v_vcffile = values[0];
4054   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
4055     goto __pyx_L5_argtuple_error;
4056   } else {
4057     __pyx_v_vcffile = PyTuple_GET_ITEM(__pyx_args, 0);
4058   }
4059   goto __pyx_L4_argument_unpacking_done;
4060   __pyx_L5_argtuple_error:;
4061   __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;}
4062   __pyx_L3_error:;
4063   __Pyx_AddTraceback("cvcf.asVCFRecord.__init__");
4064   __Pyx_RefNannyFinishContext();
4065   return -1;
4066   __pyx_L4_argument_unpacking_done:;
4067
4068   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":225
4069  *     cdef vcffile
4070  *     def __init__(self, vcffile ):
4071  *         self.vcffile = vcffile             # <<<<<<<<<<<<<<
4072  *     def __call__(self, char * buffer, int len ):
4073  *         cdef VCFRecord r
4074  */
4075   __Pyx_INCREF(__pyx_v_vcffile);
4076   __Pyx_GIVEREF(__pyx_v_vcffile);
4077   __Pyx_GOTREF(((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4078   __Pyx_DECREF(((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4079   ((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile = __pyx_v_vcffile;
4080
4081   __pyx_r = 0;
4082   __Pyx_RefNannyFinishContext();
4083   return __pyx_r;
4084 }
4085
4086 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":226
4087  *     def __init__(self, vcffile ):
4088  *         self.vcffile = vcffile
4089  *     def __call__(self, char * buffer, int len ):             # <<<<<<<<<<<<<<
4090  *         cdef VCFRecord r
4091  *         r = VCFRecord( self.vcffile )
4092  */
4093
4094 static PyObject *__pyx_pf_4cvcf_11asVCFRecord___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4095 static PyObject *__pyx_pf_4cvcf_11asVCFRecord___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4096   char *__pyx_v_buffer;
4097   int __pyx_v_len;
4098   struct __pyx_obj_4cvcf_VCFRecord *__pyx_v_r;
4099   PyObject *__pyx_r = NULL;
4100   PyObject *__pyx_t_1 = NULL;
4101   PyObject *__pyx_t_2 = NULL;
4102   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__buffer,&__pyx_n_s__len,0};
4103   __Pyx_RefNannySetupContext("__call__");
4104   if (unlikely(__pyx_kwds)) {
4105     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4106     PyObject* values[2] = {0,0};
4107     switch (PyTuple_GET_SIZE(__pyx_args)) {
4108       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4109       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4110       case  0: break;
4111       default: goto __pyx_L5_argtuple_error;
4112     }
4113     switch (PyTuple_GET_SIZE(__pyx_args)) {
4114       case  0:
4115       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buffer);
4116       if (likely(values[0])) kw_args--;
4117       else goto __pyx_L5_argtuple_error;
4118       case  1:
4119       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__len);
4120       if (likely(values[1])) kw_args--;
4121       else {
4122         __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4123       }
4124     }
4125     if (unlikely(kw_args > 0)) {
4126       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;}
4127     }
4128     __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;}
4129     __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;}
4130   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4131     goto __pyx_L5_argtuple_error;
4132   } else {
4133     __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;}
4134     __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;}
4135   }
4136   goto __pyx_L4_argument_unpacking_done;
4137   __pyx_L5_argtuple_error:;
4138   __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;}
4139   __pyx_L3_error:;
4140   __Pyx_AddTraceback("cvcf.asVCFRecord.__call__");
4141   __Pyx_RefNannyFinishContext();
4142   return NULL;
4143   __pyx_L4_argument_unpacking_done:;
4144   __pyx_v_r = ((struct __pyx_obj_4cvcf_VCFRecord *)Py_None); __Pyx_INCREF(Py_None);
4145
4146   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":228
4147  *     def __call__(self, char * buffer, int len ):
4148  *         cdef VCFRecord r
4149  *         r = VCFRecord( self.vcffile )             # <<<<<<<<<<<<<<
4150  *         r.copy( buffer, len )
4151  *         return r
4152  */
4153   __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;}
4154   __Pyx_GOTREF(__pyx_t_1);
4155   __Pyx_INCREF(((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4156   PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4157   __Pyx_GIVEREF(((struct __pyx_obj_4cvcf_asVCFRecord *)__pyx_v_self)->vcffile);
4158   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cvcf_VCFRecord)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4159   __Pyx_GOTREF(__pyx_t_2);
4160   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4161   __Pyx_DECREF(((PyObject *)__pyx_v_r));
4162   __pyx_v_r = ((struct __pyx_obj_4cvcf_VCFRecord *)__pyx_t_2);
4163   __pyx_t_2 = 0;
4164
4165   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":229
4166  *         cdef VCFRecord r
4167  *         r = VCFRecord( self.vcffile )
4168  *         r.copy( buffer, len )             # <<<<<<<<<<<<<<
4169  *         return r
4170  * 
4171  */
4172   __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;}
4173   __Pyx_GOTREF(__pyx_t_2);
4174   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4175
4176   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":230
4177  *         r = VCFRecord( self.vcffile )
4178  *         r.copy( buffer, len )
4179  *         return r             # <<<<<<<<<<<<<<
4180  * 
4181  * class VCF(object):
4182  */
4183   __Pyx_XDECREF(__pyx_r);
4184   __Pyx_INCREF(((PyObject *)__pyx_v_r));
4185   __pyx_r = ((PyObject *)__pyx_v_r);
4186   goto __pyx_L0;
4187
4188   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4189   goto __pyx_L0;
4190   __pyx_L1_error:;
4191   __Pyx_XDECREF(__pyx_t_1);
4192   __Pyx_XDECREF(__pyx_t_2);
4193   __Pyx_AddTraceback("cvcf.asVCFRecord.__call__");
4194   __pyx_r = NULL;
4195   __pyx_L0:;
4196   __Pyx_DECREF((PyObject *)__pyx_v_r);
4197   __Pyx_XGIVEREF(__pyx_r);
4198   __Pyx_RefNannyFinishContext();
4199   return __pyx_r;
4200 }
4201
4202 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":306
4203  *     _lines = None
4204  * 
4205  *     def __init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False):             # <<<<<<<<<<<<<<
4206  *         # make error identifiers accessible by name
4207  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id
4208  */
4209
4210 static PyObject *__pyx_pf_4cvcf_3VCF___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4211 static PyMethodDef __pyx_mdef_4cvcf_3VCF___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_4cvcf_3VCF___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
4212 static PyObject *__pyx_pf_4cvcf_3VCF___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4213   PyObject *__pyx_v_self = 0;
4214   PyObject *__pyx_v__copy = 0;
4215   PyObject *__pyx_v_reference = 0;
4216   PyObject *__pyx_v_regions = 0;
4217   PyObject *__pyx_v_lines = 0;
4218   PyObject *__pyx_v_leftalign = 0;
4219   PyObject *__pyx_v_id;
4220   PyObject *__pyx_r = NULL;
4221   Py_ssize_t __pyx_t_1;
4222   PyObject *__pyx_t_2 = NULL;
4223   PyObject *__pyx_t_3 = NULL;
4224   PyObject *__pyx_t_4 = NULL;
4225   PyObject *__pyx_t_5 = NULL;
4226   PyObject *__pyx_t_6 = NULL;
4227   int __pyx_t_7;
4228   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};
4229   __Pyx_RefNannySetupContext("__init__");
4230   __pyx_self = __pyx_self;
4231   if (unlikely(__pyx_kwds)) {
4232     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4233     PyObject* values[6] = {0,0,0,0,0,0};
4234     values[1] = ((PyObject *)Py_None);
4235     values[2] = ((PyObject *)Py_None);
4236     values[3] = ((PyObject *)Py_None);
4237     values[4] = ((PyObject *)Py_None);
4238     values[5] = __pyx_k_13;
4239     switch (PyTuple_GET_SIZE(__pyx_args)) {
4240       case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4241       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4242       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4243       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4244       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4245       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4246       case  0: break;
4247       default: goto __pyx_L5_argtuple_error;
4248     }
4249     switch (PyTuple_GET_SIZE(__pyx_args)) {
4250       case  0:
4251       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
4252       if (likely(values[0])) kw_args--;
4253       else goto __pyx_L5_argtuple_error;
4254       case  1:
4255       if (kw_args > 0) {
4256         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s___copy);
4257         if (value) { values[1] = value; kw_args--; }
4258       }
4259       case  2:
4260       if (kw_args > 0) {
4261         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
4262         if (value) { values[2] = value; kw_args--; }
4263       }
4264       case  3:
4265       if (kw_args > 0) {
4266         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__regions);
4267         if (value) { values[3] = value; kw_args--; }
4268       }
4269       case  4:
4270       if (kw_args > 0) {
4271         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines);
4272         if (value) { values[4] = value; kw_args--; }
4273       }
4274       case  5:
4275       if (kw_args > 0) {
4276         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__leftalign);
4277         if (value) { values[5] = value; kw_args--; }
4278       }
4279     }
4280     if (unlikely(kw_args > 0)) {
4281       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;}
4282     }
4283     __pyx_v_self = values[0];
4284     __pyx_v__copy = values[1];
4285     __pyx_v_reference = values[2];
4286     __pyx_v_regions = values[3];
4287     __pyx_v_lines = values[4];
4288     __pyx_v_leftalign = values[5];
4289   } else {
4290     __pyx_v__copy = ((PyObject *)Py_None);
4291     __pyx_v_reference = ((PyObject *)Py_None);
4292     __pyx_v_regions = ((PyObject *)Py_None);
4293     __pyx_v_lines = ((PyObject *)Py_None);
4294     __pyx_v_leftalign = __pyx_k_13;
4295     switch (PyTuple_GET_SIZE(__pyx_args)) {
4296       case  6: __pyx_v_leftalign = PyTuple_GET_ITEM(__pyx_args, 5);
4297       case  5: __pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 4);
4298       case  4: __pyx_v_regions = PyTuple_GET_ITEM(__pyx_args, 3);
4299       case  3: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 2);
4300       case  2: __pyx_v__copy = PyTuple_GET_ITEM(__pyx_args, 1);
4301       case  1: __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
4302       break;
4303       default: goto __pyx_L5_argtuple_error;
4304     }
4305   }
4306   goto __pyx_L4_argument_unpacking_done;
4307   __pyx_L5_argtuple_error:;
4308   __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;}
4309   __pyx_L3_error:;
4310   __Pyx_AddTraceback("cvcf.VCF.__init__");
4311   __Pyx_RefNannyFinishContext();
4312   return NULL;
4313   __pyx_L4_argument_unpacking_done:;
4314   __pyx_v_id = Py_None; __Pyx_INCREF(Py_None);
4315
4316   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":308
4317  *     def __init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False):
4318  *         # make error identifiers accessible by name
4319  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id             # <<<<<<<<<<<<<<
4320  *         if _copy != None:
4321  *             self._leftalign = _copy._leftalign
4322  */
4323   __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;}
4324   __Pyx_GOTREF(__pyx_t_2);
4325   __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;}
4326   __Pyx_GOTREF(__pyx_t_3);
4327   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4328   __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;}
4329   __Pyx_GOTREF(__pyx_t_2);
4330   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4331   if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
4332     __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
4333   } else {
4334     __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;}
4335     __Pyx_GOTREF(__pyx_t_3);
4336   }
4337   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4338   for (;;) {
4339     if (likely(PyList_CheckExact(__pyx_t_3))) {
4340       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
4341       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++;
4342     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
4343       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
4344       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++;
4345     } else {
4346       __pyx_t_2 = PyIter_Next(__pyx_t_3);
4347       if (!__pyx_t_2) {
4348         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4349         break;
4350       }
4351       __Pyx_GOTREF(__pyx_t_2);
4352     }
4353     __Pyx_DECREF(__pyx_v_id);
4354     __pyx_v_id = __pyx_t_2;
4355     __pyx_t_2 = 0;
4356     __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;}
4357     __Pyx_GOTREF(__pyx_t_2);
4358     __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;}
4359     __Pyx_GOTREF(__pyx_t_4);
4360     __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;}
4361     __Pyx_GOTREF(__pyx_t_5);
4362     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4363     __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;}
4364     __Pyx_GOTREF(__pyx_t_4);
4365     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4366     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4367     __Pyx_GOTREF(__pyx_t_5);
4368     __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
4369     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_3));
4370     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
4371     __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4372     __Pyx_GOTREF(__pyx_t_6);
4373     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4374     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4375     __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4376     __Pyx_GOTREF(__pyx_t_5);
4377     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4378     if (PyObject_SetItem(__pyx_t_2, __pyx_t_5, __pyx_v_id) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4379     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4380     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4381   }
4382   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4383
4384   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":309
4385  *         # make error identifiers accessible by name
4386  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id
4387  *         if _copy != None:             # <<<<<<<<<<<<<<
4388  *             self._leftalign = _copy._leftalign
4389  *             self._header = _copy._header[:]
4390  */
4391   __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;}
4392   __Pyx_GOTREF(__pyx_t_3);
4393   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4394   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4395   if (__pyx_t_7) {
4396
4397     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":310
4398  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id
4399  *         if _copy != None:
4400  *             self._leftalign = _copy._leftalign             # <<<<<<<<<<<<<<
4401  *             self._header = _copy._header[:]
4402  *             self._version = _copy._version
4403  */
4404     __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;}
4405     __Pyx_GOTREF(__pyx_t_3);
4406     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;}
4407     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4408
4409     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":311
4410  *         if _copy != None:
4411  *             self._leftalign = _copy._leftalign
4412  *             self._header = _copy._header[:]             # <<<<<<<<<<<<<<
4413  *             self._version = _copy._version
4414  *             self._info = copy.deepcopy(_copy._info)
4415  */
4416     __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;}
4417     __Pyx_GOTREF(__pyx_t_3);
4418     __pyx_t_5 = PySequence_GetSlice(__pyx_t_3, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4419     __Pyx_GOTREF(__pyx_t_5);
4420     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4421     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___header, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4422     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4423
4424     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":312
4425  *             self._leftalign = _copy._leftalign
4426  *             self._header = _copy._header[:]
4427  *             self._version = _copy._version             # <<<<<<<<<<<<<<
4428  *             self._info = copy.deepcopy(_copy._info)
4429  *             self._filter = copy.deepcopy(_copy._filter)
4430  */
4431     __pyx_t_5 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4432     __Pyx_GOTREF(__pyx_t_5);
4433     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___version, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4434     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4435
4436     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":313
4437  *             self._header = _copy._header[:]
4438  *             self._version = _copy._version
4439  *             self._info = copy.deepcopy(_copy._info)             # <<<<<<<<<<<<<<
4440  *             self._filter = copy.deepcopy(_copy._filter)
4441  *             self._format = copy.deepcopy(_copy._format)
4442  */
4443     __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4444     __Pyx_GOTREF(__pyx_t_5);
4445     __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4446     __Pyx_GOTREF(__pyx_t_3);
4447     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4448     __pyx_t_5 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4449     __Pyx_GOTREF(__pyx_t_5);
4450     __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;}
4451     __Pyx_GOTREF(__pyx_t_2);
4452     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
4453     __Pyx_GIVEREF(__pyx_t_5);
4454     __pyx_t_5 = 0;
4455     __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4456     __Pyx_GOTREF(__pyx_t_5);
4457     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4458     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4459     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___info, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4460     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4461
4462     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":314
4463  *             self._version = _copy._version
4464  *             self._info = copy.deepcopy(_copy._info)
4465  *             self._filter = copy.deepcopy(_copy._filter)             # <<<<<<<<<<<<<<
4466  *             self._format = copy.deepcopy(_copy._format)
4467  *             self._samples = _copy._samples[:]
4468  */
4469     __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4470     __Pyx_GOTREF(__pyx_t_5);
4471     __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4472     __Pyx_GOTREF(__pyx_t_2);
4473     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4474     __pyx_t_5 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___filter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4475     __Pyx_GOTREF(__pyx_t_5);
4476     __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;}
4477     __Pyx_GOTREF(__pyx_t_3);
4478     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
4479     __Pyx_GIVEREF(__pyx_t_5);
4480     __pyx_t_5 = 0;
4481     __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4482     __Pyx_GOTREF(__pyx_t_5);
4483     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4484     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4485     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___filter, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4486     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4487
4488     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":315
4489  *             self._info = copy.deepcopy(_copy._info)
4490  *             self._filter = copy.deepcopy(_copy._filter)
4491  *             self._format = copy.deepcopy(_copy._format)             # <<<<<<<<<<<<<<
4492  *             self._samples = _copy._samples[:]
4493  *             self._sample2column = copy.deepcopy(_copy._sample2column)
4494  */
4495     __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4496     __Pyx_GOTREF(__pyx_t_5);
4497     __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4498     __Pyx_GOTREF(__pyx_t_3);
4499     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4500     __pyx_t_5 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4501     __Pyx_GOTREF(__pyx_t_5);
4502     __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;}
4503     __Pyx_GOTREF(__pyx_t_2);
4504     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
4505     __Pyx_GIVEREF(__pyx_t_5);
4506     __pyx_t_5 = 0;
4507     __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4508     __Pyx_GOTREF(__pyx_t_5);
4509     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4510     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4511     if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___format, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4512     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4513
4514     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":316
4515  *             self._filter = copy.deepcopy(_copy._filter)
4516  *             self._format = copy.deepcopy(_copy._format)
4517  *             self._samples = _copy._samples[:]             # <<<<<<<<<<<<<<
4518  *             self._sample2column = copy.deepcopy(_copy._sample2column)
4519  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
4520  */
4521     __pyx_t_5 = PyObject_GetAttr(__pyx_v__copy, __pyx_n_s___samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4522     __Pyx_GOTREF(__pyx_t_5);
4523     __pyx_t_2 = PySequence_GetSlice(__pyx_t_5, 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;}
4524     __Pyx_GOTREF(__pyx_t_2);
4525     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4526     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;}
4527     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4528
4529     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":317
4530  *             self._format = copy.deepcopy(_copy._format)
4531  *             self._samples = _copy._samples[:]
4532  *             self._sample2column = copy.deepcopy(_copy._sample2column)             # <<<<<<<<<<<<<<
4533  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
4534  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
4535  */
4536     __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;}
4537     __Pyx_GOTREF(__pyx_t_2);
4538     __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4539     __Pyx_GOTREF(__pyx_t_5);
4540     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4541     __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;}
4542     __Pyx_GOTREF(__pyx_t_2);
4543     __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;}
4544     __Pyx_GOTREF(__pyx_t_3);
4545     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
4546     __Pyx_GIVEREF(__pyx_t_2);
4547     __pyx_t_2 = 0;
4548     __pyx_t_2 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4549     __Pyx_GOTREF(__pyx_t_2);
4550     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4551     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4552     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;}
4553     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4554
4555     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":318
4556  *             self._samples = _copy._samples[:]
4557  *             self._sample2column = copy.deepcopy(_copy._sample2column)
4558  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)             # <<<<<<<<<<<<<<
4559  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
4560  *             self._reference = _copy._reference
4561  */
4562     __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;}
4563     __Pyx_GOTREF(__pyx_t_2);
4564     __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;}
4565     __Pyx_GOTREF(__pyx_t_3);
4566     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4567     __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;}
4568     __Pyx_GOTREF(__pyx_t_2);
4569     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4570     __Pyx_GOTREF(__pyx_t_5);
4571     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
4572     __Pyx_GIVEREF(__pyx_t_2);
4573     __pyx_t_2 = 0;
4574     __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4575     __Pyx_GOTREF(__pyx_t_2);
4576     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4577     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4578     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;}
4579     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4580
4581     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":319
4582  *             self._sample2column = copy.deepcopy(_copy._sample2column)
4583  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
4584  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)             # <<<<<<<<<<<<<<
4585  *             self._reference = _copy._reference
4586  *             self._regions = _copy._regions
4587  */
4588     __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;}
4589     __Pyx_GOTREF(__pyx_t_2);
4590     __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__deepcopy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4591     __Pyx_GOTREF(__pyx_t_5);
4592     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4593     __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;}
4594     __Pyx_GOTREF(__pyx_t_2);
4595     __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;}
4596     __Pyx_GOTREF(__pyx_t_3);
4597     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
4598     __Pyx_GIVEREF(__pyx_t_2);
4599     __pyx_t_2 = 0;
4600     __pyx_t_2 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4601     __Pyx_GOTREF(__pyx_t_2);
4602     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4603     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4604     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;}
4605     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4606
4607     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":320
4608  *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
4609  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
4610  *             self._reference = _copy._reference             # <<<<<<<<<<<<<<
4611  *             self._regions = _copy._regions
4612  *         if reference: self._reference = reference
4613  */
4614     __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;}
4615     __Pyx_GOTREF(__pyx_t_2);
4616     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;}
4617     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4618
4619     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":321
4620  *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
4621  *             self._reference = _copy._reference
4622  *             self._regions = _copy._regions             # <<<<<<<<<<<<<<
4623  *         if reference: self._reference = reference
4624  *         if regions: self._regions = regions
4625  */
4626     __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;}
4627     __Pyx_GOTREF(__pyx_t_2);
4628     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;}
4629     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4630     goto __pyx_L8;
4631   }
4632   __pyx_L8:;
4633
4634   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":322
4635  *             self._reference = _copy._reference
4636  *             self._regions = _copy._regions
4637  *         if reference: self._reference = reference             # <<<<<<<<<<<<<<
4638  *         if regions: self._regions = regions
4639  *         if leftalign: self._leftalign = leftalign
4640  */
4641   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_reference); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4642   if (__pyx_t_7) {
4643     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;}
4644     goto __pyx_L9;
4645   }
4646   __pyx_L9:;
4647
4648   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":323
4649  *             self._regions = _copy._regions
4650  *         if reference: self._reference = reference
4651  *         if regions: self._regions = regions             # <<<<<<<<<<<<<<
4652  *         if leftalign: self._leftalign = leftalign
4653  *         self._lines = lines
4654  */
4655   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_regions); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4656   if (__pyx_t_7) {
4657     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;}
4658     goto __pyx_L10;
4659   }
4660   __pyx_L10:;
4661
4662   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":324
4663  *         if reference: self._reference = reference
4664  *         if regions: self._regions = regions
4665  *         if leftalign: self._leftalign = leftalign             # <<<<<<<<<<<<<<
4666  *         self._lines = lines
4667  * 
4668  */
4669   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_leftalign); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4670   if (__pyx_t_7) {
4671     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;}
4672     goto __pyx_L11;
4673   }
4674   __pyx_L11:;
4675
4676   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":325
4677  *         if regions: self._regions = regions
4678  *         if leftalign: self._leftalign = leftalign
4679  *         self._lines = lines             # <<<<<<<<<<<<<<
4680  * 
4681  *     def error(self,line,error,opt=None):
4682  */
4683   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;}
4684
4685   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4686   goto __pyx_L0;
4687   __pyx_L1_error:;
4688   __Pyx_XDECREF(__pyx_t_2);
4689   __Pyx_XDECREF(__pyx_t_3);
4690   __Pyx_XDECREF(__pyx_t_4);
4691   __Pyx_XDECREF(__pyx_t_5);
4692   __Pyx_XDECREF(__pyx_t_6);
4693   __Pyx_AddTraceback("cvcf.VCF.__init__");
4694   __pyx_r = NULL;
4695   __pyx_L0:;
4696   __Pyx_DECREF(__pyx_v_id);
4697   __Pyx_XGIVEREF(__pyx_r);
4698   __Pyx_RefNannyFinishContext();
4699   return __pyx_r;
4700 }
4701
4702 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":327
4703  *         self._lines = lines
4704  * 
4705  *     def error(self,line,error,opt=None):             # <<<<<<<<<<<<<<
4706  *         if error in self._ignored_errors: return
4707  *         errorlabel, errorstring = self._errors[error].split(':')
4708  */
4709
4710 static PyObject *__pyx_pf_4cvcf_3VCF_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4711 static PyMethodDef __pyx_mdef_4cvcf_3VCF_error = {__Pyx_NAMESTR("error"), (PyCFunction)__pyx_pf_4cvcf_3VCF_error, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
4712 static PyObject *__pyx_pf_4cvcf_3VCF_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4713   PyObject *__pyx_v_self = 0;
4714   PyObject *__pyx_v_line = 0;
4715   PyObject *__pyx_v_error = 0;
4716   PyObject *__pyx_v_opt = 0;
4717   PyObject *__pyx_v_errorlabel;
4718   PyObject *__pyx_v_errorstring;
4719   PyObject *__pyx_v_errwarn;
4720   PyObject *__pyx_r = NULL;
4721   PyObject *__pyx_t_1 = NULL;
4722   int __pyx_t_2;
4723   PyObject *__pyx_t_3 = NULL;
4724   PyObject *__pyx_t_4 = NULL;
4725   PyObject *__pyx_t_5 = NULL;
4726   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,&__pyx_n_s__error,&__pyx_n_s__opt,0};
4727   __Pyx_RefNannySetupContext("error");
4728   __pyx_self = __pyx_self;
4729   if (unlikely(__pyx_kwds)) {
4730     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4731     PyObject* values[4] = {0,0,0,0};
4732     values[3] = ((PyObject *)Py_None);
4733     switch (PyTuple_GET_SIZE(__pyx_args)) {
4734       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4735       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4736       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4737       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4738       case  0: break;
4739       default: goto __pyx_L5_argtuple_error;
4740     }
4741     switch (PyTuple_GET_SIZE(__pyx_args)) {
4742       case  0:
4743       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
4744       if (likely(values[0])) kw_args--;
4745       else goto __pyx_L5_argtuple_error;
4746       case  1:
4747       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
4748       if (likely(values[1])) kw_args--;
4749       else {
4750         __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4751       }
4752       case  2:
4753       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__error);
4754       if (likely(values[2])) kw_args--;
4755       else {
4756         __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4757       }
4758       case  3:
4759       if (kw_args > 0) {
4760         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__opt);
4761         if (value) { values[3] = value; kw_args--; }
4762       }
4763     }
4764     if (unlikely(kw_args > 0)) {
4765       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;}
4766     }
4767     __pyx_v_self = values[0];
4768     __pyx_v_line = values[1];
4769     __pyx_v_error = values[2];
4770     __pyx_v_opt = values[3];
4771   } else {
4772     __pyx_v_opt = ((PyObject *)Py_None);
4773     switch (PyTuple_GET_SIZE(__pyx_args)) {
4774       case  4:
4775       __pyx_v_opt = PyTuple_GET_ITEM(__pyx_args, 3);
4776       case  3:
4777       __pyx_v_error = PyTuple_GET_ITEM(__pyx_args, 2);
4778       __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
4779       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
4780       break;
4781       default: goto __pyx_L5_argtuple_error;
4782     }
4783   }
4784   goto __pyx_L4_argument_unpacking_done;
4785   __pyx_L5_argtuple_error:;
4786   __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;}
4787   __pyx_L3_error:;
4788   __Pyx_AddTraceback("cvcf.VCF.error");
4789   __Pyx_RefNannyFinishContext();
4790   return NULL;
4791   __pyx_L4_argument_unpacking_done:;
4792   __pyx_v_errorlabel = Py_None; __Pyx_INCREF(Py_None);
4793   __pyx_v_errorstring = Py_None; __Pyx_INCREF(Py_None);
4794   __pyx_v_errwarn = Py_None; __Pyx_INCREF(Py_None);
4795
4796   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":328
4797  * 
4798  *     def error(self,line,error,opt=None):
4799  *         if error in self._ignored_errors: return             # <<<<<<<<<<<<<<
4800  *         errorlabel, errorstring = self._errors[error].split(':')
4801  *         if opt: errorstring = errorstring % opt
4802  */
4803   __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;}
4804   __Pyx_GOTREF(__pyx_t_1);
4805   __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;}
4806   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4807   if (__pyx_t_2) {
4808     __Pyx_XDECREF(__pyx_r);
4809     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4810     goto __pyx_L0;
4811     goto __pyx_L6;
4812   }
4813   __pyx_L6:;
4814
4815   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":329
4816  *     def error(self,line,error,opt=None):
4817  *         if error in self._ignored_errors: return
4818  *         errorlabel, errorstring = self._errors[error].split(':')             # <<<<<<<<<<<<<<
4819  *         if opt: errorstring = errorstring % opt
4820  *         errwarn = ["Error","Warning"][error in self._warn_errors]
4821  */
4822   __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;}
4823   __Pyx_GOTREF(__pyx_t_1);
4824   __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;}
4825   __Pyx_GOTREF(__pyx_t_3);
4826   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4827   __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;}
4828   __Pyx_GOTREF(__pyx_t_1);
4829   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4830   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4831   __Pyx_GOTREF(__pyx_t_3);
4832   __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
4833   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_3));
4834   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
4835   __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4836   __Pyx_GOTREF(__pyx_t_4);
4837   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4838   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4839   if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
4840     PyObject* tuple = __pyx_t_4;
4841     __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
4842     __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
4843     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4844     __Pyx_DECREF(__pyx_v_errorlabel);
4845     __pyx_v_errorlabel = __pyx_t_3;
4846     __pyx_t_3 = 0;
4847     __Pyx_DECREF(__pyx_v_errorstring);
4848     __pyx_v_errorstring = __pyx_t_1;
4849     __pyx_t_1 = 0;
4850   } else {
4851     __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4852     __Pyx_GOTREF(__pyx_t_5);
4853     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4854     __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4855     __Pyx_GOTREF(__pyx_t_3);
4856     __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4857     __Pyx_GOTREF(__pyx_t_1);
4858     if (__Pyx_EndUnpack(__pyx_t_5, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4859     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4860     __Pyx_DECREF(__pyx_v_errorlabel);
4861     __pyx_v_errorlabel = __pyx_t_3;
4862     __pyx_t_3 = 0;
4863     __Pyx_DECREF(__pyx_v_errorstring);
4864     __pyx_v_errorstring = __pyx_t_1;
4865     __pyx_t_1 = 0;
4866   }
4867
4868   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":330
4869  *         if error in self._ignored_errors: return
4870  *         errorlabel, errorstring = self._errors[error].split(':')
4871  *         if opt: errorstring = errorstring % opt             # <<<<<<<<<<<<<<
4872  *         errwarn = ["Error","Warning"][error in self._warn_errors]
4873  *         sys.stderr.write("Line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring))
4874  */
4875   __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;}
4876   if (__pyx_t_2) {
4877     __pyx_t_4 = PyNumber_Remainder(__pyx_v_errorstring, __pyx_v_opt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4878     __Pyx_GOTREF(__pyx_t_4);
4879     __Pyx_DECREF(__pyx_v_errorstring);
4880     __pyx_v_errorstring = __pyx_t_4;
4881     __pyx_t_4 = 0;
4882     goto __pyx_L7;
4883   }
4884   __pyx_L7:;
4885
4886   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":331
4887  *         errorlabel, errorstring = self._errors[error].split(':')
4888  *         if opt: errorstring = errorstring % opt
4889  *         errwarn = ["Error","Warning"][error in self._warn_errors]             # <<<<<<<<<<<<<<
4890  *         sys.stderr.write("Line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring))
4891  *         if error in self._warn_errors: return
4892  */
4893   __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4894   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
4895   __Pyx_INCREF(((PyObject *)__pyx_n_s__Error));
4896   PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__Error));
4897   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Error));
4898   __Pyx_INCREF(((PyObject *)__pyx_n_s__Warning));
4899   PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__Warning));
4900   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Warning));
4901   __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 = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4902   __Pyx_GOTREF(__pyx_t_1);
4903   __pyx_t_2 = ((PySequence_Contains(__pyx_t_1, __pyx_v_error))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4904   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4905   __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_t_4), __pyx_t_2, sizeof(int), __Pyx_PyBool_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4906   __Pyx_GOTREF(__pyx_t_1);
4907   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
4908   __Pyx_DECREF(__pyx_v_errwarn);
4909   __pyx_v_errwarn = __pyx_t_1;
4910   __pyx_t_1 = 0;
4911
4912   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":332
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  *         raise ValueError(errorstring)
4918  */
4919   __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4920   __Pyx_GOTREF(__pyx_t_1);
4921   __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__stderr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4922   __Pyx_GOTREF(__pyx_t_4);
4923   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4924   __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4925   __Pyx_GOTREF(__pyx_t_1);
4926   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4927   __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___lineno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4928   __Pyx_GOTREF(__pyx_t_4);
4929   __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4930   __Pyx_GOTREF(__pyx_t_3);
4931   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
4932   __Pyx_GIVEREF(__pyx_t_4);
4933   __Pyx_INCREF(__pyx_v_line);
4934   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_line);
4935   __Pyx_GIVEREF(__pyx_v_line);
4936   __Pyx_INCREF(__pyx_v_errwarn);
4937   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_errwarn);
4938   __Pyx_GIVEREF(__pyx_v_errwarn);
4939   __Pyx_INCREF(__pyx_v_errorlabel);
4940   PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_errorlabel);
4941   __Pyx_GIVEREF(__pyx_v_errorlabel);
4942   __Pyx_INCREF(__pyx_v_errorstring);
4943   PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_errorstring);
4944   __Pyx_GIVEREF(__pyx_v_errorstring);
4945   __pyx_t_4 = 0;
4946   __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4947   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
4948   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4949   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4950   __Pyx_GOTREF(__pyx_t_3);
4951   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
4952   __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
4953   __pyx_t_4 = 0;
4954   __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4955   __Pyx_GOTREF(__pyx_t_4);
4956   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4957   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4958   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4959
4960   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":333
4961  *         errwarn = ["Error","Warning"][error in self._warn_errors]
4962  *         sys.stderr.write("Line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring))
4963  *         if error in self._warn_errors: return             # <<<<<<<<<<<<<<
4964  *         raise ValueError(errorstring)
4965  * 
4966  */
4967   __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 = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4968   __Pyx_GOTREF(__pyx_t_4);
4969   __pyx_t_2 = ((PySequence_Contains(__pyx_t_4, __pyx_v_error))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4970   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4971   if (__pyx_t_2) {
4972     __Pyx_XDECREF(__pyx_r);
4973     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4974     goto __pyx_L0;
4975     goto __pyx_L8;
4976   }
4977   __pyx_L8:;
4978
4979   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":334
4980  *         sys.stderr.write("Line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring))
4981  *         if error in self._warn_errors: return
4982  *         raise ValueError(errorstring)             # <<<<<<<<<<<<<<
4983  * 
4984  *     def parse_format(self,line,format,filter=False):
4985  */
4986   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4987   __Pyx_GOTREF(__pyx_t_4);
4988   __Pyx_INCREF(__pyx_v_errorstring);
4989   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_errorstring);
4990   __Pyx_GIVEREF(__pyx_v_errorstring);
4991   __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4992   __Pyx_GOTREF(__pyx_t_3);
4993   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4994   __Pyx_Raise(__pyx_t_3, 0, 0);
4995   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4996   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4997
4998   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4999   goto __pyx_L0;
5000   __pyx_L1_error:;
5001   __Pyx_XDECREF(__pyx_t_1);
5002   __Pyx_XDECREF(__pyx_t_3);
5003   __Pyx_XDECREF(__pyx_t_4);
5004   __Pyx_XDECREF(__pyx_t_5);
5005   __Pyx_AddTraceback("cvcf.VCF.error");
5006   __pyx_r = NULL;
5007   __pyx_L0:;
5008   __Pyx_DECREF(__pyx_v_errorlabel);
5009   __Pyx_DECREF(__pyx_v_errorstring);
5010   __Pyx_DECREF(__pyx_v_errwarn);
5011   __Pyx_XGIVEREF(__pyx_r);
5012   __Pyx_RefNannyFinishContext();
5013   return __pyx_r;
5014 }
5015
5016 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":336
5017  *         raise ValueError(errorstring)
5018  * 
5019  *     def parse_format(self,line,format,filter=False):             # <<<<<<<<<<<<<<
5020  *         if self._version == 40:
5021  *             if not format.startswith('<'):
5022  */
5023
5024 static PyObject *__pyx_pf_4cvcf_3VCF_parse_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5025 static PyMethodDef __pyx_mdef_4cvcf_3VCF_parse_format = {__Pyx_NAMESTR("parse_format"), (PyCFunction)__pyx_pf_4cvcf_3VCF_parse_format, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
5026 static PyObject *__pyx_pf_4cvcf_3VCF_parse_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5027   PyObject *__pyx_v_self = 0;
5028   PyObject *__pyx_v_line = 0;
5029   PyObject *__pyx_v_format = 0;
5030   PyObject *__pyx_v_filter = 0;
5031   PyObject *__pyx_v_data;
5032   PyObject *__pyx_v_idx;
5033   PyObject *__pyx_v_elts;
5034   PyObject *__pyx_v_first;
5035   PyObject *__pyx_v_rest;
5036   PyObject *__pyx_v_n;
5037   PyObject *__pyx_v_t;
5038   PyObject *__pyx_r = NULL;
5039   PyObject *__pyx_t_1 = NULL;
5040   PyObject *__pyx_t_2 = NULL;
5041   int __pyx_t_3;
5042   PyObject *__pyx_t_4 = NULL;
5043   int __pyx_t_5;
5044   Py_ssize_t __pyx_t_6;
5045   PyObject *__pyx_t_7 = NULL;
5046   int __pyx_t_8;
5047   int __pyx_t_9;
5048   PyObject *__pyx_t_10 = NULL;
5049   int __pyx_t_11;
5050   PyObject *__pyx_t_12 = NULL;
5051   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,&__pyx_n_s__format,&__pyx_n_s__filter,0};
5052   __Pyx_RefNannySetupContext("parse_format");
5053   __pyx_self = __pyx_self;
5054   if (unlikely(__pyx_kwds)) {
5055     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
5056     PyObject* values[4] = {0,0,0,0};
5057     values[3] = __pyx_k_15;
5058     switch (PyTuple_GET_SIZE(__pyx_args)) {
5059       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5060       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5061       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5062       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5063       case  0: break;
5064       default: goto __pyx_L5_argtuple_error;
5065     }
5066     switch (PyTuple_GET_SIZE(__pyx_args)) {
5067       case  0:
5068       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
5069       if (likely(values[0])) kw_args--;
5070       else goto __pyx_L5_argtuple_error;
5071       case  1:
5072       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
5073       if (likely(values[1])) kw_args--;
5074       else {
5075         __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5076       }
5077       case  2:
5078       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
5079       if (likely(values[2])) kw_args--;
5080       else {
5081         __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5082       }
5083       case  3:
5084       if (kw_args > 0) {
5085         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
5086         if (value) { values[3] = value; kw_args--; }
5087       }
5088     }
5089     if (unlikely(kw_args > 0)) {
5090       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;}
5091     }
5092     __pyx_v_self = values[0];
5093     __pyx_v_line = values[1];
5094     __pyx_v_format = values[2];
5095     __pyx_v_filter = values[3];
5096   } else {
5097     __pyx_v_filter = __pyx_k_15;
5098     switch (PyTuple_GET_SIZE(__pyx_args)) {
5099       case  4:
5100       __pyx_v_filter = PyTuple_GET_ITEM(__pyx_args, 3);
5101       case  3:
5102       __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 2);
5103       __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
5104       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
5105       break;
5106       default: goto __pyx_L5_argtuple_error;
5107     }
5108   }
5109   goto __pyx_L4_argument_unpacking_done;
5110   __pyx_L5_argtuple_error:;
5111   __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;}
5112   __pyx_L3_error:;
5113   __Pyx_AddTraceback("cvcf.VCF.parse_format");
5114   __Pyx_RefNannyFinishContext();
5115   return NULL;
5116   __pyx_L4_argument_unpacking_done:;
5117   __Pyx_INCREF(__pyx_v_format);
5118   __pyx_v_data = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
5119   __pyx_v_idx = Py_None; __Pyx_INCREF(Py_None);
5120   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
5121   __pyx_v_first = Py_None; __Pyx_INCREF(Py_None);
5122   __pyx_v_rest = Py_None; __Pyx_INCREF(Py_None);
5123   __pyx_v_n = Py_None; __Pyx_INCREF(Py_None);
5124   __pyx_v_t = Py_None; __Pyx_INCREF(Py_None);
5125
5126   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":337
5127  * 
5128  *     def parse_format(self,line,format,filter=False):
5129  *         if self._version == 40:             # <<<<<<<<<<<<<<
5130  *             if not format.startswith('<'):
5131  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5132  */
5133   __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;}
5134   __Pyx_GOTREF(__pyx_t_1);
5135   __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;}
5136   __Pyx_GOTREF(__pyx_t_2);
5137   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5138   __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;}
5139   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5140   if (__pyx_t_3) {
5141
5142     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":338
5143  *     def parse_format(self,line,format,filter=False):
5144  *         if self._version == 40:
5145  *             if not format.startswith('<'):             # <<<<<<<<<<<<<<
5146  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5147  *                 format = "<"+format
5148  */
5149     __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;}
5150     __Pyx_GOTREF(__pyx_t_2);
5151     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5152     __Pyx_GOTREF(__pyx_t_1);
5153     __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
5154     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_16));
5155     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
5156     __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5157     __Pyx_GOTREF(__pyx_t_4);
5158     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5159     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5160     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5161     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5162     __pyx_t_5 = (!__pyx_t_3);
5163     if (__pyx_t_5) {
5164
5165       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":339
5166  *         if self._version == 40:
5167  *             if not format.startswith('<'):
5168  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)             # <<<<<<<<<<<<<<
5169  *                 format = "<"+format
5170  *             if not format.endswith('>'):
5171  */
5172       __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5173       __Pyx_GOTREF(__pyx_t_4);
5174       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5175       __Pyx_GOTREF(__pyx_t_1);
5176       __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5177       __Pyx_GOTREF(__pyx_t_2);
5178       __Pyx_INCREF(__pyx_v_line);
5179       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
5180       __Pyx_GIVEREF(__pyx_v_line);
5181       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
5182       __Pyx_GIVEREF(__pyx_t_1);
5183       __pyx_t_1 = 0;
5184       __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5185       __Pyx_GOTREF(__pyx_t_1);
5186       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5187       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5188       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5189
5190       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":340
5191  *             if not format.startswith('<'):
5192  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5193  *                 format = "<"+format             # <<<<<<<<<<<<<<
5194  *             if not format.endswith('>'):
5195  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5196  */
5197       __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_16), __pyx_v_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5198       __Pyx_GOTREF(__pyx_t_1);
5199       __Pyx_DECREF(__pyx_v_format);
5200       __pyx_v_format = __pyx_t_1;
5201       __pyx_t_1 = 0;
5202       goto __pyx_L7;
5203     }
5204     __pyx_L7:;
5205
5206     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":341
5207  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5208  *                 format = "<"+format
5209  *             if not format.endswith('>'):             # <<<<<<<<<<<<<<
5210  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5211  *                 format += ">"
5212  */
5213     __pyx_t_1 = PyObject_GetAttr(__pyx_v_format, __pyx_n_s__endswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5214     __Pyx_GOTREF(__pyx_t_1);
5215     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5216     __Pyx_GOTREF(__pyx_t_2);
5217     __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
5218     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_18));
5219     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
5220     __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5221     __Pyx_GOTREF(__pyx_t_4);
5222     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5223     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5224     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5225     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5226     __pyx_t_3 = (!__pyx_t_5);
5227     if (__pyx_t_3) {
5228
5229       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":342
5230  *                 format = "<"+format
5231  *             if not format.endswith('>'):
5232  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)             # <<<<<<<<<<<<<<
5233  *                 format += ">"
5234  *             format = format[1:-1]
5235  */
5236       __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5237       __Pyx_GOTREF(__pyx_t_4);
5238       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5239       __Pyx_GOTREF(__pyx_t_2);
5240       __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;}
5241       __Pyx_GOTREF(__pyx_t_1);
5242       __Pyx_INCREF(__pyx_v_line);
5243       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
5244       __Pyx_GIVEREF(__pyx_v_line);
5245       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
5246       __Pyx_GIVEREF(__pyx_t_2);
5247       __pyx_t_2 = 0;
5248       __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5249       __Pyx_GOTREF(__pyx_t_2);
5250       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5251       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5252       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5253
5254       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":343
5255  *             if not format.endswith('>'):
5256  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5257  *                 format += ">"             # <<<<<<<<<<<<<<
5258  *             format = format[1:-1]
5259  *         data = {'id':None,'number':None,'type':None,'descr':None}
5260  */
5261       __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_format, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5262       __Pyx_GOTREF(__pyx_t_2);
5263       __Pyx_DECREF(__pyx_v_format);
5264       __pyx_v_format = __pyx_t_2;
5265       __pyx_t_2 = 0;
5266       goto __pyx_L8;
5267     }
5268     __pyx_L8:;
5269
5270     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":344
5271  *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
5272  *                 format += ">"
5273  *             format = format[1:-1]             # <<<<<<<<<<<<<<
5274  *         data = {'id':None,'number':None,'type':None,'descr':None}
5275  *         idx = 0
5276  */
5277     __pyx_t_2 = 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;}
5278     __Pyx_GOTREF(__pyx_t_2);
5279     __Pyx_DECREF(__pyx_v_format);
5280     __pyx_v_format = __pyx_t_2;
5281     __pyx_t_2 = 0;
5282     goto __pyx_L6;
5283   }
5284   __pyx_L6:;
5285
5286   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":345
5287  *                 format += ">"
5288  *             format = format[1:-1]
5289  *         data = {'id':None,'number':None,'type':None,'descr':None}             # <<<<<<<<<<<<<<
5290  *         idx = 0
5291  *         while len(format.strip())>0:
5292  */
5293   __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;}
5294   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5295   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;}
5296   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;}
5297   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;}
5298   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;}
5299   __Pyx_DECREF(((PyObject *)__pyx_v_data));
5300   __pyx_v_data = __pyx_t_2;
5301   __pyx_t_2 = 0;
5302
5303   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":346
5304  *             format = format[1:-1]
5305  *         data = {'id':None,'number':None,'type':None,'descr':None}
5306  *         idx = 0             # <<<<<<<<<<<<<<
5307  *         while len(format.strip())>0:
5308  *             elts = format.strip().split(',')
5309  */
5310   __Pyx_INCREF(__pyx_int_0);
5311   __Pyx_DECREF(__pyx_v_idx);
5312   __pyx_v_idx = __pyx_int_0;
5313
5314   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":347
5315  *         data = {'id':None,'number':None,'type':None,'descr':None}
5316  *         idx = 0
5317  *         while len(format.strip())>0:             # <<<<<<<<<<<<<<
5318  *             elts = format.strip().split(',')
5319  *             first, rest = elts[0], ','.join(elts[1:])
5320  */
5321   while (1) {
5322     __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;}
5323     __Pyx_GOTREF(__pyx_t_2);
5324     __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;}
5325     __Pyx_GOTREF(__pyx_t_1);
5326     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5327     __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;}
5328     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5329     __pyx_t_3 = (__pyx_t_6 > 0);
5330     if (!__pyx_t_3) break;
5331
5332     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":348
5333  *         idx = 0
5334  *         while len(format.strip())>0:
5335  *             elts = format.strip().split(',')             # <<<<<<<<<<<<<<
5336  *             first, rest = elts[0], ','.join(elts[1:])
5337  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
5338  */
5339     __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;}
5340     __Pyx_GOTREF(__pyx_t_1);
5341     __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;}
5342     __Pyx_GOTREF(__pyx_t_2);
5343     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5344     __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;}
5345     __Pyx_GOTREF(__pyx_t_1);
5346     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5347     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5348     __Pyx_GOTREF(__pyx_t_2);
5349     __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
5350     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_2));
5351     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
5352     __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5353     __Pyx_GOTREF(__pyx_t_4);
5354     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5355     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5356     __Pyx_DECREF(__pyx_v_elts);
5357     __pyx_v_elts = __pyx_t_4;
5358     __pyx_t_4 = 0;
5359
5360     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":349
5361  *         while len(format.strip())>0:
5362  *             elts = format.strip().split(',')
5363  *             first, rest = elts[0], ','.join(elts[1:])             # <<<<<<<<<<<<<<
5364  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
5365  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
5366  */
5367     __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5368     __Pyx_GOTREF(__pyx_t_4);
5369     __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 = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5370     __Pyx_GOTREF(__pyx_t_2);
5371     __pyx_t_1 = PySequence_GetSlice(__pyx_v_elts, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5372     __Pyx_GOTREF(__pyx_t_1);
5373     __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;}
5374     __Pyx_GOTREF(__pyx_t_7);
5375     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
5376     __Pyx_GIVEREF(__pyx_t_1);
5377     __pyx_t_1 = 0;
5378     __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5379     __Pyx_GOTREF(__pyx_t_1);
5380     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5381     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5382     __Pyx_DECREF(__pyx_v_first);
5383     __pyx_v_first = __pyx_t_4;
5384     __pyx_t_4 = 0;
5385     __Pyx_DECREF(__pyx_v_rest);
5386     __pyx_v_rest = __pyx_t_1;
5387     __pyx_t_1 = 0;
5388
5389     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":350
5390  *             elts = format.strip().split(',')
5391  *             first, rest = elts[0], ','.join(elts[1:])
5392  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):             # <<<<<<<<<<<<<<
5393  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
5394  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5395  */
5396     __pyx_t_1 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__find); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5397     __Pyx_GOTREF(__pyx_t_1);
5398     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5399     __Pyx_GOTREF(__pyx_t_4);
5400     __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
5401     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_8));
5402     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
5403     __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5404     __Pyx_GOTREF(__pyx_t_7);
5405     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5406     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5407     __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5408     __Pyx_GOTREF(__pyx_t_4);
5409     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5410     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5411     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5412     if (!__pyx_t_3) {
5413       __pyx_t_4 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__find); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5414       __Pyx_GOTREF(__pyx_t_4);
5415       __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5416       __Pyx_GOTREF(__pyx_t_7);
5417       __Pyx_INCREF(((PyObject *)__pyx_kp_s_19));
5418       PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_19));
5419       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19));
5420       __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5421       __Pyx_GOTREF(__pyx_t_1);
5422       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5423       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5424       __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5425       __Pyx_GOTREF(__pyx_t_7);
5426       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5427       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5428       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5429       if (__pyx_t_5) {
5430         __pyx_t_7 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__find); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5431         __Pyx_GOTREF(__pyx_t_7);
5432         __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5433         __Pyx_GOTREF(__pyx_t_1);
5434         __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
5435         PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_8));
5436         __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
5437         __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5438         __Pyx_GOTREF(__pyx_t_4);
5439         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5440         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5441         __pyx_t_1 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__find); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5442         __Pyx_GOTREF(__pyx_t_1);
5443         __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5444         __Pyx_GOTREF(__pyx_t_7);
5445         __Pyx_INCREF(((PyObject *)__pyx_kp_s_19));
5446         PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_19));
5447         __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19));
5448         __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5449         __Pyx_GOTREF(__pyx_t_2);
5450         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5451         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5452         __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5453         __Pyx_GOTREF(__pyx_t_7);
5454         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5455         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5456         __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5457         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5458         __pyx_t_9 = __pyx_t_8;
5459       } else {
5460         __pyx_t_9 = __pyx_t_5;
5461       }
5462       __pyx_t_5 = __pyx_t_9;
5463     } else {
5464       __pyx_t_5 = __pyx_t_3;
5465     }
5466     if (__pyx_t_5) {
5467
5468       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":351
5469  *             first, rest = elts[0], ','.join(elts[1:])
5470  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
5471  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)             # <<<<<<<<<<<<<<
5472  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5473  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
5474  */
5475       __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5476       __Pyx_GOTREF(__pyx_t_7);
5477       __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_int_40, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5478       __Pyx_GOTREF(__pyx_t_2);
5479       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5480       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5481       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5482       if (__pyx_t_5) {
5483         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5484         __Pyx_GOTREF(__pyx_t_2);
5485         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_20); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5486         __Pyx_GOTREF(__pyx_t_7);
5487         __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5488         __Pyx_GOTREF(__pyx_t_4);
5489         __Pyx_INCREF(__pyx_v_line);
5490         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_line);
5491         __Pyx_GIVEREF(__pyx_v_line);
5492         PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
5493         __Pyx_GIVEREF(__pyx_t_7);
5494         __pyx_t_7 = 0;
5495         __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5496         __Pyx_GOTREF(__pyx_t_7);
5497         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5498         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5499         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5500         goto __pyx_L12;
5501       }
5502       __pyx_L12:;
5503
5504       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":352
5505  *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
5506  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
5507  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
5508  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
5509  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
5510  */
5511       __pyx_t_7 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_4, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5512       __Pyx_GOTREF(__pyx_t_7);
5513       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5514       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5515       if (__pyx_t_5) {
5516         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5517         __Pyx_GOTREF(__pyx_t_7);
5518         __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_21); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5519         __Pyx_GOTREF(__pyx_t_4);
5520         __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5521         __Pyx_GOTREF(__pyx_t_2);
5522         __Pyx_INCREF(__pyx_v_line);
5523         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
5524         __Pyx_GIVEREF(__pyx_v_line);
5525         PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
5526         __Pyx_GIVEREF(__pyx_t_4);
5527         __pyx_t_4 = 0;
5528         __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5529         __Pyx_GOTREF(__pyx_t_4);
5530         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5531         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5532         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5533         goto __pyx_L13;
5534       }
5535       __pyx_L13:;
5536
5537       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":353
5538  *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
5539  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5540  *                 first = ["ID=","Number=","Type=","Description="][idx] + first             # <<<<<<<<<<<<<<
5541  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
5542  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
5543  */
5544       __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5545       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
5546       __Pyx_INCREF(((PyObject *)__pyx_kp_s_22));
5547       PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_22));
5548       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_22));
5549       __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
5550       PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_kp_s_23));
5551       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
5552       __Pyx_INCREF(((PyObject *)__pyx_kp_s_24));
5553       PyList_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_kp_s_24));
5554       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_24));
5555       __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
5556       PyList_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_kp_s_25));
5557       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
5558       __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_t_4), __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5559       __Pyx_GOTREF(__pyx_t_2);
5560       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
5561       __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_v_first); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5562       __Pyx_GOTREF(__pyx_t_4);
5563       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5564       __Pyx_DECREF(__pyx_v_first);
5565       __pyx_v_first = __pyx_t_4;
5566       __pyx_t_4 = 0;
5567       goto __pyx_L11;
5568     }
5569     __pyx_L11:;
5570
5571     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":354
5572  *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5573  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
5574  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]             # <<<<<<<<<<<<<<
5575  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
5576  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
5577  */
5578     __pyx_t_4 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5579     __Pyx_GOTREF(__pyx_t_4);
5580     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5581     __Pyx_GOTREF(__pyx_t_2);
5582     __Pyx_INCREF(((PyObject *)__pyx_kp_s_22));
5583     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_22));
5584     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_22));
5585     __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5586     __Pyx_GOTREF(__pyx_t_7);
5587     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5588     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5589     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5590     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5591     if (__pyx_t_5) {
5592       __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;}
5593       __Pyx_GOTREF(__pyx_t_7);
5594       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5595       __Pyx_GOTREF(__pyx_t_2);
5596       __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
5597       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_8));
5598       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
5599       __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5600       __Pyx_GOTREF(__pyx_t_4);
5601       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5602       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5603       __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5604       __Pyx_GOTREF(__pyx_t_2);
5605       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5606       if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__id), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5607       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5608       goto __pyx_L14;
5609     }
5610
5611     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":355
5612  *                 first = ["ID=","Number=","Type=","Description="][idx] + first
5613  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
5614  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]             # <<<<<<<<<<<<<<
5615  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
5616  *             elif first.startswith('Description='):
5617  */
5618     __pyx_t_2 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5619     __Pyx_GOTREF(__pyx_t_2);
5620     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5621     __Pyx_GOTREF(__pyx_t_4);
5622     __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
5623     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_23));
5624     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
5625     __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5626     __Pyx_GOTREF(__pyx_t_7);
5627     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5628     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5629     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5630     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5631     if (__pyx_t_5) {
5632       __pyx_t_7 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5633       __Pyx_GOTREF(__pyx_t_7);
5634       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5635       __Pyx_GOTREF(__pyx_t_4);
5636       __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
5637       PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_8));
5638       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
5639       __pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5640       __Pyx_GOTREF(__pyx_t_2);
5641       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5642       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5643       __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5644       __Pyx_GOTREF(__pyx_t_4);
5645       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5646       if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5647       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5648       goto __pyx_L14;
5649     }
5650
5651     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":356
5652  *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
5653  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
5654  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]             # <<<<<<<<<<<<<<
5655  *             elif first.startswith('Description='):
5656  *                 elts = format.split('"')
5657  */
5658     __pyx_t_4 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5659     __Pyx_GOTREF(__pyx_t_4);
5660     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5661     __Pyx_GOTREF(__pyx_t_2);
5662     __Pyx_INCREF(((PyObject *)__pyx_kp_s_24));
5663     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_24));
5664     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_24));
5665     __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5666     __Pyx_GOTREF(__pyx_t_7);
5667     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5668     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5669     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5670     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5671     if (__pyx_t_5) {
5672       __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;}
5673       __Pyx_GOTREF(__pyx_t_7);
5674       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5675       __Pyx_GOTREF(__pyx_t_2);
5676       __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
5677       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_8));
5678       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
5679       __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5680       __Pyx_GOTREF(__pyx_t_4);
5681       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5682       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5683       __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5684       __Pyx_GOTREF(__pyx_t_2);
5685       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5686       if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__type), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5687       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5688       goto __pyx_L14;
5689     }
5690
5691     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":357
5692  *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
5693  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
5694  *             elif first.startswith('Description='):             # <<<<<<<<<<<<<<
5695  *                 elts = format.split('"')
5696  *                 if len(elts)<3:
5697  */
5698     __pyx_t_2 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5699     __Pyx_GOTREF(__pyx_t_2);
5700     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5701     __Pyx_GOTREF(__pyx_t_4);
5702     __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
5703     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_25));
5704     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
5705     __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5706     __Pyx_GOTREF(__pyx_t_7);
5707     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5708     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5709     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5710     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5711     if (__pyx_t_5) {
5712
5713       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":358
5714  *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
5715  *             elif first.startswith('Description='):
5716  *                 elts = format.split('"')             # <<<<<<<<<<<<<<
5717  *                 if len(elts)<3:
5718  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
5719  */
5720       __pyx_t_7 = PyObject_GetAttr(__pyx_v_format, __pyx_n_s__split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5721       __Pyx_GOTREF(__pyx_t_7);
5722       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5723       __Pyx_GOTREF(__pyx_t_4);
5724       __Pyx_INCREF(((PyObject *)__pyx_kp_s_19));
5725       PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_19));
5726       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19));
5727       __pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5728       __Pyx_GOTREF(__pyx_t_2);
5729       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5730       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5731       __Pyx_DECREF(__pyx_v_elts);
5732       __pyx_v_elts = __pyx_t_2;
5733       __pyx_t_2 = 0;
5734
5735       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":359
5736  *             elif first.startswith('Description='):
5737  *                 elts = format.split('"')
5738  *                 if len(elts)<3:             # <<<<<<<<<<<<<<
5739  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
5740  *                     elts = first.split('=') + [rest]
5741  */
5742       __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;}
5743       __pyx_t_5 = (__pyx_t_6 < 3);
5744       if (__pyx_t_5) {
5745
5746         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":360
5747  *                 elts = format.split('"')
5748  *                 if len(elts)<3:
5749  *                     self.error(line,self.FORMAT_MISSING_QUOTES)             # <<<<<<<<<<<<<<
5750  *                     elts = first.split('=') + [rest]
5751  *                 data['descr'] = elts[1]
5752  */
5753         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5754         __Pyx_GOTREF(__pyx_t_2);
5755         __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_26); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5756         __Pyx_GOTREF(__pyx_t_4);
5757         __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5758         __Pyx_GOTREF(__pyx_t_7);
5759         __Pyx_INCREF(__pyx_v_line);
5760         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_line);
5761         __Pyx_GIVEREF(__pyx_v_line);
5762         PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
5763         __Pyx_GIVEREF(__pyx_t_4);
5764         __pyx_t_4 = 0;
5765         __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5766         __Pyx_GOTREF(__pyx_t_4);
5767         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5768         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5769         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5770
5771         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":361
5772  *                 if len(elts)<3:
5773  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
5774  *                     elts = first.split('=') + [rest]             # <<<<<<<<<<<<<<
5775  *                 data['descr'] = elts[1]
5776  *                 rest = '"'.join(elts[2:])
5777  */
5778         __pyx_t_4 = PyObject_GetAttr(__pyx_v_first, __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5779         __Pyx_GOTREF(__pyx_t_4);
5780         __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5781         __Pyx_GOTREF(__pyx_t_7);
5782         __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
5783         PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_8));
5784         __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
5785         __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5786         __Pyx_GOTREF(__pyx_t_2);
5787         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5788         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5789         __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5790         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
5791         __Pyx_INCREF(__pyx_v_rest);
5792         PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_rest);
5793         __Pyx_GIVEREF(__pyx_v_rest);
5794         __pyx_t_4 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5795         __Pyx_GOTREF(__pyx_t_4);
5796         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5797         __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
5798         __Pyx_DECREF(__pyx_v_elts);
5799         __pyx_v_elts = __pyx_t_4;
5800         __pyx_t_4 = 0;
5801         goto __pyx_L15;
5802       }
5803       __pyx_L15:;
5804
5805       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":362
5806  *                     self.error(line,self.FORMAT_MISSING_QUOTES)
5807  *                     elts = first.split('=') + [rest]
5808  *                 data['descr'] = elts[1]             # <<<<<<<<<<<<<<
5809  *                 rest = '"'.join(elts[2:])
5810  *                 if rest.startswith(','): rest = rest[1:]
5811  */
5812       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5813       __Pyx_GOTREF(__pyx_t_4);
5814       if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__descr), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5815       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5816
5817       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":363
5818  *                     elts = first.split('=') + [rest]
5819  *                 data['descr'] = elts[1]
5820  *                 rest = '"'.join(elts[2:])             # <<<<<<<<<<<<<<
5821  *                 if rest.startswith(','): rest = rest[1:]
5822  *             else:
5823  */
5824       __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_19), __pyx_n_s__join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5825       __Pyx_GOTREF(__pyx_t_4);
5826       __pyx_t_7 = PySequence_GetSlice(__pyx_v_elts, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5827       __Pyx_GOTREF(__pyx_t_7);
5828       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5829       __Pyx_GOTREF(__pyx_t_2);
5830       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
5831       __Pyx_GIVEREF(__pyx_t_7);
5832       __pyx_t_7 = 0;
5833       __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5834       __Pyx_GOTREF(__pyx_t_7);
5835       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5836       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5837       __Pyx_DECREF(__pyx_v_rest);
5838       __pyx_v_rest = __pyx_t_7;
5839       __pyx_t_7 = 0;
5840
5841       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":364
5842  *                 data['descr'] = elts[1]
5843  *                 rest = '"'.join(elts[2:])
5844  *                 if rest.startswith(','): rest = rest[1:]             # <<<<<<<<<<<<<<
5845  *             else:
5846  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5847  */
5848       __pyx_t_7 = PyObject_GetAttr(__pyx_v_rest, __pyx_n_s__startswith); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5849       __Pyx_GOTREF(__pyx_t_7);
5850       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5851       __Pyx_GOTREF(__pyx_t_2);
5852       __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
5853       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_2));
5854       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
5855       __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5856       __Pyx_GOTREF(__pyx_t_4);
5857       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5858       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5859       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5860       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5861       if (__pyx_t_5) {
5862         __pyx_t_4 = PySequence_GetSlice(__pyx_v_rest, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5863         __Pyx_GOTREF(__pyx_t_4);
5864         __Pyx_DECREF(__pyx_v_rest);
5865         __pyx_v_rest = __pyx_t_4;
5866         __pyx_t_4 = 0;
5867         goto __pyx_L16;
5868       }
5869       __pyx_L16:;
5870       goto __pyx_L14;
5871     }
5872     /*else*/ {
5873
5874       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":366
5875  *                 if rest.startswith(','): rest = rest[1:]
5876  *             else:
5877  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
5878  *             format = rest
5879  *             idx += 1
5880  */
5881       __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5882       __Pyx_GOTREF(__pyx_t_4);
5883       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5884       __Pyx_GOTREF(__pyx_t_2);
5885       __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;}
5886       __Pyx_GOTREF(__pyx_t_7);
5887       __Pyx_INCREF(__pyx_v_line);
5888       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_line);
5889       __Pyx_GIVEREF(__pyx_v_line);
5890       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
5891       __Pyx_GIVEREF(__pyx_t_2);
5892       __pyx_t_2 = 0;
5893       __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5894       __Pyx_GOTREF(__pyx_t_2);
5895       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5896       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5897       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5898     }
5899     __pyx_L14:;
5900
5901     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":367
5902  *             else:
5903  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5904  *             format = rest             # <<<<<<<<<<<<<<
5905  *             idx += 1
5906  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
5907  */
5908     __Pyx_INCREF(__pyx_v_rest);
5909     __Pyx_DECREF(__pyx_v_format);
5910     __pyx_v_format = __pyx_v_rest;
5911
5912     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":368
5913  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5914  *             format = rest
5915  *             idx += 1             # <<<<<<<<<<<<<<
5916  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
5917  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5918  */
5919     __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;}
5920     __Pyx_GOTREF(__pyx_t_2);
5921     __Pyx_DECREF(__pyx_v_idx);
5922     __pyx_v_idx = __pyx_t_2;
5923     __pyx_t_2 = 0;
5924
5925     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":369
5926  *             format = rest
5927  *             idx += 1
5928  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings             # <<<<<<<<<<<<<<
5929  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5930  *         if not data['descr']:
5931  */
5932     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5933     if (__pyx_t_5) {
5934       __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;}
5935       __Pyx_GOTREF(__pyx_t_2);
5936       __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;}
5937       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5938       __pyx_t_9 = __pyx_t_3;
5939     } else {
5940       __pyx_t_9 = __pyx_t_5;
5941     }
5942     if (__pyx_t_9) {
5943       __Pyx_INCREF(__pyx_int_3);
5944       __Pyx_DECREF(__pyx_v_idx);
5945       __pyx_v_idx = __pyx_int_3;
5946       goto __pyx_L17;
5947     }
5948     __pyx_L17:;
5949   }
5950
5951   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":370
5952  *             idx += 1
5953  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
5954  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
5955  *         if not data['descr']:
5956  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5957  */
5958   __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;}
5959   __Pyx_GOTREF(__pyx_t_2);
5960   __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;}
5961   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5962   __pyx_t_5 = (!__pyx_t_9);
5963   if (__pyx_t_5) {
5964     __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;}
5965     __Pyx_GOTREF(__pyx_t_2);
5966     __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_21); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5967     __Pyx_GOTREF(__pyx_t_7);
5968     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5969     __Pyx_GOTREF(__pyx_t_4);
5970     __Pyx_INCREF(__pyx_v_line);
5971     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_line);
5972     __Pyx_GIVEREF(__pyx_v_line);
5973     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
5974     __Pyx_GIVEREF(__pyx_t_7);
5975     __pyx_t_7 = 0;
5976     __pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5977     __Pyx_GOTREF(__pyx_t_7);
5978     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5979     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5980     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5981     goto __pyx_L18;
5982   }
5983   __pyx_L18:;
5984
5985   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":371
5986  *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
5987  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5988  *         if not data['descr']:             # <<<<<<<<<<<<<<
5989  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
5990  *             data['descr'] = '<none>'
5991  */
5992   __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;}
5993   __Pyx_GOTREF(__pyx_t_7);
5994   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5995   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5996   __pyx_t_9 = (!__pyx_t_5);
5997   if (__pyx_t_9) {
5998
5999     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":372
6000  *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6001  *         if not data['descr']:
6002  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
6003  *             data['descr'] = '<none>'
6004  *         if not data['type'] and not data['number']:
6005  */
6006     __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;}
6007     __Pyx_GOTREF(__pyx_t_7);
6008     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_21); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6009     __Pyx_GOTREF(__pyx_t_4);
6010     __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;}
6011     __Pyx_GOTREF(__pyx_t_2);
6012     __Pyx_INCREF(__pyx_v_line);
6013     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
6014     __Pyx_GIVEREF(__pyx_v_line);
6015     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
6016     __Pyx_GIVEREF(__pyx_t_4);
6017     __pyx_t_4 = 0;
6018     __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6019     __Pyx_GOTREF(__pyx_t_4);
6020     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6021     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6022     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6023
6024     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":373
6025  *         if not data['descr']:
6026  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6027  *             data['descr'] = '<none>'             # <<<<<<<<<<<<<<
6028  *         if not data['type'] and not data['number']:
6029  *             # fine, ##filter format
6030  */
6031     if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__descr), ((PyObject *)__pyx_kp_s_27)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6032     goto __pyx_L19;
6033   }
6034   __pyx_L19:;
6035
6036   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":374
6037  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6038  *             data['descr'] = '<none>'
6039  *         if not data['type'] and not data['number']:             # <<<<<<<<<<<<<<
6040  *             # fine, ##filter format
6041  *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')
6042  */
6043   __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__type)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6044   __Pyx_GOTREF(__pyx_t_4);
6045   __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6046   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6047   __pyx_t_5 = (!__pyx_t_9);
6048   if (__pyx_t_5) {
6049     __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6050     __Pyx_GOTREF(__pyx_t_4);
6051     __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6052     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6053     __pyx_t_3 = (!__pyx_t_9);
6054     __pyx_t_9 = __pyx_t_3;
6055   } else {
6056     __pyx_t_9 = __pyx_t_5;
6057   }
6058   if (__pyx_t_9) {
6059
6060     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":376
6061  *         if not data['type'] and not data['number']:
6062  *             # fine, ##filter format
6063  *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')             # <<<<<<<<<<<<<<
6064  *         if not data['type'] in ["Integer","Float","Character","String","Flag"]:
6065  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6066  */
6067     __Pyx_XDECREF(__pyx_r);
6068     __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6069     __Pyx_GOTREF(__pyx_t_4);
6070     __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;}
6071     __Pyx_GOTREF(__pyx_t_2);
6072     __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;}
6073     __Pyx_GOTREF(__pyx_t_7);
6074     __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;}
6075     __Pyx_GOTREF(__pyx_t_1);
6076     __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;}
6077     __Pyx_GOTREF(__pyx_t_10);
6078     PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
6079     __Pyx_GIVEREF(__pyx_t_2);
6080     PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
6081     __Pyx_GIVEREF(__pyx_t_7);
6082     __Pyx_INCREF(__pyx_int_0);
6083     PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_0);
6084     __Pyx_GIVEREF(__pyx_int_0);
6085     __Pyx_INCREF(((PyObject *)__pyx_n_s__Flag));
6086     PyTuple_SET_ITEM(__pyx_t_10, 3, ((PyObject *)__pyx_n_s__Flag));
6087     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Flag));
6088     PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_1);
6089     __Pyx_GIVEREF(__pyx_t_1);
6090     __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
6091     PyTuple_SET_ITEM(__pyx_t_10, 5, ((PyObject *)__pyx_kp_s_6));
6092     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
6093     __pyx_t_2 = 0;
6094     __pyx_t_7 = 0;
6095     __pyx_t_1 = 0;
6096     __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6097     __Pyx_GOTREF(__pyx_t_1);
6098     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6099     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6100     __pyx_r = __pyx_t_1;
6101     __pyx_t_1 = 0;
6102     goto __pyx_L0;
6103     goto __pyx_L20;
6104   }
6105   __pyx_L20:;
6106
6107   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":377
6108  *             # fine, ##filter format
6109  *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')
6110  *         if not data['type'] in ["Integer","Float","Character","String","Flag"]:             # <<<<<<<<<<<<<<
6111  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6112  *         # I would like a missing-value field, but it isn't there
6113  */
6114   __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;}
6115   __Pyx_GOTREF(__pyx_t_1);
6116   __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;}
6117   __Pyx_GOTREF(__pyx_t_10);
6118   __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;}
6119   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6120   __pyx_t_5 = __pyx_t_9;
6121   if (!__pyx_t_5) {
6122     __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;}
6123     __Pyx_GOTREF(__pyx_t_10);
6124     __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;}
6125     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6126     __pyx_t_3 = __pyx_t_9;
6127     __pyx_t_9 = __pyx_t_3;
6128   } else {
6129     __pyx_t_9 = __pyx_t_5;
6130   }
6131   if (!__pyx_t_9) {
6132     __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;}
6133     __Pyx_GOTREF(__pyx_t_10);
6134     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6135     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6136     __pyx_t_3 = __pyx_t_5;
6137     __pyx_t_5 = __pyx_t_3;
6138   } else {
6139     __pyx_t_5 = __pyx_t_9;
6140   }
6141   if (!__pyx_t_5) {
6142     __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;}
6143     __Pyx_GOTREF(__pyx_t_10);
6144     __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;}
6145     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6146     __pyx_t_3 = __pyx_t_9;
6147     __pyx_t_9 = __pyx_t_3;
6148   } else {
6149     __pyx_t_9 = __pyx_t_5;
6150   }
6151   if (!__pyx_t_9) {
6152     __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;}
6153     __Pyx_GOTREF(__pyx_t_10);
6154     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6155     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6156     __pyx_t_3 = __pyx_t_5;
6157     __pyx_t_5 = __pyx_t_3;
6158   } else {
6159     __pyx_t_5 = __pyx_t_9;
6160   }
6161   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6162   __pyx_t_9 = (!__pyx_t_5);
6163   if (__pyx_t_9) {
6164
6165     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":378
6166  *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')
6167  *         if not data['type'] in ["Integer","Float","Character","String","Flag"]:
6168  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
6169  *         # I would like a missing-value field, but it isn't there
6170  *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value
6171  */
6172     __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;}
6173     __Pyx_GOTREF(__pyx_t_1);
6174     __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_21); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6175     __Pyx_GOTREF(__pyx_t_10);
6176     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6177     __Pyx_GOTREF(__pyx_t_4);
6178     __Pyx_INCREF(__pyx_v_line);
6179     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_line);
6180     __Pyx_GIVEREF(__pyx_v_line);
6181     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
6182     __Pyx_GIVEREF(__pyx_t_10);
6183     __pyx_t_10 = 0;
6184     __pyx_t_10 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6185     __Pyx_GOTREF(__pyx_t_10);
6186     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6187     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6188     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6189     goto __pyx_L21;
6190   }
6191   __pyx_L21:;
6192
6193   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":380
6194  *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6195  *         # I would like a missing-value field, but it isn't there
6196  *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value             # <<<<<<<<<<<<<<
6197  *         else:                                   data['missing'] = '.'
6198  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6199  */
6200   __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;}
6201   __Pyx_GOTREF(__pyx_t_10);
6202   __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_n_s__Integer), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6203   __Pyx_GOTREF(__pyx_t_4);
6204   __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6205   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6206   __pyx_t_5 = __pyx_t_9;
6207   if (!__pyx_t_5) {
6208     __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_n_s__Float), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6209     __Pyx_GOTREF(__pyx_t_4);
6210     __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6211     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6212     __pyx_t_3 = __pyx_t_9;
6213     __pyx_t_9 = __pyx_t_3;
6214   } else {
6215     __pyx_t_9 = __pyx_t_5;
6216   }
6217   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6218   __pyx_t_5 = __pyx_t_9;
6219   if (__pyx_t_5) {
6220     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;}
6221     goto __pyx_L22;
6222   }
6223   /*else*/ {
6224
6225     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":381
6226  *         # I would like a missing-value field, but it isn't there
6227  *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value
6228  *         else:                                   data['missing'] = '.'             # <<<<<<<<<<<<<<
6229  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6230  *         try:
6231  */
6232     if (PyDict_SetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__missing), ((PyObject *)__pyx_kp_s_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6233   }
6234   __pyx_L22:;
6235
6236   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":382
6237  *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value
6238  *         else:                                   data['missing'] = '.'
6239  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
6240  *         try:
6241  *             n = int(data['number'])
6242  */
6243   __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;}
6244   __Pyx_GOTREF(__pyx_t_10);
6245   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6246   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6247   __pyx_t_9 = (!__pyx_t_5);
6248   if (__pyx_t_9) {
6249     __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;}
6250     __Pyx_GOTREF(__pyx_t_10);
6251     __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_21); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6252     __Pyx_GOTREF(__pyx_t_4);
6253     __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;}
6254     __Pyx_GOTREF(__pyx_t_1);
6255     __Pyx_INCREF(__pyx_v_line);
6256     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
6257     __Pyx_GIVEREF(__pyx_v_line);
6258     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
6259     __Pyx_GIVEREF(__pyx_t_4);
6260     __pyx_t_4 = 0;
6261     __pyx_t_4 = PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6262     __Pyx_GOTREF(__pyx_t_4);
6263     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6264     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6265     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6266     goto __pyx_L23;
6267   }
6268   __pyx_L23:;
6269
6270   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":383
6271  *         else:                                   data['missing'] = '.'
6272  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6273  *         try:             # <<<<<<<<<<<<<<
6274  *             n = int(data['number'])
6275  *             t = self.NT_NUMBER
6276  */
6277   {
6278     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
6279     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
6280     __Pyx_XGOTREF(__pyx_save_exc_type);
6281     __Pyx_XGOTREF(__pyx_save_exc_value);
6282     __Pyx_XGOTREF(__pyx_save_exc_tb);
6283     /*try:*/ {
6284
6285       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":384
6286  *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6287  *         try:
6288  *             n = int(data['number'])             # <<<<<<<<<<<<<<
6289  *             t = self.NT_NUMBER
6290  *         except ValueError:
6291  */
6292       __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__number)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
6293       __Pyx_GOTREF(__pyx_t_4);
6294       __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;}
6295       __Pyx_GOTREF(__pyx_t_1);
6296       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
6297       __Pyx_GIVEREF(__pyx_t_4);
6298       __pyx_t_4 = 0;
6299       __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
6300       __Pyx_GOTREF(__pyx_t_4);
6301       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6302       __Pyx_DECREF(__pyx_v_n);
6303       __pyx_v_n = __pyx_t_4;
6304       __pyx_t_4 = 0;
6305
6306       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":385
6307  *         try:
6308  *             n = int(data['number'])
6309  *             t = self.NT_NUMBER             # <<<<<<<<<<<<<<
6310  *         except ValueError:
6311  *             n = -1
6312  */
6313       __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 = 385; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
6314       __Pyx_GOTREF(__pyx_t_4);
6315       __Pyx_DECREF(__pyx_v_t);
6316       __pyx_v_t = __pyx_t_4;
6317       __pyx_t_4 = 0;
6318     }
6319     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
6320     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
6321     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
6322     goto __pyx_L31_try_end;
6323     __pyx_L24_error:;
6324     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6325     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6326     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6327     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6328     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6329
6330     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":386
6331  *             n = int(data['number'])
6332  *             t = self.NT_NUMBER
6333  *         except ValueError:             # <<<<<<<<<<<<<<
6334  *             n = -1
6335  *             if data['number'] == '.':                   t = self.NT_UNKNOWN
6336  */
6337     __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
6338     if (__pyx_t_11) {
6339       __Pyx_AddTraceback("cvcf.VCF.parse_format");
6340       if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6341       __Pyx_GOTREF(__pyx_t_4);
6342       __Pyx_GOTREF(__pyx_t_1);
6343       __Pyx_GOTREF(__pyx_t_10);
6344
6345       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":387
6346  *             t = self.NT_NUMBER
6347  *         except ValueError:
6348  *             n = -1             # <<<<<<<<<<<<<<
6349  *             if data['number'] == '.':                   t = self.NT_UNKNOWN
6350  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
6351  */
6352       __Pyx_INCREF(__pyx_int_neg_1);
6353       __Pyx_DECREF(__pyx_v_n);
6354       __pyx_v_n = __pyx_int_neg_1;
6355
6356       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":388
6357  *         except ValueError:
6358  *             n = -1
6359  *             if data['number'] == '.':                   t = self.NT_UNKNOWN             # <<<<<<<<<<<<<<
6360  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
6361  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
6362  */
6363       __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;}
6364       __Pyx_GOTREF(__pyx_t_7);
6365       __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6366       __Pyx_GOTREF(__pyx_t_2);
6367       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6368       __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;}
6369       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6370       if (__pyx_t_9) {
6371         __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;}
6372         __Pyx_GOTREF(__pyx_t_2);
6373         __Pyx_DECREF(__pyx_v_t);
6374         __pyx_v_t = __pyx_t_2;
6375         __pyx_t_2 = 0;
6376         goto __pyx_L34;
6377       }
6378
6379       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":389
6380  *             n = -1
6381  *             if data['number'] == '.':                   t = self.NT_UNKNOWN
6382  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES             # <<<<<<<<<<<<<<
6383  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
6384  *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
6385  */
6386       __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;}
6387       __Pyx_GOTREF(__pyx_t_2);
6388       __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_s_28), Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6389       __Pyx_GOTREF(__pyx_t_7);
6390       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6391       __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;}
6392       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6393       if (__pyx_t_9) {
6394         __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;}
6395         __Pyx_GOTREF(__pyx_t_7);
6396         __Pyx_DECREF(__pyx_v_t);
6397         __pyx_v_t = __pyx_t_7;
6398         __pyx_t_7 = 0;
6399         goto __pyx_L34;
6400       }
6401
6402       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":390
6403  *             if data['number'] == '.':                   t = self.NT_UNKNOWN
6404  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
6405  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES             # <<<<<<<<<<<<<<
6406  *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
6407  *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
6408  */
6409       __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;}
6410       __Pyx_GOTREF(__pyx_t_7);
6411       __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_kp_s_29), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6412       __Pyx_GOTREF(__pyx_t_2);
6413       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6414       __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;}
6415       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6416       if (__pyx_t_9) {
6417         __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;}
6418         __Pyx_GOTREF(__pyx_t_2);
6419         __Pyx_DECREF(__pyx_v_t);
6420         __pyx_v_t = __pyx_t_2;
6421         __pyx_t_2 = 0;
6422         goto __pyx_L34;
6423       }
6424
6425       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":391
6426  *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
6427  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
6428  *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES             # <<<<<<<<<<<<<<
6429  *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
6430  *             else:
6431  */
6432       __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;}
6433       __Pyx_GOTREF(__pyx_t_2);
6434       __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_s_30), Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6435       __Pyx_GOTREF(__pyx_t_7);
6436       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6437       __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;}
6438       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6439       if (__pyx_t_9) {
6440         __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;}
6441         __Pyx_GOTREF(__pyx_t_7);
6442         __Pyx_DECREF(__pyx_v_t);
6443         __pyx_v_t = __pyx_t_7;
6444         __pyx_t_7 = 0;
6445         goto __pyx_L34;
6446       }
6447
6448       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":392
6449  *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
6450  *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
6451  *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES             # <<<<<<<<<<<<<<
6452  *             else:
6453  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6454  */
6455       __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;}
6456       __Pyx_GOTREF(__pyx_t_7);
6457       __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_kp_s_31), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6458       __Pyx_GOTREF(__pyx_t_2);
6459       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6460       __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;}
6461       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6462       if (__pyx_t_9) {
6463         __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;}
6464         __Pyx_GOTREF(__pyx_t_2);
6465         __Pyx_DECREF(__pyx_v_t);
6466         __pyx_v_t = __pyx_t_2;
6467         __pyx_t_2 = 0;
6468         goto __pyx_L34;
6469       }
6470       /*else*/ {
6471
6472         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":394
6473  *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
6474  *             else:
6475  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
6476  *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])
6477  * 
6478  */
6479         __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;}
6480         __Pyx_GOTREF(__pyx_t_2);
6481         __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_21); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
6482         __Pyx_GOTREF(__pyx_t_7);
6483         __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;}
6484         __Pyx_GOTREF(__pyx_t_12);
6485         __Pyx_INCREF(__pyx_v_line);
6486         PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
6487         __Pyx_GIVEREF(__pyx_v_line);
6488         PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7);
6489         __Pyx_GIVEREF(__pyx_t_7);
6490         __pyx_t_7 = 0;
6491         __pyx_t_7 = PyObject_Call(__pyx_t_2, __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;}
6492         __Pyx_GOTREF(__pyx_t_7);
6493         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6494         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6495         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6496       }
6497       __pyx_L34:;
6498       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6499       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6500       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6501       goto __pyx_L25_exception_handled;
6502     }
6503     __pyx_L26_except_error:;
6504     __Pyx_XGIVEREF(__pyx_save_exc_type);
6505     __Pyx_XGIVEREF(__pyx_save_exc_value);
6506     __Pyx_XGIVEREF(__pyx_save_exc_tb);
6507     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
6508     goto __pyx_L1_error;
6509     __pyx_L25_exception_handled:;
6510     __Pyx_XGIVEREF(__pyx_save_exc_type);
6511     __Pyx_XGIVEREF(__pyx_save_exc_value);
6512     __Pyx_XGIVEREF(__pyx_save_exc_tb);
6513     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
6514     __pyx_L31_try_end:;
6515   }
6516
6517   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":395
6518  *             else:
6519  *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
6520  *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])             # <<<<<<<<<<<<<<
6521  * 
6522  * 
6523  */
6524   __Pyx_XDECREF(__pyx_r);
6525   __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;}
6526   __Pyx_GOTREF(__pyx_t_10);
6527   __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;}
6528   __Pyx_GOTREF(__pyx_t_1);
6529   __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_data), ((PyObject *)__pyx_n_s__type)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6530   __Pyx_GOTREF(__pyx_t_4);
6531   __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;}
6532   __Pyx_GOTREF(__pyx_t_7);
6533   __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;}
6534   __Pyx_GOTREF(__pyx_t_12);
6535   __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;}
6536   __Pyx_GOTREF(__pyx_t_2);
6537   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
6538   __Pyx_GIVEREF(__pyx_t_1);
6539   __Pyx_INCREF(__pyx_v_t);
6540   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_t);
6541   __Pyx_GIVEREF(__pyx_v_t);
6542   __Pyx_INCREF(__pyx_v_n);
6543   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_n);
6544   __Pyx_GIVEREF(__pyx_v_n);
6545   PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_4);
6546   __Pyx_GIVEREF(__pyx_t_4);
6547   PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
6548   __Pyx_GIVEREF(__pyx_t_7);
6549   PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_12);
6550   __Pyx_GIVEREF(__pyx_t_12);
6551   __pyx_t_1 = 0;
6552   __pyx_t_4 = 0;
6553   __pyx_t_7 = 0;
6554   __pyx_t_12 = 0;
6555   __pyx_t_12 = PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6556   __Pyx_GOTREF(__pyx_t_12);
6557   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6558   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6559   __pyx_r = __pyx_t_12;
6560   __pyx_t_12 = 0;
6561   goto __pyx_L0;
6562
6563   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6564   goto __pyx_L0;
6565   __pyx_L1_error:;
6566   __Pyx_XDECREF(__pyx_t_1);
6567   __Pyx_XDECREF(__pyx_t_2);
6568   __Pyx_XDECREF(__pyx_t_4);
6569   __Pyx_XDECREF(__pyx_t_7);
6570   __Pyx_XDECREF(__pyx_t_10);
6571   __Pyx_XDECREF(__pyx_t_12);
6572   __Pyx_AddTraceback("cvcf.VCF.parse_format");
6573   __pyx_r = NULL;
6574   __pyx_L0:;
6575   __Pyx_DECREF(__pyx_v_data);
6576   __Pyx_DECREF(__pyx_v_idx);
6577   __Pyx_DECREF(__pyx_v_elts);
6578   __Pyx_DECREF(__pyx_v_first);
6579   __Pyx_DECREF(__pyx_v_rest);
6580   __Pyx_DECREF(__pyx_v_n);
6581   __Pyx_DECREF(__pyx_v_t);
6582   __Pyx_DECREF(__pyx_v_format);
6583   __Pyx_XGIVEREF(__pyx_r);
6584   __Pyx_RefNannyFinishContext();
6585   return __pyx_r;
6586 }
6587
6588 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":398
6589  * 
6590  * 
6591  *     def format_format( self, fmt, filter=False ):             # <<<<<<<<<<<<<<
6592  *         values = [('ID',fmt.id)]
6593  *         if fmt.number != None and not filter:
6594  */
6595
6596 static PyObject *__pyx_pf_4cvcf_3VCF_format_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6597 static PyMethodDef __pyx_mdef_4cvcf_3VCF_format_format = {__Pyx_NAMESTR("format_format"), (PyCFunction)__pyx_pf_4cvcf_3VCF_format_format, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
6598 static PyObject *__pyx_pf_4cvcf_3VCF_format_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6599   PyObject *__pyx_v_self = 0;
6600   PyObject *__pyx_v_fmt = 0;
6601   PyObject *__pyx_v_filter = 0;
6602   PyObject *__pyx_v_values;
6603   PyObject *__pyx_v_nmb;
6604   PyObject *__pyx_v_format;
6605   PyObject *__pyx_v_k;
6606   PyObject *__pyx_v_v;
6607   PyObject *__pyx_r = NULL;
6608   PyObject *__pyx_t_1 = NULL;
6609   PyObject *__pyx_t_2 = NULL;
6610   int __pyx_t_3;
6611   int __pyx_t_4;
6612   int __pyx_t_5;
6613   PyObject *__pyx_t_6 = NULL;
6614   int __pyx_t_7;
6615   Py_ssize_t __pyx_t_8;
6616   PyObject *__pyx_t_9 = NULL;
6617   PyObject *__pyx_t_10 = NULL;
6618   PyObject *__pyx_t_11 = NULL;
6619   PyObject *__pyx_t_12 = NULL;
6620   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__fmt,&__pyx_n_s__filter,0};
6621   __Pyx_RefNannySetupContext("format_format");
6622   __pyx_self = __pyx_self;
6623   if (unlikely(__pyx_kwds)) {
6624     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
6625     PyObject* values[3] = {0,0,0};
6626     values[2] = __pyx_k_32;
6627     switch (PyTuple_GET_SIZE(__pyx_args)) {
6628       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6629       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6630       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6631       case  0: break;
6632       default: goto __pyx_L5_argtuple_error;
6633     }
6634     switch (PyTuple_GET_SIZE(__pyx_args)) {
6635       case  0:
6636       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
6637       if (likely(values[0])) kw_args--;
6638       else goto __pyx_L5_argtuple_error;
6639       case  1:
6640       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmt);
6641       if (likely(values[1])) kw_args--;
6642       else {
6643         __Pyx_RaiseArgtupleInvalid("format_format", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6644       }
6645       case  2:
6646       if (kw_args > 0) {
6647         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
6648         if (value) { values[2] = value; kw_args--; }
6649       }
6650     }
6651     if (unlikely(kw_args > 0)) {
6652       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;}
6653     }
6654     __pyx_v_self = values[0];
6655     __pyx_v_fmt = values[1];
6656     __pyx_v_filter = values[2];
6657   } else {
6658     __pyx_v_filter = __pyx_k_32;
6659     switch (PyTuple_GET_SIZE(__pyx_args)) {
6660       case  3:
6661       __pyx_v_filter = PyTuple_GET_ITEM(__pyx_args, 2);
6662       case  2:
6663       __pyx_v_fmt = PyTuple_GET_ITEM(__pyx_args, 1);
6664       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
6665       break;
6666       default: goto __pyx_L5_argtuple_error;
6667     }
6668   }
6669   goto __pyx_L4_argument_unpacking_done;
6670   __pyx_L5_argtuple_error:;
6671   __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;}
6672   __pyx_L3_error:;
6673   __Pyx_AddTraceback("cvcf.VCF.format_format");
6674   __Pyx_RefNannyFinishContext();
6675   return NULL;
6676   __pyx_L4_argument_unpacking_done:;
6677   __pyx_v_values = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
6678   __pyx_v_nmb = Py_None; __Pyx_INCREF(Py_None);
6679   __pyx_v_format = Py_None; __Pyx_INCREF(Py_None);
6680   __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
6681   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
6682
6683   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":399
6684  * 
6685  *     def format_format( self, fmt, filter=False ):
6686  *         values = [('ID',fmt.id)]             # <<<<<<<<<<<<<<
6687  *         if fmt.number != None and not filter:
6688  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
6689  */
6690   __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;}
6691   __Pyx_GOTREF(__pyx_t_1);
6692   __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;}
6693   __Pyx_GOTREF(__pyx_t_2);
6694   __Pyx_INCREF(((PyObject *)__pyx_n_s__ID));
6695   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__ID));
6696   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ID));
6697   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
6698   __Pyx_GIVEREF(__pyx_t_1);
6699   __pyx_t_1 = 0;
6700   __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;}
6701   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6702   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
6703   __Pyx_GIVEREF(__pyx_t_2);
6704   __pyx_t_2 = 0;
6705   __Pyx_DECREF(((PyObject *)__pyx_v_values));
6706   __pyx_v_values = __pyx_t_1;
6707   __pyx_t_1 = 0;
6708
6709   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":400
6710  *     def format_format( self, fmt, filter=False ):
6711  *         values = [('ID',fmt.id)]
6712  *         if fmt.number != None and not filter:             # <<<<<<<<<<<<<<
6713  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
6714  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
6715  */
6716   __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;}
6717   __Pyx_GOTREF(__pyx_t_1);
6718   __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;}
6719   __Pyx_GOTREF(__pyx_t_2);
6720   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6721   __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;}
6722   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6723   if (__pyx_t_3) {
6724     __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;}
6725     __pyx_t_5 = (!__pyx_t_4);
6726     __pyx_t_4 = __pyx_t_5;
6727   } else {
6728     __pyx_t_4 = __pyx_t_3;
6729   }
6730   if (__pyx_t_4) {
6731
6732     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":401
6733  *         values = [('ID',fmt.id)]
6734  *         if fmt.number != None and not filter:
6735  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."             # <<<<<<<<<<<<<<
6736  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
6737  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
6738  */
6739     __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;}
6740     __Pyx_GOTREF(__pyx_t_2);
6741     __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;}
6742     __Pyx_GOTREF(__pyx_t_1);
6743     __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;}
6744     __Pyx_GOTREF(__pyx_t_6);
6745     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6746     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6747     __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;}
6748     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6749     if (__pyx_t_4) {
6750       __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
6751       __Pyx_DECREF(__pyx_v_nmb);
6752       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_6);
6753       goto __pyx_L7;
6754     }
6755
6756     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":402
6757  *         if fmt.number != None and not filter:
6758  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
6759  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)             # <<<<<<<<<<<<<<
6760  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
6761  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
6762  */
6763     __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;}
6764     __Pyx_GOTREF(__pyx_t_6);
6765     __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;}
6766     __Pyx_GOTREF(__pyx_t_1);
6767     __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;}
6768     __Pyx_GOTREF(__pyx_t_2);
6769     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6770     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6771     __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;}
6772     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6773     if (__pyx_t_4) {
6774       __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;}
6775       __Pyx_GOTREF(__pyx_t_2);
6776       __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;}
6777       __Pyx_GOTREF(__pyx_t_1);
6778       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
6779       __Pyx_GIVEREF(__pyx_t_2);
6780       __pyx_t_2 = 0;
6781       __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6782       __Pyx_GOTREF(__pyx_t_2);
6783       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6784       __Pyx_DECREF(__pyx_v_nmb);
6785       __pyx_v_nmb = __pyx_t_2;
6786       __pyx_t_2 = 0;
6787       goto __pyx_L7;
6788     }
6789
6790     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":403
6791  *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
6792  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
6793  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"             # <<<<<<<<<<<<<<
6794  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
6795  *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"
6796  */
6797     __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;}
6798     __Pyx_GOTREF(__pyx_t_2);
6799     __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;}
6800     __Pyx_GOTREF(__pyx_t_1);
6801     __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;}
6802     __Pyx_GOTREF(__pyx_t_6);
6803     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6804     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6805     __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;}
6806     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6807     if (__pyx_t_4) {
6808       __Pyx_INCREF(((PyObject *)__pyx_kp_s_28));
6809       __Pyx_DECREF(__pyx_v_nmb);
6810       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_28);
6811       goto __pyx_L7;
6812     }
6813
6814     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":404
6815  *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
6816  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
6817  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"             # <<<<<<<<<<<<<<
6818  *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"
6819  *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"
6820  */
6821     __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;}
6822     __Pyx_GOTREF(__pyx_t_6);
6823     __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;}
6824     __Pyx_GOTREF(__pyx_t_1);
6825     __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;}
6826     __Pyx_GOTREF(__pyx_t_2);
6827     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6828     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6829     __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;}
6830     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6831     if (__pyx_t_4) {
6832       __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
6833       __Pyx_DECREF(__pyx_v_nmb);
6834       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_29);
6835       goto __pyx_L7;
6836     }
6837
6838     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":405
6839  *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
6840  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
6841  *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"             # <<<<<<<<<<<<<<
6842  *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"
6843  *             else:
6844  */
6845     __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;}
6846     __Pyx_GOTREF(__pyx_t_2);
6847     __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;}
6848     __Pyx_GOTREF(__pyx_t_1);
6849     __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;}
6850     __Pyx_GOTREF(__pyx_t_6);
6851     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6852     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6853     __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;}
6854     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6855     if (__pyx_t_4) {
6856       __Pyx_INCREF(((PyObject *)__pyx_kp_s_30));
6857       __Pyx_DECREF(__pyx_v_nmb);
6858       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_30);
6859       goto __pyx_L7;
6860     }
6861
6862     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":406
6863  *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
6864  *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"
6865  *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"             # <<<<<<<<<<<<<<
6866  *             else:
6867  *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)
6868  */
6869     __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;}
6870     __Pyx_GOTREF(__pyx_t_6);
6871     __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;}
6872     __Pyx_GOTREF(__pyx_t_1);
6873     __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;}
6874     __Pyx_GOTREF(__pyx_t_2);
6875     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6876     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6877     __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;}
6878     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6879     if (__pyx_t_4) {
6880       __Pyx_INCREF(((PyObject *)__pyx_kp_s_31));
6881       __Pyx_DECREF(__pyx_v_nmb);
6882       __pyx_v_nmb = ((PyObject *)__pyx_kp_s_31);
6883       goto __pyx_L7;
6884     }
6885     /*else*/ {
6886
6887       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":408
6888  *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"
6889  *             else:
6890  *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)             # <<<<<<<<<<<<<<
6891  *             values.append( ('Number',nmb) )
6892  *             values.append( ('Type', fmt.type) )
6893  */
6894       __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;}
6895       __Pyx_GOTREF(__pyx_t_2);
6896       __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_33), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6897       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6898       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6899       __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;}
6900       __Pyx_GOTREF(__pyx_t_2);
6901       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
6902       __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
6903       __pyx_t_1 = 0;
6904       __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6905       __Pyx_GOTREF(__pyx_t_1);
6906       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6907       __Pyx_Raise(__pyx_t_1, 0, 0);
6908       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6909       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6910     }
6911     __pyx_L7:;
6912
6913     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":409
6914  *             else:
6915  *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)
6916  *             values.append( ('Number',nmb) )             # <<<<<<<<<<<<<<
6917  *             values.append( ('Type', fmt.type) )
6918  *         values.append( ('Description', '"' + fmt.description + '"') )
6919  */
6920     if (unlikely(__pyx_v_values == Py_None)) {
6921       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;} 
6922     }
6923     __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;}
6924     __Pyx_GOTREF(__pyx_t_1);
6925     __Pyx_INCREF(((PyObject *)__pyx_n_s__Number));
6926     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Number));
6927     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Number));
6928     __Pyx_INCREF(__pyx_v_nmb);
6929     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nmb);
6930     __Pyx_GIVEREF(__pyx_v_nmb);
6931     __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_values), __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6932     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6933
6934     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":410
6935  *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)
6936  *             values.append( ('Number',nmb) )
6937  *             values.append( ('Type', fmt.type) )             # <<<<<<<<<<<<<<
6938  *         values.append( ('Description', '"' + fmt.description + '"') )
6939  *         if self._version == 33:
6940  */
6941     if (unlikely(__pyx_v_values == Py_None)) {
6942       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;} 
6943     }
6944     __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;}
6945     __Pyx_GOTREF(__pyx_t_1);
6946     __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;}
6947     __Pyx_GOTREF(__pyx_t_2);
6948     __Pyx_INCREF(((PyObject *)__pyx_n_s__Type));
6949     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__Type));
6950     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Type));
6951     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
6952     __Pyx_GIVEREF(__pyx_t_1);
6953     __pyx_t_1 = 0;
6954     __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_values), __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6955     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6956     goto __pyx_L6;
6957   }
6958   __pyx_L6:;
6959
6960   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":411
6961  *             values.append( ('Number',nmb) )
6962  *             values.append( ('Type', fmt.type) )
6963  *         values.append( ('Description', '"' + fmt.description + '"') )             # <<<<<<<<<<<<<<
6964  *         if self._version == 33:
6965  *             format = ",".join([v for k,v in values])
6966  */
6967   if (unlikely(__pyx_v_values == Py_None)) {
6968     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;} 
6969   }
6970   __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;}
6971   __Pyx_GOTREF(__pyx_t_2);
6972   __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_19), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6973   __Pyx_GOTREF(__pyx_t_1);
6974   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6975   __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_19)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6976   __Pyx_GOTREF(__pyx_t_2);
6977   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6978   __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;}
6979   __Pyx_GOTREF(__pyx_t_1);
6980   __Pyx_INCREF(((PyObject *)__pyx_n_s__Description));
6981   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Description));
6982   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Description));
6983   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
6984   __Pyx_GIVEREF(__pyx_t_2);
6985   __pyx_t_2 = 0;
6986   __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_values), __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6987   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6988
6989   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":412
6990  *             values.append( ('Type', fmt.type) )
6991  *         values.append( ('Description', '"' + fmt.description + '"') )
6992  *         if self._version == 33:             # <<<<<<<<<<<<<<
6993  *             format = ",".join([v for k,v in values])
6994  *         else:
6995  */
6996   __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;}
6997   __Pyx_GOTREF(__pyx_t_1);
6998   __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;}
6999   __Pyx_GOTREF(__pyx_t_2);
7000   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7001   __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;}
7002   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7003   if (__pyx_t_4) {
7004
7005     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":413
7006  *         values.append( ('Description', '"' + fmt.description + '"') )
7007  *         if self._version == 33:
7008  *             format = ",".join([v for k,v in values])             # <<<<<<<<<<<<<<
7009  *         else:
7010  *             format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">"
7011  */
7012     __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;}
7013     __Pyx_GOTREF(__pyx_t_2);
7014     __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;}
7015     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
7016     if (likely(((PyObject *)__pyx_v_values) != Py_None)) {
7017       __pyx_t_8 = 0; __pyx_t_6 = ((PyObject *)__pyx_v_values); __Pyx_INCREF(__pyx_t_6);
7018     } else {
7019       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7020     }
7021     for (;;) {
7022       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
7023       __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++;
7024       if (PyTuple_CheckExact(__pyx_t_9) && likely(PyTuple_GET_SIZE(__pyx_t_9) == 2)) {
7025         PyObject* tuple = __pyx_t_9;
7026         __pyx_t_10 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_10);
7027         __pyx_t_11 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_11);
7028         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7029         __Pyx_DECREF(__pyx_v_k);
7030         __pyx_v_k = __pyx_t_10;
7031         __pyx_t_10 = 0;
7032         __Pyx_DECREF(__pyx_v_v);
7033         __pyx_v_v = __pyx_t_11;
7034         __pyx_t_11 = 0;
7035       } else {
7036         __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;}
7037         __Pyx_GOTREF(__pyx_t_12);
7038         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7039         __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;}
7040         __Pyx_GOTREF(__pyx_t_10);
7041         __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;}
7042         __Pyx_GOTREF(__pyx_t_11);
7043         if (__Pyx_EndUnpack(__pyx_t_12, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7044         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7045         __Pyx_DECREF(__pyx_v_k);
7046         __pyx_v_k = __pyx_t_10;
7047         __pyx_t_10 = 0;
7048         __Pyx_DECREF(__pyx_v_v);
7049         __pyx_v_v = __pyx_t_11;
7050         __pyx_t_11 = 0;
7051       }
7052       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;}
7053     }
7054     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7055     __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;}
7056     __Pyx_GOTREF(__pyx_t_6);
7057     __Pyx_INCREF(((PyObject *)__pyx_t_1));
7058     PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
7059     __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
7060     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
7061     __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7062     __Pyx_GOTREF(__pyx_t_1);
7063     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7064     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7065     __Pyx_DECREF(__pyx_v_format);
7066     __pyx_v_format = __pyx_t_1;
7067     __pyx_t_1 = 0;
7068     goto __pyx_L8;
7069   }
7070   /*else*/ {
7071
7072     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":415
7073  *             format = ",".join([v for k,v in values])
7074  *         else:
7075  *             format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">"             # <<<<<<<<<<<<<<
7076  *         return format
7077  * 
7078  */
7079     __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;}
7080     __Pyx_GOTREF(__pyx_t_1);
7081     __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;}
7082     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
7083     if (likely(((PyObject *)__pyx_v_values) != Py_None)) {
7084       __pyx_t_8 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_values); __Pyx_INCREF(__pyx_t_2);
7085     } else {
7086       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7087     }
7088     for (;;) {
7089       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
7090       __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++;
7091       if (PyTuple_CheckExact(__pyx_t_9) && likely(PyTuple_GET_SIZE(__pyx_t_9) == 2)) {
7092         PyObject* tuple = __pyx_t_9;
7093         __pyx_t_11 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_11);
7094         __pyx_t_10 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_10);
7095         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7096         __Pyx_DECREF(__pyx_v_k);
7097         __pyx_v_k = __pyx_t_11;
7098         __pyx_t_11 = 0;
7099         __Pyx_DECREF(__pyx_v_v);
7100         __pyx_v_v = __pyx_t_10;
7101         __pyx_t_10 = 0;
7102       } else {
7103         __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;}
7104         __Pyx_GOTREF(__pyx_t_12);
7105         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7106         __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;}
7107         __Pyx_GOTREF(__pyx_t_11);
7108         __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;}
7109         __Pyx_GOTREF(__pyx_t_10);
7110         if (__Pyx_EndUnpack(__pyx_t_12, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7111         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7112         __Pyx_DECREF(__pyx_v_k);
7113         __pyx_v_k = __pyx_t_11;
7114         __pyx_t_11 = 0;
7115         __Pyx_DECREF(__pyx_v_v);
7116         __pyx_v_v = __pyx_t_10;
7117         __pyx_t_10 = 0;
7118       }
7119       __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;}
7120       __Pyx_GOTREF(__pyx_t_9);
7121       __Pyx_INCREF(__pyx_v_k);
7122       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_k);
7123       __Pyx_GIVEREF(__pyx_v_k);
7124       __Pyx_INCREF(__pyx_v_v);
7125       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_v);
7126       __Pyx_GIVEREF(__pyx_v_v);
7127       __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_34), __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7128       __Pyx_GOTREF(((PyObject *)__pyx_t_10));
7129       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7130       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;}
7131       __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
7132     }
7133     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7134     __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;}
7135     __Pyx_GOTREF(__pyx_t_2);
7136     __Pyx_INCREF(((PyObject *)__pyx_t_6));
7137     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
7138     __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
7139     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
7140     __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7141     __Pyx_GOTREF(__pyx_t_6);
7142     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7143     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7144     __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_16), __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7145     __Pyx_GOTREF(__pyx_t_2);
7146     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7147     __pyx_t_6 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7148     __Pyx_GOTREF(__pyx_t_6);
7149     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7150     __Pyx_DECREF(__pyx_v_format);
7151     __pyx_v_format = __pyx_t_6;
7152     __pyx_t_6 = 0;
7153   }
7154   __pyx_L8:;
7155
7156   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":416
7157  *         else:
7158  *             format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">"
7159  *         return format             # <<<<<<<<<<<<<<
7160  * 
7161  *     def get_expected(self, format, formatdict, alt):
7162  */
7163   __Pyx_XDECREF(__pyx_r);
7164   __Pyx_INCREF(__pyx_v_format);
7165   __pyx_r = __pyx_v_format;
7166   goto __pyx_L0;
7167
7168   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7169   goto __pyx_L0;
7170   __pyx_L1_error:;
7171   __Pyx_XDECREF(__pyx_t_1);
7172   __Pyx_XDECREF(__pyx_t_2);
7173   __Pyx_XDECREF(__pyx_t_6);
7174   __Pyx_XDECREF(__pyx_t_9);
7175   __Pyx_XDECREF(__pyx_t_10);
7176   __Pyx_XDECREF(__pyx_t_11);
7177   __Pyx_XDECREF(__pyx_t_12);
7178   __Pyx_AddTraceback("cvcf.VCF.format_format");
7179   __pyx_r = NULL;
7180   __pyx_L0:;
7181   __Pyx_DECREF(__pyx_v_values);
7182   __Pyx_DECREF(__pyx_v_nmb);
7183   __Pyx_DECREF(__pyx_v_format);
7184   __Pyx_DECREF(__pyx_v_k);
7185   __Pyx_DECREF(__pyx_v_v);
7186   __Pyx_XGIVEREF(__pyx_r);
7187   __Pyx_RefNannyFinishContext();
7188   return __pyx_r;
7189 }
7190
7191 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":418
7192  *         return format
7193  * 
7194  *     def get_expected(self, format, formatdict, alt):             # <<<<<<<<<<<<<<
7195  *         fmt = formatdict[format]
7196  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
7197  */
7198
7199 static PyObject *__pyx_pf_4cvcf_3VCF_get_expected(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7200 static PyMethodDef __pyx_mdef_4cvcf_3VCF_get_expected = {__Pyx_NAMESTR("get_expected"), (PyCFunction)__pyx_pf_4cvcf_3VCF_get_expected, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
7201 static PyObject *__pyx_pf_4cvcf_3VCF_get_expected(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7202   PyObject *__pyx_v_self = 0;
7203   PyObject *__pyx_v_format = 0;
7204   PyObject *__pyx_v_formatdict = 0;
7205   PyObject *__pyx_v_alt = 0;
7206   PyObject *__pyx_v_fmt;
7207   PyObject *__pyx_r = NULL;
7208   PyObject *__pyx_t_1 = NULL;
7209   PyObject *__pyx_t_2 = NULL;
7210   PyObject *__pyx_t_3 = NULL;
7211   int __pyx_t_4;
7212   Py_ssize_t __pyx_t_5;
7213   Py_ssize_t __pyx_t_6;
7214   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__format,&__pyx_n_s__formatdict,&__pyx_n_s__alt,0};
7215   __Pyx_RefNannySetupContext("get_expected");
7216   __pyx_self = __pyx_self;
7217   if (unlikely(__pyx_kwds)) {
7218     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7219     PyObject* values[4] = {0,0,0,0};
7220     switch (PyTuple_GET_SIZE(__pyx_args)) {
7221       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7222       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7223       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7224       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7225       case  0: break;
7226       default: goto __pyx_L5_argtuple_error;
7227     }
7228     switch (PyTuple_GET_SIZE(__pyx_args)) {
7229       case  0:
7230       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7231       if (likely(values[0])) kw_args--;
7232       else goto __pyx_L5_argtuple_error;
7233       case  1:
7234       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
7235       if (likely(values[1])) kw_args--;
7236       else {
7237         __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7238       }
7239       case  2:
7240       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__formatdict);
7241       if (likely(values[2])) kw_args--;
7242       else {
7243         __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7244       }
7245       case  3:
7246       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alt);
7247       if (likely(values[3])) kw_args--;
7248       else {
7249         __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7250       }
7251     }
7252     if (unlikely(kw_args > 0)) {
7253       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;}
7254     }
7255     __pyx_v_self = values[0];
7256     __pyx_v_format = values[1];
7257     __pyx_v_formatdict = values[2];
7258     __pyx_v_alt = values[3];
7259   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
7260     goto __pyx_L5_argtuple_error;
7261   } else {
7262     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
7263     __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 1);
7264     __pyx_v_formatdict = PyTuple_GET_ITEM(__pyx_args, 2);
7265     __pyx_v_alt = PyTuple_GET_ITEM(__pyx_args, 3);
7266   }
7267   goto __pyx_L4_argument_unpacking_done;
7268   __pyx_L5_argtuple_error:;
7269   __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;}
7270   __pyx_L3_error:;
7271   __Pyx_AddTraceback("cvcf.VCF.get_expected");
7272   __Pyx_RefNannyFinishContext();
7273   return NULL;
7274   __pyx_L4_argument_unpacking_done:;
7275   __pyx_v_fmt = Py_None; __Pyx_INCREF(Py_None);
7276
7277   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":419
7278  * 
7279  *     def get_expected(self, format, formatdict, alt):
7280  *         fmt = formatdict[format]             # <<<<<<<<<<<<<<
7281  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
7282  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
7283  */
7284   __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;}
7285   __Pyx_GOTREF(__pyx_t_1);
7286   __Pyx_DECREF(__pyx_v_fmt);
7287   __pyx_v_fmt = __pyx_t_1;
7288   __pyx_t_1 = 0;
7289
7290   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":420
7291  *     def get_expected(self, format, formatdict, alt):
7292  *         fmt = formatdict[format]
7293  *         if fmt.numbertype == self.NT_UNKNOWN: return -1             # <<<<<<<<<<<<<<
7294  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
7295  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
7296  */
7297   __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;}
7298   __Pyx_GOTREF(__pyx_t_1);
7299   __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;}
7300   __Pyx_GOTREF(__pyx_t_2);
7301   __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;}
7302   __Pyx_GOTREF(__pyx_t_3);
7303   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7304   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7305   __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;}
7306   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7307   if (__pyx_t_4) {
7308     __Pyx_XDECREF(__pyx_r);
7309     __Pyx_INCREF(__pyx_int_neg_1);
7310     __pyx_r = __pyx_int_neg_1;
7311     goto __pyx_L0;
7312     goto __pyx_L6;
7313   }
7314   __pyx_L6:;
7315
7316   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":421
7317  *         fmt = formatdict[format]
7318  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
7319  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number             # <<<<<<<<<<<<<<
7320  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
7321  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
7322  */
7323   __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;}
7324   __Pyx_GOTREF(__pyx_t_3);
7325   __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;}
7326   __Pyx_GOTREF(__pyx_t_2);
7327   __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;}
7328   __Pyx_GOTREF(__pyx_t_1);
7329   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7330   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7331   __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;}
7332   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7333   if (__pyx_t_4) {
7334     __Pyx_XDECREF(__pyx_r);
7335     __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;}
7336     __Pyx_GOTREF(__pyx_t_1);
7337     __pyx_r = __pyx_t_1;
7338     __pyx_t_1 = 0;
7339     goto __pyx_L0;
7340     goto __pyx_L7;
7341   }
7342   __pyx_L7:;
7343
7344   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":422
7345  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
7346  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
7347  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1             # <<<<<<<<<<<<<<
7348  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
7349  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
7350  */
7351   __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;}
7352   __Pyx_GOTREF(__pyx_t_1);
7353   __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;}
7354   __Pyx_GOTREF(__pyx_t_2);
7355   __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;}
7356   __Pyx_GOTREF(__pyx_t_3);
7357   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7358   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7359   __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;}
7360   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7361   if (__pyx_t_4) {
7362     __Pyx_XDECREF(__pyx_r);
7363     __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;}
7364     __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;}
7365     __Pyx_GOTREF(__pyx_t_3);
7366     __pyx_r = __pyx_t_3;
7367     __pyx_t_3 = 0;
7368     goto __pyx_L0;
7369     goto __pyx_L8;
7370   }
7371   __pyx_L8:;
7372
7373   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":423
7374  *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
7375  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
7376  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)             # <<<<<<<<<<<<<<
7377  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
7378  *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)
7379  */
7380   __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;}
7381   __Pyx_GOTREF(__pyx_t_3);
7382   __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;}
7383   __Pyx_GOTREF(__pyx_t_2);
7384   __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;}
7385   __Pyx_GOTREF(__pyx_t_1);
7386   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7387   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7388   __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;}
7389   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7390   if (__pyx_t_4) {
7391     __Pyx_XDECREF(__pyx_r);
7392     __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;}
7393     __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;}
7394     __Pyx_GOTREF(__pyx_t_1);
7395     __pyx_r = __pyx_t_1;
7396     __pyx_t_1 = 0;
7397     goto __pyx_L0;
7398     goto __pyx_L9;
7399   }
7400   __pyx_L9:;
7401
7402   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":424
7403  *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
7404  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
7405  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2             # <<<<<<<<<<<<<<
7406  *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)
7407  *         return 0
7408  */
7409   __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;}
7410   __Pyx_GOTREF(__pyx_t_1);
7411   __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;}
7412   __Pyx_GOTREF(__pyx_t_2);
7413   __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;}
7414   __Pyx_GOTREF(__pyx_t_3);
7415   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7416   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7417   __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;}
7418   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7419   if (__pyx_t_4) {
7420     __Pyx_XDECREF(__pyx_r);
7421     __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;}
7422     __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;}
7423     __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;}
7424     __Pyx_GOTREF(__pyx_t_3);
7425     __pyx_r = __pyx_t_3;
7426     __pyx_t_3 = 0;
7427     goto __pyx_L0;
7428     goto __pyx_L10;
7429   }
7430   __pyx_L10:;
7431
7432   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":425
7433  *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
7434  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
7435  *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)             # <<<<<<<<<<<<<<
7436  *         return 0
7437  * 
7438  */
7439   __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;}
7440   __Pyx_GOTREF(__pyx_t_3);
7441   __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;}
7442   __Pyx_GOTREF(__pyx_t_2);
7443   __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;}
7444   __Pyx_GOTREF(__pyx_t_1);
7445   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7446   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7447   __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;}
7448   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7449   if (__pyx_t_4) {
7450     __Pyx_XDECREF(__pyx_r);
7451     __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;}
7452     __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;}
7453     __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;}
7454     __Pyx_GOTREF(__pyx_t_1);
7455     __pyx_r = __pyx_t_1;
7456     __pyx_t_1 = 0;
7457     goto __pyx_L0;
7458     goto __pyx_L11;
7459   }
7460   __pyx_L11:;
7461
7462   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":426
7463  *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
7464  *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)
7465  *         return 0             # <<<<<<<<<<<<<<
7466  * 
7467  * 
7468  */
7469   __Pyx_XDECREF(__pyx_r);
7470   __Pyx_INCREF(__pyx_int_0);
7471   __pyx_r = __pyx_int_0;
7472   goto __pyx_L0;
7473
7474   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7475   goto __pyx_L0;
7476   __pyx_L1_error:;
7477   __Pyx_XDECREF(__pyx_t_1);
7478   __Pyx_XDECREF(__pyx_t_2);
7479   __Pyx_XDECREF(__pyx_t_3);
7480   __Pyx_AddTraceback("cvcf.VCF.get_expected");
7481   __pyx_r = NULL;
7482   __pyx_L0:;
7483   __Pyx_DECREF(__pyx_v_fmt);
7484   __Pyx_XGIVEREF(__pyx_r);
7485   __Pyx_RefNannyFinishContext();
7486   return __pyx_r;
7487 }
7488
7489 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":429
7490  * 
7491  * 
7492  *     def _add_definition(self, formatdict, key, data, line ):             # <<<<<<<<<<<<<<
7493  *         if key in formatdict: return
7494  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
7495  */
7496
7497 static PyObject *__pyx_pf_4cvcf_3VCF__add_definition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7498 static PyMethodDef __pyx_mdef_4cvcf_3VCF__add_definition = {__Pyx_NAMESTR("_add_definition"), (PyCFunction)__pyx_pf_4cvcf_3VCF__add_definition, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
7499 static PyObject *__pyx_pf_4cvcf_3VCF__add_definition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7500   PyObject *__pyx_v_self = 0;
7501   PyObject *__pyx_v_formatdict = 0;
7502   PyObject *__pyx_v_key = 0;
7503   PyObject *__pyx_v_data = 0;
7504   PyObject *__pyx_v_line = 0;
7505   PyObject *__pyx_r = NULL;
7506   int __pyx_t_1;
7507   PyObject *__pyx_t_2 = NULL;
7508   PyObject *__pyx_t_3 = NULL;
7509   PyObject *__pyx_t_4 = NULL;
7510   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};
7511   __Pyx_RefNannySetupContext("_add_definition");
7512   __pyx_self = __pyx_self;
7513   if (unlikely(__pyx_kwds)) {
7514     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7515     PyObject* values[5] = {0,0,0,0,0};
7516     switch (PyTuple_GET_SIZE(__pyx_args)) {
7517       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7518       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7519       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7520       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7521       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7522       case  0: break;
7523       default: goto __pyx_L5_argtuple_error;
7524     }
7525     switch (PyTuple_GET_SIZE(__pyx_args)) {
7526       case  0:
7527       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7528       if (likely(values[0])) kw_args--;
7529       else goto __pyx_L5_argtuple_error;
7530       case  1:
7531       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__formatdict);
7532       if (likely(values[1])) kw_args--;
7533       else {
7534         __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7535       }
7536       case  2:
7537       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
7538       if (likely(values[2])) kw_args--;
7539       else {
7540         __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7541       }
7542       case  3:
7543       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
7544       if (likely(values[3])) kw_args--;
7545       else {
7546         __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7547       }
7548       case  4:
7549       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
7550       if (likely(values[4])) kw_args--;
7551       else {
7552         __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7553       }
7554     }
7555     if (unlikely(kw_args > 0)) {
7556       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;}
7557     }
7558     __pyx_v_self = values[0];
7559     __pyx_v_formatdict = values[1];
7560     __pyx_v_key = values[2];
7561     __pyx_v_data = values[3];
7562     __pyx_v_line = values[4];
7563   } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
7564     goto __pyx_L5_argtuple_error;
7565   } else {
7566     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
7567     __pyx_v_formatdict = PyTuple_GET_ITEM(__pyx_args, 1);
7568     __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 2);
7569     __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 3);
7570     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 4);
7571   }
7572   goto __pyx_L4_argument_unpacking_done;
7573   __pyx_L5_argtuple_error:;
7574   __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;}
7575   __pyx_L3_error:;
7576   __Pyx_AddTraceback("cvcf.VCF._add_definition");
7577   __Pyx_RefNannyFinishContext();
7578   return NULL;
7579   __pyx_L4_argument_unpacking_done:;
7580   __Pyx_INCREF(__pyx_v_data);
7581
7582   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":430
7583  * 
7584  *     def _add_definition(self, formatdict, key, data, line ):
7585  *         if key in formatdict: return             # <<<<<<<<<<<<<<
7586  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
7587  *         if data == None:
7588  */
7589   __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;}
7590   if (__pyx_t_1) {
7591     __Pyx_XDECREF(__pyx_r);
7592     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7593     goto __pyx_L0;
7594     goto __pyx_L6;
7595   }
7596   __pyx_L6:;
7597
7598   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":431
7599  *     def _add_definition(self, formatdict, key, data, line ):
7600  *         if key in formatdict: return
7601  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)             # <<<<<<<<<<<<<<
7602  *         if data == None:
7603  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
7604  */
7605   __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;}
7606   __Pyx_GOTREF(__pyx_t_2);
7607   __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;}
7608   __Pyx_GOTREF(__pyx_t_3);
7609   __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;}
7610   __Pyx_GOTREF(__pyx_t_4);
7611   __Pyx_INCREF(__pyx_v_line);
7612   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_line);
7613   __Pyx_GIVEREF(__pyx_v_line);
7614   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
7615   __Pyx_GIVEREF(__pyx_t_3);
7616   __Pyx_INCREF(__pyx_v_key);
7617   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_key);
7618   __Pyx_GIVEREF(__pyx_v_key);
7619   __pyx_t_3 = 0;
7620   __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7621   __Pyx_GOTREF(__pyx_t_3);
7622   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7623   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7624   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7625
7626   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":432
7627  *         if key in formatdict: return
7628  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
7629  *         if data == None:             # <<<<<<<<<<<<<<
7630  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
7631  *             return
7632  */
7633   __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;}
7634   __Pyx_GOTREF(__pyx_t_3);
7635   __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;}
7636   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7637   if (__pyx_t_1) {
7638
7639     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":433
7640  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
7641  *         if data == None:
7642  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")             # <<<<<<<<<<<<<<
7643  *             return
7644  *         if data == []: data = [""]             # unsure what type -- say string
7645  */
7646     __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;}
7647     __Pyx_GOTREF(__pyx_t_3);
7648     __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;}
7649     __Pyx_GOTREF(__pyx_t_4);
7650     __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;}
7651     __Pyx_GOTREF(__pyx_t_2);
7652     __Pyx_INCREF(__pyx_v_key);
7653     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
7654     __Pyx_GIVEREF(__pyx_v_key);
7655     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
7656     __Pyx_GIVEREF(__pyx_t_4);
7657     __Pyx_INCREF(__pyx_int_0);
7658     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0);
7659     __Pyx_GIVEREF(__pyx_int_0);
7660     __Pyx_INCREF(((PyObject *)__pyx_n_s__Flag));
7661     PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s__Flag));
7662     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Flag));
7663     __Pyx_INCREF(((PyObject *)__pyx_kp_s_35));
7664     PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_kp_s_35));
7665     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35));
7666     __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
7667     PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_kp_s_6));
7668     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
7669     __pyx_t_4 = 0;
7670     __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7671     __Pyx_GOTREF(__pyx_t_4);
7672     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7673     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7674     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;}
7675     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7676
7677     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":434
7678  *         if data == None:
7679  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
7680  *             return             # <<<<<<<<<<<<<<
7681  *         if data == []: data = [""]             # unsure what type -- say string
7682  *         if type(data[0]) == type(0.0):
7683  */
7684     __Pyx_XDECREF(__pyx_r);
7685     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7686     goto __pyx_L0;
7687     goto __pyx_L7;
7688   }
7689   __pyx_L7:;
7690
7691   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":435
7692  *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
7693  *             return
7694  *         if data == []: data = [""]             # unsure what type -- say string             # <<<<<<<<<<<<<<
7695  *         if type(data[0]) == type(0.0):
7696  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
7697  */
7698   __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;}
7699   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
7700   __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;}
7701   __Pyx_GOTREF(__pyx_t_2);
7702   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
7703   __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;}
7704   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7705   if (__pyx_t_1) {
7706     __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;}
7707     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
7708     __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
7709     PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_1));
7710     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
7711     __Pyx_DECREF(__pyx_v_data);
7712     __pyx_v_data = ((PyObject *)__pyx_t_2);
7713     __pyx_t_2 = 0;
7714     goto __pyx_L8;
7715   }
7716   __pyx_L8:;
7717
7718   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":436
7719  *             return
7720  *         if data == []: data = [""]             # unsure what type -- say string
7721  *         if type(data[0]) == type(0.0):             # <<<<<<<<<<<<<<
7722  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
7723  *             return
7724  */
7725   __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;}
7726   __Pyx_GOTREF(__pyx_t_2);
7727   __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;}
7728   __Pyx_GOTREF(__pyx_t_4);
7729   __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;}
7730   __Pyx_GOTREF(__pyx_t_3);
7731   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7732   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7733   __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;}
7734   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7735   if (__pyx_t_1) {
7736
7737     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":437
7738  *         if data == []: data = [""]             # unsure what type -- say string
7739  *         if type(data[0]) == type(0.0):
7740  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)             # <<<<<<<<<<<<<<
7741  *             return
7742  *         if type(data[0]) == type(0):
7743  */
7744     __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;}
7745     __Pyx_GOTREF(__pyx_t_3);
7746     __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;}
7747     __Pyx_GOTREF(__pyx_t_4);
7748     __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;}
7749     __Pyx_GOTREF(__pyx_t_2);
7750     __Pyx_INCREF(__pyx_v_key);
7751     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
7752     __Pyx_GIVEREF(__pyx_v_key);
7753     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
7754     __Pyx_GIVEREF(__pyx_t_4);
7755     __Pyx_INCREF(__pyx_int_neg_1);
7756     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_neg_1);
7757     __Pyx_GIVEREF(__pyx_int_neg_1);
7758     __Pyx_INCREF(((PyObject *)__pyx_n_s__Float));
7759     PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s__Float));
7760     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Float));
7761     __Pyx_INCREF(((PyObject *)__pyx_kp_s_35));
7762     PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_kp_s_35));
7763     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35));
7764     __Pyx_INCREF(Py_None);
7765     PyTuple_SET_ITEM(__pyx_t_2, 5, Py_None);
7766     __Pyx_GIVEREF(Py_None);
7767     __pyx_t_4 = 0;
7768     __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7769     __Pyx_GOTREF(__pyx_t_4);
7770     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7771     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7772     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;}
7773     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7774
7775     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":438
7776  *         if type(data[0]) == type(0.0):
7777  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
7778  *             return             # <<<<<<<<<<<<<<
7779  *         if type(data[0]) == type(0):
7780  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
7781  */
7782     __Pyx_XDECREF(__pyx_r);
7783     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7784     goto __pyx_L0;
7785     goto __pyx_L9;
7786   }
7787   __pyx_L9:;
7788
7789   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":439
7790  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
7791  *             return
7792  *         if type(data[0]) == type(0):             # <<<<<<<<<<<<<<
7793  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
7794  *             return
7795  */
7796   __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;}
7797   __Pyx_GOTREF(__pyx_t_4);
7798   __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;}
7799   __Pyx_GOTREF(__pyx_t_2);
7800   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7801   __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;}
7802   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7803   if (__pyx_t_1) {
7804
7805     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":440
7806  *             return
7807  *         if type(data[0]) == type(0):
7808  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)             # <<<<<<<<<<<<<<
7809  *             return
7810  *         formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".")
7811  */
7812     __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;}
7813     __Pyx_GOTREF(__pyx_t_2);
7814     __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;}
7815     __Pyx_GOTREF(__pyx_t_4);
7816     __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;}
7817     __Pyx_GOTREF(__pyx_t_3);
7818     __Pyx_INCREF(__pyx_v_key);
7819     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
7820     __Pyx_GIVEREF(__pyx_v_key);
7821     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
7822     __Pyx_GIVEREF(__pyx_t_4);
7823     __Pyx_INCREF(__pyx_int_neg_1);
7824     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_neg_1);
7825     __Pyx_GIVEREF(__pyx_int_neg_1);
7826     __Pyx_INCREF(((PyObject *)__pyx_n_s__Integer));
7827     PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_n_s__Integer));
7828     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Integer));
7829     __Pyx_INCREF(((PyObject *)__pyx_kp_s_35));
7830     PyTuple_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_kp_s_35));
7831     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35));
7832     __Pyx_INCREF(Py_None);
7833     PyTuple_SET_ITEM(__pyx_t_3, 5, Py_None);
7834     __Pyx_GIVEREF(Py_None);
7835     __pyx_t_4 = 0;
7836     __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7837     __Pyx_GOTREF(__pyx_t_4);
7838     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7839     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7840     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;}
7841     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7842
7843     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":441
7844  *         if type(data[0]) == type(0):
7845  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
7846  *             return             # <<<<<<<<<<<<<<
7847  *         formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".")
7848  * 
7849  */
7850     __Pyx_XDECREF(__pyx_r);
7851     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7852     goto __pyx_L0;
7853     goto __pyx_L10;
7854   }
7855   __pyx_L10:;
7856
7857   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":442
7858  *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
7859  *             return
7860  *         formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".")             # <<<<<<<<<<<<<<
7861  * 
7862  * 
7863  */
7864   __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;}
7865   __Pyx_GOTREF(__pyx_t_4);
7866   __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;}
7867   __Pyx_GOTREF(__pyx_t_3);
7868   __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;}
7869   __Pyx_GOTREF(__pyx_t_2);
7870   __Pyx_INCREF(__pyx_v_key);
7871   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
7872   __Pyx_GIVEREF(__pyx_v_key);
7873   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
7874   __Pyx_GIVEREF(__pyx_t_3);
7875   __Pyx_INCREF(__pyx_int_neg_1);
7876   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_neg_1);
7877   __Pyx_GIVEREF(__pyx_int_neg_1);
7878   __Pyx_INCREF(((PyObject *)__pyx_n_s__String));
7879   PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s__String));
7880   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__String));
7881   __Pyx_INCREF(((PyObject *)__pyx_kp_s_35));
7882   PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_kp_s_35));
7883   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35));
7884   __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
7885   PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_kp_s_6));
7886   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
7887   __pyx_t_3 = 0;
7888   __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7889   __Pyx_GOTREF(__pyx_t_3);
7890   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7891   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7892   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;}
7893   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7894
7895   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7896   goto __pyx_L0;
7897   __pyx_L1_error:;
7898   __Pyx_XDECREF(__pyx_t_2);
7899   __Pyx_XDECREF(__pyx_t_3);
7900   __Pyx_XDECREF(__pyx_t_4);
7901   __Pyx_AddTraceback("cvcf.VCF._add_definition");
7902   __pyx_r = NULL;
7903   __pyx_L0:;
7904   __Pyx_DECREF(__pyx_v_data);
7905   __Pyx_XGIVEREF(__pyx_r);
7906   __Pyx_RefNannyFinishContext();
7907   return __pyx_r;
7908 }
7909
7910 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":446
7911  * 
7912  *     # todo: trim trailing missing values
7913  *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):             # <<<<<<<<<<<<<<
7914  *         output, sdata = [], []
7915  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
7916  */
7917
7918 static PyObject *__pyx_pf_4cvcf_3VCF_format_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7919 static PyMethodDef __pyx_mdef_4cvcf_3VCF_format_formatdata = {__Pyx_NAMESTR("format_formatdata"), (PyCFunction)__pyx_pf_4cvcf_3VCF_format_formatdata, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
7920 static PyObject *__pyx_pf_4cvcf_3VCF_format_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7921   PyObject *__pyx_v_self = 0;
7922   PyObject *__pyx_v_data = 0;
7923   PyObject *__pyx_v_format = 0;
7924   PyObject *__pyx_v_key = 0;
7925   PyObject *__pyx_v_value = 0;
7926   PyObject *__pyx_v_separator = 0;
7927   PyObject *__pyx_v_output;
7928   PyObject *__pyx_v_sdata;
7929   PyObject *__pyx_v_d;
7930   PyObject *__pyx_v_k;
7931   PyObject *__pyx_v_idx;
7932   PyObject *__pyx_v_v;
7933   PyObject *__pyx_v_last;
7934   PyObject *__pyx_r = NULL;
7935   PyObject *__pyx_t_1 = NULL;
7936   PyObject *__pyx_t_2 = NULL;
7937   int __pyx_t_3;
7938   Py_ssize_t __pyx_t_4;
7939   PyObject *__pyx_t_5 = NULL;
7940   PyObject *__pyx_t_6 = NULL;
7941   Py_ssize_t __pyx_t_7;
7942   PyObject *__pyx_t_8 = NULL;
7943   int __pyx_t_9;
7944   int __pyx_t_10;
7945   int __pyx_t_11;
7946   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};
7947   __Pyx_RefNannySetupContext("format_formatdata");
7948   __pyx_self = __pyx_self;
7949   if (unlikely(__pyx_kwds)) {
7950     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7951     PyObject* values[6] = {0,0,0,0,0,0};
7952     values[3] = __pyx_k_36;
7953     values[4] = __pyx_k_37;
7954     values[5] = ((PyObject *)__pyx_kp_s_3);
7955     switch (PyTuple_GET_SIZE(__pyx_args)) {
7956       case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7957       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7958       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7959       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7960       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7961       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7962       case  0: break;
7963       default: goto __pyx_L5_argtuple_error;
7964     }
7965     switch (PyTuple_GET_SIZE(__pyx_args)) {
7966       case  0:
7967       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7968       if (likely(values[0])) kw_args--;
7969       else goto __pyx_L5_argtuple_error;
7970       case  1:
7971       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
7972       if (likely(values[1])) kw_args--;
7973       else {
7974         __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7975       }
7976       case  2:
7977       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
7978       if (likely(values[2])) kw_args--;
7979       else {
7980         __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7981       }
7982       case  3:
7983       if (kw_args > 0) {
7984         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
7985         if (value) { values[3] = value; kw_args--; }
7986       }
7987       case  4:
7988       if (kw_args > 0) {
7989         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
7990         if (value) { values[4] = value; kw_args--; }
7991       }
7992       case  5:
7993       if (kw_args > 0) {
7994         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__separator);
7995         if (value) { values[5] = value; kw_args--; }
7996       }
7997     }
7998     if (unlikely(kw_args > 0)) {
7999       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;}
8000     }
8001     __pyx_v_self = values[0];
8002     __pyx_v_data = values[1];
8003     __pyx_v_format = values[2];
8004     __pyx_v_key = values[3];
8005     __pyx_v_value = values[4];
8006     __pyx_v_separator = values[5];
8007   } else {
8008     __pyx_v_key = __pyx_k_36;
8009     __pyx_v_value = __pyx_k_37;
8010     __pyx_v_separator = ((PyObject *)__pyx_kp_s_3);
8011     switch (PyTuple_GET_SIZE(__pyx_args)) {
8012       case  6:
8013       __pyx_v_separator = PyTuple_GET_ITEM(__pyx_args, 5);
8014       case  5:
8015       __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 4);
8016       case  4:
8017       __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 3);
8018       case  3:
8019       __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 2);
8020       __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 1);
8021       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
8022       break;
8023       default: goto __pyx_L5_argtuple_error;
8024     }
8025   }
8026   goto __pyx_L4_argument_unpacking_done;
8027   __pyx_L5_argtuple_error:;
8028   __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;}
8029   __pyx_L3_error:;
8030   __Pyx_AddTraceback("cvcf.VCF.format_formatdata");
8031   __Pyx_RefNannyFinishContext();
8032   return NULL;
8033   __pyx_L4_argument_unpacking_done:;
8034   __Pyx_INCREF(__pyx_v_data);
8035   __pyx_v_output = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
8036   __pyx_v_sdata = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
8037   __pyx_v_d = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
8038   __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
8039   __pyx_v_idx = Py_None; __Pyx_INCREF(Py_None);
8040   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
8041   __pyx_v_last = Py_None; __Pyx_INCREF(Py_None);
8042
8043   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":447
8044  *     # todo: trim trailing missing values
8045  *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):
8046  *         output, sdata = [], []             # <<<<<<<<<<<<<<
8047  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
8048  *             d = {}
8049  */
8050   __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;}
8051   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
8052   __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;}
8053   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8054   __Pyx_DECREF(((PyObject *)__pyx_v_output));
8055   __pyx_v_output = __pyx_t_1;
8056   __pyx_t_1 = 0;
8057   __Pyx_DECREF(((PyObject *)__pyx_v_sdata));
8058   __pyx_v_sdata = __pyx_t_2;
8059   __pyx_t_2 = 0;
8060
8061   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":448
8062  *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):
8063  *         output, sdata = [], []
8064  *         if type(data) == type([]): # for FORMAT field, make data with dummy values             # <<<<<<<<<<<<<<
8065  *             d = {}
8066  *             for k in data: d[k] = []
8067  */
8068   __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;}
8069   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8070   __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;}
8071   __Pyx_GOTREF(__pyx_t_1);
8072   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
8073   __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;}
8074   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8075   if (__pyx_t_3) {
8076
8077     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":449
8078  *         output, sdata = [], []
8079  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
8080  *             d = {}             # <<<<<<<<<<<<<<
8081  *             for k in data: d[k] = []
8082  *             data = d
8083  */
8084     __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;}
8085     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
8086     __Pyx_DECREF(((PyObject *)__pyx_v_d));
8087     __pyx_v_d = __pyx_t_1;
8088     __pyx_t_1 = 0;
8089
8090     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":450
8091  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
8092  *             d = {}
8093  *             for k in data: d[k] = []             # <<<<<<<<<<<<<<
8094  *             data = d
8095  *         # convert missing values; and silently add definitions if required
8096  */
8097     if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
8098       __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1);
8099     } else {
8100       __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;}
8101       __Pyx_GOTREF(__pyx_t_1);
8102     }
8103     for (;;) {
8104       if (likely(PyList_CheckExact(__pyx_t_1))) {
8105         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
8106         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8107       } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
8108         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8109         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8110       } else {
8111         __pyx_t_2 = PyIter_Next(__pyx_t_1);
8112         if (!__pyx_t_2) {
8113           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8114           break;
8115         }
8116         __Pyx_GOTREF(__pyx_t_2);
8117       }
8118       __Pyx_DECREF(__pyx_v_k);
8119       __pyx_v_k = __pyx_t_2;
8120       __pyx_t_2 = 0;
8121       __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;}
8122       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8123       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;}
8124       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
8125     }
8126     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8127
8128     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":451
8129  *             d = {}
8130  *             for k in data: d[k] = []
8131  *             data = d             # <<<<<<<<<<<<<<
8132  *         # convert missing values; and silently add definitions if required
8133  *         for k in data:
8134  */
8135     __Pyx_INCREF(((PyObject *)__pyx_v_d));
8136     __Pyx_DECREF(__pyx_v_data);
8137     __pyx_v_data = ((PyObject *)__pyx_v_d);
8138     goto __pyx_L6;
8139   }
8140   __pyx_L6:;
8141
8142   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":453
8143  *             data = d
8144  *         # convert missing values; and silently add definitions if required
8145  *         for k in data:             # <<<<<<<<<<<<<<
8146  *             self._add_definition( format, k, data[k], "(output)" )
8147  *             for idx,v in enumerate(data[k]):
8148  */
8149   if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
8150     __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1);
8151   } else {
8152     __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;}
8153     __Pyx_GOTREF(__pyx_t_1);
8154   }
8155   for (;;) {
8156     if (likely(PyList_CheckExact(__pyx_t_1))) {
8157       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
8158       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8159     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
8160       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8161       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8162     } else {
8163       __pyx_t_2 = PyIter_Next(__pyx_t_1);
8164       if (!__pyx_t_2) {
8165         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8166         break;
8167       }
8168       __Pyx_GOTREF(__pyx_t_2);
8169     }
8170     __Pyx_DECREF(__pyx_v_k);
8171     __pyx_v_k = __pyx_t_2;
8172     __pyx_t_2 = 0;
8173
8174     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":454
8175  *         # convert missing values; and silently add definitions if required
8176  *         for k in data:
8177  *             self._add_definition( format, k, data[k], "(output)" )             # <<<<<<<<<<<<<<
8178  *             for idx,v in enumerate(data[k]):
8179  *                 if v == format[k].missingvalue: data[k][idx] = "."
8180  */
8181     __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;}
8182     __Pyx_GOTREF(__pyx_t_2);
8183     __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;}
8184     __Pyx_GOTREF(__pyx_t_5);
8185     __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;}
8186     __Pyx_GOTREF(__pyx_t_6);
8187     __Pyx_INCREF(__pyx_v_format);
8188     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_format);
8189     __Pyx_GIVEREF(__pyx_v_format);
8190     __Pyx_INCREF(__pyx_v_k);
8191     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_k);
8192     __Pyx_GIVEREF(__pyx_v_k);
8193     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
8194     __Pyx_GIVEREF(__pyx_t_5);
8195     __Pyx_INCREF(((PyObject *)__pyx_kp_s_38));
8196     PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_kp_s_38));
8197     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_38));
8198     __pyx_t_5 = 0;
8199     __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8200     __Pyx_GOTREF(__pyx_t_5);
8201     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8202     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8203     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8204
8205     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":455
8206  *         for k in data:
8207  *             self._add_definition( format, k, data[k], "(output)" )
8208  *             for idx,v in enumerate(data[k]):             # <<<<<<<<<<<<<<
8209  *                 if v == format[k].missingvalue: data[k][idx] = "."
8210  *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
8211  */
8212     __Pyx_INCREF(__pyx_int_0);
8213     __pyx_t_5 = __pyx_int_0;
8214     __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;}
8215     __Pyx_GOTREF(__pyx_t_6);
8216     if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
8217       __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2);
8218     } else {
8219       __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;}
8220       __Pyx_GOTREF(__pyx_t_2);
8221     }
8222     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8223     for (;;) {
8224       if (likely(PyList_CheckExact(__pyx_t_2))) {
8225         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
8226         __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++;
8227       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
8228         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
8229         __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++;
8230       } else {
8231         __pyx_t_6 = PyIter_Next(__pyx_t_2);
8232         if (!__pyx_t_6) {
8233           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8234           break;
8235         }
8236         __Pyx_GOTREF(__pyx_t_6);
8237       }
8238       __Pyx_DECREF(__pyx_v_v);
8239       __pyx_v_v = __pyx_t_6;
8240       __pyx_t_6 = 0;
8241       __Pyx_INCREF(__pyx_t_5);
8242       __Pyx_DECREF(__pyx_v_idx);
8243       __pyx_v_idx = __pyx_t_5;
8244       __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;}
8245       __Pyx_GOTREF(__pyx_t_6);
8246       __Pyx_DECREF(__pyx_t_5);
8247       __pyx_t_5 = __pyx_t_6;
8248       __pyx_t_6 = 0;
8249
8250       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":456
8251  *             self._add_definition( format, k, data[k], "(output)" )
8252  *             for idx,v in enumerate(data[k]):
8253  *                 if v == format[k].missingvalue: data[k][idx] = "."             # <<<<<<<<<<<<<<
8254  *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
8255  *         for k in data:
8256  */
8257       __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;}
8258       __Pyx_GOTREF(__pyx_t_6);
8259       __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;}
8260       __Pyx_GOTREF(__pyx_t_8);
8261       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8262       __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;}
8263       __Pyx_GOTREF(__pyx_t_6);
8264       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8265       __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;}
8266       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8267       if (__pyx_t_3) {
8268         __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;}
8269         __Pyx_GOTREF(__pyx_t_6);
8270         if (PyObject_SetItem(__pyx_t_6, __pyx_v_idx, ((PyObject *)__pyx_kp_s_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8271         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8272         goto __pyx_L13;
8273       }
8274       __pyx_L13:;
8275     }
8276     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8277     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8278   }
8279   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8280
8281   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":458
8282  *                 if v == format[k].missingvalue: data[k][idx] = "."
8283  *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
8284  *         for k in data:             # <<<<<<<<<<<<<<
8285  *             if k != 'GT': sdata.append( (k,data[k]) )
8286  *         sdata.sort()
8287  */
8288   if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
8289     __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1);
8290   } else {
8291     __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;}
8292     __Pyx_GOTREF(__pyx_t_1);
8293   }
8294   for (;;) {
8295     if (likely(PyList_CheckExact(__pyx_t_1))) {
8296       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
8297       __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
8298     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
8299       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8300       __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
8301     } else {
8302       __pyx_t_5 = PyIter_Next(__pyx_t_1);
8303       if (!__pyx_t_5) {
8304         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8305         break;
8306       }
8307       __Pyx_GOTREF(__pyx_t_5);
8308     }
8309     __Pyx_DECREF(__pyx_v_k);
8310     __pyx_v_k = __pyx_t_5;
8311     __pyx_t_5 = 0;
8312
8313     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":459
8314  *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
8315  *         for k in data:
8316  *             if k != 'GT': sdata.append( (k,data[k]) )             # <<<<<<<<<<<<<<
8317  *         sdata.sort()
8318  *         if 'GT' in data:
8319  */
8320     __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;}
8321     __Pyx_GOTREF(__pyx_t_5);
8322     __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;}
8323     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8324     if (__pyx_t_3) {
8325       if (unlikely(__pyx_v_sdata == Py_None)) {
8326         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;} 
8327       }
8328       __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;}
8329       __Pyx_GOTREF(__pyx_t_5);
8330       __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;}
8331       __Pyx_GOTREF(__pyx_t_2);
8332       __Pyx_INCREF(__pyx_v_k);
8333       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k);
8334       __Pyx_GIVEREF(__pyx_v_k);
8335       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
8336       __Pyx_GIVEREF(__pyx_t_5);
8337       __pyx_t_5 = 0;
8338       __pyx_t_9 = PyList_Append(((PyObject *)__pyx_v_sdata), __pyx_t_2); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8339       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8340       goto __pyx_L16;
8341     }
8342     __pyx_L16:;
8343   }
8344   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8345
8346   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":460
8347  *         for k in data:
8348  *             if k != 'GT': sdata.append( (k,data[k]) )
8349  *         sdata.sort()             # <<<<<<<<<<<<<<
8350  *         if 'GT' in data:
8351  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
8352  */
8353   if (unlikely(__pyx_v_sdata == Py_None)) {
8354     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;} 
8355   }
8356   __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;}
8357
8358   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":461
8359  *             if k != 'GT': sdata.append( (k,data[k]) )
8360  *         sdata.sort()
8361  *         if 'GT' in data:             # <<<<<<<<<<<<<<
8362  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
8363  *         for k,v in sdata:
8364  */
8365   __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;}
8366   if (__pyx_t_3) {
8367
8368     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":462
8369  *         sdata.sort()
8370  *         if 'GT' in data:
8371  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata             # <<<<<<<<<<<<<<
8372  *         for k,v in sdata:
8373  *             if v == []: v = None
8374  */
8375     __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;}
8376     __Pyx_GOTREF(__pyx_t_1);
8377     __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;}
8378     __Pyx_GOTREF(__pyx_t_2);
8379     __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;}
8380     __Pyx_GOTREF(__pyx_t_5);
8381     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
8382     __Pyx_GIVEREF(__pyx_t_1);
8383     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8384     __Pyx_GIVEREF(__pyx_t_2);
8385     __pyx_t_1 = 0;
8386     __pyx_t_2 = 0;
8387     __pyx_t_2 = PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8388     __Pyx_GOTREF(__pyx_t_2);
8389     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8390     __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;}
8391     __Pyx_GOTREF(__pyx_t_5);
8392     __Pyx_INCREF(((PyObject *)__pyx_n_s__GT));
8393     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__GT));
8394     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__GT));
8395     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8396     __Pyx_GIVEREF(__pyx_t_2);
8397     __pyx_t_2 = 0;
8398     __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;}
8399     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8400     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
8401     __Pyx_GIVEREF(__pyx_t_5);
8402     __pyx_t_5 = 0;
8403     __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;}
8404     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
8405     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
8406     __Pyx_DECREF(((PyObject *)__pyx_v_sdata));
8407     __pyx_v_sdata = __pyx_t_5;
8408     __pyx_t_5 = 0;
8409     goto __pyx_L17;
8410   }
8411   __pyx_L17:;
8412
8413   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":463
8414  *         if 'GT' in data:
8415  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
8416  *         for k,v in sdata:             # <<<<<<<<<<<<<<
8417  *             if v == []: v = None
8418  *             if key and value:
8419  */
8420   if (likely(((PyObject *)__pyx_v_sdata) != Py_None)) {
8421     __pyx_t_4 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_sdata); __Pyx_INCREF(__pyx_t_5);
8422   } else {
8423     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8424   }
8425   for (;;) {
8426     if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
8427     __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8428     if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
8429       PyObject* tuple = __pyx_t_2;
8430       __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
8431       __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
8432       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8433       __Pyx_DECREF(__pyx_v_k);
8434       __pyx_v_k = __pyx_t_1;
8435       __pyx_t_1 = 0;
8436       __Pyx_DECREF(__pyx_v_v);
8437       __pyx_v_v = __pyx_t_6;
8438       __pyx_t_6 = 0;
8439     } else {
8440       __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;}
8441       __Pyx_GOTREF(__pyx_t_8);
8442       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8443       __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;}
8444       __Pyx_GOTREF(__pyx_t_1);
8445       __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;}
8446       __Pyx_GOTREF(__pyx_t_6);
8447       if (__Pyx_EndUnpack(__pyx_t_8, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8448       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8449       __Pyx_DECREF(__pyx_v_k);
8450       __pyx_v_k = __pyx_t_1;
8451       __pyx_t_1 = 0;
8452       __Pyx_DECREF(__pyx_v_v);
8453       __pyx_v_v = __pyx_t_6;
8454       __pyx_t_6 = 0;
8455     }
8456
8457     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":464
8458  *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
8459  *         for k,v in sdata:
8460  *             if v == []: v = None             # <<<<<<<<<<<<<<
8461  *             if key and value:
8462  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
8463  */
8464     __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;}
8465     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8466     __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;}
8467     __Pyx_GOTREF(__pyx_t_6);
8468     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
8469     __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;}
8470     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8471     if (__pyx_t_3) {
8472       __Pyx_INCREF(Py_None);
8473       __Pyx_DECREF(__pyx_v_v);
8474       __pyx_v_v = Py_None;
8475       goto __pyx_L20;
8476     }
8477     __pyx_L20:;
8478
8479     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":465
8480  *         for k,v in sdata:
8481  *             if v == []: v = None
8482  *             if key and value:             # <<<<<<<<<<<<<<
8483  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
8484  *                 else: output.append( k )
8485  */
8486     __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;}
8487     if (__pyx_t_3) {
8488       __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;}
8489       __pyx_t_11 = __pyx_t_10;
8490     } else {
8491       __pyx_t_11 = __pyx_t_3;
8492     }
8493     if (__pyx_t_11) {
8494
8495       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":466
8496  *             if v == []: v = None
8497  *             if key and value:
8498  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )             # <<<<<<<<<<<<<<
8499  *                 else: output.append( k )
8500  *             elif key: output.append(k)
8501  */
8502       __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;}
8503       __Pyx_GOTREF(__pyx_t_6);
8504       __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;}
8505       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8506       if (__pyx_t_11) {
8507         if (unlikely(__pyx_v_output == Py_None)) {
8508           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;} 
8509         }
8510         __pyx_t_6 = PyNumber_Add(__pyx_v_k, ((PyObject *)__pyx_kp_s_8)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8511         __Pyx_GOTREF(__pyx_t_6);
8512         __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;}
8513         __Pyx_GOTREF(__pyx_t_2);
8514         __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;}
8515         __Pyx_GOTREF(__pyx_t_1);
8516         __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
8517         PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)&PyString_Type)));
8518         __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
8519         __Pyx_INCREF(__pyx_v_v);
8520         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_v);
8521         __Pyx_GIVEREF(__pyx_v_v);
8522         __pyx_t_8 = PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8523         __Pyx_GOTREF(__pyx_t_8);
8524         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8525         __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;}
8526         __Pyx_GOTREF(__pyx_t_1);
8527         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
8528         __Pyx_GIVEREF(__pyx_t_8);
8529         __pyx_t_8 = 0;
8530         __pyx_t_8 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8531         __Pyx_GOTREF(__pyx_t_8);
8532         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8533         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8534         __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;}
8535         __Pyx_GOTREF(__pyx_t_1);
8536         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8537         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8538         __pyx_t_9 = PyList_Append(((PyObject *)__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;}
8539         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8540         goto __pyx_L22;
8541       }
8542       /*else*/ {
8543
8544         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":467
8545  *             if key and value:
8546  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
8547  *                 else: output.append( k )             # <<<<<<<<<<<<<<
8548  *             elif key: output.append(k)
8549  *             elif value:
8550  */
8551         if (unlikely(__pyx_v_output == Py_None)) {
8552           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;} 
8553         }
8554         __pyx_t_9 = PyList_Append(((PyObject *)__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;}
8555       }
8556       __pyx_L22:;
8557       goto __pyx_L21;
8558     }
8559
8560     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":468
8561  *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
8562  *                 else: output.append( k )
8563  *             elif key: output.append(k)             # <<<<<<<<<<<<<<
8564  *             elif value:
8565  *                 if v != None: output.append( ','.join(map(str,v)) )
8566  */
8567     __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;}
8568     if (__pyx_t_11) {
8569       if (unlikely(__pyx_v_output == Py_None)) {
8570         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;} 
8571       }
8572       __pyx_t_9 = PyList_Append(((PyObject *)__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;}
8573       goto __pyx_L21;
8574     }
8575
8576     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":469
8577  *                 else: output.append( k )
8578  *             elif key: output.append(k)
8579  *             elif value:             # <<<<<<<<<<<<<<
8580  *                 if v != None: output.append( ','.join(map(str,v)) )
8581  *                 else: output.append( "." )                    # should not happen
8582  */
8583     __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;}
8584     if (__pyx_t_11) {
8585
8586       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":470
8587  *             elif key: output.append(k)
8588  *             elif value:
8589  *                 if v != None: output.append( ','.join(map(str,v)) )             # <<<<<<<<<<<<<<
8590  *                 else: output.append( "." )                    # should not happen
8591  *         # snip off trailing missing data
8592  */
8593       __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;}
8594       __Pyx_GOTREF(__pyx_t_1);
8595       __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;}
8596       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8597       if (__pyx_t_11) {
8598         if (unlikely(__pyx_v_output == Py_None)) {
8599           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;} 
8600         }
8601         __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;}
8602         __Pyx_GOTREF(__pyx_t_1);
8603         __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;}
8604         __Pyx_GOTREF(__pyx_t_8);
8605         __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
8606         PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)((PyObject*)&PyString_Type)));
8607         __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
8608         __Pyx_INCREF(__pyx_v_v);
8609         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_v);
8610         __Pyx_GIVEREF(__pyx_v_v);
8611         __pyx_t_6 = PyObject_Call(__pyx_builtin_map, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8612         __Pyx_GOTREF(__pyx_t_6);
8613         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8614         __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;}
8615         __Pyx_GOTREF(__pyx_t_8);
8616         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
8617         __Pyx_GIVEREF(__pyx_t_6);
8618         __pyx_t_6 = 0;
8619         __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8620         __Pyx_GOTREF(__pyx_t_6);
8621         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8622         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8623         __pyx_t_9 = PyList_Append(((PyObject *)__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;}
8624         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8625         goto __pyx_L23;
8626       }
8627       /*else*/ {
8628
8629         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":471
8630  *             elif value:
8631  *                 if v != None: output.append( ','.join(map(str,v)) )
8632  *                 else: output.append( "." )                    # should not happen             # <<<<<<<<<<<<<<
8633  *         # snip off trailing missing data
8634  *         while len(output) > 1:
8635  */
8636         if (unlikely(__pyx_v_output == Py_None)) {
8637           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;} 
8638         }
8639         __pyx_t_9 = PyList_Append(((PyObject *)__pyx_v_output), ((PyObject *)__pyx_kp_s_6)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8640       }
8641       __pyx_L23:;
8642       goto __pyx_L21;
8643     }
8644     __pyx_L21:;
8645   }
8646   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8647
8648   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":473
8649  *                 else: output.append( "." )                    # should not happen
8650  *         # snip off trailing missing data
8651  *         while len(output) > 1:             # <<<<<<<<<<<<<<
8652  *             last = output[-1].replace(',','').replace('.','')
8653  *             if len(last)>0: break
8654  */
8655   while (1) {
8656     if (unlikely(__pyx_v_output == Py_None)) {
8657       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;} 
8658     }
8659     __pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_output)); 
8660     __pyx_t_11 = (__pyx_t_4 > 1);
8661     if (!__pyx_t_11) break;
8662
8663     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":474
8664  *         # snip off trailing missing data
8665  *         while len(output) > 1:
8666  *             last = output[-1].replace(',','').replace('.','')             # <<<<<<<<<<<<<<
8667  *             if len(last)>0: break
8668  *             output = output[:-1]
8669  */
8670     __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;}
8671     __Pyx_GOTREF(__pyx_t_5);
8672     __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;}
8673     __Pyx_GOTREF(__pyx_t_6);
8674     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8675     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8676     __Pyx_GOTREF(__pyx_t_5);
8677     __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
8678     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_2));
8679     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
8680     __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
8681     PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_kp_s_1));
8682     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
8683     __pyx_t_8 = PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8684     __Pyx_GOTREF(__pyx_t_8);
8685     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8686     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8687     __pyx_t_5 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__replace); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8688     __Pyx_GOTREF(__pyx_t_5);
8689     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8690     __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8691     __Pyx_GOTREF(__pyx_t_8);
8692     __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
8693     PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_6));
8694     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
8695     __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
8696     PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_kp_s_1));
8697     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
8698     __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8699     __Pyx_GOTREF(__pyx_t_6);
8700     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8701     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8702     __Pyx_DECREF(__pyx_v_last);
8703     __pyx_v_last = __pyx_t_6;
8704     __pyx_t_6 = 0;
8705
8706     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":475
8707  *         while len(output) > 1:
8708  *             last = output[-1].replace(',','').replace('.','')
8709  *             if len(last)>0: break             # <<<<<<<<<<<<<<
8710  *             output = output[:-1]
8711  *         return separator.join(output)
8712  */
8713     __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;}
8714     __pyx_t_11 = (__pyx_t_4 > 0);
8715     if (__pyx_t_11) {
8716       goto __pyx_L25_break;
8717       goto __pyx_L26;
8718     }
8719     __pyx_L26:;
8720
8721     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":476
8722  *             last = output[-1].replace(',','').replace('.','')
8723  *             if len(last)>0: break
8724  *             output = output[:-1]             # <<<<<<<<<<<<<<
8725  *         return separator.join(output)
8726  * 
8727  */
8728     __pyx_t_6 = PySequence_GetSlice(((PyObject *)__pyx_v_output), 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8729     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
8730     __Pyx_DECREF(((PyObject *)__pyx_v_output));
8731     __pyx_v_output = __pyx_t_6;
8732     __pyx_t_6 = 0;
8733   }
8734   __pyx_L25_break:;
8735
8736   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":477
8737  *             if len(last)>0: break
8738  *             output = output[:-1]
8739  *         return separator.join(output)             # <<<<<<<<<<<<<<
8740  * 
8741  * 
8742  */
8743   __Pyx_XDECREF(__pyx_r);
8744   __pyx_t_6 = PyObject_GetAttr(__pyx_v_separator, __pyx_n_s__join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8745   __Pyx_GOTREF(__pyx_t_6);
8746   __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8747   __Pyx_GOTREF(__pyx_t_8);
8748   __Pyx_INCREF(((PyObject *)__pyx_v_output));
8749   PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_output));
8750   __Pyx_GIVEREF(((PyObject *)__pyx_v_output));
8751   __pyx_t_5 = PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8752   __Pyx_GOTREF(__pyx_t_5);
8753   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8754   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8755   __pyx_r = __pyx_t_5;
8756   __pyx_t_5 = 0;
8757   goto __pyx_L0;
8758
8759   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8760   goto __pyx_L0;
8761   __pyx_L1_error:;
8762   __Pyx_XDECREF(__pyx_t_1);
8763   __Pyx_XDECREF(__pyx_t_2);
8764   __Pyx_XDECREF(__pyx_t_5);
8765   __Pyx_XDECREF(__pyx_t_6);
8766   __Pyx_XDECREF(__pyx_t_8);
8767   __Pyx_AddTraceback("cvcf.VCF.format_formatdata");
8768   __pyx_r = NULL;
8769   __pyx_L0:;
8770   __Pyx_DECREF(__pyx_v_output);
8771   __Pyx_DECREF(__pyx_v_sdata);
8772   __Pyx_DECREF(__pyx_v_d);
8773   __Pyx_DECREF(__pyx_v_k);
8774   __Pyx_DECREF(__pyx_v_idx);
8775   __Pyx_DECREF(__pyx_v_v);
8776   __Pyx_DECREF(__pyx_v_last);
8777   __Pyx_DECREF(__pyx_v_data);
8778   __Pyx_XGIVEREF(__pyx_r);
8779   __Pyx_RefNannyFinishContext();
8780   return __pyx_r;
8781 }
8782
8783 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":480
8784  * 
8785  * 
8786  *     def enter_default_format(self):             # <<<<<<<<<<<<<<
8787  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
8788  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
8789  */
8790
8791 static PyObject *__pyx_pf_4cvcf_3VCF_enter_default_format(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
8792 static PyMethodDef __pyx_mdef_4cvcf_3VCF_enter_default_format = {__Pyx_NAMESTR("enter_default_format"), (PyCFunction)__pyx_pf_4cvcf_3VCF_enter_default_format, METH_O, __Pyx_DOCSTR(0)};
8793 static PyObject *__pyx_pf_4cvcf_3VCF_enter_default_format(PyObject *__pyx_self, PyObject *__pyx_v_self) {
8794   PyObject *__pyx_v_f;
8795   PyObject *__pyx_r = NULL;
8796   Py_ssize_t __pyx_t_1;
8797   PyObject *__pyx_t_2 = NULL;
8798   PyObject *__pyx_t_3 = NULL;
8799   PyObject *__pyx_t_4 = NULL;
8800   PyObject *__pyx_t_5 = NULL;
8801   PyObject *__pyx_t_6 = NULL;
8802   PyObject *__pyx_t_7 = NULL;
8803   PyObject *__pyx_t_8 = NULL;
8804   int __pyx_t_9;
8805   __Pyx_RefNannySetupContext("enter_default_format");
8806   __pyx_self = __pyx_self;
8807   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
8808
8809   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":481
8810  * 
8811  *     def enter_default_format(self):
8812  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),             # <<<<<<<<<<<<<<
8813  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
8814  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
8815  */
8816   __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;}
8817   __Pyx_GOTREF(__pyx_t_2);
8818   __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;}
8819   __Pyx_GOTREF(__pyx_t_3);
8820   __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;}
8821   __Pyx_GOTREF(__pyx_t_4);
8822   __Pyx_INCREF(((PyObject *)__pyx_n_s__GT));
8823   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__GT));
8824   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__GT));
8825   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
8826   __Pyx_GIVEREF(__pyx_t_3);
8827   __Pyx_INCREF(__pyx_int_1);
8828   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1);
8829   __Pyx_GIVEREF(__pyx_int_1);
8830   __Pyx_INCREF(((PyObject *)__pyx_n_s__String));
8831   PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_n_s__String));
8832   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__String));
8833   __Pyx_INCREF(((PyObject *)__pyx_n_s__Genotype));
8834   PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_n_s__Genotype));
8835   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Genotype));
8836   __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
8837   PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_kp_s_6));
8838   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
8839   __pyx_t_3 = 0;
8840   __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8841   __Pyx_GOTREF(__pyx_t_3);
8842   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8843   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8844
8845   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":482
8846  *     def enter_default_format(self):
8847  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
8848  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),             # <<<<<<<<<<<<<<
8849  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
8850  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
8851  */
8852   __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;}
8853   __Pyx_GOTREF(__pyx_t_4);
8854   __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;}
8855   __Pyx_GOTREF(__pyx_t_2);
8856   __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;}
8857   __Pyx_GOTREF(__pyx_t_5);
8858   __Pyx_INCREF(((PyObject *)__pyx_n_s__GQ));
8859   PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__GQ));
8860   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__GQ));
8861   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8862   __Pyx_GIVEREF(__pyx_t_2);
8863   __Pyx_INCREF(__pyx_int_1);
8864   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_1);
8865   __Pyx_GIVEREF(__pyx_int_1);
8866   __Pyx_INCREF(((PyObject *)__pyx_n_s__Integer));
8867   PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_n_s__Integer));
8868   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Integer));
8869   __Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
8870   PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_kp_s_39));
8871   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
8872   __Pyx_INCREF(__pyx_int_neg_1);
8873   PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_int_neg_1);
8874   __Pyx_GIVEREF(__pyx_int_neg_1);
8875   __pyx_t_2 = 0;
8876   __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8877   __Pyx_GOTREF(__pyx_t_2);
8878   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8879   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8880
8881   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":483
8882  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
8883  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
8884  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),             # <<<<<<<<<<<<<<
8885  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
8886  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:
8887  */
8888   __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;}
8889   __Pyx_GOTREF(__pyx_t_5);
8890   __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;}
8891   __Pyx_GOTREF(__pyx_t_4);
8892   __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;}
8893   __Pyx_GOTREF(__pyx_t_6);
8894   __Pyx_INCREF(((PyObject *)__pyx_n_s__DP));
8895   PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__DP));
8896   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__DP));
8897   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
8898   __Pyx_GIVEREF(__pyx_t_4);
8899   __Pyx_INCREF(__pyx_int_1);
8900   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_1);
8901   __Pyx_GIVEREF(__pyx_int_1);
8902   __Pyx_INCREF(((PyObject *)__pyx_n_s__Integer));
8903   PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_n_s__Integer));
8904   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Integer));
8905   __Pyx_INCREF(((PyObject *)__pyx_kp_s_40));
8906   PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_kp_s_40));
8907   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40));
8908   __Pyx_INCREF(__pyx_int_neg_1);
8909   PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_neg_1);
8910   __Pyx_GIVEREF(__pyx_int_neg_1);
8911   __pyx_t_4 = 0;
8912   __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8913   __Pyx_GOTREF(__pyx_t_4);
8914   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8915   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8916
8917   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":484
8918  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
8919  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
8920  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid             # <<<<<<<<<<<<<<
8921  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:
8922  *             if f.id not in self._format:
8923  */
8924   __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;}
8925   __Pyx_GOTREF(__pyx_t_6);
8926   __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;}
8927   __Pyx_GOTREF(__pyx_t_5);
8928   __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;}
8929   __Pyx_GOTREF(__pyx_t_7);
8930   __Pyx_INCREF(((PyObject *)__pyx_n_s__HQ));
8931   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__HQ));
8932   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__HQ));
8933   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
8934   __Pyx_GIVEREF(__pyx_t_5);
8935   __Pyx_INCREF(__pyx_int_neg_1);
8936   PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_neg_1);
8937   __Pyx_GIVEREF(__pyx_int_neg_1);
8938   __Pyx_INCREF(((PyObject *)__pyx_n_s__Integer));
8939   PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_n_s__Integer));
8940   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Integer));
8941   __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
8942   PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_kp_s_41));
8943   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41));
8944   __Pyx_INCREF(__pyx_int_neg_1);
8945   PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_int_neg_1);
8946   __Pyx_GIVEREF(__pyx_int_neg_1);
8947   __pyx_t_5 = 0;
8948   __pyx_t_5 = PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8949   __Pyx_GOTREF(__pyx_t_5);
8950   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8951   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8952
8953   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":485
8954  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
8955  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
8956  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:             # <<<<<<<<<<<<<<
8957  *             if f.id not in self._format:
8958  *                 self._format[f.id] = f
8959  */
8960   __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;}
8961   __Pyx_GOTREF(__pyx_t_7);
8962   __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;}
8963   __Pyx_GOTREF(__pyx_t_6);
8964   __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;}
8965   __Pyx_GOTREF(__pyx_t_8);
8966   __Pyx_INCREF(((PyObject *)__pyx_n_s__FT));
8967   PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_n_s__FT));
8968   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FT));
8969   PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
8970   __Pyx_GIVEREF(__pyx_t_6);
8971   __Pyx_INCREF(__pyx_int_1);
8972   PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_1);
8973   __Pyx_GIVEREF(__pyx_int_1);
8974   __Pyx_INCREF(((PyObject *)__pyx_n_s__String));
8975   PyTuple_SET_ITEM(__pyx_t_8, 3, ((PyObject *)__pyx_n_s__String));
8976   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__String));
8977   __Pyx_INCREF(((PyObject *)__pyx_kp_s_42));
8978   PyTuple_SET_ITEM(__pyx_t_8, 4, ((PyObject *)__pyx_kp_s_42));
8979   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42));
8980   __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
8981   PyTuple_SET_ITEM(__pyx_t_8, 5, ((PyObject *)__pyx_kp_s_6));
8982   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
8983   __pyx_t_6 = 0;
8984   __pyx_t_6 = PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8985   __Pyx_GOTREF(__pyx_t_6);
8986   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8987   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8988   __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;}
8989   __Pyx_GOTREF(((PyObject *)__pyx_t_8));
8990   PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
8991   __Pyx_GIVEREF(__pyx_t_3);
8992   PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
8993   __Pyx_GIVEREF(__pyx_t_2);
8994   PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_4);
8995   __Pyx_GIVEREF(__pyx_t_4);
8996   PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_5);
8997   __Pyx_GIVEREF(__pyx_t_5);
8998   PyList_SET_ITEM(__pyx_t_8, 4, __pyx_t_6);
8999   __Pyx_GIVEREF(__pyx_t_6);
9000   __pyx_t_3 = 0;
9001   __pyx_t_2 = 0;
9002   __pyx_t_4 = 0;
9003   __pyx_t_5 = 0;
9004   __pyx_t_6 = 0;
9005   if (likely(((PyObject *)__pyx_t_8) != Py_None)) {
9006     __pyx_t_1 = 0; __pyx_t_6 = ((PyObject *)__pyx_t_8); __Pyx_INCREF(__pyx_t_6);
9007   } else {
9008     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9009   }
9010   __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
9011   for (;;) {
9012
9013     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":481
9014  * 
9015  *     def enter_default_format(self):
9016  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),             # <<<<<<<<<<<<<<
9017  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
9018  *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
9019  */
9020     if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_6)) break;
9021     __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++;
9022     __Pyx_DECREF(__pyx_v_f);
9023     __pyx_v_f = __pyx_t_8;
9024     __pyx_t_8 = 0;
9025
9026     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":486
9027  *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
9028  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:
9029  *             if f.id not in self._format:             # <<<<<<<<<<<<<<
9030  *                 self._format[f.id] = f
9031  * 
9032  */
9033     __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;}
9034     __Pyx_GOTREF(__pyx_t_8);
9035     __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;}
9036     __Pyx_GOTREF(__pyx_t_5);
9037     __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;}
9038     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9039     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9040     if (__pyx_t_9) {
9041
9042       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":487
9043  *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.')]:
9044  *             if f.id not in self._format:
9045  *                 self._format[f.id] = f             # <<<<<<<<<<<<<<
9046  * 
9047  *     def parse_header( self, line ):
9048  */
9049       __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;}
9050       __Pyx_GOTREF(__pyx_t_5);
9051       __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;}
9052       __Pyx_GOTREF(__pyx_t_8);
9053       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;}
9054       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9055       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9056       goto __pyx_L7;
9057     }
9058     __pyx_L7:;
9059   }
9060   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9061
9062   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9063   goto __pyx_L0;
9064   __pyx_L1_error:;
9065   __Pyx_XDECREF(__pyx_t_2);
9066   __Pyx_XDECREF(__pyx_t_3);
9067   __Pyx_XDECREF(__pyx_t_4);
9068   __Pyx_XDECREF(__pyx_t_5);
9069   __Pyx_XDECREF(__pyx_t_6);
9070   __Pyx_XDECREF(__pyx_t_7);
9071   __Pyx_XDECREF(__pyx_t_8);
9072   __Pyx_AddTraceback("cvcf.VCF.enter_default_format");
9073   __pyx_r = NULL;
9074   __pyx_L0:;
9075   __Pyx_DECREF(__pyx_v_f);
9076   __Pyx_XGIVEREF(__pyx_r);
9077   __Pyx_RefNannyFinishContext();
9078   return __pyx_r;
9079 }
9080
9081 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":489
9082  *                 self._format[f.id] = f
9083  * 
9084  *     def parse_header( self, line ):             # <<<<<<<<<<<<<<
9085  *         assert line.startswith('##')
9086  *         elts = line[2:].split('=')
9087  */
9088
9089 static PyObject *__pyx_pf_4cvcf_3VCF_parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9090 static PyMethodDef __pyx_mdef_4cvcf_3VCF_parse_header = {__Pyx_NAMESTR("parse_header"), (PyCFunction)__pyx_pf_4cvcf_3VCF_parse_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
9091 static PyObject *__pyx_pf_4cvcf_3VCF_parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9092   PyObject *__pyx_v_self = 0;
9093   PyObject *__pyx_v_line = 0;
9094   PyObject *__pyx_v_elts;
9095   PyObject *__pyx_v_key;
9096   PyObject *__pyx_v_value;
9097   PyObject *__pyx_v_f;
9098   PyObject *__pyx_r = NULL;
9099   PyObject *__pyx_t_1 = NULL;
9100   PyObject *__pyx_t_2 = NULL;
9101   PyObject *__pyx_t_3 = NULL;
9102   int __pyx_t_4;
9103   PyObject *__pyx_t_5 = NULL;
9104   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,0};
9105   __Pyx_RefNannySetupContext("parse_header");
9106   __pyx_self = __pyx_self;
9107   if (unlikely(__pyx_kwds)) {
9108     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
9109     PyObject* values[2] = {0,0};
9110     switch (PyTuple_GET_SIZE(__pyx_args)) {
9111       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9112       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9113       case  0: break;
9114       default: goto __pyx_L5_argtuple_error;
9115     }
9116     switch (PyTuple_GET_SIZE(__pyx_args)) {
9117       case  0:
9118       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
9119       if (likely(values[0])) kw_args--;
9120       else goto __pyx_L5_argtuple_error;
9121       case  1:
9122       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
9123       if (likely(values[1])) kw_args--;
9124       else {
9125         __Pyx_RaiseArgtupleInvalid("parse_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9126       }
9127     }
9128     if (unlikely(kw_args > 0)) {
9129       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;}
9130     }
9131     __pyx_v_self = values[0];
9132     __pyx_v_line = values[1];
9133   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
9134     goto __pyx_L5_argtuple_error;
9135   } else {
9136     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
9137     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
9138   }
9139   goto __pyx_L4_argument_unpacking_done;
9140   __pyx_L5_argtuple_error:;
9141   __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;}
9142   __pyx_L3_error:;
9143   __Pyx_AddTraceback("cvcf.VCF.parse_header");
9144   __Pyx_RefNannyFinishContext();
9145   return NULL;
9146   __pyx_L4_argument_unpacking_done:;
9147   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
9148   __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
9149   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
9150   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
9151
9152   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":490
9153  * 
9154  *     def parse_header( self, line ):
9155  *         assert line.startswith('##')             # <<<<<<<<<<<<<<
9156  *         elts = line[2:].split('=')
9157  *         key = elts[0].strip()
9158  */
9159   #ifndef PYREX_WITHOUT_ASSERTIONS
9160   __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;}
9161   __Pyx_GOTREF(__pyx_t_1);
9162   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9163   __Pyx_GOTREF(__pyx_t_2);
9164   __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
9165   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_43));
9166   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
9167   __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9168   __Pyx_GOTREF(__pyx_t_3);
9169   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9170   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9171   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9172   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9173   if (unlikely(!__pyx_t_4)) {
9174     PyErr_SetNone(PyExc_AssertionError);
9175     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9176   }
9177   #endif
9178
9179   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":491
9180  *     def parse_header( self, line ):
9181  *         assert line.startswith('##')
9182  *         elts = line[2:].split('=')             # <<<<<<<<<<<<<<
9183  *         key = elts[0].strip()
9184  *         value = '='.join(elts[1:]).strip()
9185  */
9186   __pyx_t_3 = PySequence_GetSlice(__pyx_v_line, 2, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9187   __Pyx_GOTREF(__pyx_t_3);
9188   __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9189   __Pyx_GOTREF(__pyx_t_2);
9190   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9191   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9192   __Pyx_GOTREF(__pyx_t_3);
9193   __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
9194   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_8));
9195   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
9196   __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9197   __Pyx_GOTREF(__pyx_t_1);
9198   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9199   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9200   __Pyx_DECREF(__pyx_v_elts);
9201   __pyx_v_elts = __pyx_t_1;
9202   __pyx_t_1 = 0;
9203
9204   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":492
9205  *         assert line.startswith('##')
9206  *         elts = line[2:].split('=')
9207  *         key = elts[0].strip()             # <<<<<<<<<<<<<<
9208  *         value = '='.join(elts[1:]).strip()
9209  *         if key == "fileformat":
9210  */
9211   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9212   __Pyx_GOTREF(__pyx_t_1);
9213   __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__strip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9214   __Pyx_GOTREF(__pyx_t_3);
9215   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9216   __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9217   __Pyx_GOTREF(__pyx_t_1);
9218   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9219   __Pyx_DECREF(__pyx_v_key);
9220   __pyx_v_key = __pyx_t_1;
9221   __pyx_t_1 = 0;
9222
9223   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":493
9224  *         elts = line[2:].split('=')
9225  *         key = elts[0].strip()
9226  *         value = '='.join(elts[1:]).strip()             # <<<<<<<<<<<<<<
9227  *         if key == "fileformat":
9228  *             if value == "VCFv3.3":
9229  */
9230   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_8), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9231   __Pyx_GOTREF(__pyx_t_1);
9232   __pyx_t_3 = PySequence_GetSlice(__pyx_v_elts, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9233   __Pyx_GOTREF(__pyx_t_3);
9234   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9235   __Pyx_GOTREF(__pyx_t_2);
9236   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
9237   __Pyx_GIVEREF(__pyx_t_3);
9238   __pyx_t_3 = 0;
9239   __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9240   __Pyx_GOTREF(__pyx_t_3);
9241   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9242   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9243   __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9244   __Pyx_GOTREF(__pyx_t_2);
9245   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9246   __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9247   __Pyx_GOTREF(__pyx_t_3);
9248   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9249   __Pyx_DECREF(__pyx_v_value);
9250   __pyx_v_value = __pyx_t_3;
9251   __pyx_t_3 = 0;
9252
9253   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":494
9254  *         key = elts[0].strip()
9255  *         value = '='.join(elts[1:]).strip()
9256  *         if key == "fileformat":             # <<<<<<<<<<<<<<
9257  *             if value == "VCFv3.3":
9258  *                 self._version = 33
9259  */
9260   __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__fileformat), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9261   __Pyx_GOTREF(__pyx_t_3);
9262   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9263   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9264   if (__pyx_t_4) {
9265
9266     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":495
9267  *         value = '='.join(elts[1:]).strip()
9268  *         if key == "fileformat":
9269  *             if value == "VCFv3.3":             # <<<<<<<<<<<<<<
9270  *                 self._version = 33
9271  *             elif value == "VCFv4.0":
9272  */
9273     __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, ((PyObject *)__pyx_kp_s_44), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9274     __Pyx_GOTREF(__pyx_t_3);
9275     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9276     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9277     if (__pyx_t_4) {
9278
9279       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":496
9280  *         if key == "fileformat":
9281  *             if value == "VCFv3.3":
9282  *                 self._version = 33             # <<<<<<<<<<<<<<
9283  *             elif value == "VCFv4.0":
9284  *                 self._version = 40
9285  */
9286       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;}
9287       goto __pyx_L7;
9288     }
9289
9290     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":497
9291  *             if value == "VCFv3.3":
9292  *                 self._version = 33
9293  *             elif value == "VCFv4.0":             # <<<<<<<<<<<<<<
9294  *                 self._version = 40
9295  *             elif value == "VCFv4.1":
9296  */
9297     __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, ((PyObject *)__pyx_kp_s_45), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9298     __Pyx_GOTREF(__pyx_t_3);
9299     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9300     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9301     if (__pyx_t_4) {
9302
9303       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":498
9304  *                 self._version = 33
9305  *             elif value == "VCFv4.0":
9306  *                 self._version = 40             # <<<<<<<<<<<<<<
9307  *             elif value == "VCFv4.1":
9308  *                 # AH - for testing
9309  */
9310       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;}
9311       goto __pyx_L7;
9312     }
9313
9314     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":499
9315  *             elif value == "VCFv4.0":
9316  *                 self._version = 40
9317  *             elif value == "VCFv4.1":             # <<<<<<<<<<<<<<
9318  *                 # AH - for testing
9319  *                 self._version = 40
9320  */
9321     __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, ((PyObject *)__pyx_kp_s_46), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9322     __Pyx_GOTREF(__pyx_t_3);
9323     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9324     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9325     if (__pyx_t_4) {
9326
9327       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":501
9328  *             elif value == "VCFv4.1":
9329  *                 # AH - for testing
9330  *                 self._version = 40             # <<<<<<<<<<<<<<
9331  *             else:
9332  *                 self.error(line,self.UNKNOWN_FORMAT_STRING)
9333  */
9334       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;}
9335       goto __pyx_L7;
9336     }
9337     /*else*/ {
9338
9339       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":503
9340  *                 self._version = 40
9341  *             else:
9342  *                 self.error(line,self.UNKNOWN_FORMAT_STRING)             # <<<<<<<<<<<<<<
9343  *         elif key == "INFO":
9344  *             f = self.parse_format(line, value)
9345  */
9346       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9347       __Pyx_GOTREF(__pyx_t_3);
9348       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_47); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9349       __Pyx_GOTREF(__pyx_t_2);
9350       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9351       __Pyx_GOTREF(__pyx_t_1);
9352       __Pyx_INCREF(__pyx_v_line);
9353       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
9354       __Pyx_GIVEREF(__pyx_v_line);
9355       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
9356       __Pyx_GIVEREF(__pyx_t_2);
9357       __pyx_t_2 = 0;
9358       __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9359       __Pyx_GOTREF(__pyx_t_2);
9360       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9361       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9362       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9363     }
9364     __pyx_L7:;
9365     goto __pyx_L6;
9366   }
9367
9368   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":504
9369  *             else:
9370  *                 self.error(line,self.UNKNOWN_FORMAT_STRING)
9371  *         elif key == "INFO":             # <<<<<<<<<<<<<<
9372  *             f = self.parse_format(line, value)
9373  *             self._info[ f.id ] = f
9374  */
9375   __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__INFO), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9376   __Pyx_GOTREF(__pyx_t_2);
9377   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9378   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9379   if (__pyx_t_4) {
9380
9381     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":505
9382  *                 self.error(line,self.UNKNOWN_FORMAT_STRING)
9383  *         elif key == "INFO":
9384  *             f = self.parse_format(line, value)             # <<<<<<<<<<<<<<
9385  *             self._info[ f.id ] = f
9386  *         elif key == "FILTER":
9387  */
9388     __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 = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9389     __Pyx_GOTREF(__pyx_t_2);
9390     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9391     __Pyx_GOTREF(__pyx_t_1);
9392     __Pyx_INCREF(__pyx_v_line);
9393     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
9394     __Pyx_GIVEREF(__pyx_v_line);
9395     __Pyx_INCREF(__pyx_v_value);
9396     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
9397     __Pyx_GIVEREF(__pyx_v_value);
9398     __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9399     __Pyx_GOTREF(__pyx_t_3);
9400     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9401     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9402     __Pyx_DECREF(__pyx_v_f);
9403     __pyx_v_f = __pyx_t_3;
9404     __pyx_t_3 = 0;
9405
9406     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":506
9407  *         elif key == "INFO":
9408  *             f = self.parse_format(line, value)
9409  *             self._info[ f.id ] = f             # <<<<<<<<<<<<<<
9410  *         elif key == "FILTER":
9411  *             f = self.parse_format(line, value, filter=True)
9412  */
9413     __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9414     __Pyx_GOTREF(__pyx_t_3);
9415     __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9416     __Pyx_GOTREF(__pyx_t_1);
9417     if (PyObject_SetItem(__pyx_t_3, __pyx_t_1, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9418     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9419     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9420     goto __pyx_L6;
9421   }
9422
9423   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":507
9424  *             f = self.parse_format(line, value)
9425  *             self._info[ f.id ] = f
9426  *         elif key == "FILTER":             # <<<<<<<<<<<<<<
9427  *             f = self.parse_format(line, value, filter=True)
9428  *             self._filter[ f.id ] = f
9429  */
9430   __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__FILTER), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9431   __Pyx_GOTREF(__pyx_t_1);
9432   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9433   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9434   if (__pyx_t_4) {
9435
9436     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":508
9437  *             self._info[ f.id ] = f
9438  *         elif key == "FILTER":
9439  *             f = self.parse_format(line, value, filter=True)             # <<<<<<<<<<<<<<
9440  *             self._filter[ f.id ] = f
9441  *         elif key == "FORMAT":
9442  */
9443     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9444     __Pyx_GOTREF(__pyx_t_1);
9445     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9446     __Pyx_GOTREF(__pyx_t_3);
9447     __Pyx_INCREF(__pyx_v_line);
9448     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_line);
9449     __Pyx_GIVEREF(__pyx_v_line);
9450     __Pyx_INCREF(__pyx_v_value);
9451     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
9452     __Pyx_GIVEREF(__pyx_v_value);
9453     __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9454     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
9455     __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;}
9456     __Pyx_GOTREF(__pyx_t_5);
9457     if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__filter), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9458     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9459     __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9460     __Pyx_GOTREF(__pyx_t_5);
9461     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9462     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9463     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
9464     __Pyx_DECREF(__pyx_v_f);
9465     __pyx_v_f = __pyx_t_5;
9466     __pyx_t_5 = 0;
9467
9468     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":509
9469  *         elif key == "FILTER":
9470  *             f = self.parse_format(line, value, filter=True)
9471  *             self._filter[ f.id ] = f             # <<<<<<<<<<<<<<
9472  *         elif key == "FORMAT":
9473  *             f = self.parse_format(line, value)
9474  */
9475     __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;}
9476     __Pyx_GOTREF(__pyx_t_5);
9477     __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9478     __Pyx_GOTREF(__pyx_t_2);
9479     if (PyObject_SetItem(__pyx_t_5, __pyx_t_2, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9480     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9481     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9482     goto __pyx_L6;
9483   }
9484
9485   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":510
9486  *             f = self.parse_format(line, value, filter=True)
9487  *             self._filter[ f.id ] = f
9488  *         elif key == "FORMAT":             # <<<<<<<<<<<<<<
9489  *             f = self.parse_format(line, value)
9490  *             self._format[ f.id ] = f
9491  */
9492   __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__FORMAT), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9493   __Pyx_GOTREF(__pyx_t_2);
9494   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9495   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9496   if (__pyx_t_4) {
9497
9498     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":511
9499  *             self._filter[ f.id ] = f
9500  *         elif key == "FORMAT":
9501  *             f = self.parse_format(line, value)             # <<<<<<<<<<<<<<
9502  *             self._format[ f.id ] = f
9503  *         else:
9504  */
9505     __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 = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9506     __Pyx_GOTREF(__pyx_t_2);
9507     __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;}
9508     __Pyx_GOTREF(__pyx_t_5);
9509     __Pyx_INCREF(__pyx_v_line);
9510     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
9511     __Pyx_GIVEREF(__pyx_v_line);
9512     __Pyx_INCREF(__pyx_v_value);
9513     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_value);
9514     __Pyx_GIVEREF(__pyx_v_value);
9515     __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9516     __Pyx_GOTREF(__pyx_t_3);
9517     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9518     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9519     __Pyx_DECREF(__pyx_v_f);
9520     __pyx_v_f = __pyx_t_3;
9521     __pyx_t_3 = 0;
9522
9523     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":512
9524  *         elif key == "FORMAT":
9525  *             f = self.parse_format(line, value)
9526  *             self._format[ f.id ] = f             # <<<<<<<<<<<<<<
9527  *         else:
9528  *             # keep other keys in the header field
9529  */
9530     __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9531     __Pyx_GOTREF(__pyx_t_3);
9532     __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;}
9533     __Pyx_GOTREF(__pyx_t_5);
9534     if (PyObject_SetItem(__pyx_t_3, __pyx_t_5, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9535     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9536     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9537     goto __pyx_L6;
9538   }
9539   /*else*/ {
9540
9541     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":515
9542  *         else:
9543  *             # keep other keys in the header field
9544  *             self._header.append( (key,value) )             # <<<<<<<<<<<<<<
9545  * 
9546  * 
9547  */
9548     __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;}
9549     __Pyx_GOTREF(__pyx_t_5);
9550     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9551     __Pyx_GOTREF(__pyx_t_3);
9552     __Pyx_INCREF(__pyx_v_key);
9553     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
9554     __Pyx_GIVEREF(__pyx_v_key);
9555     __Pyx_INCREF(__pyx_v_value);
9556     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
9557     __Pyx_GIVEREF(__pyx_v_value);
9558     __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9559     __Pyx_GOTREF(__pyx_t_2);
9560     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9561     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9562     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9563   }
9564   __pyx_L6:;
9565
9566   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9567   goto __pyx_L0;
9568   __pyx_L1_error:;
9569   __Pyx_XDECREF(__pyx_t_1);
9570   __Pyx_XDECREF(__pyx_t_2);
9571   __Pyx_XDECREF(__pyx_t_3);
9572   __Pyx_XDECREF(__pyx_t_5);
9573   __Pyx_AddTraceback("cvcf.VCF.parse_header");
9574   __pyx_r = NULL;
9575   __pyx_L0:;
9576   __Pyx_DECREF(__pyx_v_elts);
9577   __Pyx_DECREF(__pyx_v_key);
9578   __Pyx_DECREF(__pyx_v_value);
9579   __Pyx_DECREF(__pyx_v_f);
9580   __Pyx_XGIVEREF(__pyx_r);
9581   __Pyx_RefNannyFinishContext();
9582   return __pyx_r;
9583 }
9584
9585 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":518
9586  * 
9587  * 
9588  *     def write_header( self, stream ):             # <<<<<<<<<<<<<<
9589  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
9590  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
9591  */
9592
9593 static PyObject *__pyx_pf_4cvcf_3VCF_write_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9594 static PyMethodDef __pyx_mdef_4cvcf_3VCF_write_header = {__Pyx_NAMESTR("write_header"), (PyCFunction)__pyx_pf_4cvcf_3VCF_write_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
9595 static PyObject *__pyx_pf_4cvcf_3VCF_write_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9596   PyObject *__pyx_v_self = 0;
9597   PyObject *__pyx_v_stream = 0;
9598   PyObject *__pyx_v_key;
9599   PyObject *__pyx_v_value;
9600   PyObject *__pyx_v_var;
9601   PyObject *__pyx_v_label;
9602   PyObject *__pyx_v_f;
9603   PyObject *__pyx_r = NULL;
9604   PyObject *__pyx_t_1 = NULL;
9605   PyObject *__pyx_t_2 = NULL;
9606   PyObject *__pyx_t_3 = NULL;
9607   PyObject *__pyx_t_4 = NULL;
9608   Py_ssize_t __pyx_t_5;
9609   PyObject *__pyx_t_6 = NULL;
9610   Py_ssize_t __pyx_t_7;
9611   PyObject *__pyx_t_8 = NULL;
9612   PyObject *__pyx_t_9 = NULL;
9613   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
9614   __Pyx_RefNannySetupContext("write_header");
9615   __pyx_self = __pyx_self;
9616   if (unlikely(__pyx_kwds)) {
9617     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
9618     PyObject* values[2] = {0,0};
9619     switch (PyTuple_GET_SIZE(__pyx_args)) {
9620       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9621       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9622       case  0: break;
9623       default: goto __pyx_L5_argtuple_error;
9624     }
9625     switch (PyTuple_GET_SIZE(__pyx_args)) {
9626       case  0:
9627       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
9628       if (likely(values[0])) kw_args--;
9629       else goto __pyx_L5_argtuple_error;
9630       case  1:
9631       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
9632       if (likely(values[1])) kw_args--;
9633       else {
9634         __Pyx_RaiseArgtupleInvalid("write_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
9635       }
9636     }
9637     if (unlikely(kw_args > 0)) {
9638       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;}
9639     }
9640     __pyx_v_self = values[0];
9641     __pyx_v_stream = values[1];
9642   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
9643     goto __pyx_L5_argtuple_error;
9644   } else {
9645     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
9646     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
9647   }
9648   goto __pyx_L4_argument_unpacking_done;
9649   __pyx_L5_argtuple_error:;
9650   __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;}
9651   __pyx_L3_error:;
9652   __Pyx_AddTraceback("cvcf.VCF.write_header");
9653   __Pyx_RefNannyFinishContext();
9654   return NULL;
9655   __pyx_L4_argument_unpacking_done:;
9656   __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
9657   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
9658   __pyx_v_var = Py_None; __Pyx_INCREF(Py_None);
9659   __pyx_v_label = Py_None; __Pyx_INCREF(Py_None);
9660   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
9661
9662   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":519
9663  * 
9664  *     def write_header( self, stream ):
9665  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))             # <<<<<<<<<<<<<<
9666  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
9667  *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:
9668  */
9669   __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;}
9670   __Pyx_GOTREF(__pyx_t_1);
9671   __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;}
9672   __Pyx_GOTREF(__pyx_t_2);
9673   __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;}
9674   __Pyx_GOTREF(__pyx_t_3);
9675   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9676   __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;}
9677   __Pyx_GOTREF(__pyx_t_2);
9678   __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;}
9679   __Pyx_GOTREF(__pyx_t_4);
9680   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9681   __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;}
9682   __Pyx_GOTREF(__pyx_t_2);
9683   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
9684   __Pyx_GIVEREF(__pyx_t_3);
9685   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9686   __Pyx_GIVEREF(__pyx_t_4);
9687   __pyx_t_3 = 0;
9688   __pyx_t_4 = 0;
9689   __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_48), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9690   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
9691   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9692   __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;}
9693   __Pyx_GOTREF(__pyx_t_2);
9694   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
9695   __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
9696   __pyx_t_4 = 0;
9697   __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9698   __Pyx_GOTREF(__pyx_t_4);
9699   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9700   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9701   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9702
9703   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":520
9704  *     def write_header( self, stream ):
9705  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
9706  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))             # <<<<<<<<<<<<<<
9707  *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:
9708  *             for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER"))))
9709  */
9710   __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;}
9711   __Pyx_GOTREF(__pyx_t_4);
9712   if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
9713     __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2);
9714   } else {
9715     __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;}
9716     __Pyx_GOTREF(__pyx_t_2);
9717   }
9718   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9719   for (;;) {
9720     if (likely(PyList_CheckExact(__pyx_t_2))) {
9721       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
9722       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
9723     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
9724       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9725       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
9726     } else {
9727       __pyx_t_4 = PyIter_Next(__pyx_t_2);
9728       if (!__pyx_t_4) {
9729         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9730         break;
9731       }
9732       __Pyx_GOTREF(__pyx_t_4);
9733     }
9734     if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
9735       PyObject* tuple = __pyx_t_4;
9736       __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
9737       __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
9738       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9739       __Pyx_DECREF(__pyx_v_key);
9740       __pyx_v_key = __pyx_t_1;
9741       __pyx_t_1 = 0;
9742       __Pyx_DECREF(__pyx_v_value);
9743       __pyx_v_value = __pyx_t_3;
9744       __pyx_t_3 = 0;
9745     } else {
9746       __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;}
9747       __Pyx_GOTREF(__pyx_t_6);
9748       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9749       __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;}
9750       __Pyx_GOTREF(__pyx_t_1);
9751       __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;}
9752       __Pyx_GOTREF(__pyx_t_3);
9753       if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9754       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9755       __Pyx_DECREF(__pyx_v_key);
9756       __pyx_v_key = __pyx_t_1;
9757       __pyx_t_1 = 0;
9758       __Pyx_DECREF(__pyx_v_value);
9759       __pyx_v_value = __pyx_t_3;
9760       __pyx_t_3 = 0;
9761     }
9762     __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;}
9763     __Pyx_GOTREF(__pyx_t_4);
9764     __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;}
9765     __Pyx_GOTREF(__pyx_t_3);
9766     __Pyx_INCREF(__pyx_v_key);
9767     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
9768     __Pyx_GIVEREF(__pyx_v_key);
9769     __Pyx_INCREF(__pyx_v_value);
9770     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
9771     __Pyx_GIVEREF(__pyx_v_value);
9772     __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9773     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
9774     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9775     __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;}
9776     __Pyx_GOTREF(__pyx_t_3);
9777     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
9778     __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
9779     __pyx_t_1 = 0;
9780     __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9781     __Pyx_GOTREF(__pyx_t_1);
9782     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9783     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9784     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9785   }
9786   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9787
9788   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":521
9789  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
9790  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
9791  *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:             # <<<<<<<<<<<<<<
9792  *             for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER"))))
9793  * 
9794  */
9795   __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;}
9796   __Pyx_GOTREF(__pyx_t_2);
9797   __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;}
9798   __Pyx_GOTREF(__pyx_t_1);
9799   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
9800   __Pyx_GIVEREF(__pyx_t_2);
9801   __Pyx_INCREF(((PyObject *)__pyx_n_s__INFO));
9802   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__INFO));
9803   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__INFO));
9804   __pyx_t_2 = 0;
9805   __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;}
9806   __Pyx_GOTREF(__pyx_t_2);
9807   __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;}
9808   __Pyx_GOTREF(__pyx_t_3);
9809   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
9810   __Pyx_GIVEREF(__pyx_t_2);
9811   __Pyx_INCREF(((PyObject *)__pyx_n_s__FILTER));
9812   PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__FILTER));
9813   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FILTER));
9814   __pyx_t_2 = 0;
9815   __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;}
9816   __Pyx_GOTREF(__pyx_t_2);
9817   __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;}
9818   __Pyx_GOTREF(__pyx_t_4);
9819   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
9820   __Pyx_GIVEREF(__pyx_t_2);
9821   __Pyx_INCREF(((PyObject *)__pyx_n_s__FORMAT));
9822   PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__FORMAT));
9823   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FORMAT));
9824   __pyx_t_2 = 0;
9825   __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;}
9826   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
9827   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
9828   __Pyx_GIVEREF(__pyx_t_1);
9829   PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
9830   __Pyx_GIVEREF(__pyx_t_3);
9831   PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
9832   __Pyx_GIVEREF(__pyx_t_4);
9833   __pyx_t_1 = 0;
9834   __pyx_t_3 = 0;
9835   __pyx_t_4 = 0;
9836   if (likely(((PyObject *)__pyx_t_2) != Py_None)) {
9837     __pyx_t_5 = 0; __pyx_t_4 = ((PyObject *)__pyx_t_2); __Pyx_INCREF(__pyx_t_4);
9838   } else {
9839     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9840   }
9841   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
9842   for (;;) {
9843     if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
9844     __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
9845     if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
9846       PyObject* tuple = __pyx_t_2;
9847       __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
9848       __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
9849       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9850       __Pyx_DECREF(__pyx_v_var);
9851       __pyx_v_var = __pyx_t_3;
9852       __pyx_t_3 = 0;
9853       __Pyx_DECREF(__pyx_v_label);
9854       __pyx_v_label = __pyx_t_1;
9855       __pyx_t_1 = 0;
9856     } else {
9857       __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;}
9858       __Pyx_GOTREF(__pyx_t_6);
9859       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9860       __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;}
9861       __Pyx_GOTREF(__pyx_t_3);
9862       __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;}
9863       __Pyx_GOTREF(__pyx_t_1);
9864       if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9865       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9866       __Pyx_DECREF(__pyx_v_var);
9867       __pyx_v_var = __pyx_t_3;
9868       __pyx_t_3 = 0;
9869       __Pyx_DECREF(__pyx_v_label);
9870       __pyx_v_label = __pyx_t_1;
9871       __pyx_t_1 = 0;
9872     }
9873
9874     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":522
9875  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
9876  *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:
9877  *             for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER"))))             # <<<<<<<<<<<<<<
9878  * 
9879  * 
9880  */
9881     __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;}
9882     __Pyx_GOTREF(__pyx_t_2);
9883     __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;}
9884     __Pyx_GOTREF(__pyx_t_1);
9885     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9886     if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
9887       __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
9888     } else {
9889       __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;}
9890       __Pyx_GOTREF(__pyx_t_2);
9891     }
9892     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9893     for (;;) {
9894       if (likely(PyList_CheckExact(__pyx_t_2))) {
9895         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
9896         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
9897       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
9898         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9899         __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
9900       } else {
9901         __pyx_t_1 = PyIter_Next(__pyx_t_2);
9902         if (!__pyx_t_1) {
9903           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9904           break;
9905         }
9906         __Pyx_GOTREF(__pyx_t_1);
9907       }
9908       __Pyx_DECREF(__pyx_v_f);
9909       __pyx_v_f = __pyx_t_1;
9910       __pyx_t_1 = 0;
9911       __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;}
9912       __Pyx_GOTREF(__pyx_t_1);
9913       __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;}
9914       __Pyx_GOTREF(__pyx_t_3);
9915       __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;}
9916       __Pyx_GOTREF(__pyx_t_6);
9917       __Pyx_INCREF(__pyx_v_f);
9918       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_f);
9919       __Pyx_GIVEREF(__pyx_v_f);
9920       __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;}
9921       __Pyx_GOTREF(((PyObject *)__pyx_t_8));
9922       __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;}
9923       __Pyx_GOTREF(__pyx_t_9);
9924       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;}
9925       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9926       __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_3, __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;}
9927       __Pyx_GOTREF(__pyx_t_9);
9928       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9929       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9930       __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
9931       __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;}
9932       __Pyx_GOTREF(__pyx_t_8);
9933       __Pyx_INCREF(__pyx_v_label);
9934       PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_label);
9935       __Pyx_GIVEREF(__pyx_v_label);
9936       PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
9937       __Pyx_GIVEREF(__pyx_t_9);
9938       __pyx_t_9 = 0;
9939       __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9940       __Pyx_GOTREF(((PyObject *)__pyx_t_9));
9941       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9942       __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;}
9943       __Pyx_GOTREF(__pyx_t_8);
9944       PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_9));
9945       __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
9946       __pyx_t_9 = 0;
9947       __pyx_t_9 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9948       __Pyx_GOTREF(__pyx_t_9);
9949       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9950       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9951       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9952     }
9953     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9954   }
9955   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9956
9957   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9958   goto __pyx_L0;
9959   __pyx_L1_error:;
9960   __Pyx_XDECREF(__pyx_t_1);
9961   __Pyx_XDECREF(__pyx_t_2);
9962   __Pyx_XDECREF(__pyx_t_3);
9963   __Pyx_XDECREF(__pyx_t_4);
9964   __Pyx_XDECREF(__pyx_t_6);
9965   __Pyx_XDECREF(__pyx_t_8);
9966   __Pyx_XDECREF(__pyx_t_9);
9967   __Pyx_AddTraceback("cvcf.VCF.write_header");
9968   __pyx_r = NULL;
9969   __pyx_L0:;
9970   __Pyx_DECREF(__pyx_v_key);
9971   __Pyx_DECREF(__pyx_v_value);
9972   __Pyx_DECREF(__pyx_v_var);
9973   __Pyx_DECREF(__pyx_v_label);
9974   __Pyx_DECREF(__pyx_v_f);
9975   __Pyx_XGIVEREF(__pyx_r);
9976   __Pyx_RefNannyFinishContext();
9977   return __pyx_r;
9978 }
9979
9980 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":525
9981  * 
9982  * 
9983  *     def parse_heading( self, line ):             # <<<<<<<<<<<<<<
9984  *         assert line.startswith('#')
9985  *         assert not line.startswith('##')
9986  */
9987
9988 static PyObject *__pyx_pf_4cvcf_3VCF_parse_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9989 static PyMethodDef __pyx_mdef_4cvcf_3VCF_parse_heading = {__Pyx_NAMESTR("parse_heading"), (PyCFunction)__pyx_pf_4cvcf_3VCF_parse_heading, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
9990 static PyObject *__pyx_pf_4cvcf_3VCF_parse_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9991   PyObject *__pyx_v_self = 0;
9992   PyObject *__pyx_v_line = 0;
9993   PyObject *__pyx_v_headings;
9994   PyObject *__pyx_v_i;
9995   PyObject *__pyx_v_s;
9996   PyObject *__pyx_v_err;
9997   PyObject *__pyx_v_x;
9998   PyObject *__pyx_v_y;
9999   PyObject *__pyx_r = NULL;
10000   PyObject *__pyx_t_1 = NULL;
10001   PyObject *__pyx_t_2 = NULL;
10002   PyObject *__pyx_t_3 = NULL;
10003   int __pyx_t_4;
10004   Py_ssize_t __pyx_t_5;
10005   int __pyx_t_6;
10006   int __pyx_t_7;
10007   Py_ssize_t __pyx_t_8;
10008   PyObject *__pyx_t_9 = NULL;
10009   PyObject *__pyx_t_10 = NULL;
10010   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,0};
10011   __Pyx_RefNannySetupContext("parse_heading");
10012   __pyx_self = __pyx_self;
10013   if (unlikely(__pyx_kwds)) {
10014     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
10015     PyObject* values[2] = {0,0};
10016     switch (PyTuple_GET_SIZE(__pyx_args)) {
10017       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10018       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10019       case  0: break;
10020       default: goto __pyx_L5_argtuple_error;
10021     }
10022     switch (PyTuple_GET_SIZE(__pyx_args)) {
10023       case  0:
10024       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
10025       if (likely(values[0])) kw_args--;
10026       else goto __pyx_L5_argtuple_error;
10027       case  1:
10028       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
10029       if (likely(values[1])) kw_args--;
10030       else {
10031         __Pyx_RaiseArgtupleInvalid("parse_heading", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10032       }
10033     }
10034     if (unlikely(kw_args > 0)) {
10035       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;}
10036     }
10037     __pyx_v_self = values[0];
10038     __pyx_v_line = values[1];
10039   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10040     goto __pyx_L5_argtuple_error;
10041   } else {
10042     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
10043     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
10044   }
10045   goto __pyx_L4_argument_unpacking_done;
10046   __pyx_L5_argtuple_error:;
10047   __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;}
10048   __pyx_L3_error:;
10049   __Pyx_AddTraceback("cvcf.VCF.parse_heading");
10050   __Pyx_RefNannyFinishContext();
10051   return NULL;
10052   __pyx_L4_argument_unpacking_done:;
10053   __pyx_v_headings = Py_None; __Pyx_INCREF(Py_None);
10054   __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
10055   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
10056   __pyx_v_err = Py_None; __Pyx_INCREF(Py_None);
10057   __pyx_v_x = Py_None; __Pyx_INCREF(Py_None);
10058   __pyx_v_y = Py_None; __Pyx_INCREF(Py_None);
10059
10060   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":526
10061  * 
10062  *     def parse_heading( self, line ):
10063  *         assert line.startswith('#')             # <<<<<<<<<<<<<<
10064  *         assert not line.startswith('##')
10065  *         headings = line[1:].split('\t')
10066  */
10067   #ifndef PYREX_WITHOUT_ASSERTIONS
10068   __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;}
10069   __Pyx_GOTREF(__pyx_t_1);
10070   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10071   __Pyx_GOTREF(__pyx_t_2);
10072   __Pyx_INCREF(((PyObject *)__pyx_kp_s_50));
10073   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_50));
10074   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_50));
10075   __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10076   __Pyx_GOTREF(__pyx_t_3);
10077   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10078   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10079   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10080   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10081   if (unlikely(!__pyx_t_4)) {
10082     PyErr_SetNone(PyExc_AssertionError);
10083     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10084   }
10085   #endif
10086
10087   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":527
10088  *     def parse_heading( self, line ):
10089  *         assert line.startswith('#')
10090  *         assert not line.startswith('##')             # <<<<<<<<<<<<<<
10091  *         headings = line[1:].split('\t')
10092  *         if len(headings)==1 and len(line[1:].split()) >= 9:
10093  */
10094   #ifndef PYREX_WITHOUT_ASSERTIONS
10095   __pyx_t_3 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__startswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10096   __Pyx_GOTREF(__pyx_t_3);
10097   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10098   __Pyx_GOTREF(__pyx_t_2);
10099   __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
10100   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_43));
10101   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
10102   __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10103   __Pyx_GOTREF(__pyx_t_1);
10104   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10105   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10106   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10107   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10108   if (unlikely(!(!__pyx_t_4))) {
10109     PyErr_SetNone(PyExc_AssertionError);
10110     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10111   }
10112   #endif
10113
10114   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":528
10115  *         assert line.startswith('#')
10116  *         assert not line.startswith('##')
10117  *         headings = line[1:].split('\t')             # <<<<<<<<<<<<<<
10118  *         if len(headings)==1 and len(line[1:].split()) >= 9:
10119  *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
10120  */
10121   __pyx_t_1 = 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;}
10122   __Pyx_GOTREF(__pyx_t_1);
10123   __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;}
10124   __Pyx_GOTREF(__pyx_t_2);
10125   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10126   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10127   __Pyx_GOTREF(__pyx_t_1);
10128   __Pyx_INCREF(((PyObject *)__pyx_kp_s_51));
10129   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_51));
10130   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_51));
10131   __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10132   __Pyx_GOTREF(__pyx_t_3);
10133   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10134   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10135   __Pyx_DECREF(__pyx_v_headings);
10136   __pyx_v_headings = __pyx_t_3;
10137   __pyx_t_3 = 0;
10138
10139   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":529
10140  *         assert not line.startswith('##')
10141  *         headings = line[1:].split('\t')
10142  *         if len(headings)==1 and len(line[1:].split()) >= 9:             # <<<<<<<<<<<<<<
10143  *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
10144  *             headings = line[1:].split()
10145  */
10146   __pyx_t_5 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10147   __pyx_t_4 = (__pyx_t_5 == 1);
10148   if (__pyx_t_4) {
10149     __pyx_t_3 = PySequence_GetSlice(__pyx_v_line, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10150     __Pyx_GOTREF(__pyx_t_3);
10151     __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10152     __Pyx_GOTREF(__pyx_t_1);
10153     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10154     __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 = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10155     __Pyx_GOTREF(__pyx_t_3);
10156     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10157     __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10158     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10159     __pyx_t_6 = (__pyx_t_5 >= 9);
10160     __pyx_t_7 = __pyx_t_6;
10161   } else {
10162     __pyx_t_7 = __pyx_t_4;
10163   }
10164   if (__pyx_t_7) {
10165
10166     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":530
10167  *         headings = line[1:].split('\t')
10168  *         if len(headings)==1 and len(line[1:].split()) >= 9:
10169  *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)             # <<<<<<<<<<<<<<
10170  *             headings = line[1:].split()
10171  * 
10172  */
10173     __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10174     __Pyx_GOTREF(__pyx_t_3);
10175     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_52); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10176     __Pyx_GOTREF(__pyx_t_1);
10177     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10178     __Pyx_GOTREF(__pyx_t_2);
10179     __Pyx_INCREF(__pyx_v_line);
10180     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
10181     __Pyx_GIVEREF(__pyx_v_line);
10182     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
10183     __Pyx_GIVEREF(__pyx_t_1);
10184     __pyx_t_1 = 0;
10185     __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10186     __Pyx_GOTREF(__pyx_t_1);
10187     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10188     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10189     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10190
10191     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":531
10192  *         if len(headings)==1 and len(line[1:].split()) >= 9:
10193  *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
10194  *             headings = line[1:].split()             # <<<<<<<<<<<<<<
10195  * 
10196  *         for i,s in enumerate(self._required):
10197  */
10198     __pyx_t_1 = PySequence_GetSlice(__pyx_v_line, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10199     __Pyx_GOTREF(__pyx_t_1);
10200     __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10201     __Pyx_GOTREF(__pyx_t_2);
10202     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10203     __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 = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10204     __Pyx_GOTREF(__pyx_t_1);
10205     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10206     __Pyx_DECREF(__pyx_v_headings);
10207     __pyx_v_headings = __pyx_t_1;
10208     __pyx_t_1 = 0;
10209     goto __pyx_L6;
10210   }
10211   __pyx_L6:;
10212
10213   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":533
10214  *             headings = line[1:].split()
10215  * 
10216  *         for i,s in enumerate(self._required):             # <<<<<<<<<<<<<<
10217  * 
10218  *             if len(headings)<=i or headings[i] != s:
10219  */
10220   __Pyx_INCREF(__pyx_int_0);
10221   __pyx_t_1 = __pyx_int_0;
10222   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___required); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10223   __Pyx_GOTREF(__pyx_t_2);
10224   if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
10225     __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
10226   } else {
10227     __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10228     __Pyx_GOTREF(__pyx_t_3);
10229   }
10230   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10231   for (;;) {
10232     if (likely(PyList_CheckExact(__pyx_t_3))) {
10233       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
10234       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
10235     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
10236       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
10237       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
10238     } else {
10239       __pyx_t_2 = PyIter_Next(__pyx_t_3);
10240       if (!__pyx_t_2) {
10241         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10242         break;
10243       }
10244       __Pyx_GOTREF(__pyx_t_2);
10245     }
10246     __Pyx_DECREF(__pyx_v_s);
10247     __pyx_v_s = __pyx_t_2;
10248     __pyx_t_2 = 0;
10249     __Pyx_INCREF(__pyx_t_1);
10250     __Pyx_DECREF(__pyx_v_i);
10251     __pyx_v_i = __pyx_t_1;
10252     __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10253     __Pyx_GOTREF(__pyx_t_2);
10254     __Pyx_DECREF(__pyx_t_1);
10255     __pyx_t_1 = __pyx_t_2;
10256     __pyx_t_2 = 0;
10257
10258     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":535
10259  *         for i,s in enumerate(self._required):
10260  * 
10261  *             if len(headings)<=i or headings[i] != s:             # <<<<<<<<<<<<<<
10262  * 
10263  *                 if len(headings) <= i:
10264  */
10265     __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;}
10266     __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10267     __Pyx_GOTREF(__pyx_t_2);
10268     __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __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;}
10269     __Pyx_GOTREF(__pyx_t_9);
10270     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10271     __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10272     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10273     if (!__pyx_t_7) {
10274       __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;}
10275       __Pyx_GOTREF(__pyx_t_9);
10276       __pyx_t_2 = PyObject_RichCompare(__pyx_t_9, __pyx_v_s, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10277       __Pyx_GOTREF(__pyx_t_2);
10278       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10279       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10280       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10281       __pyx_t_6 = __pyx_t_4;
10282     } else {
10283       __pyx_t_6 = __pyx_t_7;
10284     }
10285     if (__pyx_t_6) {
10286
10287       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":537
10288  *             if len(headings)<=i or headings[i] != s:
10289  * 
10290  *                 if len(headings) <= i:             # <<<<<<<<<<<<<<
10291  *                     err = "(%sth entry not found)" % (i+1)
10292  *                 else:
10293  */
10294       __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;}
10295       __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10296       __Pyx_GOTREF(__pyx_t_2);
10297       __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __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;}
10298       __Pyx_GOTREF(__pyx_t_9);
10299       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10300       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10301       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10302       if (__pyx_t_6) {
10303
10304         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":538
10305  * 
10306  *                 if len(headings) <= i:
10307  *                     err = "(%sth entry not found)" % (i+1)             # <<<<<<<<<<<<<<
10308  *                 else:
10309  *                     err = "(found %s, expected %s)" % (headings[i],s)
10310  */
10311         __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;}
10312         __Pyx_GOTREF(__pyx_t_9);
10313         __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_53), __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10314         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
10315         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10316         __Pyx_DECREF(__pyx_v_err);
10317         __pyx_v_err = ((PyObject *)__pyx_t_2);
10318         __pyx_t_2 = 0;
10319         goto __pyx_L10;
10320       }
10321       /*else*/ {
10322
10323         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":540
10324  *                     err = "(%sth entry not found)" % (i+1)
10325  *                 else:
10326  *                     err = "(found %s, expected %s)" % (headings[i],s)             # <<<<<<<<<<<<<<
10327  * 
10328  *                 #self.error(line,self.BADLY_FORMATTED_HEADING,err)
10329  */
10330         __pyx_t_2 = PyObject_GetItem(__pyx_v_headings, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10331         __Pyx_GOTREF(__pyx_t_2);
10332         __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;}
10333         __Pyx_GOTREF(__pyx_t_9);
10334         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
10335         __Pyx_GIVEREF(__pyx_t_2);
10336         __Pyx_INCREF(__pyx_v_s);
10337         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_s);
10338         __Pyx_GIVEREF(__pyx_v_s);
10339         __pyx_t_2 = 0;
10340         __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10341         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
10342         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10343         __Pyx_DECREF(__pyx_v_err);
10344         __pyx_v_err = ((PyObject *)__pyx_t_2);
10345         __pyx_t_2 = 0;
10346       }
10347       __pyx_L10:;
10348
10349       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":545
10350  * 
10351  *                 # allow FORMAT column to be absent
10352  *                 if len(headings) == 8:             # <<<<<<<<<<<<<<
10353  *                     headings.append("FORMAT")
10354  *                 else:
10355  */
10356       __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;}
10357       __pyx_t_6 = (__pyx_t_8 == 8);
10358       if (__pyx_t_6) {
10359
10360         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":546
10361  *                 # allow FORMAT column to be absent
10362  *                 if len(headings) == 8:
10363  *                     headings.append("FORMAT")             # <<<<<<<<<<<<<<
10364  *                 else:
10365  *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)
10366  */
10367         __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_headings, ((PyObject *)__pyx_n_s__FORMAT)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10368         __Pyx_GOTREF(__pyx_t_2);
10369         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10370         goto __pyx_L11;
10371       }
10372       /*else*/ {
10373
10374         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":548
10375  *                     headings.append("FORMAT")
10376  *                 else:
10377  *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)             # <<<<<<<<<<<<<<
10378  * 
10379  *         self._samples = headings[9:]
10380  */
10381         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10382         __Pyx_GOTREF(__pyx_t_2);
10383         __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_55); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10384         __Pyx_GOTREF(__pyx_t_9);
10385         __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;}
10386         __Pyx_GOTREF(__pyx_t_10);
10387         __Pyx_INCREF(__pyx_v_line);
10388         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
10389         __Pyx_GIVEREF(__pyx_v_line);
10390         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
10391         __Pyx_GIVEREF(__pyx_t_9);
10392         __Pyx_INCREF(__pyx_v_err);
10393         PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_err);
10394         __Pyx_GIVEREF(__pyx_v_err);
10395         __pyx_t_9 = 0;
10396         __pyx_t_9 = PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10397         __Pyx_GOTREF(__pyx_t_9);
10398         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10399         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10400         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10401       }
10402       __pyx_L11:;
10403       goto __pyx_L9;
10404     }
10405     __pyx_L9:;
10406   }
10407   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10408   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10409
10410   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":550
10411  *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)
10412  * 
10413  *         self._samples = headings[9:]             # <<<<<<<<<<<<<<
10414  *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
10415  * 
10416  */
10417   __pyx_t_1 = PySequence_GetSlice(__pyx_v_headings, 9, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10418   __Pyx_GOTREF(__pyx_t_1);
10419   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___samples, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10420   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10421
10422   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":551
10423  * 
10424  *         self._samples = headings[9:]
10425  *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )             # <<<<<<<<<<<<<<
10426  * 
10427  *     def write_heading( self, stream ):
10428  */
10429   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10430   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10431   __Pyx_INCREF(__pyx_int_0);
10432   __pyx_t_3 = __pyx_int_0;
10433   __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;}
10434   __Pyx_GOTREF(__pyx_t_9);
10435   if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
10436     __pyx_t_5 = 0; __pyx_t_10 = __pyx_t_9; __Pyx_INCREF(__pyx_t_10);
10437   } else {
10438     __pyx_t_5 = -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;}
10439     __Pyx_GOTREF(__pyx_t_10);
10440   }
10441   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10442   for (;;) {
10443     if (likely(PyList_CheckExact(__pyx_t_10))) {
10444       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_10)) break;
10445       __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++;
10446     } else if (likely(PyTuple_CheckExact(__pyx_t_10))) {
10447       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
10448       __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++;
10449     } else {
10450       __pyx_t_9 = PyIter_Next(__pyx_t_10);
10451       if (!__pyx_t_9) {
10452         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10453         break;
10454       }
10455       __Pyx_GOTREF(__pyx_t_9);
10456     }
10457     __Pyx_DECREF(__pyx_v_y);
10458     __pyx_v_y = __pyx_t_9;
10459     __pyx_t_9 = 0;
10460     __Pyx_INCREF(__pyx_t_3);
10461     __Pyx_DECREF(__pyx_v_x);
10462     __pyx_v_x = __pyx_t_3;
10463     __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10464     __Pyx_GOTREF(__pyx_t_9);
10465     __Pyx_DECREF(__pyx_t_3);
10466     __pyx_t_3 = __pyx_t_9;
10467     __pyx_t_9 = 0;
10468     __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;}
10469     __Pyx_GOTREF(__pyx_t_9);
10470     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10471     __Pyx_GOTREF(__pyx_t_2);
10472     __Pyx_INCREF(__pyx_v_y);
10473     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_y);
10474     __Pyx_GIVEREF(__pyx_v_y);
10475     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
10476     __Pyx_GIVEREF(__pyx_t_9);
10477     __pyx_t_9 = 0;
10478     if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10479     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10480   }
10481   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10482   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10483   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10484   __Pyx_GOTREF(__pyx_t_3);
10485   __Pyx_INCREF(((PyObject *)__pyx_t_1));
10486   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
10487   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
10488   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
10489   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10490   __Pyx_GOTREF(__pyx_t_1);
10491   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10492   if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___sample2column, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10493   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10494
10495   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10496   goto __pyx_L0;
10497   __pyx_L1_error:;
10498   __Pyx_XDECREF(__pyx_t_1);
10499   __Pyx_XDECREF(__pyx_t_2);
10500   __Pyx_XDECREF(__pyx_t_3);
10501   __Pyx_XDECREF(__pyx_t_9);
10502   __Pyx_XDECREF(__pyx_t_10);
10503   __Pyx_AddTraceback("cvcf.VCF.parse_heading");
10504   __pyx_r = NULL;
10505   __pyx_L0:;
10506   __Pyx_DECREF(__pyx_v_headings);
10507   __Pyx_DECREF(__pyx_v_i);
10508   __Pyx_DECREF(__pyx_v_s);
10509   __Pyx_DECREF(__pyx_v_err);
10510   __Pyx_DECREF(__pyx_v_x);
10511   __Pyx_DECREF(__pyx_v_y);
10512   __Pyx_XGIVEREF(__pyx_r);
10513   __Pyx_RefNannyFinishContext();
10514   return __pyx_r;
10515 }
10516
10517 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":553
10518  *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
10519  * 
10520  *     def write_heading( self, stream ):             # <<<<<<<<<<<<<<
10521  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
10522  * 
10523  */
10524
10525 static PyObject *__pyx_pf_4cvcf_3VCF_write_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10526 static PyMethodDef __pyx_mdef_4cvcf_3VCF_write_heading = {__Pyx_NAMESTR("write_heading"), (PyCFunction)__pyx_pf_4cvcf_3VCF_write_heading, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
10527 static PyObject *__pyx_pf_4cvcf_3VCF_write_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10528   PyObject *__pyx_v_self = 0;
10529   PyObject *__pyx_v_stream = 0;
10530   PyObject *__pyx_r = NULL;
10531   PyObject *__pyx_t_1 = NULL;
10532   PyObject *__pyx_t_2 = NULL;
10533   PyObject *__pyx_t_3 = NULL;
10534   PyObject *__pyx_t_4 = NULL;
10535   PyObject *__pyx_t_5 = NULL;
10536   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
10537   __Pyx_RefNannySetupContext("write_heading");
10538   __pyx_self = __pyx_self;
10539   if (unlikely(__pyx_kwds)) {
10540     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
10541     PyObject* values[2] = {0,0};
10542     switch (PyTuple_GET_SIZE(__pyx_args)) {
10543       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10544       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10545       case  0: break;
10546       default: goto __pyx_L5_argtuple_error;
10547     }
10548     switch (PyTuple_GET_SIZE(__pyx_args)) {
10549       case  0:
10550       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
10551       if (likely(values[0])) kw_args--;
10552       else goto __pyx_L5_argtuple_error;
10553       case  1:
10554       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
10555       if (likely(values[1])) kw_args--;
10556       else {
10557         __Pyx_RaiseArgtupleInvalid("write_heading", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10558       }
10559     }
10560     if (unlikely(kw_args > 0)) {
10561       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;}
10562     }
10563     __pyx_v_self = values[0];
10564     __pyx_v_stream = values[1];
10565   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10566     goto __pyx_L5_argtuple_error;
10567   } else {
10568     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
10569     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
10570   }
10571   goto __pyx_L4_argument_unpacking_done;
10572   __pyx_L5_argtuple_error:;
10573   __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;}
10574   __pyx_L3_error:;
10575   __Pyx_AddTraceback("cvcf.VCF.write_heading");
10576   __Pyx_RefNannyFinishContext();
10577   return NULL;
10578   __pyx_L4_argument_unpacking_done:;
10579
10580   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":554
10581  * 
10582  *     def write_heading( self, stream ):
10583  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")             # <<<<<<<<<<<<<<
10584  * 
10585  *     def convertGT(self, GTstring):
10586  */
10587   __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;}
10588   __Pyx_GOTREF(__pyx_t_1);
10589   __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_51), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10590   __Pyx_GOTREF(__pyx_t_2);
10591   __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;}
10592   __Pyx_GOTREF(__pyx_t_3);
10593   __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;}
10594   __Pyx_GOTREF(__pyx_t_4);
10595   __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;}
10596   __Pyx_GOTREF(__pyx_t_5);
10597   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10598   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10599   __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;}
10600   __Pyx_GOTREF(__pyx_t_4);
10601   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10602   __Pyx_GIVEREF(__pyx_t_5);
10603   __pyx_t_5 = 0;
10604   __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10605   __Pyx_GOTREF(__pyx_t_5);
10606   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10607   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10608   __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_50), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10609   __Pyx_GOTREF(__pyx_t_4);
10610   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10611   __pyx_t_5 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10612   __Pyx_GOTREF(__pyx_t_5);
10613   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10614   __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;}
10615   __Pyx_GOTREF(__pyx_t_4);
10616   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10617   __Pyx_GIVEREF(__pyx_t_5);
10618   __pyx_t_5 = 0;
10619   __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10620   __Pyx_GOTREF(__pyx_t_5);
10621   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10622   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10623   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10624
10625   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10626   goto __pyx_L0;
10627   __pyx_L1_error:;
10628   __Pyx_XDECREF(__pyx_t_1);
10629   __Pyx_XDECREF(__pyx_t_2);
10630   __Pyx_XDECREF(__pyx_t_3);
10631   __Pyx_XDECREF(__pyx_t_4);
10632   __Pyx_XDECREF(__pyx_t_5);
10633   __Pyx_AddTraceback("cvcf.VCF.write_heading");
10634   __pyx_r = NULL;
10635   __pyx_L0:;
10636   __Pyx_XGIVEREF(__pyx_r);
10637   __Pyx_RefNannyFinishContext();
10638   return __pyx_r;
10639 }
10640
10641 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":556
10642  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
10643  * 
10644  *     def convertGT(self, GTstring):             # <<<<<<<<<<<<<<
10645  *         if GTstring == ".": return ["."]
10646  *         try:
10647  */
10648
10649 static PyObject *__pyx_pf_4cvcf_3VCF_convertGT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10650 static PyMethodDef __pyx_mdef_4cvcf_3VCF_convertGT = {__Pyx_NAMESTR("convertGT"), (PyCFunction)__pyx_pf_4cvcf_3VCF_convertGT, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
10651 static PyObject *__pyx_pf_4cvcf_3VCF_convertGT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10652   PyObject *__pyx_v_self = 0;
10653   PyObject *__pyx_v_GTstring = 0;
10654   PyObject *__pyx_v_gts;
10655   PyObject *__pyx_r = NULL;
10656   PyObject *__pyx_t_1 = NULL;
10657   int __pyx_t_2;
10658   PyObject *__pyx_t_3 = NULL;
10659   PyObject *__pyx_t_4 = NULL;
10660   Py_ssize_t __pyx_t_5;
10661   int __pyx_t_6;
10662   int __pyx_t_7;
10663   Py_ssize_t __pyx_t_8;
10664   PyObject *__pyx_t_9 = NULL;
10665   int __pyx_t_10;
10666   PyObject *__pyx_t_11 = NULL;
10667   PyObject *__pyx_t_12 = NULL;
10668   PyObject *__pyx_t_13 = NULL;
10669   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__GTstring,0};
10670   __Pyx_RefNannySetupContext("convertGT");
10671   __pyx_self = __pyx_self;
10672   if (unlikely(__pyx_kwds)) {
10673     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
10674     PyObject* values[2] = {0,0};
10675     switch (PyTuple_GET_SIZE(__pyx_args)) {
10676       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10677       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10678       case  0: break;
10679       default: goto __pyx_L5_argtuple_error;
10680     }
10681     switch (PyTuple_GET_SIZE(__pyx_args)) {
10682       case  0:
10683       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
10684       if (likely(values[0])) kw_args--;
10685       else goto __pyx_L5_argtuple_error;
10686       case  1:
10687       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__GTstring);
10688       if (likely(values[1])) kw_args--;
10689       else {
10690         __Pyx_RaiseArgtupleInvalid("convertGT", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10691       }
10692     }
10693     if (unlikely(kw_args > 0)) {
10694       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;}
10695     }
10696     __pyx_v_self = values[0];
10697     __pyx_v_GTstring = values[1];
10698   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10699     goto __pyx_L5_argtuple_error;
10700   } else {
10701     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
10702     __pyx_v_GTstring = PyTuple_GET_ITEM(__pyx_args, 1);
10703   }
10704   goto __pyx_L4_argument_unpacking_done;
10705   __pyx_L5_argtuple_error:;
10706   __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;}
10707   __pyx_L3_error:;
10708   __Pyx_AddTraceback("cvcf.VCF.convertGT");
10709   __Pyx_RefNannyFinishContext();
10710   return NULL;
10711   __pyx_L4_argument_unpacking_done:;
10712   __pyx_v_gts = Py_None; __Pyx_INCREF(Py_None);
10713
10714   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":557
10715  * 
10716  *     def convertGT(self, GTstring):
10717  *         if GTstring == ".": return ["."]             # <<<<<<<<<<<<<<
10718  *         try:
10719  *             gts = gtsRegEx.split(GTstring)
10720  */
10721   __pyx_t_1 = PyObject_RichCompare(__pyx_v_GTstring, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10722   __Pyx_GOTREF(__pyx_t_1);
10723   __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;}
10724   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10725   if (__pyx_t_2) {
10726     __Pyx_XDECREF(__pyx_r);
10727     __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;}
10728     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10729     __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
10730     PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_6));
10731     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
10732     __pyx_r = ((PyObject *)__pyx_t_1);
10733     __pyx_t_1 = 0;
10734     goto __pyx_L0;
10735     goto __pyx_L6;
10736   }
10737   __pyx_L6:;
10738
10739   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":558
10740  *     def convertGT(self, GTstring):
10741  *         if GTstring == ".": return ["."]
10742  *         try:             # <<<<<<<<<<<<<<
10743  *             gts = gtsRegEx.split(GTstring)
10744  *             if len(gts) == 1: return [int(gts[0])]
10745  */
10746   {
10747     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
10748     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
10749     __Pyx_XGOTREF(__pyx_save_exc_type);
10750     __Pyx_XGOTREF(__pyx_save_exc_value);
10751     __Pyx_XGOTREF(__pyx_save_exc_tb);
10752     /*try:*/ {
10753
10754       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":559
10755  *         if GTstring == ".": return ["."]
10756  *         try:
10757  *             gts = gtsRegEx.split(GTstring)             # <<<<<<<<<<<<<<
10758  *             if len(gts) == 1: return [int(gts[0])]
10759  *             if len(gts) != 2: raise ValueError()
10760  */
10761       __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;}
10762       __Pyx_GOTREF(__pyx_t_1);
10763       __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;}
10764       __Pyx_GOTREF(__pyx_t_3);
10765       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10766       __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;}
10767       __Pyx_GOTREF(__pyx_t_1);
10768       __Pyx_INCREF(__pyx_v_GTstring);
10769       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_GTstring);
10770       __Pyx_GIVEREF(__pyx_v_GTstring);
10771       __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10772       __Pyx_GOTREF(__pyx_t_4);
10773       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10774       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10775       __Pyx_DECREF(__pyx_v_gts);
10776       __pyx_v_gts = __pyx_t_4;
10777       __pyx_t_4 = 0;
10778
10779       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":560
10780  *         try:
10781  *             gts = gtsRegEx.split(GTstring)
10782  *             if len(gts) == 1: return [int(gts[0])]             # <<<<<<<<<<<<<<
10783  *             if len(gts) != 2: raise ValueError()
10784  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
10785  */
10786       __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;}
10787       __pyx_t_2 = (__pyx_t_5 == 1);
10788       if (__pyx_t_2) {
10789         __Pyx_XDECREF(__pyx_r);
10790         __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;}
10791         __Pyx_GOTREF(__pyx_t_4);
10792         __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;}
10793         __Pyx_GOTREF(__pyx_t_1);
10794         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
10795         __Pyx_GIVEREF(__pyx_t_4);
10796         __pyx_t_4 = 0;
10797         __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10798         __Pyx_GOTREF(__pyx_t_4);
10799         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10800         __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;}
10801         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10802         PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
10803         __Pyx_GIVEREF(__pyx_t_4);
10804         __pyx_t_4 = 0;
10805         __pyx_r = ((PyObject *)__pyx_t_1);
10806         __pyx_t_1 = 0;
10807         goto __pyx_L11_try_return;
10808         goto __pyx_L15;
10809       }
10810       __pyx_L15:;
10811
10812       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":561
10813  *             gts = gtsRegEx.split(GTstring)
10814  *             if len(gts) == 1: return [int(gts[0])]
10815  *             if len(gts) != 2: raise ValueError()             # <<<<<<<<<<<<<<
10816  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
10817  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
10818  */
10819       __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;}
10820       __pyx_t_2 = (__pyx_t_5 != 2);
10821       if (__pyx_t_2) {
10822         __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;}
10823         __Pyx_GOTREF(__pyx_t_1);
10824         __Pyx_Raise(__pyx_t_1, 0, 0);
10825         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10826         {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10827         goto __pyx_L16;
10828       }
10829       __pyx_L16:;
10830
10831       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":562
10832  *             if len(gts) == 1: return [int(gts[0])]
10833  *             if len(gts) != 2: raise ValueError()
10834  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]             # <<<<<<<<<<<<<<
10835  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
10836  *         except ValueError:
10837  */
10838       __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;}
10839       __Pyx_GOTREF(__pyx_t_1);
10840       __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10841       __Pyx_GOTREF(__pyx_t_4);
10842       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10843       __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;}
10844       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10845       if (__pyx_t_2) {
10846         __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;}
10847         __Pyx_GOTREF(__pyx_t_4);
10848         __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10849         __Pyx_GOTREF(__pyx_t_1);
10850         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10851         __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;}
10852         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10853         __pyx_t_7 = __pyx_t_6;
10854       } else {
10855         __pyx_t_7 = __pyx_t_2;
10856       }
10857       if (__pyx_t_7) {
10858         __Pyx_XDECREF(__pyx_r);
10859         __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;}
10860         __Pyx_GOTREF(__pyx_t_1);
10861         __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;}
10862         __Pyx_GOTREF(__pyx_t_4);
10863         __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;}
10864         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10865         __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;}
10866         __Pyx_GOTREF(__pyx_t_4);
10867         __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;}
10868         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10869         __pyx_t_4 = 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;}
10870         __Pyx_GOTREF(__pyx_t_4);
10871         __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;}
10872         __Pyx_GOTREF(__pyx_t_3);
10873         __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;}
10874         __Pyx_GOTREF(((PyObject *)__pyx_t_9));
10875         PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
10876         __Pyx_GIVEREF(__pyx_t_1);
10877         PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_4);
10878         __Pyx_GIVEREF(__pyx_t_4);
10879         PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
10880         __Pyx_GIVEREF(__pyx_t_3);
10881         __pyx_t_1 = 0;
10882         __pyx_t_4 = 0;
10883         __pyx_t_3 = 0;
10884         __pyx_r = ((PyObject *)__pyx_t_9);
10885         __pyx_t_9 = 0;
10886         goto __pyx_L11_try_return;
10887         goto __pyx_L17;
10888       }
10889       __pyx_L17:;
10890
10891       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":563
10892  *             if len(gts) != 2: raise ValueError()
10893  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
10894  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]             # <<<<<<<<<<<<<<
10895  *         except ValueError:
10896  *             self.error(self._line,self.BAD_GENOTYPE,GTstring)
10897  */
10898       __Pyx_XDECREF(__pyx_r);
10899       __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;}
10900       __Pyx_GOTREF(__pyx_t_9);
10901       __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;}
10902       __Pyx_GOTREF(__pyx_t_3);
10903       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
10904       __Pyx_GIVEREF(__pyx_t_9);
10905       __pyx_t_9 = 0;
10906       __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10907       __Pyx_GOTREF(__pyx_t_9);
10908       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10909       __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;}
10910       __Pyx_GOTREF(__pyx_t_3);
10911       __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;}
10912       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10913       __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;}
10914       __Pyx_GOTREF(__pyx_t_3);
10915       __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;}
10916       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10917       __pyx_t_3 = 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;}
10918       __Pyx_GOTREF(__pyx_t_3);
10919       __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;}
10920       __Pyx_GOTREF(__pyx_t_4);
10921       __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;}
10922       __Pyx_GOTREF(__pyx_t_1);
10923       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
10924       __Pyx_GIVEREF(__pyx_t_4);
10925       __pyx_t_4 = 0;
10926       __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
10927       __Pyx_GOTREF(__pyx_t_4);
10928       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10929       __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;}
10930       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
10931       PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
10932       __Pyx_GIVEREF(__pyx_t_9);
10933       PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
10934       __Pyx_GIVEREF(__pyx_t_3);
10935       PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
10936       __Pyx_GIVEREF(__pyx_t_4);
10937       __pyx_t_9 = 0;
10938       __pyx_t_3 = 0;
10939       __pyx_t_4 = 0;
10940       __pyx_r = ((PyObject *)__pyx_t_1);
10941       __pyx_t_1 = 0;
10942       goto __pyx_L11_try_return;
10943     }
10944     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
10945     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
10946     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
10947     goto __pyx_L14_try_end;
10948     __pyx_L11_try_return:;
10949     __Pyx_XGIVEREF(__pyx_save_exc_type);
10950     __Pyx_XGIVEREF(__pyx_save_exc_value);
10951     __Pyx_XGIVEREF(__pyx_save_exc_tb);
10952     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
10953     goto __pyx_L0;
10954     __pyx_L7_error:;
10955     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10956     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10957     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10958     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10959
10960     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":564
10961  *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
10962  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
10963  *         except ValueError:             # <<<<<<<<<<<<<<
10964  *             self.error(self._line,self.BAD_GENOTYPE,GTstring)
10965  *             return [".","|","."]
10966  */
10967     __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
10968     if (__pyx_t_10) {
10969       __Pyx_AddTraceback("cvcf.VCF.convertGT");
10970       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;}
10971       __Pyx_GOTREF(__pyx_t_1);
10972       __Pyx_GOTREF(__pyx_t_4);
10973       __Pyx_GOTREF(__pyx_t_3);
10974
10975       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":565
10976  *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
10977  *         except ValueError:
10978  *             self.error(self._line,self.BAD_GENOTYPE,GTstring)             # <<<<<<<<<<<<<<
10979  *             return [".","|","."]
10980  * 
10981  */
10982       __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;}
10983       __Pyx_GOTREF(__pyx_t_9);
10984       __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;}
10985       __Pyx_GOTREF(__pyx_t_11);
10986       __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;}
10987       __Pyx_GOTREF(__pyx_t_12);
10988       __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;}
10989       __Pyx_GOTREF(__pyx_t_13);
10990       PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11);
10991       __Pyx_GIVEREF(__pyx_t_11);
10992       PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12);
10993       __Pyx_GIVEREF(__pyx_t_12);
10994       __Pyx_INCREF(__pyx_v_GTstring);
10995       PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_GTstring);
10996       __Pyx_GIVEREF(__pyx_v_GTstring);
10997       __pyx_t_11 = 0;
10998       __pyx_t_12 = 0;
10999       __pyx_t_12 = PyObject_Call(__pyx_t_9, __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;}
11000       __Pyx_GOTREF(__pyx_t_12);
11001       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11002       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
11003       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11004
11005       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":566
11006  *         except ValueError:
11007  *             self.error(self._line,self.BAD_GENOTYPE,GTstring)
11008  *             return [".","|","."]             # <<<<<<<<<<<<<<
11009  * 
11010  * 
11011  */
11012       __Pyx_XDECREF(__pyx_r);
11013       __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;}
11014       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
11015       __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
11016       PyList_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_kp_s_6));
11017       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
11018       __Pyx_INCREF(((PyObject *)__pyx_kp_s_57));
11019       PyList_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_kp_s_57));
11020       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_57));
11021       __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
11022       PyList_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_kp_s_6));
11023       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
11024       __pyx_r = ((PyObject *)__pyx_t_12);
11025       __pyx_t_12 = 0;
11026       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11027       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11028       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11029       goto __pyx_L10_except_return;
11030       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11031       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11032       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11033       goto __pyx_L8_exception_handled;
11034     }
11035     __pyx_L9_except_error:;
11036     __Pyx_XGIVEREF(__pyx_save_exc_type);
11037     __Pyx_XGIVEREF(__pyx_save_exc_value);
11038     __Pyx_XGIVEREF(__pyx_save_exc_tb);
11039     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11040     goto __pyx_L1_error;
11041     __pyx_L10_except_return:;
11042     __Pyx_XGIVEREF(__pyx_save_exc_type);
11043     __Pyx_XGIVEREF(__pyx_save_exc_value);
11044     __Pyx_XGIVEREF(__pyx_save_exc_tb);
11045     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11046     goto __pyx_L0;
11047     __pyx_L8_exception_handled:;
11048     __Pyx_XGIVEREF(__pyx_save_exc_type);
11049     __Pyx_XGIVEREF(__pyx_save_exc_value);
11050     __Pyx_XGIVEREF(__pyx_save_exc_tb);
11051     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11052     __pyx_L14_try_end:;
11053   }
11054
11055   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11056   goto __pyx_L0;
11057   __pyx_L1_error:;
11058   __Pyx_XDECREF(__pyx_t_1);
11059   __Pyx_XDECREF(__pyx_t_3);
11060   __Pyx_XDECREF(__pyx_t_4);
11061   __Pyx_XDECREF(__pyx_t_9);
11062   __Pyx_XDECREF(__pyx_t_11);
11063   __Pyx_XDECREF(__pyx_t_12);
11064   __Pyx_XDECREF(__pyx_t_13);
11065   __Pyx_AddTraceback("cvcf.VCF.convertGT");
11066   __pyx_r = NULL;
11067   __pyx_L0:;
11068   __Pyx_DECREF(__pyx_v_gts);
11069   __Pyx_XGIVEREF(__pyx_r);
11070   __Pyx_RefNannyFinishContext();
11071   return __pyx_r;
11072 }
11073
11074 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":569
11075  * 
11076  * 
11077  *     def convertGTback(self, GTdata):             # <<<<<<<<<<<<<<
11078  *         return ''.join(map(str,GTdata))
11079  * 
11080  */
11081
11082 static PyObject *__pyx_pf_4cvcf_3VCF_convertGTback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11083 static PyMethodDef __pyx_mdef_4cvcf_3VCF_convertGTback = {__Pyx_NAMESTR("convertGTback"), (PyCFunction)__pyx_pf_4cvcf_3VCF_convertGTback, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
11084 static PyObject *__pyx_pf_4cvcf_3VCF_convertGTback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11085   PyObject *__pyx_v_self = 0;
11086   PyObject *__pyx_v_GTdata = 0;
11087   PyObject *__pyx_r = NULL;
11088   PyObject *__pyx_t_1 = NULL;
11089   PyObject *__pyx_t_2 = NULL;
11090   PyObject *__pyx_t_3 = NULL;
11091   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__GTdata,0};
11092   __Pyx_RefNannySetupContext("convertGTback");
11093   __pyx_self = __pyx_self;
11094   if (unlikely(__pyx_kwds)) {
11095     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
11096     PyObject* values[2] = {0,0};
11097     switch (PyTuple_GET_SIZE(__pyx_args)) {
11098       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11099       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11100       case  0: break;
11101       default: goto __pyx_L5_argtuple_error;
11102     }
11103     switch (PyTuple_GET_SIZE(__pyx_args)) {
11104       case  0:
11105       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
11106       if (likely(values[0])) kw_args--;
11107       else goto __pyx_L5_argtuple_error;
11108       case  1:
11109       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__GTdata);
11110       if (likely(values[1])) kw_args--;
11111       else {
11112         __Pyx_RaiseArgtupleInvalid("convertGTback", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11113       }
11114     }
11115     if (unlikely(kw_args > 0)) {
11116       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;}
11117     }
11118     __pyx_v_self = values[0];
11119     __pyx_v_GTdata = values[1];
11120   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
11121     goto __pyx_L5_argtuple_error;
11122   } else {
11123     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
11124     __pyx_v_GTdata = PyTuple_GET_ITEM(__pyx_args, 1);
11125   }
11126   goto __pyx_L4_argument_unpacking_done;
11127   __pyx_L5_argtuple_error:;
11128   __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;}
11129   __pyx_L3_error:;
11130   __Pyx_AddTraceback("cvcf.VCF.convertGTback");
11131   __Pyx_RefNannyFinishContext();
11132   return NULL;
11133   __pyx_L4_argument_unpacking_done:;
11134
11135   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":570
11136  * 
11137  *     def convertGTback(self, GTdata):
11138  *         return ''.join(map(str,GTdata))             # <<<<<<<<<<<<<<
11139  * 
11140  *     def parse_formatdata( self, key, value, formatdict, line ):
11141  */
11142   __Pyx_XDECREF(__pyx_r);
11143   __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;}
11144   __Pyx_GOTREF(__pyx_t_1);
11145   __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;}
11146   __Pyx_GOTREF(__pyx_t_2);
11147   __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
11148   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)&PyString_Type)));
11149   __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
11150   __Pyx_INCREF(__pyx_v_GTdata);
11151   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_GTdata);
11152   __Pyx_GIVEREF(__pyx_v_GTdata);
11153   __pyx_t_3 = PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11154   __Pyx_GOTREF(__pyx_t_3);
11155   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11156   __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;}
11157   __Pyx_GOTREF(__pyx_t_2);
11158   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
11159   __Pyx_GIVEREF(__pyx_t_3);
11160   __pyx_t_3 = 0;
11161   __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11162   __Pyx_GOTREF(__pyx_t_3);
11163   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11164   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11165   __pyx_r = __pyx_t_3;
11166   __pyx_t_3 = 0;
11167   goto __pyx_L0;
11168
11169   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11170   goto __pyx_L0;
11171   __pyx_L1_error:;
11172   __Pyx_XDECREF(__pyx_t_1);
11173   __Pyx_XDECREF(__pyx_t_2);
11174   __Pyx_XDECREF(__pyx_t_3);
11175   __Pyx_AddTraceback("cvcf.VCF.convertGTback");
11176   __pyx_r = NULL;
11177   __pyx_L0:;
11178   __Pyx_XGIVEREF(__pyx_r);
11179   __Pyx_RefNannyFinishContext();
11180   return __pyx_r;
11181 }
11182
11183 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":572
11184  *         return ''.join(map(str,GTdata))
11185  * 
11186  *     def parse_formatdata( self, key, value, formatdict, line ):             # <<<<<<<<<<<<<<
11187  *         # To do: check that the right number of values is present
11188  *         f = formatdict.get(key,None)
11189  */
11190
11191 static PyObject *__pyx_pf_4cvcf_3VCF_parse_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11192 static PyMethodDef __pyx_mdef_4cvcf_3VCF_parse_formatdata = {__Pyx_NAMESTR("parse_formatdata"), (PyCFunction)__pyx_pf_4cvcf_3VCF_parse_formatdata, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
11193 static PyObject *__pyx_pf_4cvcf_3VCF_parse_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11194   PyObject *__pyx_v_self = 0;
11195   PyObject *__pyx_v_key = 0;
11196   PyObject *__pyx_v_value = 0;
11197   PyObject *__pyx_v_formatdict = 0;
11198   PyObject *__pyx_v_line = 0;
11199   PyObject *__pyx_v_f;
11200   PyObject *__pyx_v_values;
11201   PyObject *__pyx_v_idx;
11202   PyObject *__pyx_v_v;
11203   PyObject *__pyx_r = NULL;
11204   PyObject *__pyx_t_1 = NULL;
11205   PyObject *__pyx_t_2 = NULL;
11206   PyObject *__pyx_t_3 = NULL;
11207   int __pyx_t_4;
11208   int __pyx_t_5;
11209   int __pyx_t_6;
11210   Py_ssize_t __pyx_t_7;
11211   int __pyx_t_8;
11212   PyObject *__pyx_t_9 = NULL;
11213   PyObject *__pyx_t_10 = NULL;
11214   PyObject *__pyx_t_11 = NULL;
11215   PyObject *__pyx_t_12 = NULL;
11216   PyObject *__pyx_t_13 = NULL;
11217   Py_ssize_t __pyx_t_14;
11218   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};
11219   __Pyx_RefNannySetupContext("parse_formatdata");
11220   __pyx_self = __pyx_self;
11221   if (unlikely(__pyx_kwds)) {
11222     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
11223     PyObject* values[5] = {0,0,0,0,0};
11224     switch (PyTuple_GET_SIZE(__pyx_args)) {
11225       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11226       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11227       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11228       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11229       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11230       case  0: break;
11231       default: goto __pyx_L5_argtuple_error;
11232     }
11233     switch (PyTuple_GET_SIZE(__pyx_args)) {
11234       case  0:
11235       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
11236       if (likely(values[0])) kw_args--;
11237       else goto __pyx_L5_argtuple_error;
11238       case  1:
11239       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
11240       if (likely(values[1])) kw_args--;
11241       else {
11242         __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11243       }
11244       case  2:
11245       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
11246       if (likely(values[2])) kw_args--;
11247       else {
11248         __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11249       }
11250       case  3:
11251       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__formatdict);
11252       if (likely(values[3])) kw_args--;
11253       else {
11254         __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11255       }
11256       case  4:
11257       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
11258       if (likely(values[4])) kw_args--;
11259       else {
11260         __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11261       }
11262     }
11263     if (unlikely(kw_args > 0)) {
11264       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;}
11265     }
11266     __pyx_v_self = values[0];
11267     __pyx_v_key = values[1];
11268     __pyx_v_value = values[2];
11269     __pyx_v_formatdict = values[3];
11270     __pyx_v_line = values[4];
11271   } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
11272     goto __pyx_L5_argtuple_error;
11273   } else {
11274     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
11275     __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1);
11276     __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 2);
11277     __pyx_v_formatdict = PyTuple_GET_ITEM(__pyx_args, 3);
11278     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 4);
11279   }
11280   goto __pyx_L4_argument_unpacking_done;
11281   __pyx_L5_argtuple_error:;
11282   __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;}
11283   __pyx_L3_error:;
11284   __Pyx_AddTraceback("cvcf.VCF.parse_formatdata");
11285   __Pyx_RefNannyFinishContext();
11286   return NULL;
11287   __pyx_L4_argument_unpacking_done:;
11288   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
11289   __pyx_v_values = Py_None; __Pyx_INCREF(Py_None);
11290   __pyx_v_idx = Py_None; __Pyx_INCREF(Py_None);
11291   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
11292
11293   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":574
11294  *     def parse_formatdata( self, key, value, formatdict, line ):
11295  *         # To do: check that the right number of values is present
11296  *         f = formatdict.get(key,None)             # <<<<<<<<<<<<<<
11297  *         if f == None:
11298  *             self._add_definition(formatdict, key, value, line )
11299  */
11300   __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;}
11301   __Pyx_GOTREF(__pyx_t_1);
11302   __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;}
11303   __Pyx_GOTREF(__pyx_t_2);
11304   __Pyx_INCREF(__pyx_v_key);
11305   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
11306   __Pyx_GIVEREF(__pyx_v_key);
11307   __Pyx_INCREF(Py_None);
11308   PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
11309   __Pyx_GIVEREF(Py_None);
11310   __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11311   __Pyx_GOTREF(__pyx_t_3);
11312   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11313   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11314   __Pyx_DECREF(__pyx_v_f);
11315   __pyx_v_f = __pyx_t_3;
11316   __pyx_t_3 = 0;
11317
11318   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":575
11319  *         # To do: check that the right number of values is present
11320  *         f = formatdict.get(key,None)
11321  *         if f == None:             # <<<<<<<<<<<<<<
11322  *             self._add_definition(formatdict, key, value, line )
11323  *             f = formatdict[key]
11324  */
11325   __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;}
11326   __Pyx_GOTREF(__pyx_t_3);
11327   __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;}
11328   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11329   if (__pyx_t_4) {
11330
11331     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":576
11332  *         f = formatdict.get(key,None)
11333  *         if f == None:
11334  *             self._add_definition(formatdict, key, value, line )             # <<<<<<<<<<<<<<
11335  *             f = formatdict[key]
11336  *         if f.type == "Flag":
11337  */
11338     __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;}
11339     __Pyx_GOTREF(__pyx_t_3);
11340     __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;}
11341     __Pyx_GOTREF(__pyx_t_2);
11342     __Pyx_INCREF(__pyx_v_formatdict);
11343     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_formatdict);
11344     __Pyx_GIVEREF(__pyx_v_formatdict);
11345     __Pyx_INCREF(__pyx_v_key);
11346     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key);
11347     __Pyx_GIVEREF(__pyx_v_key);
11348     __Pyx_INCREF(__pyx_v_value);
11349     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value);
11350     __Pyx_GIVEREF(__pyx_v_value);
11351     __Pyx_INCREF(__pyx_v_line);
11352     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_line);
11353     __Pyx_GIVEREF(__pyx_v_line);
11354     __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11355     __Pyx_GOTREF(__pyx_t_1);
11356     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11357     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11358     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11359
11360     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":577
11361  *         if f == None:
11362  *             self._add_definition(formatdict, key, value, line )
11363  *             f = formatdict[key]             # <<<<<<<<<<<<<<
11364  *         if f.type == "Flag":
11365  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
11366  */
11367     __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;}
11368     __Pyx_GOTREF(__pyx_t_1);
11369     __Pyx_DECREF(__pyx_v_f);
11370     __pyx_v_f = __pyx_t_1;
11371     __pyx_t_1 = 0;
11372     goto __pyx_L6;
11373   }
11374   __pyx_L6:;
11375
11376   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":578
11377  *             self._add_definition(formatdict, key, value, line )
11378  *             f = formatdict[key]
11379  *         if f.type == "Flag":             # <<<<<<<<<<<<<<
11380  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
11381  *             return []
11382  */
11383   __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;}
11384   __Pyx_GOTREF(__pyx_t_1);
11385   __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;}
11386   __Pyx_GOTREF(__pyx_t_2);
11387   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11388   __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;}
11389   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11390   if (__pyx_t_4) {
11391
11392     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":579
11393  *             f = formatdict[key]
11394  *         if f.type == "Flag":
11395  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)             # <<<<<<<<<<<<<<
11396  *             return []
11397  *         values = value.split(',')
11398  */
11399     __pyx_t_4 = (__pyx_v_value != Py_None);
11400     if (__pyx_t_4) {
11401       __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;}
11402       __Pyx_GOTREF(__pyx_t_2);
11403       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_58); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11404       __Pyx_GOTREF(__pyx_t_1);
11405       __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;}
11406       __Pyx_GOTREF(__pyx_t_3);
11407       __Pyx_INCREF(__pyx_v_line);
11408       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_line);
11409       __Pyx_GIVEREF(__pyx_v_line);
11410       PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
11411       __Pyx_GIVEREF(__pyx_t_1);
11412       __pyx_t_1 = 0;
11413       __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11414       __Pyx_GOTREF(__pyx_t_1);
11415       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11416       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11417       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11418       goto __pyx_L8;
11419     }
11420     __pyx_L8:;
11421
11422     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":580
11423  *         if f.type == "Flag":
11424  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
11425  *             return []             # <<<<<<<<<<<<<<
11426  *         values = value.split(',')
11427  *         # deal with trailing data in some early VCF files
11428  */
11429     __Pyx_XDECREF(__pyx_r);
11430     __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;}
11431     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
11432     __pyx_r = ((PyObject *)__pyx_t_1);
11433     __pyx_t_1 = 0;
11434     goto __pyx_L0;
11435     goto __pyx_L7;
11436   }
11437   __pyx_L7:;
11438
11439   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":581
11440  *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
11441  *             return []
11442  *         values = value.split(',')             # <<<<<<<<<<<<<<
11443  *         # deal with trailing data in some early VCF files
11444  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
11445  */
11446   __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;}
11447   __Pyx_GOTREF(__pyx_t_1);
11448   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11449   __Pyx_GOTREF(__pyx_t_3);
11450   __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
11451   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2));
11452   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
11453   __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11454   __Pyx_GOTREF(__pyx_t_2);
11455   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11456   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11457   __Pyx_DECREF(__pyx_v_values);
11458   __pyx_v_values = __pyx_t_2;
11459   __pyx_t_2 = 0;
11460
11461   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":583
11462  *         values = value.split(',')
11463  *         # deal with trailing data in some early VCF files
11464  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:             # <<<<<<<<<<<<<<
11465  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
11466  *             values[-1] = values[-1].split(';')[0]
11467  */
11468   __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11469   __Pyx_GOTREF(__pyx_t_2);
11470   __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__Float), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11471   __Pyx_GOTREF(__pyx_t_3);
11472   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11473   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11474   __pyx_t_5 = __pyx_t_4;
11475   if (!__pyx_t_5) {
11476     __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__Integer), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11477     __Pyx_GOTREF(__pyx_t_3);
11478     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11479     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11480     __pyx_t_6 = __pyx_t_4;
11481     __pyx_t_4 = __pyx_t_6;
11482   } else {
11483     __pyx_t_4 = __pyx_t_5;
11484   }
11485   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11486   __pyx_t_5 = __pyx_t_4;
11487   if (__pyx_t_5) {
11488     __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;}
11489     __pyx_t_4 = (__pyx_t_7 > 0);
11490     if (__pyx_t_4) {
11491       __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11492       __Pyx_GOTREF(__pyx_t_2);
11493       __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__find); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11494       __Pyx_GOTREF(__pyx_t_3);
11495       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11496       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11497       __Pyx_GOTREF(__pyx_t_2);
11498       __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
11499       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_7));
11500       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
11501       __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11502       __Pyx_GOTREF(__pyx_t_1);
11503       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11504       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11505       __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11506       __Pyx_GOTREF(__pyx_t_2);
11507       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11508       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11509       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11510       __pyx_t_8 = __pyx_t_6;
11511     } else {
11512       __pyx_t_8 = __pyx_t_4;
11513     }
11514     __pyx_t_4 = __pyx_t_8;
11515   } else {
11516     __pyx_t_4 = __pyx_t_5;
11517   }
11518   if (__pyx_t_4) {
11519
11520     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":584
11521  *         # deal with trailing data in some early VCF files
11522  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
11523  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])             # <<<<<<<<<<<<<<
11524  *             values[-1] = values[-1].split(';')[0]
11525  *         if f.type == "Integer":
11526  */
11527     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11528     __Pyx_GOTREF(__pyx_t_2);
11529     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ERROR_TRAILING_DATA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11530     __Pyx_GOTREF(__pyx_t_1);
11531     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_values, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11532     __Pyx_GOTREF(__pyx_t_3);
11533     __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;}
11534     __Pyx_GOTREF(__pyx_t_9);
11535     __Pyx_INCREF(__pyx_v_line);
11536     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
11537     __Pyx_GIVEREF(__pyx_v_line);
11538     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
11539     __Pyx_GIVEREF(__pyx_t_1);
11540     PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
11541     __Pyx_GIVEREF(__pyx_t_3);
11542     __pyx_t_1 = 0;
11543     __pyx_t_3 = 0;
11544     __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11545     __Pyx_GOTREF(__pyx_t_3);
11546     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11547     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11548     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11549
11550     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":585
11551  *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
11552  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
11553  *             values[-1] = values[-1].split(';')[0]             # <<<<<<<<<<<<<<
11554  *         if f.type == "Integer":
11555  *             for idx,v in enumerate(values):
11556  */
11557     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_values, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11558     __Pyx_GOTREF(__pyx_t_3);
11559     __pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__split); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11560     __Pyx_GOTREF(__pyx_t_9);
11561     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11562     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11563     __Pyx_GOTREF(__pyx_t_3);
11564     __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
11565     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_7));
11566     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
11567     __pyx_t_2 = PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11568     __Pyx_GOTREF(__pyx_t_2);
11569     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11570     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11571     __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11572     __Pyx_GOTREF(__pyx_t_3);
11573     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11574     if (__Pyx_SetItemInt(__pyx_v_values, -1, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11575     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11576     goto __pyx_L9;
11577   }
11578   __pyx_L9:;
11579
11580   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":586
11581  *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
11582  *             values[-1] = values[-1].split(';')[0]
11583  *         if f.type == "Integer":             # <<<<<<<<<<<<<<
11584  *             for idx,v in enumerate(values):
11585  *                 try:
11586  */
11587   __pyx_t_3 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11588   __Pyx_GOTREF(__pyx_t_3);
11589   __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((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;}
11590   __Pyx_GOTREF(__pyx_t_2);
11591   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11592   __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;}
11593   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11594   if (__pyx_t_4) {
11595
11596     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":587
11597  *             values[-1] = values[-1].split(';')[0]
11598  *         if f.type == "Integer":
11599  *             for idx,v in enumerate(values):             # <<<<<<<<<<<<<<
11600  *                 try:
11601  *                     if v == ".": values[idx] = f.missingvalue
11602  */
11603     __Pyx_INCREF(__pyx_int_0);
11604     __pyx_t_2 = __pyx_int_0;
11605     if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
11606       __pyx_t_7 = 0; __pyx_t_3 = __pyx_v_values; __Pyx_INCREF(__pyx_t_3);
11607     } else {
11608       __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11609       __Pyx_GOTREF(__pyx_t_3);
11610     }
11611     for (;;) {
11612       if (likely(PyList_CheckExact(__pyx_t_3))) {
11613         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
11614         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
11615       } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
11616         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
11617         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
11618       } else {
11619         __pyx_t_9 = PyIter_Next(__pyx_t_3);
11620         if (!__pyx_t_9) {
11621           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11622           break;
11623         }
11624         __Pyx_GOTREF(__pyx_t_9);
11625       }
11626       __Pyx_DECREF(__pyx_v_v);
11627       __pyx_v_v = __pyx_t_9;
11628       __pyx_t_9 = 0;
11629       __Pyx_INCREF(__pyx_t_2);
11630       __Pyx_DECREF(__pyx_v_idx);
11631       __pyx_v_idx = __pyx_t_2;
11632       __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11633       __Pyx_GOTREF(__pyx_t_9);
11634       __Pyx_DECREF(__pyx_t_2);
11635       __pyx_t_2 = __pyx_t_9;
11636       __pyx_t_9 = 0;
11637
11638       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":588
11639  *         if f.type == "Integer":
11640  *             for idx,v in enumerate(values):
11641  *                 try:             # <<<<<<<<<<<<<<
11642  *                     if v == ".": values[idx] = f.missingvalue
11643  *                     else:        values[idx] = int(v)
11644  */
11645       {
11646         PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
11647         __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
11648         __Pyx_XGOTREF(__pyx_save_exc_type);
11649         __Pyx_XGOTREF(__pyx_save_exc_value);
11650         __Pyx_XGOTREF(__pyx_save_exc_tb);
11651         /*try:*/ {
11652
11653           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":589
11654  *             for idx,v in enumerate(values):
11655  *                 try:
11656  *                     if v == ".": values[idx] = f.missingvalue             # <<<<<<<<<<<<<<
11657  *                     else:        values[idx] = int(v)
11658  *                 except:
11659  */
11660           __pyx_t_9 = PyObject_RichCompare(__pyx_v_v, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11661           __Pyx_GOTREF(__pyx_t_9);
11662           __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11663           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11664           if (__pyx_t_4) {
11665             __pyx_t_9 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__missingvalue); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11666             __Pyx_GOTREF(__pyx_t_9);
11667             if (PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11668             __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11669             goto __pyx_L21;
11670           }
11671           /*else*/ {
11672
11673             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":590
11674  *                 try:
11675  *                     if v == ".": values[idx] = f.missingvalue
11676  *                     else:        values[idx] = int(v)             # <<<<<<<<<<<<<<
11677  *                 except:
11678  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11679  */
11680             __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11681             __Pyx_GOTREF(__pyx_t_9);
11682             __Pyx_INCREF(__pyx_v_v);
11683             PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_v);
11684             __Pyx_GIVEREF(__pyx_v_v);
11685             __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11686             __Pyx_GOTREF(__pyx_t_1);
11687             __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11688             if (PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
11689             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11690           }
11691           __pyx_L21:;
11692         }
11693         __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
11694         __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
11695         __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
11696         goto __pyx_L20_try_end;
11697         __pyx_L13_error:;
11698         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11699         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11700
11701         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":591
11702  *                     if v == ".": values[idx] = f.missingvalue
11703  *                     else:        values[idx] = int(v)
11704  *                 except:             # <<<<<<<<<<<<<<
11705  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11706  *                     return [0] * len(values)
11707  */
11708         /*except:*/ {
11709           __Pyx_AddTraceback("cvcf.VCF.parse_formatdata");
11710           if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11711           __Pyx_GOTREF(__pyx_t_1);
11712           __Pyx_GOTREF(__pyx_t_9);
11713           __Pyx_GOTREF(__pyx_t_10);
11714
11715           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":592
11716  *                     else:        values[idx] = int(v)
11717  *                 except:
11718  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)             # <<<<<<<<<<<<<<
11719  *                     return [0] * len(values)
11720  *             return values
11721  */
11722           __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;}
11723           __Pyx_GOTREF(__pyx_t_11);
11724           __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_59); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
11725           __Pyx_GOTREF(__pyx_t_12);
11726           __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;}
11727           __Pyx_GOTREF(__pyx_t_13);
11728           __Pyx_INCREF(__pyx_v_line);
11729           PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_line);
11730           __Pyx_GIVEREF(__pyx_v_line);
11731           PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12);
11732           __Pyx_GIVEREF(__pyx_t_12);
11733           __Pyx_INCREF(__pyx_v_values);
11734           PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_values);
11735           __Pyx_GIVEREF(__pyx_v_values);
11736           __pyx_t_12 = 0;
11737           __pyx_t_12 = PyObject_Call(__pyx_t_11, __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;}
11738           __Pyx_GOTREF(__pyx_t_12);
11739           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11740           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
11741           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11742
11743           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":593
11744  *                 except:
11745  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11746  *                     return [0] * len(values)             # <<<<<<<<<<<<<<
11747  *             return values
11748  *         elif f.type == "String":
11749  */
11750           __Pyx_XDECREF(__pyx_r);
11751           __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;}
11752           __Pyx_GOTREF(((PyObject *)__pyx_t_12));
11753           __Pyx_INCREF(__pyx_int_0);
11754           PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
11755           __Pyx_GIVEREF(__pyx_int_0);
11756           __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;}
11757           __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;}
11758           __Pyx_GOTREF(__pyx_t_13);
11759           __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;}
11760           __Pyx_GOTREF(__pyx_t_11);
11761           __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
11762           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
11763           __pyx_r = __pyx_t_11;
11764           __pyx_t_11 = 0;
11765           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11766           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11767           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11768           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11769           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11770           goto __pyx_L16_except_return;
11771           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11772           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11773           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11774           goto __pyx_L14_exception_handled;
11775         }
11776         __pyx_L15_except_error:;
11777         __Pyx_XGIVEREF(__pyx_save_exc_type);
11778         __Pyx_XGIVEREF(__pyx_save_exc_value);
11779         __Pyx_XGIVEREF(__pyx_save_exc_tb);
11780         __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11781         goto __pyx_L1_error;
11782         __pyx_L16_except_return:;
11783         __Pyx_XGIVEREF(__pyx_save_exc_type);
11784         __Pyx_XGIVEREF(__pyx_save_exc_value);
11785         __Pyx_XGIVEREF(__pyx_save_exc_tb);
11786         __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11787         goto __pyx_L0;
11788         __pyx_L14_exception_handled:;
11789         __Pyx_XGIVEREF(__pyx_save_exc_type);
11790         __Pyx_XGIVEREF(__pyx_save_exc_value);
11791         __Pyx_XGIVEREF(__pyx_save_exc_tb);
11792         __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11793         __pyx_L20_try_end:;
11794       }
11795     }
11796     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11797     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11798
11799     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":594
11800  *                     self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
11801  *                     return [0] * len(values)
11802  *             return values             # <<<<<<<<<<<<<<
11803  *         elif f.type == "String":
11804  *             self._line = line
11805  */
11806     __Pyx_XDECREF(__pyx_r);
11807     __Pyx_INCREF(__pyx_v_values);
11808     __pyx_r = __pyx_v_values;
11809     goto __pyx_L0;
11810     goto __pyx_L10;
11811   }
11812
11813   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":595
11814  *                     return [0] * len(values)
11815  *             return values
11816  *         elif f.type == "String":             # <<<<<<<<<<<<<<
11817  *             self._line = line
11818  *             if f.id == "GT": values = map( self.convertGT, values )
11819  */
11820   __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;}
11821   __Pyx_GOTREF(__pyx_t_2);
11822   __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__String), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11823   __Pyx_GOTREF(__pyx_t_3);
11824   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11825   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11826   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11827   if (__pyx_t_4) {
11828
11829     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":596
11830  *             return values
11831  *         elif f.type == "String":
11832  *             self._line = line             # <<<<<<<<<<<<<<
11833  *             if f.id == "GT": values = map( self.convertGT, values )
11834  *             return values
11835  */
11836     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;}
11837
11838     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":597
11839  *         elif f.type == "String":
11840  *             self._line = line
11841  *             if f.id == "GT": values = map( self.convertGT, values )             # <<<<<<<<<<<<<<
11842  *             return values
11843  *         elif f.type == "Character":
11844  */
11845     __pyx_t_3 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11846     __Pyx_GOTREF(__pyx_t_3);
11847     __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((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;}
11848     __Pyx_GOTREF(__pyx_t_2);
11849     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11850     __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;}
11851     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11852     if (__pyx_t_4) {
11853       __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;}
11854       __Pyx_GOTREF(__pyx_t_2);
11855       __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11856       __Pyx_GOTREF(__pyx_t_3);
11857       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
11858       __Pyx_GIVEREF(__pyx_t_2);
11859       __Pyx_INCREF(__pyx_v_values);
11860       PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
11861       __Pyx_GIVEREF(__pyx_v_values);
11862       __pyx_t_2 = 0;
11863       __pyx_t_2 = PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11864       __Pyx_GOTREF(__pyx_t_2);
11865       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11866       __Pyx_DECREF(__pyx_v_values);
11867       __pyx_v_values = __pyx_t_2;
11868       __pyx_t_2 = 0;
11869       goto __pyx_L24;
11870     }
11871     __pyx_L24:;
11872
11873     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":598
11874  *             self._line = line
11875  *             if f.id == "GT": values = map( self.convertGT, values )
11876  *             return values             # <<<<<<<<<<<<<<
11877  *         elif f.type == "Character":
11878  *             for v in values:
11879  */
11880     __Pyx_XDECREF(__pyx_r);
11881     __Pyx_INCREF(__pyx_v_values);
11882     __pyx_r = __pyx_v_values;
11883     goto __pyx_L0;
11884     goto __pyx_L10;
11885   }
11886
11887   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":599
11888  *             if f.id == "GT": values = map( self.convertGT, values )
11889  *             return values
11890  *         elif f.type == "Character":             # <<<<<<<<<<<<<<
11891  *             for v in values:
11892  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
11893  */
11894   __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;}
11895   __Pyx_GOTREF(__pyx_t_2);
11896   __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__Character), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11897   __Pyx_GOTREF(__pyx_t_3);
11898   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11899   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11900   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11901   if (__pyx_t_4) {
11902
11903     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":600
11904  *             return values
11905  *         elif f.type == "Character":
11906  *             for v in values:             # <<<<<<<<<<<<<<
11907  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
11908  *             return values
11909  */
11910     if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
11911       __pyx_t_7 = 0; __pyx_t_3 = __pyx_v_values; __Pyx_INCREF(__pyx_t_3);
11912     } else {
11913       __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11914       __Pyx_GOTREF(__pyx_t_3);
11915     }
11916     for (;;) {
11917       if (likely(PyList_CheckExact(__pyx_t_3))) {
11918         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
11919         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
11920       } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
11921         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
11922         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
11923       } else {
11924         __pyx_t_2 = PyIter_Next(__pyx_t_3);
11925         if (!__pyx_t_2) {
11926           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11927           break;
11928         }
11929         __Pyx_GOTREF(__pyx_t_2);
11930       }
11931       __Pyx_DECREF(__pyx_v_v);
11932       __pyx_v_v = __pyx_t_2;
11933       __pyx_t_2 = 0;
11934
11935       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":601
11936  *         elif f.type == "Character":
11937  *             for v in values:
11938  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)             # <<<<<<<<<<<<<<
11939  *             return values
11940  *         elif f.type == "Float":
11941  */
11942       __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;}
11943       __pyx_t_4 = (__pyx_t_14 != 1);
11944       if (__pyx_t_4) {
11945         __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;}
11946         __Pyx_GOTREF(__pyx_t_2);
11947         __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_60); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11948         __Pyx_GOTREF(__pyx_t_10);
11949         __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11950         __Pyx_GOTREF(__pyx_t_9);
11951         __Pyx_INCREF(__pyx_v_line);
11952         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
11953         __Pyx_GIVEREF(__pyx_v_line);
11954         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
11955         __Pyx_GIVEREF(__pyx_t_10);
11956         __pyx_t_10 = 0;
11957         __pyx_t_10 = PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11958         __Pyx_GOTREF(__pyx_t_10);
11959         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11960         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11961         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11962         goto __pyx_L27;
11963       }
11964       __pyx_L27:;
11965     }
11966     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11967
11968     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":602
11969  *             for v in values:
11970  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
11971  *             return values             # <<<<<<<<<<<<<<
11972  *         elif f.type == "Float":
11973  *             for idx,v in enumerate(values):
11974  */
11975     __Pyx_XDECREF(__pyx_r);
11976     __Pyx_INCREF(__pyx_v_values);
11977     __pyx_r = __pyx_v_values;
11978     goto __pyx_L0;
11979     goto __pyx_L10;
11980   }
11981
11982   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":603
11983  *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
11984  *             return values
11985  *         elif f.type == "Float":             # <<<<<<<<<<<<<<
11986  *             for idx,v in enumerate(values):
11987  *                 if v == ".": values[idx] = f.missingvalue
11988  */
11989   __pyx_t_3 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11990   __Pyx_GOTREF(__pyx_t_3);
11991   __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, ((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;}
11992   __Pyx_GOTREF(__pyx_t_10);
11993   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11994   __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;}
11995   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11996   if (__pyx_t_4) {
11997
11998     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":604
11999  *             return values
12000  *         elif f.type == "Float":
12001  *             for idx,v in enumerate(values):             # <<<<<<<<<<<<<<
12002  *                 if v == ".": values[idx] = f.missingvalue
12003  *             try: return map(float,values)
12004  */
12005     __Pyx_INCREF(__pyx_int_0);
12006     __pyx_t_10 = __pyx_int_0;
12007     if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
12008       __pyx_t_7 = 0; __pyx_t_3 = __pyx_v_values; __Pyx_INCREF(__pyx_t_3);
12009     } else {
12010       __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12011       __Pyx_GOTREF(__pyx_t_3);
12012     }
12013     for (;;) {
12014       if (likely(PyList_CheckExact(__pyx_t_3))) {
12015         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
12016         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
12017       } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
12018         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
12019         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
12020       } else {
12021         __pyx_t_9 = PyIter_Next(__pyx_t_3);
12022         if (!__pyx_t_9) {
12023           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12024           break;
12025         }
12026         __Pyx_GOTREF(__pyx_t_9);
12027       }
12028       __Pyx_DECREF(__pyx_v_v);
12029       __pyx_v_v = __pyx_t_9;
12030       __pyx_t_9 = 0;
12031       __Pyx_INCREF(__pyx_t_10);
12032       __Pyx_DECREF(__pyx_v_idx);
12033       __pyx_v_idx = __pyx_t_10;
12034       __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12035       __Pyx_GOTREF(__pyx_t_9);
12036       __Pyx_DECREF(__pyx_t_10);
12037       __pyx_t_10 = __pyx_t_9;
12038       __pyx_t_9 = 0;
12039
12040       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":605
12041  *         elif f.type == "Float":
12042  *             for idx,v in enumerate(values):
12043  *                 if v == ".": values[idx] = f.missingvalue             # <<<<<<<<<<<<<<
12044  *             try: return map(float,values)
12045  *             except:
12046  */
12047       __pyx_t_9 = PyObject_RichCompare(__pyx_v_v, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12048       __Pyx_GOTREF(__pyx_t_9);
12049       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12050       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12051       if (__pyx_t_4) {
12052         __pyx_t_9 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__missingvalue); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12053         __Pyx_GOTREF(__pyx_t_9);
12054         if (PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12055         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12056         goto __pyx_L30;
12057       }
12058       __pyx_L30:;
12059     }
12060     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12061     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12062
12063     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":606
12064  *             for idx,v in enumerate(values):
12065  *                 if v == ".": values[idx] = f.missingvalue
12066  *             try: return map(float,values)             # <<<<<<<<<<<<<<
12067  *             except:
12068  *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
12069  */
12070     {
12071       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
12072       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
12073       __Pyx_XGOTREF(__pyx_save_exc_type);
12074       __Pyx_XGOTREF(__pyx_save_exc_value);
12075       __Pyx_XGOTREF(__pyx_save_exc_tb);
12076       /*try:*/ {
12077         __Pyx_XDECREF(__pyx_r);
12078         __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;}
12079         __Pyx_GOTREF(__pyx_t_10);
12080         __Pyx_INCREF(((PyObject *)((PyObject*)&PyFloat_Type)));
12081         PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)((PyObject*)&PyFloat_Type)));
12082         __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyFloat_Type)));
12083         __Pyx_INCREF(__pyx_v_values);
12084         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_values);
12085         __Pyx_GIVEREF(__pyx_v_values);
12086         __pyx_t_3 = PyObject_Call(__pyx_builtin_map, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
12087         __Pyx_GOTREF(__pyx_t_3);
12088         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12089         __pyx_r = __pyx_t_3;
12090         __pyx_t_3 = 0;
12091         goto __pyx_L35_try_return;
12092       }
12093       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
12094       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
12095       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
12096       goto __pyx_L38_try_end;
12097       __pyx_L35_try_return:;
12098       __Pyx_XGIVEREF(__pyx_save_exc_type);
12099       __Pyx_XGIVEREF(__pyx_save_exc_value);
12100       __Pyx_XGIVEREF(__pyx_save_exc_tb);
12101       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12102       goto __pyx_L0;
12103       __pyx_L31_error:;
12104       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
12105       __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
12106       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12107       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12108       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12109       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12110       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12111       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12112
12113       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":607
12114  *                 if v == ".": values[idx] = f.missingvalue
12115  *             try: return map(float,values)
12116  *             except:             # <<<<<<<<<<<<<<
12117  *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
12118  *                 return [0.0] * len(values)
12119  */
12120       /*except:*/ {
12121         __Pyx_AddTraceback("cvcf.VCF.parse_formatdata");
12122         if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12123         __Pyx_GOTREF(__pyx_t_3);
12124         __Pyx_GOTREF(__pyx_t_10);
12125         __Pyx_GOTREF(__pyx_t_9);
12126
12127         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":608
12128  *             try: return map(float,values)
12129  *             except:
12130  *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)             # <<<<<<<<<<<<<<
12131  *                 return [0.0] * len(values)
12132  *         else:
12133  */
12134         __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;}
12135         __Pyx_GOTREF(__pyx_t_2);
12136         __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_59); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12137         __Pyx_GOTREF(__pyx_t_1);
12138         __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;}
12139         __Pyx_GOTREF(__pyx_t_11);
12140         __Pyx_INCREF(__pyx_v_line);
12141         PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_line);
12142         __Pyx_GIVEREF(__pyx_v_line);
12143         PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
12144         __Pyx_GIVEREF(__pyx_t_1);
12145         __Pyx_INCREF(__pyx_v_values);
12146         PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_values);
12147         __Pyx_GIVEREF(__pyx_v_values);
12148         __pyx_t_1 = 0;
12149         __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12150         __Pyx_GOTREF(__pyx_t_1);
12151         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12152         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12153         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12154
12155         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":609
12156  *             except:
12157  *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,values)
12158  *                 return [0.0] * len(values)             # <<<<<<<<<<<<<<
12159  *         else:
12160  *             # can't happen
12161  */
12162         __Pyx_XDECREF(__pyx_r);
12163         __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12164         __Pyx_GOTREF(__pyx_t_1);
12165         __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;}
12166         __Pyx_GOTREF(((PyObject *)__pyx_t_11));
12167         PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
12168         __Pyx_GIVEREF(__pyx_t_1);
12169         __pyx_t_1 = 0;
12170         __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;}
12171         __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12172         __Pyx_GOTREF(__pyx_t_1);
12173         __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_t_11), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
12174         __Pyx_GOTREF(__pyx_t_2);
12175         __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
12176         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12177         __pyx_r = __pyx_t_2;
12178         __pyx_t_2 = 0;
12179         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12180         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12181         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12182         goto __pyx_L34_except_return;
12183         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12184         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12185         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12186         goto __pyx_L32_exception_handled;
12187       }
12188       __pyx_L33_except_error:;
12189       __Pyx_XGIVEREF(__pyx_save_exc_type);
12190       __Pyx_XGIVEREF(__pyx_save_exc_value);
12191       __Pyx_XGIVEREF(__pyx_save_exc_tb);
12192       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12193       goto __pyx_L1_error;
12194       __pyx_L34_except_return:;
12195       __Pyx_XGIVEREF(__pyx_save_exc_type);
12196       __Pyx_XGIVEREF(__pyx_save_exc_value);
12197       __Pyx_XGIVEREF(__pyx_save_exc_tb);
12198       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12199       goto __pyx_L0;
12200       __pyx_L32_exception_handled:;
12201       __Pyx_XGIVEREF(__pyx_save_exc_type);
12202       __Pyx_XGIVEREF(__pyx_save_exc_value);
12203       __Pyx_XGIVEREF(__pyx_save_exc_tb);
12204       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12205       __pyx_L38_try_end:;
12206     }
12207     goto __pyx_L10;
12208   }
12209   /*else*/ {
12210
12211     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":612
12212  *         else:
12213  *             # can't happen
12214  *             self.error(line,self.ERROR_INFO_STRING)             # <<<<<<<<<<<<<<
12215  * 
12216  * 
12217  */
12218     __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12219     __Pyx_GOTREF(__pyx_t_9);
12220     __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;}
12221     __Pyx_GOTREF(__pyx_t_10);
12222     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12223     __Pyx_GOTREF(__pyx_t_3);
12224     __Pyx_INCREF(__pyx_v_line);
12225     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_line);
12226     __Pyx_GIVEREF(__pyx_v_line);
12227     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_10);
12228     __Pyx_GIVEREF(__pyx_t_10);
12229     __pyx_t_10 = 0;
12230     __pyx_t_10 = PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12231     __Pyx_GOTREF(__pyx_t_10);
12232     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12233     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12234     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12235   }
12236   __pyx_L10:;
12237
12238   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12239   goto __pyx_L0;
12240   __pyx_L1_error:;
12241   __Pyx_XDECREF(__pyx_t_1);
12242   __Pyx_XDECREF(__pyx_t_2);
12243   __Pyx_XDECREF(__pyx_t_3);
12244   __Pyx_XDECREF(__pyx_t_9);
12245   __Pyx_XDECREF(__pyx_t_10);
12246   __Pyx_XDECREF(__pyx_t_11);
12247   __Pyx_XDECREF(__pyx_t_12);
12248   __Pyx_XDECREF(__pyx_t_13);
12249   __Pyx_AddTraceback("cvcf.VCF.parse_formatdata");
12250   __pyx_r = NULL;
12251   __pyx_L0:;
12252   __Pyx_DECREF(__pyx_v_f);
12253   __Pyx_DECREF(__pyx_v_values);
12254   __Pyx_DECREF(__pyx_v_idx);
12255   __Pyx_DECREF(__pyx_v_v);
12256   __Pyx_XGIVEREF(__pyx_r);
12257   __Pyx_RefNannyFinishContext();
12258   return __pyx_r;
12259 }
12260
12261 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":615
12262  * 
12263  * 
12264  *     def inregion(self, chrom, pos):             # <<<<<<<<<<<<<<
12265  *         if not self._regions: return True
12266  *         for r in self._regions:
12267  */
12268
12269 static PyObject *__pyx_pf_4cvcf_3VCF_inregion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12270 static PyMethodDef __pyx_mdef_4cvcf_3VCF_inregion = {__Pyx_NAMESTR("inregion"), (PyCFunction)__pyx_pf_4cvcf_3VCF_inregion, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
12271 static PyObject *__pyx_pf_4cvcf_3VCF_inregion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12272   PyObject *__pyx_v_self = 0;
12273   PyObject *__pyx_v_chrom = 0;
12274   PyObject *__pyx_v_pos = 0;
12275   PyObject *__pyx_v_r;
12276   PyObject *__pyx_r = NULL;
12277   PyObject *__pyx_t_1 = NULL;
12278   int __pyx_t_2;
12279   int __pyx_t_3;
12280   Py_ssize_t __pyx_t_4;
12281   PyObject *__pyx_t_5 = NULL;
12282   PyObject *__pyx_t_6 = NULL;
12283   PyObject *__pyx_t_7 = NULL;
12284   int __pyx_t_8;
12285   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chrom,&__pyx_n_s__pos,0};
12286   __Pyx_RefNannySetupContext("inregion");
12287   __pyx_self = __pyx_self;
12288   if (unlikely(__pyx_kwds)) {
12289     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
12290     PyObject* values[3] = {0,0,0};
12291     switch (PyTuple_GET_SIZE(__pyx_args)) {
12292       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12293       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12294       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12295       case  0: break;
12296       default: goto __pyx_L5_argtuple_error;
12297     }
12298     switch (PyTuple_GET_SIZE(__pyx_args)) {
12299       case  0:
12300       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
12301       if (likely(values[0])) kw_args--;
12302       else goto __pyx_L5_argtuple_error;
12303       case  1:
12304       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom);
12305       if (likely(values[1])) kw_args--;
12306       else {
12307         __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12308       }
12309       case  2:
12310       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos);
12311       if (likely(values[2])) kw_args--;
12312       else {
12313         __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12314       }
12315     }
12316     if (unlikely(kw_args > 0)) {
12317       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;}
12318     }
12319     __pyx_v_self = values[0];
12320     __pyx_v_chrom = values[1];
12321     __pyx_v_pos = values[2];
12322   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
12323     goto __pyx_L5_argtuple_error;
12324   } else {
12325     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
12326     __pyx_v_chrom = PyTuple_GET_ITEM(__pyx_args, 1);
12327     __pyx_v_pos = PyTuple_GET_ITEM(__pyx_args, 2);
12328   }
12329   goto __pyx_L4_argument_unpacking_done;
12330   __pyx_L5_argtuple_error:;
12331   __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;}
12332   __pyx_L3_error:;
12333   __Pyx_AddTraceback("cvcf.VCF.inregion");
12334   __Pyx_RefNannyFinishContext();
12335   return NULL;
12336   __pyx_L4_argument_unpacking_done:;
12337   __pyx_v_r = Py_None; __Pyx_INCREF(Py_None);
12338
12339   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":616
12340  * 
12341  *     def inregion(self, chrom, pos):
12342  *         if not self._regions: return True             # <<<<<<<<<<<<<<
12343  *         for r in self._regions:
12344  *             if r[0] == chrom and r[1] <= pos < r[2]: return True
12345  */
12346   __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;}
12347   __Pyx_GOTREF(__pyx_t_1);
12348   __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;}
12349   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12350   __pyx_t_3 = (!__pyx_t_2);
12351   if (__pyx_t_3) {
12352     __Pyx_XDECREF(__pyx_r);
12353     __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;}
12354     __Pyx_GOTREF(__pyx_t_1);
12355     __pyx_r = __pyx_t_1;
12356     __pyx_t_1 = 0;
12357     goto __pyx_L0;
12358     goto __pyx_L6;
12359   }
12360   __pyx_L6:;
12361
12362   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":617
12363  *     def inregion(self, chrom, pos):
12364  *         if not self._regions: return True
12365  *         for r in self._regions:             # <<<<<<<<<<<<<<
12366  *             if r[0] == chrom and r[1] <= pos < r[2]: return True
12367  *         return False
12368  */
12369   __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;}
12370   __Pyx_GOTREF(__pyx_t_1);
12371   if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
12372     __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5);
12373   } else {
12374     __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;}
12375     __Pyx_GOTREF(__pyx_t_5);
12376   }
12377   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12378   for (;;) {
12379     if (likely(PyList_CheckExact(__pyx_t_5))) {
12380       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
12381       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
12382     } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
12383       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
12384       __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
12385     } else {
12386       __pyx_t_1 = PyIter_Next(__pyx_t_5);
12387       if (!__pyx_t_1) {
12388         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12389         break;
12390       }
12391       __Pyx_GOTREF(__pyx_t_1);
12392     }
12393     __Pyx_DECREF(__pyx_v_r);
12394     __pyx_v_r = __pyx_t_1;
12395     __pyx_t_1 = 0;
12396
12397     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":618
12398  *         if not self._regions: return True
12399  *         for r in self._regions:
12400  *             if r[0] == chrom and r[1] <= pos < r[2]: return True             # <<<<<<<<<<<<<<
12401  *         return False
12402  * 
12403  */
12404     __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;}
12405     __Pyx_GOTREF(__pyx_t_1);
12406     __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;}
12407     __Pyx_GOTREF(__pyx_t_6);
12408     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12409     __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;}
12410     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12411     if (__pyx_t_3) {
12412       __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;}
12413       __Pyx_GOTREF(__pyx_t_6);
12414       __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;}
12415       __Pyx_GOTREF(__pyx_t_1);
12416       if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
12417         __Pyx_DECREF(__pyx_t_1);
12418         __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;}
12419         __Pyx_GOTREF(__pyx_t_7);
12420         __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;}
12421         __Pyx_GOTREF(__pyx_t_1);
12422         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12423       }
12424       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12425       __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;}
12426       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12427       __pyx_t_8 = __pyx_t_2;
12428     } else {
12429       __pyx_t_8 = __pyx_t_3;
12430     }
12431     if (__pyx_t_8) {
12432       __Pyx_XDECREF(__pyx_r);
12433       __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;}
12434       __Pyx_GOTREF(__pyx_t_1);
12435       __pyx_r = __pyx_t_1;
12436       __pyx_t_1 = 0;
12437       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12438       goto __pyx_L0;
12439       goto __pyx_L9;
12440     }
12441     __pyx_L9:;
12442   }
12443   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12444
12445   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":619
12446  *         for r in self._regions:
12447  *             if r[0] == chrom and r[1] <= pos < r[2]: return True
12448  *         return False             # <<<<<<<<<<<<<<
12449  * 
12450  * 
12451  */
12452   __Pyx_XDECREF(__pyx_r);
12453   __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;}
12454   __Pyx_GOTREF(__pyx_t_5);
12455   __pyx_r = __pyx_t_5;
12456   __pyx_t_5 = 0;
12457   goto __pyx_L0;
12458
12459   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12460   goto __pyx_L0;
12461   __pyx_L1_error:;
12462   __Pyx_XDECREF(__pyx_t_1);
12463   __Pyx_XDECREF(__pyx_t_5);
12464   __Pyx_XDECREF(__pyx_t_6);
12465   __Pyx_XDECREF(__pyx_t_7);
12466   __Pyx_AddTraceback("cvcf.VCF.inregion");
12467   __pyx_r = NULL;
12468   __pyx_L0:;
12469   __Pyx_DECREF(__pyx_v_r);
12470   __Pyx_XGIVEREF(__pyx_r);
12471   __Pyx_RefNannyFinishContext();
12472   return __pyx_r;
12473 }
12474
12475 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":622
12476  * 
12477  * 
12478  *     def parse_data( self, line, lineparse=False ):             # <<<<<<<<<<<<<<
12479  *         cols = line.split('\t')
12480  *         if len(cols) != len(self._samples)+9:
12481  */
12482
12483 static PyObject *__pyx_pf_4cvcf_3VCF_parse_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12484 static PyMethodDef __pyx_mdef_4cvcf_3VCF_parse_data = {__Pyx_NAMESTR("parse_data"), (PyCFunction)__pyx_pf_4cvcf_3VCF_parse_data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
12485 static PyObject *__pyx_pf_4cvcf_3VCF_parse_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12486   PyObject *__pyx_v_self = 0;
12487   PyObject *__pyx_v_line = 0;
12488   PyObject *__pyx_v_lineparse = 0;
12489   PyObject *__pyx_v_cols;
12490   PyObject *__pyx_v_chrom;
12491   PyObject *__pyx_v_pos;
12492   PyObject *__pyx_v_id;
12493   PyObject *__pyx_v_ref;
12494   PyObject *__pyx_v_c;
12495   PyObject *__pyx_v_left;
12496   PyObject *__pyx_v_faref_leftflank;
12497   PyObject *__pyx_v_faref;
12498   PyObject *__pyx_v_alt;
12499   double __pyx_v_qual;
12500   PyObject *__pyx_v_filter;
12501   PyObject *__pyx_v_info;
12502   PyObject *__pyx_v_blurp;
12503   PyObject *__pyx_v_elts;
12504   PyObject *__pyx_v_v;
12505   PyObject *__pyx_v_format;
12506   PyObject *__pyx_v_f;
12507   PyObject *__pyx_v_newalts;
12508   int __pyx_v_have_deletions;
12509   PyObject *__pyx_v_a;
12510   PyObject *__pyx_v_l;
12511   PyObject *__pyx_v_addns;
12512   PyObject *__pyx_v_i;
12513   PyObject *__pyx_v_na;
12514   PyObject *__pyx_v_s;
12515   PyObject *__pyx_v_addn;
12516   PyObject *__pyx_v_allele;
12517   int __pyx_v_movable;
12518   PyObject *__pyx_v_longest;
12519   PyObject *__pyx_v_shortest;
12520   PyObject *__pyx_v_samples;
12521   PyObject *__pyx_v_sample;
12522   PyObject *__pyx_v_dict;
12523   PyObject *__pyx_v_values;
12524   Py_ssize_t __pyx_v_idx;
12525   PyObject *__pyx_v_expected;
12526   PyObject *__pyx_v_value;
12527   PyObject *__pyx_v_d;
12528   PyObject *__pyx_v_key;
12529   PyObject *__pyx_8genexpr0__pyx_v_allele;
12530   PyObject *__pyx_r = NULL;
12531   PyObject *__pyx_t_1 = NULL;
12532   PyObject *__pyx_t_2 = NULL;
12533   PyObject *__pyx_t_3 = NULL;
12534   Py_ssize_t __pyx_t_4;
12535   Py_ssize_t __pyx_t_5;
12536   int __pyx_t_6;
12537   int __pyx_t_7;
12538   int __pyx_t_8;
12539   PyObject *__pyx_t_9 = NULL;
12540   PyObject *__pyx_t_10 = NULL;
12541   PyObject *__pyx_t_11 = NULL;
12542   PyObject *__pyx_t_12 = NULL;
12543   long __pyx_t_13;
12544   double __pyx_t_14;
12545   int __pyx_t_15;
12546   int __pyx_t_16;
12547   Py_ssize_t __pyx_t_17;
12548   PyObject *__pyx_t_18 = NULL;
12549   PyObject *__pyx_t_19 = NULL;
12550   PyObject *__pyx_t_20 = NULL;
12551   Py_ssize_t __pyx_t_21;
12552   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,&__pyx_n_s__lineparse,0};
12553   __Pyx_RefNannySetupContext("parse_data");
12554   __pyx_self = __pyx_self;
12555   if (unlikely(__pyx_kwds)) {
12556     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
12557     PyObject* values[3] = {0,0,0};
12558     values[2] = __pyx_k_61;
12559     switch (PyTuple_GET_SIZE(__pyx_args)) {
12560       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12561       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12562       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12563       case  0: break;
12564       default: goto __pyx_L5_argtuple_error;
12565     }
12566     switch (PyTuple_GET_SIZE(__pyx_args)) {
12567       case  0:
12568       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
12569       if (likely(values[0])) kw_args--;
12570       else goto __pyx_L5_argtuple_error;
12571       case  1:
12572       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
12573       if (likely(values[1])) kw_args--;
12574       else {
12575         __Pyx_RaiseArgtupleInvalid("parse_data", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12576       }
12577       case  2:
12578       if (kw_args > 0) {
12579         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lineparse);
12580         if (value) { values[2] = value; kw_args--; }
12581       }
12582     }
12583     if (unlikely(kw_args > 0)) {
12584       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;}
12585     }
12586     __pyx_v_self = values[0];
12587     __pyx_v_line = values[1];
12588     __pyx_v_lineparse = values[2];
12589   } else {
12590     __pyx_v_lineparse = __pyx_k_61;
12591     switch (PyTuple_GET_SIZE(__pyx_args)) {
12592       case  3:
12593       __pyx_v_lineparse = PyTuple_GET_ITEM(__pyx_args, 2);
12594       case  2:
12595       __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
12596       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
12597       break;
12598       default: goto __pyx_L5_argtuple_error;
12599     }
12600   }
12601   goto __pyx_L4_argument_unpacking_done;
12602   __pyx_L5_argtuple_error:;
12603   __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;}
12604   __pyx_L3_error:;
12605   __Pyx_AddTraceback("cvcf.VCF.parse_data");
12606   __Pyx_RefNannyFinishContext();
12607   return NULL;
12608   __pyx_L4_argument_unpacking_done:;
12609   __pyx_v_cols = Py_None; __Pyx_INCREF(Py_None);
12610   __pyx_v_chrom = Py_None; __Pyx_INCREF(Py_None);
12611   __pyx_v_pos = Py_None; __Pyx_INCREF(Py_None);
12612   __pyx_v_id = Py_None; __Pyx_INCREF(Py_None);
12613   __pyx_v_ref = Py_None; __Pyx_INCREF(Py_None);
12614   __pyx_v_c = Py_None; __Pyx_INCREF(Py_None);
12615   __pyx_v_left = Py_None; __Pyx_INCREF(Py_None);
12616   __pyx_v_faref_leftflank = Py_None; __Pyx_INCREF(Py_None);
12617   __pyx_v_faref = Py_None; __Pyx_INCREF(Py_None);
12618   __pyx_v_alt = Py_None; __Pyx_INCREF(Py_None);
12619   __pyx_v_filter = Py_None; __Pyx_INCREF(Py_None);
12620   __pyx_v_info = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
12621   __pyx_v_blurp = Py_None; __Pyx_INCREF(Py_None);
12622   __pyx_v_elts = Py_None; __Pyx_INCREF(Py_None);
12623   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
12624   __pyx_v_format = Py_None; __Pyx_INCREF(Py_None);
12625   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
12626   __pyx_v_newalts = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
12627   __pyx_v_a = Py_None; __Pyx_INCREF(Py_None);
12628   __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
12629   __pyx_v_addns = Py_None; __Pyx_INCREF(Py_None);
12630   __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
12631   __pyx_v_na = Py_None; __Pyx_INCREF(Py_None);
12632   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
12633   __pyx_v_addn = Py_None; __Pyx_INCREF(Py_None);
12634   __pyx_v_allele = Py_None; __Pyx_INCREF(Py_None);
12635   __pyx_v_longest = Py_None; __Pyx_INCREF(Py_None);
12636   __pyx_v_shortest = Py_None; __Pyx_INCREF(Py_None);
12637   __pyx_v_samples = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
12638   __pyx_v_sample = Py_None; __Pyx_INCREF(Py_None);
12639   __pyx_v_dict = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
12640   __pyx_v_values = Py_None; __Pyx_INCREF(Py_None);
12641   __pyx_v_expected = Py_None; __Pyx_INCREF(Py_None);
12642   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
12643   __pyx_v_d = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
12644   __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
12645   __pyx_8genexpr0__pyx_v_allele = Py_None; __Pyx_INCREF(Py_None);
12646
12647   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":623
12648  * 
12649  *     def parse_data( self, line, lineparse=False ):
12650  *         cols = line.split('\t')             # <<<<<<<<<<<<<<
12651  *         if len(cols) != len(self._samples)+9:
12652  *             # gracefully deal with absent FORMAT column
12653  */
12654   __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;}
12655   __Pyx_GOTREF(__pyx_t_1);
12656   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12657   __Pyx_GOTREF(__pyx_t_2);
12658   __Pyx_INCREF(((PyObject *)__pyx_kp_s_51));
12659   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_51));
12660   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_51));
12661   __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12662   __Pyx_GOTREF(__pyx_t_3);
12663   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12664   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12665   __Pyx_DECREF(__pyx_v_cols);
12666   __pyx_v_cols = __pyx_t_3;
12667   __pyx_t_3 = 0;
12668
12669   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":624
12670  *     def parse_data( self, line, lineparse=False ):
12671  *         cols = line.split('\t')
12672  *         if len(cols) != len(self._samples)+9:             # <<<<<<<<<<<<<<
12673  *             # gracefully deal with absent FORMAT column
12674  *             if len(cols) == 8 and len(self._samples)==0:
12675  */
12676   __pyx_t_4 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12677   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12678   __Pyx_GOTREF(__pyx_t_3);
12679   __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12680   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12681   __pyx_t_6 = (__pyx_t_4 != (__pyx_t_5 + 9));
12682   if (__pyx_t_6) {
12683
12684     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":626
12685  *         if len(cols) != len(self._samples)+9:
12686  *             # gracefully deal with absent FORMAT column
12687  *             if len(cols) == 8 and len(self._samples)==0:             # <<<<<<<<<<<<<<
12688  *                 cols.append("")
12689  *             else:
12690  */
12691     __pyx_t_5 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12692     __pyx_t_6 = (__pyx_t_5 == 8);
12693     if (__pyx_t_6) {
12694       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12695       __Pyx_GOTREF(__pyx_t_3);
12696       __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12697       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12698       __pyx_t_7 = (__pyx_t_5 == 0);
12699       __pyx_t_8 = __pyx_t_7;
12700     } else {
12701       __pyx_t_8 = __pyx_t_6;
12702     }
12703     if (__pyx_t_8) {
12704
12705       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":627
12706  *             # gracefully deal with absent FORMAT column
12707  *             if len(cols) == 8 and len(self._samples)==0:
12708  *                 cols.append("")             # <<<<<<<<<<<<<<
12709  *             else:
12710  *                 self.error(line,
12711  */
12712       __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_cols, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12713       __Pyx_GOTREF(__pyx_t_3);
12714       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12715       goto __pyx_L7;
12716     }
12717     /*else*/ {
12718
12719       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":629
12720  *                 cols.append("")
12721  *             else:
12722  *                 self.error(line,             # <<<<<<<<<<<<<<
12723  *                            self.BAD_NUMBER_OF_COLUMNS,
12724  *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
12725  */
12726       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12727       __Pyx_GOTREF(__pyx_t_3);
12728
12729       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":630
12730  *             else:
12731  *                 self.error(line,
12732  *                            self.BAD_NUMBER_OF_COLUMNS,             # <<<<<<<<<<<<<<
12733  *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
12734  * 
12735  */
12736       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_62); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12737       __Pyx_GOTREF(__pyx_t_2);
12738
12739       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":631
12740  *                 self.error(line,
12741  *                            self.BAD_NUMBER_OF_COLUMNS,
12742  *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))             # <<<<<<<<<<<<<<
12743  * 
12744  *         chrom = cols[0]
12745  */
12746       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12747       __Pyx_GOTREF(__pyx_t_1);
12748       __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12749       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12750       __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_5 + 9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12751       __Pyx_GOTREF(__pyx_t_1);
12752       __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;}
12753       __Pyx_GOTREF(__pyx_t_9);
12754       __pyx_t_5 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12755       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12756       __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12757       __Pyx_GOTREF(__pyx_t_9);
12758       __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;}
12759       __Pyx_GOTREF(__pyx_t_10);
12760       __pyx_t_5 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12761       __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12762       __Pyx_GOTREF(__pyx_t_11);
12763       __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;}
12764       __Pyx_GOTREF(__pyx_t_12);
12765       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1);
12766       __Pyx_GIVEREF(__pyx_t_1);
12767       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_9);
12768       __Pyx_GIVEREF(__pyx_t_9);
12769       PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_10);
12770       __Pyx_GIVEREF(__pyx_t_10);
12771       PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_11);
12772       __Pyx_GIVEREF(__pyx_t_11);
12773       __pyx_t_1 = 0;
12774       __pyx_t_9 = 0;
12775       __pyx_t_10 = 0;
12776       __pyx_t_11 = 0;
12777       __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12778       __Pyx_GOTREF(((PyObject *)__pyx_t_11));
12779       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12780       __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;}
12781       __Pyx_GOTREF(__pyx_t_12);
12782       __Pyx_INCREF(__pyx_v_line);
12783       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
12784       __Pyx_GIVEREF(__pyx_v_line);
12785       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2);
12786       __Pyx_GIVEREF(__pyx_t_2);
12787       PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_t_11));
12788       __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
12789       __pyx_t_2 = 0;
12790       __pyx_t_11 = 0;
12791       __pyx_t_11 = PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12792       __Pyx_GOTREF(__pyx_t_11);
12793       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12794       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12795       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12796     }
12797     __pyx_L7:;
12798     goto __pyx_L6;
12799   }
12800   __pyx_L6:;
12801
12802   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":633
12803  *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
12804  * 
12805  *         chrom = cols[0]             # <<<<<<<<<<<<<<
12806  * 
12807  *         # get 0-based position
12808  */
12809   __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;}
12810   __Pyx_GOTREF(__pyx_t_11);
12811   __Pyx_DECREF(__pyx_v_chrom);
12812   __pyx_v_chrom = __pyx_t_11;
12813   __pyx_t_11 = 0;
12814
12815   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":636
12816  * 
12817  *         # get 0-based position
12818  *         try:    pos = int(cols[1])-1             # <<<<<<<<<<<<<<
12819  *         except: self.error(line,self.POS_NOT_NUMERICAL)
12820  *         if pos < 0: self.error(line,self.POS_NOT_POSITIVE)
12821  */
12822   {
12823     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
12824     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
12825     __Pyx_XGOTREF(__pyx_save_exc_type);
12826     __Pyx_XGOTREF(__pyx_save_exc_value);
12827     __Pyx_XGOTREF(__pyx_save_exc_tb);
12828     /*try:*/ {
12829       __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;}
12830       __Pyx_GOTREF(__pyx_t_11);
12831       __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;}
12832       __Pyx_GOTREF(__pyx_t_12);
12833       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11);
12834       __Pyx_GIVEREF(__pyx_t_11);
12835       __pyx_t_11 = 0;
12836       __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
12837       __Pyx_GOTREF(__pyx_t_11);
12838       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12839       __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;}
12840       __Pyx_GOTREF(__pyx_t_12);
12841       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12842       __Pyx_DECREF(__pyx_v_pos);
12843       __pyx_v_pos = __pyx_t_12;
12844       __pyx_t_12 = 0;
12845     }
12846     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
12847     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
12848     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
12849     goto __pyx_L15_try_end;
12850     __pyx_L8_error:;
12851     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12852     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12853     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12854     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12855     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12856     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12857     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
12858
12859     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":637
12860  *         # get 0-based position
12861  *         try:    pos = int(cols[1])-1
12862  *         except: self.error(line,self.POS_NOT_NUMERICAL)             # <<<<<<<<<<<<<<
12863  *         if pos < 0: self.error(line,self.POS_NOT_POSITIVE)
12864  * 
12865  */
12866     /*except:*/ {
12867       __Pyx_AddTraceback("cvcf.VCF.parse_data");
12868       if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
12869       __Pyx_GOTREF(__pyx_t_12);
12870       __Pyx_GOTREF(__pyx_t_11);
12871       __Pyx_GOTREF(__pyx_t_3);
12872       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
12873       __Pyx_GOTREF(__pyx_t_2);
12874       __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;}
12875       __Pyx_GOTREF(__pyx_t_10);
12876       __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;}
12877       __Pyx_GOTREF(__pyx_t_9);
12878       __Pyx_INCREF(__pyx_v_line);
12879       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
12880       __Pyx_GIVEREF(__pyx_v_line);
12881       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
12882       __Pyx_GIVEREF(__pyx_t_10);
12883       __pyx_t_10 = 0;
12884       __pyx_t_10 = PyObject_Call(__pyx_t_2, __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;}
12885       __Pyx_GOTREF(__pyx_t_10);
12886       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12887       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12888       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12889       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12890       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12891       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12892       goto __pyx_L9_exception_handled;
12893     }
12894     __pyx_L10_except_error:;
12895     __Pyx_XGIVEREF(__pyx_save_exc_type);
12896     __Pyx_XGIVEREF(__pyx_save_exc_value);
12897     __Pyx_XGIVEREF(__pyx_save_exc_tb);
12898     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12899     goto __pyx_L1_error;
12900     __pyx_L9_exception_handled:;
12901     __Pyx_XGIVEREF(__pyx_save_exc_type);
12902     __Pyx_XGIVEREF(__pyx_save_exc_value);
12903     __Pyx_XGIVEREF(__pyx_save_exc_tb);
12904     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
12905     __pyx_L15_try_end:;
12906   }
12907
12908   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":638
12909  *         try:    pos = int(cols[1])-1
12910  *         except: self.error(line,self.POS_NOT_NUMERICAL)
12911  *         if pos < 0: self.error(line,self.POS_NOT_POSITIVE)             # <<<<<<<<<<<<<<
12912  * 
12913  *         # implement filtering
12914  */
12915   __pyx_t_3 = PyObject_RichCompare(__pyx_v_pos, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12916   __Pyx_GOTREF(__pyx_t_3);
12917   __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12918   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12919   if (__pyx_t_8) {
12920     __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12921     __Pyx_GOTREF(__pyx_t_3);
12922     __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;}
12923     __Pyx_GOTREF(__pyx_t_11);
12924     __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;}
12925     __Pyx_GOTREF(__pyx_t_12);
12926     __Pyx_INCREF(__pyx_v_line);
12927     PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
12928     __Pyx_GIVEREF(__pyx_v_line);
12929     PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
12930     __Pyx_GIVEREF(__pyx_t_11);
12931     __pyx_t_11 = 0;
12932     __pyx_t_11 = PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12933     __Pyx_GOTREF(__pyx_t_11);
12934     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12935     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12936     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12937     goto __pyx_L18;
12938   }
12939   __pyx_L18:;
12940
12941   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":641
12942  * 
12943  *         # implement filtering
12944  *         if not self.inregion(chrom,pos): return None             # <<<<<<<<<<<<<<
12945  * 
12946  *         # end of first-pass parse for sortedVCF
12947  */
12948   __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;}
12949   __Pyx_GOTREF(__pyx_t_11);
12950   __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;}
12951   __Pyx_GOTREF(__pyx_t_12);
12952   __Pyx_INCREF(__pyx_v_chrom);
12953   PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_chrom);
12954   __Pyx_GIVEREF(__pyx_v_chrom);
12955   __Pyx_INCREF(__pyx_v_pos);
12956   PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_pos);
12957   __Pyx_GIVEREF(__pyx_v_pos);
12958   __pyx_t_3 = PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12959   __Pyx_GOTREF(__pyx_t_3);
12960   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12961   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12962   __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12963   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12964   __pyx_t_6 = (!__pyx_t_8);
12965   if (__pyx_t_6) {
12966     __Pyx_XDECREF(__pyx_r);
12967     __Pyx_INCREF(Py_None);
12968     __pyx_r = Py_None;
12969     goto __pyx_L0;
12970     goto __pyx_L19;
12971   }
12972   __pyx_L19:;
12973
12974   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":644
12975  * 
12976  *         # end of first-pass parse for sortedVCF
12977  *         if lineparse: return chrom, pos, line             # <<<<<<<<<<<<<<
12978  * 
12979  *         id = cols[2]
12980  */
12981   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_lineparse); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12982   if (__pyx_t_6) {
12983     __Pyx_XDECREF(__pyx_r);
12984     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12985     __Pyx_GOTREF(__pyx_t_3);
12986     __Pyx_INCREF(__pyx_v_chrom);
12987     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom);
12988     __Pyx_GIVEREF(__pyx_v_chrom);
12989     __Pyx_INCREF(__pyx_v_pos);
12990     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_pos);
12991     __Pyx_GIVEREF(__pyx_v_pos);
12992     __Pyx_INCREF(__pyx_v_line);
12993     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_line);
12994     __Pyx_GIVEREF(__pyx_v_line);
12995     __pyx_r = __pyx_t_3;
12996     __pyx_t_3 = 0;
12997     goto __pyx_L0;
12998     goto __pyx_L20;
12999   }
13000   __pyx_L20:;
13001
13002   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":646
13003  *         if lineparse: return chrom, pos, line
13004  * 
13005  *         id = cols[2]             # <<<<<<<<<<<<<<
13006  * 
13007  *         ref = cols[3].upper()
13008  */
13009   __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_cols, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13010   __Pyx_GOTREF(__pyx_t_3);
13011   __Pyx_DECREF(__pyx_v_id);
13012   __pyx_v_id = __pyx_t_3;
13013   __pyx_t_3 = 0;
13014
13015   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":648
13016  *         id = cols[2]
13017  * 
13018  *         ref = cols[3].upper()             # <<<<<<<<<<<<<<
13019  *         if ref == ".":
13020  *             self.error(line,self.MISSING_REF)
13021  */
13022   __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_cols, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13023   __Pyx_GOTREF(__pyx_t_3);
13024   __pyx_t_12 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__upper); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13025   __Pyx_GOTREF(__pyx_t_12);
13026   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13027   __pyx_t_3 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13028   __Pyx_GOTREF(__pyx_t_3);
13029   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13030   __Pyx_DECREF(__pyx_v_ref);
13031   __pyx_v_ref = __pyx_t_3;
13032   __pyx_t_3 = 0;
13033
13034   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":649
13035  * 
13036  *         ref = cols[3].upper()
13037  *         if ref == ".":             # <<<<<<<<<<<<<<
13038  *             self.error(line,self.MISSING_REF)
13039  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
13040  */
13041   __pyx_t_3 = PyObject_RichCompare(__pyx_v_ref, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13042   __Pyx_GOTREF(__pyx_t_3);
13043   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13044   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13045   if (__pyx_t_6) {
13046
13047     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":650
13048  *         ref = cols[3].upper()
13049  *         if ref == ".":
13050  *             self.error(line,self.MISSING_REF)             # <<<<<<<<<<<<<<
13051  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
13052  *             else:                   ref = ""
13053  */
13054     __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13055     __Pyx_GOTREF(__pyx_t_3);
13056     __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;}
13057     __Pyx_GOTREF(__pyx_t_12);
13058     __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;}
13059     __Pyx_GOTREF(__pyx_t_11);
13060     __Pyx_INCREF(__pyx_v_line);
13061     PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_line);
13062     __Pyx_GIVEREF(__pyx_v_line);
13063     PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12);
13064     __Pyx_GIVEREF(__pyx_t_12);
13065     __pyx_t_12 = 0;
13066     __pyx_t_12 = PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13067     __Pyx_GOTREF(__pyx_t_12);
13068     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13069     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13070     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13071
13072     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":651
13073  *         if ref == ".":
13074  *             self.error(line,self.MISSING_REF)
13075  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)             # <<<<<<<<<<<<<<
13076  *             else:                   ref = ""
13077  *         else:
13078  */
13079     __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;}
13080     __Pyx_GOTREF(__pyx_t_12);
13081     __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;}
13082     __Pyx_GOTREF(__pyx_t_11);
13083     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13084     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13085     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13086     if (__pyx_t_6) {
13087       __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;}
13088       __Pyx_GOTREF(__pyx_t_11);
13089       __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;}
13090       __Pyx_GOTREF(__pyx_t_12);
13091       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13092       __Pyx_GOTREF(__pyx_t_3);
13093       __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;}
13094       __Pyx_GOTREF(__pyx_t_10);
13095       __Pyx_INCREF(__pyx_v_chrom);
13096       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
13097       __Pyx_GIVEREF(__pyx_v_chrom);
13098       __Pyx_INCREF(__pyx_v_pos);
13099       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_pos);
13100       __Pyx_GIVEREF(__pyx_v_pos);
13101       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_12);
13102       __Pyx_GIVEREF(__pyx_t_12);
13103       PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_3);
13104       __Pyx_GIVEREF(__pyx_t_3);
13105       __pyx_t_12 = 0;
13106       __pyx_t_3 = 0;
13107       __pyx_t_3 = PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13108       __Pyx_GOTREF(__pyx_t_3);
13109       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13110       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13111       __Pyx_DECREF(__pyx_v_ref);
13112       __pyx_v_ref = __pyx_t_3;
13113       __pyx_t_3 = 0;
13114       goto __pyx_L22;
13115     }
13116     /*else*/ {
13117
13118       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":652
13119  *             self.error(line,self.MISSING_REF)
13120  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
13121  *             else:                   ref = ""             # <<<<<<<<<<<<<<
13122  *         else:
13123  *             for c in ref:
13124  */
13125       __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
13126       __Pyx_DECREF(__pyx_v_ref);
13127       __pyx_v_ref = ((PyObject *)__pyx_kp_s_1);
13128     }
13129     __pyx_L22:;
13130     goto __pyx_L21;
13131   }
13132   /*else*/ {
13133
13134     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":654
13135  *             else:                   ref = ""
13136  *         else:
13137  *             for c in ref:             # <<<<<<<<<<<<<<
13138  *                 if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF)
13139  *             if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference)
13140  */
13141     if (PyList_CheckExact(__pyx_v_ref) || PyTuple_CheckExact(__pyx_v_ref)) {
13142       __pyx_t_5 = 0; __pyx_t_3 = __pyx_v_ref; __Pyx_INCREF(__pyx_t_3);
13143     } else {
13144       __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13145       __Pyx_GOTREF(__pyx_t_3);
13146     }
13147     for (;;) {
13148       if (likely(PyList_CheckExact(__pyx_t_3))) {
13149         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
13150         __pyx_t_10 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_10); __pyx_t_5++;
13151       } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
13152         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
13153         __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_10); __pyx_t_5++;
13154       } else {
13155         __pyx_t_10 = PyIter_Next(__pyx_t_3);
13156         if (!__pyx_t_10) {
13157           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13158           break;
13159         }
13160         __Pyx_GOTREF(__pyx_t_10);
13161       }
13162       __Pyx_DECREF(__pyx_v_c);
13163       __pyx_v_c = __pyx_t_10;
13164       __pyx_t_10 = 0;
13165
13166       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":655
13167  *         else:
13168  *             for c in ref:
13169  *                 if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF)             # <<<<<<<<<<<<<<
13170  *             if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference)
13171  * 
13172  */
13173       __pyx_t_6 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_n_s__ACGTN), __pyx_v_c))); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13174       if (__pyx_t_6) {
13175         __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;}
13176         __Pyx_GOTREF(__pyx_t_10);
13177         __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;}
13178         __Pyx_GOTREF(__pyx_t_11);
13179         __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;}
13180         __Pyx_GOTREF(__pyx_t_12);
13181         __Pyx_INCREF(__pyx_v_line);
13182         PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
13183         __Pyx_GIVEREF(__pyx_v_line);
13184         PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
13185         __Pyx_GIVEREF(__pyx_t_11);
13186         __pyx_t_11 = 0;
13187         __pyx_t_11 = PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13188         __Pyx_GOTREF(__pyx_t_11);
13189         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13190         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13191         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13192         goto __pyx_L25;
13193       }
13194       __pyx_L25:;
13195     }
13196     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13197
13198     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":656
13199  *             for c in ref:
13200  *                 if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF)
13201  *             if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference)             # <<<<<<<<<<<<<<
13202  * 
13203  *         # make sure reference is sane
13204  */
13205     __pyx_t_6 = ((PySequence_Contains(__pyx_v_ref, ((PyObject *)__pyx_n_s__N)))); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13206     if (__pyx_t_6) {
13207       __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13208       __Pyx_GOTREF(__pyx_t_3);
13209       __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13210       __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13211       __Pyx_GOTREF(__pyx_t_11);
13212       __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;}
13213       __Pyx_GOTREF(__pyx_t_12);
13214       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13215       __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;}
13216       __Pyx_GOTREF(__pyx_t_11);
13217       __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;}
13218       __Pyx_GOTREF(__pyx_t_10);
13219       __Pyx_INCREF(__pyx_v_chrom);
13220       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
13221       __Pyx_GIVEREF(__pyx_v_chrom);
13222       __Pyx_INCREF(__pyx_v_pos);
13223       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_pos);
13224       __Pyx_GIVEREF(__pyx_v_pos);
13225       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_12);
13226       __Pyx_GIVEREF(__pyx_t_12);
13227       PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_11);
13228       __Pyx_GIVEREF(__pyx_t_11);
13229       __pyx_t_12 = 0;
13230       __pyx_t_11 = 0;
13231       __pyx_t_11 = PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13232       __Pyx_GOTREF(__pyx_t_11);
13233       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13234       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13235       __Pyx_DECREF(__pyx_v_ref);
13236       __pyx_v_ref = __pyx_t_11;
13237       __pyx_t_11 = 0;
13238       goto __pyx_L26;
13239     }
13240     __pyx_L26:;
13241   }
13242   __pyx_L21:;
13243
13244   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":659
13245  * 
13246  *         # make sure reference is sane
13247  *         if self._reference:             # <<<<<<<<<<<<<<
13248  *             left = max(0,pos-100)
13249  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
13250  */
13251   __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;}
13252   __Pyx_GOTREF(__pyx_t_11);
13253   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13254   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13255   if (__pyx_t_6) {
13256
13257     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":660
13258  *         # make sure reference is sane
13259  *         if self._reference:
13260  *             left = max(0,pos-100)             # <<<<<<<<<<<<<<
13261  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
13262  *             faref = faref_leftflank[pos-left:]
13263  */
13264     __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;}
13265     __Pyx_GOTREF(__pyx_t_11);
13266     __pyx_t_13 = 0;
13267     __pyx_t_3 = PyInt_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13268     __Pyx_GOTREF(__pyx_t_3);
13269     __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13270     __Pyx_GOTREF(__pyx_t_12);
13271     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13272     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13273     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13274     if (__pyx_t_6) {
13275       __Pyx_INCREF(__pyx_t_11);
13276       __pyx_t_10 = __pyx_t_11;
13277     } else {
13278       __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;}
13279       __Pyx_GOTREF(__pyx_t_12);
13280       __pyx_t_10 = __pyx_t_12;
13281       __pyx_t_12 = 0;
13282     }
13283     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13284     __Pyx_INCREF(__pyx_t_10);
13285     __Pyx_DECREF(__pyx_v_left);
13286     __pyx_v_left = __pyx_t_10;
13287     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13288
13289     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":661
13290  *         if self._reference:
13291  *             left = max(0,pos-100)
13292  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)             # <<<<<<<<<<<<<<
13293  *             faref = faref_leftflank[pos-left:]
13294  *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
13295  */
13296     __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;}
13297     __Pyx_GOTREF(__pyx_t_10);
13298     __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13299     __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13300     __Pyx_GOTREF(__pyx_t_11);
13301     __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;}
13302     __Pyx_GOTREF(__pyx_t_12);
13303     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13304     __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;}
13305     __Pyx_GOTREF(__pyx_t_11);
13306     __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13307     __Pyx_GOTREF(__pyx_t_3);
13308     __Pyx_INCREF(__pyx_v_chrom);
13309     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom);
13310     __Pyx_GIVEREF(__pyx_v_chrom);
13311     __Pyx_INCREF(__pyx_v_left);
13312     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_left);
13313     __Pyx_GIVEREF(__pyx_v_left);
13314     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_12);
13315     __Pyx_GIVEREF(__pyx_t_12);
13316     PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_11);
13317     __Pyx_GIVEREF(__pyx_t_11);
13318     __pyx_t_12 = 0;
13319     __pyx_t_11 = 0;
13320     __pyx_t_11 = PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13321     __Pyx_GOTREF(__pyx_t_11);
13322     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13323     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13324     __Pyx_DECREF(__pyx_v_faref_leftflank);
13325     __pyx_v_faref_leftflank = __pyx_t_11;
13326     __pyx_t_11 = 0;
13327
13328     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":662
13329  *             left = max(0,pos-100)
13330  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
13331  *             faref = faref_leftflank[pos-left:]             # <<<<<<<<<<<<<<
13332  *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
13333  *             ref = faref
13334  */
13335     __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;}
13336     __Pyx_GOTREF(__pyx_t_11);
13337     __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13338     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13339     __pyx_t_11 = PySequence_GetSlice(__pyx_v_faref_leftflank, __pyx_t_5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13340     __Pyx_GOTREF(__pyx_t_11);
13341     __Pyx_DECREF(__pyx_v_faref);
13342     __pyx_v_faref = __pyx_t_11;
13343     __pyx_t_11 = 0;
13344
13345     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":663
13346  *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
13347  *             faref = faref_leftflank[pos-left:]
13348  *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))             # <<<<<<<<<<<<<<
13349  *             ref = faref
13350  * 
13351  */
13352     __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;}
13353     __Pyx_GOTREF(__pyx_t_11);
13354     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13355     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13356     if (__pyx_t_6) {
13357       __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;}
13358       __Pyx_GOTREF(__pyx_t_11);
13359       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__WRONG_REF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13360       __Pyx_GOTREF(__pyx_t_3);
13361       __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;}
13362       __Pyx_GOTREF(__pyx_t_10);
13363       __Pyx_INCREF(__pyx_v_faref);
13364       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_faref);
13365       __Pyx_GIVEREF(__pyx_v_faref);
13366       __Pyx_INCREF(__pyx_v_ref);
13367       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_ref);
13368       __Pyx_GIVEREF(__pyx_v_ref);
13369       __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_64), __pyx_t_10); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13370       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
13371       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13372       __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;}
13373       __Pyx_GOTREF(__pyx_t_10);
13374       __Pyx_INCREF(__pyx_v_line);
13375       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
13376       __Pyx_GIVEREF(__pyx_v_line);
13377       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_3);
13378       __Pyx_GIVEREF(__pyx_t_3);
13379       PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_t_12));
13380       __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
13381       __pyx_t_3 = 0;
13382       __pyx_t_12 = 0;
13383       __pyx_t_12 = PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13384       __Pyx_GOTREF(__pyx_t_12);
13385       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13386       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13387       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13388       goto __pyx_L28;
13389     }
13390     __pyx_L28:;
13391
13392     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":664
13393  *             faref = faref_leftflank[pos-left:]
13394  *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
13395  *             ref = faref             # <<<<<<<<<<<<<<
13396  * 
13397  *         # convert v3.3 to v4.0 alleles below
13398  */
13399     __Pyx_INCREF(__pyx_v_faref);
13400     __Pyx_DECREF(__pyx_v_ref);
13401     __pyx_v_ref = __pyx_v_faref;
13402     goto __pyx_L27;
13403   }
13404   __pyx_L27:;
13405
13406   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":667
13407  * 
13408  *         # convert v3.3 to v4.0 alleles below
13409  *         if cols[4] == ".": alt = []             # <<<<<<<<<<<<<<
13410  *         else: alt = cols[4].upper().split(',')
13411  * 
13412  */
13413   __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;}
13414   __Pyx_GOTREF(__pyx_t_12);
13415   __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13416   __Pyx_GOTREF(__pyx_t_10);
13417   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13418   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13419   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13420   if (__pyx_t_6) {
13421     __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;}
13422     __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13423     __Pyx_DECREF(__pyx_v_alt);
13424     __pyx_v_alt = ((PyObject *)__pyx_t_10);
13425     __pyx_t_10 = 0;
13426     goto __pyx_L29;
13427   }
13428   /*else*/ {
13429
13430     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":668
13431  *         # convert v3.3 to v4.0 alleles below
13432  *         if cols[4] == ".": alt = []
13433  *         else: alt = cols[4].upper().split(',')             # <<<<<<<<<<<<<<
13434  * 
13435  *         if cols[5] == ".": qual = -1
13436  */
13437     __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;}
13438     __Pyx_GOTREF(__pyx_t_10);
13439     __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;}
13440     __Pyx_GOTREF(__pyx_t_12);
13441     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13442     __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;}
13443     __Pyx_GOTREF(__pyx_t_10);
13444     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13445     __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;}
13446     __Pyx_GOTREF(__pyx_t_12);
13447     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13448     __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13449     __Pyx_GOTREF(__pyx_t_10);
13450     __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
13451     PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_kp_s_2));
13452     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
13453     __pyx_t_11 = PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13454     __Pyx_GOTREF(__pyx_t_11);
13455     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13456     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13457     __Pyx_DECREF(__pyx_v_alt);
13458     __pyx_v_alt = __pyx_t_11;
13459     __pyx_t_11 = 0;
13460   }
13461   __pyx_L29:;
13462
13463   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":670
13464  *         else: alt = cols[4].upper().split(',')
13465  * 
13466  *         if cols[5] == ".": qual = -1             # <<<<<<<<<<<<<<
13467  *         else:
13468  *             try:    qual = float(cols[5])
13469  */
13470   __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13471   __Pyx_GOTREF(__pyx_t_11);
13472   __pyx_t_10 = PyObject_RichCompare(__pyx_t_11, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13473   __Pyx_GOTREF(__pyx_t_10);
13474   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13475   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13476   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13477   if (__pyx_t_6) {
13478     __pyx_v_qual = -1.0;
13479     goto __pyx_L30;
13480   }
13481   /*else*/ {
13482
13483     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":672
13484  *         if cols[5] == ".": qual = -1
13485  *         else:
13486  *             try:    qual = float(cols[5])             # <<<<<<<<<<<<<<
13487  *             except: self.error(line,self.QUAL_NOT_NUMERICAL)
13488  * 
13489  */
13490     {
13491       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
13492       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
13493       __Pyx_XGOTREF(__pyx_save_exc_type);
13494       __Pyx_XGOTREF(__pyx_save_exc_value);
13495       __Pyx_XGOTREF(__pyx_save_exc_tb);
13496       /*try:*/ {
13497         __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
13498         __Pyx_GOTREF(__pyx_t_10);
13499         __pyx_t_14 = __Pyx_PyObject_AsDouble(__pyx_t_10); if (unlikely(__pyx_t_14 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L31_error;}
13500         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13501         __pyx_v_qual = __pyx_t_14;
13502       }
13503       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
13504       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
13505       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
13506       goto __pyx_L38_try_end;
13507       __pyx_L31_error:;
13508       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13509       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13510       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13511       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13512       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
13513       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
13514       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13515
13516       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":673
13517  *         else:
13518  *             try:    qual = float(cols[5])
13519  *             except: self.error(line,self.QUAL_NOT_NUMERICAL)             # <<<<<<<<<<<<<<
13520  * 
13521  *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
13522  */
13523       /*except:*/ {
13524         __Pyx_AddTraceback("cvcf.VCF.parse_data");
13525         if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
13526         __Pyx_GOTREF(__pyx_t_10);
13527         __Pyx_GOTREF(__pyx_t_11);
13528         __Pyx_GOTREF(__pyx_t_12);
13529         __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
13530         __Pyx_GOTREF(__pyx_t_3);
13531         __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;}
13532         __Pyx_GOTREF(__pyx_t_9);
13533         __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
13534         __Pyx_GOTREF(__pyx_t_2);
13535         __Pyx_INCREF(__pyx_v_line);
13536         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
13537         __Pyx_GIVEREF(__pyx_v_line);
13538         PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
13539         __Pyx_GIVEREF(__pyx_t_9);
13540         __pyx_t_9 = 0;
13541         __pyx_t_9 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
13542         __Pyx_GOTREF(__pyx_t_9);
13543         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13544         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13545         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13546         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13547         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13548         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13549         goto __pyx_L32_exception_handled;
13550       }
13551       __pyx_L33_except_error:;
13552       __Pyx_XGIVEREF(__pyx_save_exc_type);
13553       __Pyx_XGIVEREF(__pyx_save_exc_value);
13554       __Pyx_XGIVEREF(__pyx_save_exc_tb);
13555       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
13556       goto __pyx_L1_error;
13557       __pyx_L32_exception_handled:;
13558       __Pyx_XGIVEREF(__pyx_save_exc_type);
13559       __Pyx_XGIVEREF(__pyx_save_exc_value);
13560       __Pyx_XGIVEREF(__pyx_save_exc_tb);
13561       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
13562       __pyx_L38_try_end:;
13563     }
13564   }
13565   __pyx_L30:;
13566
13567   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":676
13568  * 
13569  *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
13570  *         if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = []             # <<<<<<<<<<<<<<
13571  *         else: filter = cols[6].split(';')
13572  * 
13573  */
13574   __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13575   __Pyx_GOTREF(__pyx_t_12);
13576   __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13577   __Pyx_GOTREF(__pyx_t_11);
13578   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13579   __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13580   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13581   if (!__pyx_t_6) {
13582     __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;}
13583     __Pyx_GOTREF(__pyx_t_11);
13584     __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, ((PyObject *)__pyx_n_s__PASS), Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13585     __Pyx_GOTREF(__pyx_t_12);
13586     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13587     __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13588     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13589     if (!__pyx_t_8) {
13590       __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cols, 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13591       __Pyx_GOTREF(__pyx_t_12);
13592       __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, ((PyObject *)__pyx_kp_s__0), Py_EQ); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13593       __Pyx_GOTREF(__pyx_t_11);
13594       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13595       __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;}
13596       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13597       __pyx_t_15 = __pyx_t_7;
13598     } else {
13599       __pyx_t_15 = __pyx_t_8;
13600     }
13601     __pyx_t_8 = __pyx_t_15;
13602   } else {
13603     __pyx_t_8 = __pyx_t_6;
13604   }
13605   if (__pyx_t_8) {
13606     __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13607     __Pyx_GOTREF(((PyObject *)__pyx_t_11));
13608     __Pyx_DECREF(__pyx_v_filter);
13609     __pyx_v_filter = ((PyObject *)__pyx_t_11);
13610     __pyx_t_11 = 0;
13611     goto __pyx_L41;
13612   }
13613   /*else*/ {
13614
13615     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":677
13616  *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
13617  *         if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = []
13618  *         else: filter = cols[6].split(';')             # <<<<<<<<<<<<<<
13619  * 
13620  *         # dictionary of keys, and list of values
13621  */
13622     __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13623     __Pyx_GOTREF(__pyx_t_11);
13624     __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__split); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13625     __Pyx_GOTREF(__pyx_t_12);
13626     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13627     __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13628     __Pyx_GOTREF(__pyx_t_11);
13629     __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
13630     PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_kp_s_7));
13631     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
13632     __pyx_t_10 = PyObject_Call(__pyx_t_12, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13633     __Pyx_GOTREF(__pyx_t_10);
13634     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13635     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13636     __Pyx_DECREF(__pyx_v_filter);
13637     __pyx_v_filter = __pyx_t_10;
13638     __pyx_t_10 = 0;
13639   }
13640   __pyx_L41:;
13641
13642   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":680
13643  * 
13644  *         # dictionary of keys, and list of values
13645  *         info = {}             # <<<<<<<<<<<<<<
13646  *         if cols[7] != ".":
13647  *             for blurp in cols[7].split(';'):
13648  */
13649   __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;}
13650   __Pyx_GOTREF(((PyObject *)__pyx_t_10));
13651   __Pyx_DECREF(((PyObject *)__pyx_v_info));
13652   __pyx_v_info = __pyx_t_10;
13653   __pyx_t_10 = 0;
13654
13655   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":681
13656  *         # dictionary of keys, and list of values
13657  *         info = {}
13658  *         if cols[7] != ".":             # <<<<<<<<<<<<<<
13659  *             for blurp in cols[7].split(';'):
13660  *                 elts = blurp.split('=')
13661  */
13662   __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;}
13663   __Pyx_GOTREF(__pyx_t_10);
13664   __pyx_t_11 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_kp_s_6), Py_NE); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13665   __Pyx_GOTREF(__pyx_t_11);
13666   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13667   __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13668   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13669   if (__pyx_t_8) {
13670
13671     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":682
13672  *         info = {}
13673  *         if cols[7] != ".":
13674  *             for blurp in cols[7].split(';'):             # <<<<<<<<<<<<<<
13675  *                 elts = blurp.split('=')
13676  *                 if len(elts) == 1: v = None
13677  */
13678     __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;}
13679     __Pyx_GOTREF(__pyx_t_11);
13680     __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;}
13681     __Pyx_GOTREF(__pyx_t_10);
13682     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13683     __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13684     __Pyx_GOTREF(__pyx_t_11);
13685     __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
13686     PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_kp_s_7));
13687     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
13688     __pyx_t_12 = PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13689     __Pyx_GOTREF(__pyx_t_12);
13690     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13691     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13692     if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
13693       __pyx_t_5 = 0; __pyx_t_11 = __pyx_t_12; __Pyx_INCREF(__pyx_t_11);
13694     } else {
13695       __pyx_t_5 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13696       __Pyx_GOTREF(__pyx_t_11);
13697     }
13698     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13699     for (;;) {
13700       if (likely(PyList_CheckExact(__pyx_t_11))) {
13701         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_11)) break;
13702         __pyx_t_12 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_12); __pyx_t_5++;
13703       } else if (likely(PyTuple_CheckExact(__pyx_t_11))) {
13704         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
13705         __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_12); __pyx_t_5++;
13706       } else {
13707         __pyx_t_12 = PyIter_Next(__pyx_t_11);
13708         if (!__pyx_t_12) {
13709           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13710           break;
13711         }
13712         __Pyx_GOTREF(__pyx_t_12);
13713       }
13714       __Pyx_DECREF(__pyx_v_blurp);
13715       __pyx_v_blurp = __pyx_t_12;
13716       __pyx_t_12 = 0;
13717
13718       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":683
13719  *         if cols[7] != ".":
13720  *             for blurp in cols[7].split(';'):
13721  *                 elts = blurp.split('=')             # <<<<<<<<<<<<<<
13722  *                 if len(elts) == 1: v = None
13723  *                 elif len(elts) == 2: v = elts[1]
13724  */
13725       __pyx_t_12 = PyObject_GetAttr(__pyx_v_blurp, __pyx_n_s__split); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13726       __Pyx_GOTREF(__pyx_t_12);
13727       __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13728       __Pyx_GOTREF(__pyx_t_10);
13729       __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
13730       PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_kp_s_8));
13731       __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
13732       __pyx_t_9 = PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13733       __Pyx_GOTREF(__pyx_t_9);
13734       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13735       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13736       __Pyx_DECREF(__pyx_v_elts);
13737       __pyx_v_elts = __pyx_t_9;
13738       __pyx_t_9 = 0;
13739
13740       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":684
13741  *             for blurp in cols[7].split(';'):
13742  *                 elts = blurp.split('=')
13743  *                 if len(elts) == 1: v = None             # <<<<<<<<<<<<<<
13744  *                 elif len(elts) == 2: v = elts[1]
13745  *                 else: self.error(line,self.ERROR_INFO_STRING)
13746  */
13747       __pyx_t_4 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13748       __pyx_t_8 = (__pyx_t_4 == 1);
13749       if (__pyx_t_8) {
13750         __Pyx_INCREF(Py_None);
13751         __Pyx_DECREF(__pyx_v_v);
13752         __pyx_v_v = Py_None;
13753         goto __pyx_L45;
13754       }
13755
13756       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":685
13757  *                 elts = blurp.split('=')
13758  *                 if len(elts) == 1: v = None
13759  *                 elif len(elts) == 2: v = elts[1]             # <<<<<<<<<<<<<<
13760  *                 else: self.error(line,self.ERROR_INFO_STRING)
13761  *                 info[elts[0]] = self.parse_formatdata(elts[0], v, self._info, line)
13762  */
13763       __pyx_t_4 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13764       __pyx_t_8 = (__pyx_t_4 == 2);
13765       if (__pyx_t_8) {
13766         __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_elts, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13767         __Pyx_GOTREF(__pyx_t_9);
13768         __Pyx_DECREF(__pyx_v_v);
13769         __pyx_v_v = __pyx_t_9;
13770         __pyx_t_9 = 0;
13771         goto __pyx_L45;
13772       }
13773       /*else*/ {
13774
13775         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":686
13776  *                 if len(elts) == 1: v = None
13777  *                 elif len(elts) == 2: v = elts[1]
13778  *                 else: self.error(line,self.ERROR_INFO_STRING)             # <<<<<<<<<<<<<<
13779  *                 info[elts[0]] = self.parse_formatdata(elts[0], v, self._info, line)
13780  * 
13781  */
13782         __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13783         __Pyx_GOTREF(__pyx_t_9);
13784         __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 = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13785         __Pyx_GOTREF(__pyx_t_10);
13786         __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13787         __Pyx_GOTREF(__pyx_t_12);
13788         __Pyx_INCREF(__pyx_v_line);
13789         PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
13790         __Pyx_GIVEREF(__pyx_v_line);
13791         PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10);
13792         __Pyx_GIVEREF(__pyx_t_10);
13793         __pyx_t_10 = 0;
13794         __pyx_t_10 = PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13795         __Pyx_GOTREF(__pyx_t_10);
13796         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13797         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
13798         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13799       }
13800       __pyx_L45:;
13801
13802       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":687
13803  *                 elif len(elts) == 2: v = elts[1]
13804  *                 else: self.error(line,self.ERROR_INFO_STRING)
13805  *                 info[elts[0]] = self.parse_formatdata(elts[0], v, self._info, line)             # <<<<<<<<<<<<<<
13806  * 
13807  *         # Gracefully deal with absent FORMAT column
13808  */
13809       __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_formatdata); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13810       __Pyx_GOTREF(__pyx_t_10);
13811       __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13812       __Pyx_GOTREF(__pyx_t_12);
13813       __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13814       __Pyx_GOTREF(__pyx_t_9);
13815       __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13816       __Pyx_GOTREF(__pyx_t_2);
13817       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12);
13818       __Pyx_GIVEREF(__pyx_t_12);
13819       __Pyx_INCREF(__pyx_v_v);
13820       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_v);
13821       __Pyx_GIVEREF(__pyx_v_v);
13822       PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9);
13823       __Pyx_GIVEREF(__pyx_t_9);
13824       __Pyx_INCREF(__pyx_v_line);
13825       PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_line);
13826       __Pyx_GIVEREF(__pyx_v_line);
13827       __pyx_t_12 = 0;
13828       __pyx_t_9 = 0;
13829       __pyx_t_9 = PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13830       __Pyx_GOTREF(__pyx_t_9);
13831       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13832       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13833       __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_elts, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13834       __Pyx_GOTREF(__pyx_t_2);
13835       if (PyDict_SetItem(((PyObject *)__pyx_v_info), __pyx_t_2, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13836       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13837       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13838     }
13839     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13840     goto __pyx_L42;
13841   }
13842   __pyx_L42:;
13843
13844   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":690
13845  * 
13846  *         # Gracefully deal with absent FORMAT column
13847  *         if cols[8] == "": format = []             # <<<<<<<<<<<<<<
13848  *         else: format = cols[8].split(':')
13849  * 
13850  */
13851   __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 8, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13852   __Pyx_GOTREF(__pyx_t_11);
13853   __pyx_t_9 = PyObject_RichCompare(__pyx_t_11, ((PyObject *)__pyx_kp_s_1), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13854   __Pyx_GOTREF(__pyx_t_9);
13855   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13856   __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13857   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13858   if (__pyx_t_8) {
13859     __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13860     __Pyx_GOTREF(((PyObject *)__pyx_t_9));
13861     __Pyx_DECREF(__pyx_v_format);
13862     __pyx_v_format = ((PyObject *)__pyx_t_9);
13863     __pyx_t_9 = 0;
13864     goto __pyx_L46;
13865   }
13866   /*else*/ {
13867
13868     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":691
13869  *         # Gracefully deal with absent FORMAT column
13870  *         if cols[8] == "": format = []
13871  *         else: format = cols[8].split(':')             # <<<<<<<<<<<<<<
13872  * 
13873  *         # check: all filters are defined
13874  */
13875     __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_cols, 8, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13876     __Pyx_GOTREF(__pyx_t_9);
13877     __pyx_t_11 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__split); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13878     __Pyx_GOTREF(__pyx_t_11);
13879     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13880     __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13881     __Pyx_GOTREF(__pyx_t_9);
13882     __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
13883     PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_3));
13884     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
13885     __pyx_t_2 = PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13886     __Pyx_GOTREF(__pyx_t_2);
13887     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13888     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13889     __Pyx_DECREF(__pyx_v_format);
13890     __pyx_v_format = __pyx_t_2;
13891     __pyx_t_2 = 0;
13892   }
13893   __pyx_L46:;
13894
13895   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":694
13896  * 
13897  *         # check: all filters are defined
13898  *         for f in filter:             # <<<<<<<<<<<<<<
13899  *             if f not in self._filter: self.error(line,self.FILTER_NOT_DEFINED, f)
13900  * 
13901  */
13902   if (PyList_CheckExact(__pyx_v_filter) || PyTuple_CheckExact(__pyx_v_filter)) {
13903     __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_filter; __Pyx_INCREF(__pyx_t_2);
13904   } else {
13905     __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13906     __Pyx_GOTREF(__pyx_t_2);
13907   }
13908   for (;;) {
13909     if (likely(PyList_CheckExact(__pyx_t_2))) {
13910       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
13911       __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++;
13912     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
13913       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
13914       __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++;
13915     } else {
13916       __pyx_t_9 = PyIter_Next(__pyx_t_2);
13917       if (!__pyx_t_9) {
13918         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13919         break;
13920       }
13921       __Pyx_GOTREF(__pyx_t_9);
13922     }
13923     __Pyx_DECREF(__pyx_v_f);
13924     __pyx_v_f = __pyx_t_9;
13925     __pyx_t_9 = 0;
13926
13927     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":695
13928  *         # check: all filters are defined
13929  *         for f in filter:
13930  *             if f not in self._filter: self.error(line,self.FILTER_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
13931  * 
13932  *         # check: format fields are defined
13933  */
13934     __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___filter); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13935     __Pyx_GOTREF(__pyx_t_9);
13936     __pyx_t_8 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_9, __pyx_v_f))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13937     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13938     if (__pyx_t_8) {
13939       __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13940       __Pyx_GOTREF(__pyx_t_9);
13941       __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__FILTER_NOT_DEFINED); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13942       __Pyx_GOTREF(__pyx_t_11);
13943       __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13944       __Pyx_GOTREF(__pyx_t_10);
13945       __Pyx_INCREF(__pyx_v_line);
13946       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
13947       __Pyx_GIVEREF(__pyx_v_line);
13948       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
13949       __Pyx_GIVEREF(__pyx_t_11);
13950       __Pyx_INCREF(__pyx_v_f);
13951       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_f);
13952       __Pyx_GIVEREF(__pyx_v_f);
13953       __pyx_t_11 = 0;
13954       __pyx_t_11 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13955       __Pyx_GOTREF(__pyx_t_11);
13956       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13957       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13958       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13959       goto __pyx_L49;
13960     }
13961     __pyx_L49:;
13962   }
13963   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13964
13965   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":698
13966  * 
13967  *         # check: format fields are defined
13968  *         for f in format:             # <<<<<<<<<<<<<<
13969  *             if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f)
13970  * 
13971  */
13972   if (PyList_CheckExact(__pyx_v_format) || PyTuple_CheckExact(__pyx_v_format)) {
13973     __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_format; __Pyx_INCREF(__pyx_t_2);
13974   } else {
13975     __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13976     __Pyx_GOTREF(__pyx_t_2);
13977   }
13978   for (;;) {
13979     if (likely(PyList_CheckExact(__pyx_t_2))) {
13980       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
13981       __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_11); __pyx_t_5++;
13982     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
13983       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
13984       __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_11); __pyx_t_5++;
13985     } else {
13986       __pyx_t_11 = PyIter_Next(__pyx_t_2);
13987       if (!__pyx_t_11) {
13988         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13989         break;
13990       }
13991       __Pyx_GOTREF(__pyx_t_11);
13992     }
13993     __Pyx_DECREF(__pyx_v_f);
13994     __pyx_v_f = __pyx_t_11;
13995     __pyx_t_11 = 0;
13996
13997     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":699
13998  *         # check: format fields are defined
13999  *         for f in format:
14000  *             if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
14001  * 
14002  *         # convert v3.3 alleles
14003  */
14004     __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14005     __Pyx_GOTREF(__pyx_t_11);
14006     __pyx_t_8 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_11, __pyx_v_f))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14007     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14008     if (__pyx_t_8) {
14009       __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14010       __Pyx_GOTREF(__pyx_t_11);
14011       __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__FORMAT_NOT_DEFINED); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14012       __Pyx_GOTREF(__pyx_t_10);
14013       __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14014       __Pyx_GOTREF(__pyx_t_9);
14015       __Pyx_INCREF(__pyx_v_line);
14016       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
14017       __Pyx_GIVEREF(__pyx_v_line);
14018       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
14019       __Pyx_GIVEREF(__pyx_t_10);
14020       __Pyx_INCREF(__pyx_v_f);
14021       PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_f);
14022       __Pyx_GIVEREF(__pyx_v_f);
14023       __pyx_t_10 = 0;
14024       __pyx_t_10 = PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14025       __Pyx_GOTREF(__pyx_t_10);
14026       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14027       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14028       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14029       goto __pyx_L52;
14030     }
14031     __pyx_L52:;
14032   }
14033   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14034
14035   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":702
14036  * 
14037  *         # convert v3.3 alleles
14038  *         if self._version == 33:             # <<<<<<<<<<<<<<
14039  *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)
14040  *             newalts = []
14041  */
14042   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14043   __Pyx_GOTREF(__pyx_t_2);
14044   __pyx_t_10 = PyObject_RichCompare(__pyx_t_2, __pyx_int_33, Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14045   __Pyx_GOTREF(__pyx_t_10);
14046   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14047   __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14048   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14049   if (__pyx_t_8) {
14050
14051     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":703
14052  *         # convert v3.3 alleles
14053  *         if self._version == 33:
14054  *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)             # <<<<<<<<<<<<<<
14055  *             newalts = []
14056  *             have_deletions = False
14057  */
14058     __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14059     __pyx_t_8 = (__pyx_t_5 != 1);
14060     if (__pyx_t_8) {
14061       __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14062       __Pyx_GOTREF(__pyx_t_10);
14063       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__V33_BAD_REF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14064       __Pyx_GOTREF(__pyx_t_2);
14065       __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14066       __Pyx_GOTREF(__pyx_t_9);
14067       __Pyx_INCREF(__pyx_v_line);
14068       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
14069       __Pyx_GIVEREF(__pyx_v_line);
14070       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
14071       __Pyx_GIVEREF(__pyx_t_2);
14072       __pyx_t_2 = 0;
14073       __pyx_t_2 = PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14074       __Pyx_GOTREF(__pyx_t_2);
14075       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14076       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14077       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14078       goto __pyx_L54;
14079     }
14080     __pyx_L54:;
14081
14082     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":704
14083  *         if self._version == 33:
14084  *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)
14085  *             newalts = []             # <<<<<<<<<<<<<<
14086  *             have_deletions = False
14087  *             for a in alt:
14088  */
14089     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14090     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
14091     __Pyx_DECREF(((PyObject *)__pyx_v_newalts));
14092     __pyx_v_newalts = __pyx_t_2;
14093     __pyx_t_2 = 0;
14094
14095     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":705
14096  *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)
14097  *             newalts = []
14098  *             have_deletions = False             # <<<<<<<<<<<<<<
14099  *             for a in alt:
14100  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
14101  */
14102     __pyx_v_have_deletions = 0;
14103
14104     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":706
14105  *             newalts = []
14106  *             have_deletions = False
14107  *             for a in alt:             # <<<<<<<<<<<<<<
14108  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
14109  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
14110  */
14111     if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
14112       __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2);
14113     } else {
14114       __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14115       __Pyx_GOTREF(__pyx_t_2);
14116     }
14117     for (;;) {
14118       if (likely(PyList_CheckExact(__pyx_t_2))) {
14119         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
14120         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++;
14121       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
14122         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
14123         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++;
14124       } else {
14125         __pyx_t_9 = PyIter_Next(__pyx_t_2);
14126         if (!__pyx_t_9) {
14127           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14128           break;
14129         }
14130         __Pyx_GOTREF(__pyx_t_9);
14131       }
14132       __Pyx_DECREF(__pyx_v_a);
14133       __pyx_v_a = __pyx_t_9;
14134       __pyx_t_9 = 0;
14135
14136       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":707
14137  *             have_deletions = False
14138  *             for a in alt:
14139  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference             # <<<<<<<<<<<<<<
14140  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
14141  *                 elif a.startswith('D'): # allow D<seq> and D<num>
14142  */
14143       __pyx_t_4 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14144       __pyx_t_8 = (__pyx_t_4 == 1);
14145       if (__pyx_t_8) {
14146         __pyx_t_9 = PySequence_GetSlice(__pyx_v_ref, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14147         __Pyx_GOTREF(__pyx_t_9);
14148         __pyx_t_10 = PyNumber_Add(__pyx_v_a, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14149         __Pyx_GOTREF(__pyx_t_10);
14150         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14151         __Pyx_DECREF(__pyx_v_a);
14152         __pyx_v_a = __pyx_t_10;
14153         __pyx_t_10 = 0;
14154         goto __pyx_L57;
14155       }
14156
14157       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":708
14158  *             for a in alt:
14159  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
14160  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference             # <<<<<<<<<<<<<<
14161  *                 elif a.startswith('D'): # allow D<seq> and D<num>
14162  *                     have_deletions = True
14163  */
14164       __pyx_t_10 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__startswith); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14165       __Pyx_GOTREF(__pyx_t_10);
14166       __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14167       __Pyx_GOTREF(__pyx_t_9);
14168       __Pyx_INCREF(((PyObject *)__pyx_n_s__I));
14169       PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_n_s__I));
14170       __Pyx_GIVEREF(((PyObject *)__pyx_n_s__I));
14171       __pyx_t_11 = PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14172       __Pyx_GOTREF(__pyx_t_11);
14173       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14174       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14175       __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14176       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14177       if (__pyx_t_8) {
14178         __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14179         __Pyx_GOTREF(__pyx_t_11);
14180         __pyx_t_9 = PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14181         __Pyx_GOTREF(__pyx_t_9);
14182         __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14183         __Pyx_GOTREF(__pyx_t_10);
14184         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14185         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14186         __pyx_t_9 = PySequence_GetSlice(__pyx_v_ref, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14187         __Pyx_GOTREF(__pyx_t_9);
14188         __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14189         __Pyx_GOTREF(__pyx_t_11);
14190         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14191         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14192         __Pyx_DECREF(__pyx_v_a);
14193         __pyx_v_a = __pyx_t_11;
14194         __pyx_t_11 = 0;
14195         goto __pyx_L57;
14196       }
14197
14198       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":709
14199  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
14200  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
14201  *                 elif a.startswith('D'): # allow D<seq> and D<num>             # <<<<<<<<<<<<<<
14202  *                     have_deletions = True
14203  *                     try:
14204  */
14205       __pyx_t_11 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__startswith); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14206       __Pyx_GOTREF(__pyx_t_11);
14207       __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14208       __Pyx_GOTREF(__pyx_t_9);
14209       __Pyx_INCREF(((PyObject *)__pyx_n_s__D));
14210       PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_n_s__D));
14211       __Pyx_GIVEREF(((PyObject *)__pyx_n_s__D));
14212       __pyx_t_10 = PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14213       __Pyx_GOTREF(__pyx_t_10);
14214       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14215       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14216       __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14217       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14218       if (__pyx_t_8) {
14219
14220         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":710
14221  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
14222  *                 elif a.startswith('D'): # allow D<seq> and D<num>
14223  *                     have_deletions = True             # <<<<<<<<<<<<<<
14224  *                     try:
14225  *                         l = int(a[1:])          # throws ValueError if sequence
14226  */
14227         __pyx_v_have_deletions = 1;
14228
14229         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":711
14230  *                 elif a.startswith('D'): # allow D<seq> and D<num>
14231  *                     have_deletions = True
14232  *                     try:             # <<<<<<<<<<<<<<
14233  *                         l = int(a[1:])          # throws ValueError if sequence
14234  *                         if len(ref) < l:        # add to reference if necessary
14235  */
14236         {
14237           PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
14238           __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
14239           __Pyx_XGOTREF(__pyx_save_exc_type);
14240           __Pyx_XGOTREF(__pyx_save_exc_value);
14241           __Pyx_XGOTREF(__pyx_save_exc_tb);
14242           /*try:*/ {
14243
14244             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":712
14245  *                     have_deletions = True
14246  *                     try:
14247  *                         l = int(a[1:])          # throws ValueError if sequence             # <<<<<<<<<<<<<<
14248  *                         if len(ref) < l:        # add to reference if necessary
14249  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
14250  */
14251             __pyx_t_10 = PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14252             __Pyx_GOTREF(__pyx_t_10);
14253             __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14254             __Pyx_GOTREF(__pyx_t_9);
14255             PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
14256             __Pyx_GIVEREF(__pyx_t_10);
14257             __pyx_t_10 = 0;
14258             __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14259             __Pyx_GOTREF(__pyx_t_10);
14260             __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14261             __Pyx_DECREF(__pyx_v_l);
14262             __pyx_v_l = __pyx_t_10;
14263             __pyx_t_10 = 0;
14264
14265             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":713
14266  *                     try:
14267  *                         l = int(a[1:])          # throws ValueError if sequence
14268  *                         if len(ref) < l:        # add to reference if necessary             # <<<<<<<<<<<<<<
14269  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
14270  *                             ref += addns
14271  */
14272             __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14273             __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14274             __Pyx_GOTREF(__pyx_t_10);
14275             __pyx_t_9 = PyObject_RichCompare(__pyx_t_10, __pyx_v_l, Py_LT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14276             __Pyx_GOTREF(__pyx_t_9);
14277             __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14278             __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14279             __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14280             if (__pyx_t_8) {
14281
14282               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":714
14283  *                         l = int(a[1:])          # throws ValueError if sequence
14284  *                         if len(ref) < l:        # add to reference if necessary
14285  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)             # <<<<<<<<<<<<<<
14286  *                             ref += addns
14287  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14288  */
14289               __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14290               __Pyx_GOTREF(__pyx_t_9);
14291               __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14292               __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14293               __Pyx_GOTREF(__pyx_t_10);
14294               __pyx_t_11 = PyNumber_Add(__pyx_v_pos, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14295               __Pyx_GOTREF(__pyx_t_11);
14296               __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14297               __pyx_t_10 = PyNumber_Add(__pyx_v_pos, __pyx_v_l); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14298               __Pyx_GOTREF(__pyx_t_10);
14299               __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14300               __Pyx_GOTREF(__pyx_t_12);
14301               __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14302               __Pyx_GOTREF(__pyx_t_3);
14303               __Pyx_INCREF(__pyx_v_chrom);
14304               PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom);
14305               __Pyx_GIVEREF(__pyx_v_chrom);
14306               PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
14307               __Pyx_GIVEREF(__pyx_t_11);
14308               PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_10);
14309               __Pyx_GIVEREF(__pyx_t_10);
14310               PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_12);
14311               __Pyx_GIVEREF(__pyx_t_12);
14312               __pyx_t_11 = 0;
14313               __pyx_t_10 = 0;
14314               __pyx_t_12 = 0;
14315               __pyx_t_12 = PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14316               __Pyx_GOTREF(__pyx_t_12);
14317               __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14318               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14319               __Pyx_DECREF(__pyx_v_addns);
14320               __pyx_v_addns = __pyx_t_12;
14321               __pyx_t_12 = 0;
14322
14323               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":715
14324  *                         if len(ref) < l:        # add to reference if necessary
14325  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
14326  *                             ref += addns             # <<<<<<<<<<<<<<
14327  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14328  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
14329  */
14330               __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addns); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14331               __Pyx_GOTREF(__pyx_t_12);
14332               __Pyx_DECREF(__pyx_v_ref);
14333               __pyx_v_ref = __pyx_t_12;
14334               __pyx_t_12 = 0;
14335
14336               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":716
14337  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
14338  *                             ref += addns
14339  *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
14340  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
14341  *                     except ValueError:
14342  */
14343               __Pyx_INCREF(__pyx_int_0);
14344               __pyx_t_12 = __pyx_int_0;
14345               if (likely(((PyObject *)__pyx_v_newalts) != Py_None)) {
14346                 __pyx_t_4 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_newalts); __Pyx_INCREF(__pyx_t_3);
14347               } else {
14348                 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14349               }
14350               for (;;) {
14351                 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
14352                 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++;
14353                 __Pyx_DECREF(__pyx_v_na);
14354                 __pyx_v_na = __pyx_t_9;
14355                 __pyx_t_9 = 0;
14356                 __Pyx_INCREF(__pyx_t_12);
14357                 __Pyx_DECREF(__pyx_v_i);
14358                 __pyx_v_i = __pyx_t_12;
14359                 __pyx_t_9 = PyNumber_Add(__pyx_t_12, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14360                 __Pyx_GOTREF(__pyx_t_9);
14361                 __Pyx_DECREF(__pyx_t_12);
14362                 __pyx_t_12 = __pyx_t_9;
14363                 __pyx_t_9 = 0;
14364                 __pyx_t_9 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14365                 __Pyx_GOTREF(__pyx_t_9);
14366                 if (PyObject_SetItem(((PyObject *)__pyx_v_newalts), __pyx_v_i, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14367                 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14368               }
14369               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14370               __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14371               goto __pyx_L66;
14372             }
14373             __pyx_L66:;
14374
14375             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":717
14376  *                             ref += addns
14377  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14378  *                         a = ref[l:]             # new deletion, deleting pos...pos+l             # <<<<<<<<<<<<<<
14379  *                     except ValueError:
14380  *                         s = a[1:]
14381  */
14382             __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14383             __pyx_t_12 = PySequence_GetSlice(__pyx_v_ref, __pyx_t_4, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
14384             __Pyx_GOTREF(__pyx_t_12);
14385             __Pyx_DECREF(__pyx_v_a);
14386             __pyx_v_a = __pyx_t_12;
14387             __pyx_t_12 = 0;
14388           }
14389           __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
14390           __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
14391           __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
14392           goto __pyx_L65_try_end;
14393           __pyx_L58_error:;
14394           __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14395           __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
14396           __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
14397           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14398           __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14399           __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
14400
14401           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":718
14402  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14403  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
14404  *                     except ValueError:             # <<<<<<<<<<<<<<
14405  *                         s = a[1:]
14406  *                         if len(ref) < len(s):   # add Ns to reference if necessary
14407  */
14408           __pyx_t_16 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
14409           if (__pyx_t_16) {
14410             __Pyx_AddTraceback("cvcf.VCF.parse_data");
14411             if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_3, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14412             __Pyx_GOTREF(__pyx_t_12);
14413             __Pyx_GOTREF(__pyx_t_3);
14414             __Pyx_GOTREF(__pyx_t_9);
14415
14416             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":719
14417  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
14418  *                     except ValueError:
14419  *                         s = a[1:]             # <<<<<<<<<<<<<<
14420  *                         if len(ref) < len(s):   # add Ns to reference if necessary
14421  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
14422  */
14423             __pyx_t_10 = PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14424             __Pyx_GOTREF(__pyx_t_10);
14425             __Pyx_DECREF(__pyx_v_s);
14426             __pyx_v_s = __pyx_t_10;
14427             __pyx_t_10 = 0;
14428
14429             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":720
14430  *                     except ValueError:
14431  *                         s = a[1:]
14432  *                         if len(ref) < len(s):   # add Ns to reference if necessary             # <<<<<<<<<<<<<<
14433  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
14434  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
14435  */
14436             __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14437             __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;}
14438             __pyx_t_8 = (__pyx_t_4 < __pyx_t_17);
14439             if (__pyx_t_8) {
14440
14441               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":721
14442  *                         s = a[1:]
14443  *                         if len(ref) < len(s):   # add Ns to reference if necessary
14444  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)             # <<<<<<<<<<<<<<
14445  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
14446  *                                 self.error(line,self.V33_UNMATCHED_DELETION,
14447  */
14448               __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14449               __Pyx_GOTREF(__pyx_t_10);
14450               __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;}
14451               __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14452               __Pyx_GOTREF(__pyx_t_11);
14453               __pyx_t_1 = PyNumber_Add(__pyx_v_pos, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14454               __Pyx_GOTREF(__pyx_t_1);
14455               __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14456               __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;}
14457               __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14458               __Pyx_GOTREF(__pyx_t_11);
14459               __pyx_t_18 = PyNumber_Add(__pyx_v_pos, __pyx_t_11); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14460               __Pyx_GOTREF(__pyx_t_18);
14461               __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14462               __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14463               __Pyx_GOTREF(__pyx_t_11);
14464               __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;}
14465               __Pyx_GOTREF(__pyx_t_19);
14466               __Pyx_INCREF(__pyx_v_chrom);
14467               PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_chrom);
14468               __Pyx_GIVEREF(__pyx_v_chrom);
14469               PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_1);
14470               __Pyx_GIVEREF(__pyx_t_1);
14471               PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_18);
14472               __Pyx_GIVEREF(__pyx_t_18);
14473               PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_11);
14474               __Pyx_GIVEREF(__pyx_t_11);
14475               __pyx_t_1 = 0;
14476               __pyx_t_18 = 0;
14477               __pyx_t_11 = 0;
14478               __pyx_t_11 = PyObject_Call(__pyx_t_10, __pyx_t_19, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14479               __Pyx_GOTREF(__pyx_t_11);
14480               __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14481               __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
14482               __Pyx_DECREF(__pyx_v_addns);
14483               __pyx_v_addns = __pyx_t_11;
14484               __pyx_t_11 = 0;
14485
14486               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":722
14487  *                         if len(ref) < len(s):   # add Ns to reference if necessary
14488  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
14489  *                             if not s.endswith(addns) and addns != 'N'*len(addns):             # <<<<<<<<<<<<<<
14490  *                                 self.error(line,self.V33_UNMATCHED_DELETION,
14491  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
14492  */
14493               __pyx_t_11 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__endswith); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14494               __Pyx_GOTREF(__pyx_t_11);
14495               __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;}
14496               __Pyx_GOTREF(__pyx_t_19);
14497               __Pyx_INCREF(__pyx_v_addns);
14498               PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_addns);
14499               __Pyx_GIVEREF(__pyx_v_addns);
14500               __pyx_t_10 = PyObject_Call(__pyx_t_11, __pyx_t_19, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14501               __Pyx_GOTREF(__pyx_t_10);
14502               __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14503               __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
14504               __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14505               __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14506               __pyx_t_6 = (!__pyx_t_8);
14507               if (__pyx_t_6) {
14508                 __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;}
14509                 __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14510                 __Pyx_GOTREF(__pyx_t_10);
14511                 __pyx_t_19 = PyNumber_Multiply(((PyObject *)__pyx_n_s__N), __pyx_t_10); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14512                 __Pyx_GOTREF(((PyObject *)__pyx_t_19));
14513                 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14514                 __pyx_t_10 = PyObject_RichCompare(__pyx_v_addns, ((PyObject *)__pyx_t_19), Py_NE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14515                 __Pyx_GOTREF(__pyx_t_10);
14516                 __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
14517                 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14518                 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14519                 __pyx_t_15 = __pyx_t_8;
14520               } else {
14521                 __pyx_t_15 = __pyx_t_6;
14522               }
14523               if (__pyx_t_15) {
14524
14525                 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":723
14526  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
14527  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
14528  *                                 self.error(line,self.V33_UNMATCHED_DELETION,             # <<<<<<<<<<<<<<
14529  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
14530  *                             ref += addns
14531  */
14532                 __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14533                 __Pyx_GOTREF(__pyx_t_10);
14534                 __pyx_t_19 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_65); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14535                 __Pyx_GOTREF(__pyx_t_19);
14536
14537                 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":724
14538  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
14539  *                                 self.error(line,self.V33_UNMATCHED_DELETION,
14540  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))             # <<<<<<<<<<<<<<
14541  *                             ref += addns
14542  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14543  */
14544                 __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14545                 __Pyx_GOTREF(__pyx_t_11);
14546                 __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;}
14547                 __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;}
14548                 __Pyx_GOTREF(__pyx_t_18);
14549                 __pyx_t_1 = PyNumber_Add(__pyx_v_pos, __pyx_t_18); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14550                 __Pyx_GOTREF(__pyx_t_1);
14551                 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14552                 __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;}
14553                 __Pyx_GOTREF(__pyx_t_18);
14554                 __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;}
14555                 __Pyx_GOTREF(__pyx_t_20);
14556                 __Pyx_INCREF(__pyx_v_chrom);
14557                 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_chrom);
14558                 __Pyx_GIVEREF(__pyx_v_chrom);
14559                 __Pyx_INCREF(__pyx_v_pos);
14560                 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_pos);
14561                 __Pyx_GIVEREF(__pyx_v_pos);
14562                 PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_1);
14563                 __Pyx_GIVEREF(__pyx_t_1);
14564                 PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_18);
14565                 __Pyx_GIVEREF(__pyx_t_18);
14566                 __pyx_t_1 = 0;
14567                 __pyx_t_18 = 0;
14568                 __pyx_t_18 = PyObject_Call(__pyx_t_11, __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;}
14569                 __Pyx_GOTREF(__pyx_t_18);
14570                 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14571                 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
14572                 __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;}
14573                 __Pyx_GOTREF(__pyx_t_20);
14574                 __Pyx_INCREF(__pyx_v_a);
14575                 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_a);
14576                 __Pyx_GIVEREF(__pyx_v_a);
14577                 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_18);
14578                 __Pyx_GIVEREF(__pyx_t_18);
14579                 __pyx_t_18 = 0;
14580                 __pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_66), __pyx_t_20); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14581                 __Pyx_GOTREF(((PyObject *)__pyx_t_18));
14582                 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
14583                 __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;}
14584                 __Pyx_GOTREF(__pyx_t_20);
14585                 __Pyx_INCREF(__pyx_v_line);
14586                 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_line);
14587                 __Pyx_GIVEREF(__pyx_v_line);
14588                 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
14589                 __Pyx_GIVEREF(__pyx_t_19);
14590                 PyTuple_SET_ITEM(__pyx_t_20, 2, ((PyObject *)__pyx_t_18));
14591                 __Pyx_GIVEREF(((PyObject *)__pyx_t_18));
14592                 __pyx_t_19 = 0;
14593                 __pyx_t_18 = 0;
14594                 __pyx_t_18 = PyObject_Call(__pyx_t_10, __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;}
14595                 __Pyx_GOTREF(__pyx_t_18);
14596                 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14597                 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
14598                 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14599                 goto __pyx_L72;
14600               }
14601               __pyx_L72:;
14602
14603               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":725
14604  *                                 self.error(line,self.V33_UNMATCHED_DELETION,
14605  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
14606  *                             ref += addns             # <<<<<<<<<<<<<<
14607  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14608  *                         a = ref[len(s):]        # new deletion, deleting from pos
14609  */
14610               __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;}
14611               __Pyx_GOTREF(__pyx_t_18);
14612               __Pyx_DECREF(__pyx_v_ref);
14613               __pyx_v_ref = __pyx_t_18;
14614               __pyx_t_18 = 0;
14615
14616               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":726
14617  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
14618  *                             ref += addns
14619  *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
14620  *                         a = ref[len(s):]        # new deletion, deleting from pos
14621  *                 else:
14622  */
14623               __Pyx_INCREF(__pyx_int_0);
14624               __pyx_t_18 = __pyx_int_0;
14625               if (likely(((PyObject *)__pyx_v_newalts) != Py_None)) {
14626                 __pyx_t_17 = 0; __pyx_t_20 = ((PyObject *)__pyx_v_newalts); __Pyx_INCREF(__pyx_t_20);
14627               } else {
14628                 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14629               }
14630               for (;;) {
14631                 if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_20)) break;
14632                 __pyx_t_10 = PyList_GET_ITEM(__pyx_t_20, __pyx_t_17); __Pyx_INCREF(__pyx_t_10); __pyx_t_17++;
14633                 __Pyx_DECREF(__pyx_v_na);
14634                 __pyx_v_na = __pyx_t_10;
14635                 __pyx_t_10 = 0;
14636                 __Pyx_INCREF(__pyx_t_18);
14637                 __Pyx_DECREF(__pyx_v_i);
14638                 __pyx_v_i = __pyx_t_18;
14639                 __pyx_t_10 = PyNumber_Add(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14640                 __Pyx_GOTREF(__pyx_t_10);
14641                 __Pyx_DECREF(__pyx_t_18);
14642                 __pyx_t_18 = __pyx_t_10;
14643                 __pyx_t_10 = 0;
14644                 __pyx_t_10 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14645                 __Pyx_GOTREF(__pyx_t_10);
14646                 if (PyObject_SetItem(((PyObject *)__pyx_v_newalts), __pyx_v_i, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
14647                 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14648               }
14649               __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
14650               __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14651               goto __pyx_L71;
14652             }
14653             __pyx_L71:;
14654
14655             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":727
14656  *                             ref += addns
14657  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
14658  *                         a = ref[len(s):]        # new deletion, deleting from pos             # <<<<<<<<<<<<<<
14659  *                 else:
14660  *                     self.error(line,self.V33_BAD_ALLELE)
14661  */
14662             __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;}
14663             __pyx_t_18 = 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;}
14664             __Pyx_GOTREF(__pyx_t_18);
14665             __Pyx_DECREF(__pyx_v_a);
14666             __pyx_v_a = __pyx_t_18;
14667             __pyx_t_18 = 0;
14668             __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14669             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14670             __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14671             goto __pyx_L59_exception_handled;
14672           }
14673           __pyx_L60_except_error:;
14674           __Pyx_XGIVEREF(__pyx_save_exc_type);
14675           __Pyx_XGIVEREF(__pyx_save_exc_value);
14676           __Pyx_XGIVEREF(__pyx_save_exc_tb);
14677           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
14678           goto __pyx_L1_error;
14679           __pyx_L59_exception_handled:;
14680           __Pyx_XGIVEREF(__pyx_save_exc_type);
14681           __Pyx_XGIVEREF(__pyx_save_exc_value);
14682           __Pyx_XGIVEREF(__pyx_save_exc_tb);
14683           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
14684           __pyx_L65_try_end:;
14685         }
14686         goto __pyx_L57;
14687       }
14688       /*else*/ {
14689
14690         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":729
14691  *                         a = ref[len(s):]        # new deletion, deleting from pos
14692  *                 else:
14693  *                     self.error(line,self.V33_BAD_ALLELE)             # <<<<<<<<<<<<<<
14694  *                 newalts.append(a)
14695  *             alt = newalts
14696  */
14697         __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14698         __Pyx_GOTREF(__pyx_t_9);
14699         __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__V33_BAD_ALLELE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14700         __Pyx_GOTREF(__pyx_t_3);
14701         __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14702         __Pyx_GOTREF(__pyx_t_12);
14703         __Pyx_INCREF(__pyx_v_line);
14704         PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
14705         __Pyx_GIVEREF(__pyx_v_line);
14706         PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_3);
14707         __Pyx_GIVEREF(__pyx_t_3);
14708         __pyx_t_3 = 0;
14709         __pyx_t_3 = PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14710         __Pyx_GOTREF(__pyx_t_3);
14711         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14712         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14713         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14714       }
14715       __pyx_L57:;
14716
14717       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":730
14718  *                 else:
14719  *                     self.error(line,self.V33_BAD_ALLELE)
14720  *                 newalts.append(a)             # <<<<<<<<<<<<<<
14721  *             alt = newalts
14722  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
14723  */
14724       if (unlikely(__pyx_v_newalts == Py_None)) {
14725         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;} 
14726       }
14727       __pyx_t_16 = PyList_Append(((PyObject *)__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;}
14728     }
14729     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14730
14731     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":731
14732  *                     self.error(line,self.V33_BAD_ALLELE)
14733  *                 newalts.append(a)
14734  *             alt = newalts             # <<<<<<<<<<<<<<
14735  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
14736  *             if have_deletions:
14737  */
14738     __Pyx_INCREF(((PyObject *)__pyx_v_newalts));
14739     __Pyx_DECREF(__pyx_v_alt);
14740     __pyx_v_alt = ((PyObject *)__pyx_v_newalts);
14741
14742     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":733
14743  *             alt = newalts
14744  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
14745  *             if have_deletions:             # <<<<<<<<<<<<<<
14746  *                 if pos == 0:
14747  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
14748  */
14749     if (__pyx_v_have_deletions) {
14750
14751       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":734
14752  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
14753  *             if have_deletions:
14754  *                 if pos == 0:             # <<<<<<<<<<<<<<
14755  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
14756  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
14757  */
14758       __pyx_t_2 = PyObject_RichCompare(__pyx_v_pos, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14759       __Pyx_GOTREF(__pyx_t_2);
14760       __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14761       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14762       if (__pyx_t_15) {
14763
14764         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":736
14765  *                 if pos == 0:
14766  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
14767  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)             # <<<<<<<<<<<<<<
14768  *                     ref += addn
14769  *                     alt = [allele+addn for allele in alt]
14770  */
14771         __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14772         __Pyx_GOTREF(__pyx_t_2);
14773         __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14774         __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14775         __Pyx_GOTREF(__pyx_t_3);
14776         __pyx_t_12 = PyNumber_Add(__pyx_v_pos, __pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14777         __Pyx_GOTREF(__pyx_t_12);
14778         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14779         __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14780         __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14781         __Pyx_GOTREF(__pyx_t_3);
14782         __pyx_t_9 = PyNumber_Add(__pyx_v_pos, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14783         __Pyx_GOTREF(__pyx_t_9);
14784         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14785         __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14786         __Pyx_GOTREF(__pyx_t_3);
14787         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14788         __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14789         __Pyx_GOTREF(__pyx_t_9);
14790         __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;}
14791         __Pyx_GOTREF(__pyx_t_18);
14792         __Pyx_INCREF(__pyx_v_chrom);
14793         PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_chrom);
14794         __Pyx_GIVEREF(__pyx_v_chrom);
14795         PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_12);
14796         __Pyx_GIVEREF(__pyx_t_12);
14797         PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_3);
14798         __Pyx_GIVEREF(__pyx_t_3);
14799         PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_9);
14800         __Pyx_GIVEREF(__pyx_t_9);
14801         __pyx_t_12 = 0;
14802         __pyx_t_3 = 0;
14803         __pyx_t_9 = 0;
14804         __pyx_t_9 = PyObject_Call(__pyx_t_2, __pyx_t_18, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14805         __Pyx_GOTREF(__pyx_t_9);
14806         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14807         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14808         __Pyx_DECREF(__pyx_v_addn);
14809         __pyx_v_addn = __pyx_t_9;
14810         __pyx_t_9 = 0;
14811
14812         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":737
14813  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
14814  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
14815  *                     ref += addn             # <<<<<<<<<<<<<<
14816  *                     alt = [allele+addn for allele in alt]
14817  *                 else:
14818  */
14819         __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addn); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14820         __Pyx_GOTREF(__pyx_t_9);
14821         __Pyx_DECREF(__pyx_v_ref);
14822         __pyx_v_ref = __pyx_t_9;
14823         __pyx_t_9 = 0;
14824
14825         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":738
14826  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
14827  *                     ref += addn
14828  *                     alt = [allele+addn for allele in alt]             # <<<<<<<<<<<<<<
14829  *                 else:
14830  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
14831  */
14832         __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14833         __Pyx_GOTREF(((PyObject *)__pyx_t_9));
14834         if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
14835           __pyx_t_5 = 0; __pyx_t_18 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_18);
14836         } else {
14837           __pyx_t_5 = -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;}
14838           __Pyx_GOTREF(__pyx_t_18);
14839         }
14840         for (;;) {
14841           if (likely(PyList_CheckExact(__pyx_t_18))) {
14842             if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_18)) break;
14843             __pyx_t_2 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
14844           } else if (likely(PyTuple_CheckExact(__pyx_t_18))) {
14845             if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_18)) break;
14846             __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
14847           } else {
14848             __pyx_t_2 = PyIter_Next(__pyx_t_18);
14849             if (!__pyx_t_2) {
14850               if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14851               break;
14852             }
14853             __Pyx_GOTREF(__pyx_t_2);
14854           }
14855           __Pyx_DECREF(__pyx_v_allele);
14856           __pyx_v_allele = __pyx_t_2;
14857           __pyx_t_2 = 0;
14858           __pyx_t_2 = PyNumber_Add(__pyx_v_allele, __pyx_v_addn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14859           __Pyx_GOTREF(__pyx_t_2);
14860           if (unlikely(PyList_Append(__pyx_t_9, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14861           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14862         }
14863         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
14864         __Pyx_INCREF(((PyObject *)__pyx_t_9));
14865         __Pyx_DECREF(__pyx_v_alt);
14866         __pyx_v_alt = ((PyObject *)__pyx_t_9);
14867         __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
14868         goto __pyx_L76;
14869       }
14870       /*else*/ {
14871
14872         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":740
14873  *                     alt = [allele+addn for allele in alt]
14874  *                 else:
14875  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)             # <<<<<<<<<<<<<<
14876  *                     ref = addn + ref
14877  *                     alt = [addn + allele for allele in alt]
14878  */
14879         __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14880         __Pyx_GOTREF(__pyx_t_9);
14881         __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;}
14882         __Pyx_GOTREF(__pyx_t_18);
14883         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14884         __Pyx_GOTREF(__pyx_t_2);
14885         __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14886         __Pyx_GOTREF(__pyx_t_3);
14887         __Pyx_INCREF(__pyx_v_chrom);
14888         PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom);
14889         __Pyx_GIVEREF(__pyx_v_chrom);
14890         PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_18);
14891         __Pyx_GIVEREF(__pyx_t_18);
14892         __Pyx_INCREF(__pyx_v_pos);
14893         PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_pos);
14894         __Pyx_GIVEREF(__pyx_v_pos);
14895         PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
14896         __Pyx_GIVEREF(__pyx_t_2);
14897         __pyx_t_18 = 0;
14898         __pyx_t_2 = 0;
14899         __pyx_t_2 = PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14900         __Pyx_GOTREF(__pyx_t_2);
14901         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14902         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14903         __Pyx_DECREF(__pyx_v_addn);
14904         __pyx_v_addn = __pyx_t_2;
14905         __pyx_t_2 = 0;
14906
14907         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":741
14908  *                 else:
14909  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
14910  *                     ref = addn + ref             # <<<<<<<<<<<<<<
14911  *                     alt = [addn + allele for allele in alt]
14912  *                     pos -= 1
14913  */
14914         __pyx_t_2 = PyNumber_Add(__pyx_v_addn, __pyx_v_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14915         __Pyx_GOTREF(__pyx_t_2);
14916         __Pyx_DECREF(__pyx_v_ref);
14917         __pyx_v_ref = __pyx_t_2;
14918         __pyx_t_2 = 0;
14919
14920         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":742
14921  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
14922  *                     ref = addn + ref
14923  *                     alt = [addn + allele for allele in alt]             # <<<<<<<<<<<<<<
14924  *                     pos -= 1
14925  *         else:
14926  */
14927         __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14928         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
14929         if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
14930           __pyx_t_5 = 0; __pyx_t_3 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_3);
14931         } else {
14932           __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14933           __Pyx_GOTREF(__pyx_t_3);
14934         }
14935         for (;;) {
14936           if (likely(PyList_CheckExact(__pyx_t_3))) {
14937             if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
14938             __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++;
14939           } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
14940             if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
14941             __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++;
14942           } else {
14943             __pyx_t_9 = PyIter_Next(__pyx_t_3);
14944             if (!__pyx_t_9) {
14945               if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14946               break;
14947             }
14948             __Pyx_GOTREF(__pyx_t_9);
14949           }
14950           __Pyx_DECREF(__pyx_v_allele);
14951           __pyx_v_allele = __pyx_t_9;
14952           __pyx_t_9 = 0;
14953           __pyx_t_9 = PyNumber_Add(__pyx_v_addn, __pyx_v_allele); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14954           __Pyx_GOTREF(__pyx_t_9);
14955           if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14956           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14957         }
14958         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14959         __Pyx_INCREF(((PyObject *)__pyx_t_2));
14960         __Pyx_DECREF(__pyx_v_alt);
14961         __pyx_v_alt = ((PyObject *)__pyx_t_2);
14962         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
14963
14964         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":743
14965  *                     ref = addn + ref
14966  *                     alt = [addn + allele for allele in alt]
14967  *                     pos -= 1             # <<<<<<<<<<<<<<
14968  *         else:
14969  *             # format v4.0 -- just check for nucleotides
14970  */
14971         __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14972         __Pyx_GOTREF(__pyx_t_2);
14973         __Pyx_DECREF(__pyx_v_pos);
14974         __pyx_v_pos = __pyx_t_2;
14975         __pyx_t_2 = 0;
14976       }
14977       __pyx_L76:;
14978       goto __pyx_L75;
14979     }
14980     __pyx_L75:;
14981     goto __pyx_L53;
14982   }
14983   /*else*/ {
14984
14985     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":746
14986  *         else:
14987  *             # format v4.0 -- just check for nucleotides
14988  *             for allele in alt:             # <<<<<<<<<<<<<<
14989  *                 if not alleleRegEx.match(allele):
14990  *                     self.error(line,self.V40_BAD_ALLELE,allele)
14991  */
14992     if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
14993       __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2);
14994     } else {
14995       __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14996       __Pyx_GOTREF(__pyx_t_2);
14997     }
14998     for (;;) {
14999       if (likely(PyList_CheckExact(__pyx_t_2))) {
15000         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
15001         __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15002       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
15003         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
15004         __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15005       } else {
15006         __pyx_t_3 = PyIter_Next(__pyx_t_2);
15007         if (!__pyx_t_3) {
15008           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15009           break;
15010         }
15011         __Pyx_GOTREF(__pyx_t_3);
15012       }
15013       __Pyx_DECREF(__pyx_v_allele);
15014       __pyx_v_allele = __pyx_t_3;
15015       __pyx_t_3 = 0;
15016
15017       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":747
15018  *             # format v4.0 -- just check for nucleotides
15019  *             for allele in alt:
15020  *                 if not alleleRegEx.match(allele):             # <<<<<<<<<<<<<<
15021  *                     self.error(line,self.V40_BAD_ALLELE,allele)
15022  * 
15023  */
15024       __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__alleleRegEx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15025       __Pyx_GOTREF(__pyx_t_3);
15026       __pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__match); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15027       __Pyx_GOTREF(__pyx_t_9);
15028       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15029       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15030       __Pyx_GOTREF(__pyx_t_3);
15031       __Pyx_INCREF(__pyx_v_allele);
15032       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_allele);
15033       __Pyx_GIVEREF(__pyx_v_allele);
15034       __pyx_t_18 = PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15035       __Pyx_GOTREF(__pyx_t_18);
15036       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15037       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15038       __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;}
15039       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15040       __pyx_t_6 = (!__pyx_t_15);
15041       if (__pyx_t_6) {
15042
15043         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":748
15044  *             for allele in alt:
15045  *                 if not alleleRegEx.match(allele):
15046  *                     self.error(line,self.V40_BAD_ALLELE,allele)             # <<<<<<<<<<<<<<
15047  * 
15048  *         # check for leading nucleotide in indel calls
15049  */
15050         __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;}
15051         __Pyx_GOTREF(__pyx_t_18);
15052         __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__V40_BAD_ALLELE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15053         __Pyx_GOTREF(__pyx_t_3);
15054         __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15055         __Pyx_GOTREF(__pyx_t_9);
15056         __Pyx_INCREF(__pyx_v_line);
15057         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
15058         __Pyx_GIVEREF(__pyx_v_line);
15059         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3);
15060         __Pyx_GIVEREF(__pyx_t_3);
15061         __Pyx_INCREF(__pyx_v_allele);
15062         PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_allele);
15063         __Pyx_GIVEREF(__pyx_v_allele);
15064         __pyx_t_3 = 0;
15065         __pyx_t_3 = PyObject_Call(__pyx_t_18, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15066         __Pyx_GOTREF(__pyx_t_3);
15067         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15068         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15069         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15070         goto __pyx_L83;
15071       }
15072       __pyx_L83:;
15073     }
15074     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15075   }
15076   __pyx_L53:;
15077
15078   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":751
15079  * 
15080  *         # check for leading nucleotide in indel calls
15081  *         for allele in alt:             # <<<<<<<<<<<<<<
15082  *             if len(allele) != len(ref):
15083  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
15084  */
15085   if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15086     __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2);
15087   } else {
15088     __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15089     __Pyx_GOTREF(__pyx_t_2);
15090   }
15091   for (;;) {
15092     if (likely(PyList_CheckExact(__pyx_t_2))) {
15093       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
15094       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15095     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
15096       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
15097       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15098     } else {
15099       __pyx_t_3 = PyIter_Next(__pyx_t_2);
15100       if (!__pyx_t_3) {
15101         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15102         break;
15103       }
15104       __Pyx_GOTREF(__pyx_t_3);
15105     }
15106     __Pyx_DECREF(__pyx_v_allele);
15107     __pyx_v_allele = __pyx_t_3;
15108     __pyx_t_3 = 0;
15109
15110     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":752
15111  *         # check for leading nucleotide in indel calls
15112  *         for allele in alt:
15113  *             if len(allele) != len(ref):             # <<<<<<<<<<<<<<
15114  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
15115  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
15116  */
15117     __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;}
15118     __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15119     __pyx_t_6 = (__pyx_t_17 != __pyx_t_4);
15120     if (__pyx_t_6) {
15121
15122       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":753
15123  *         for allele in alt:
15124  *             if len(allele) != len(ref):
15125  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)             # <<<<<<<<<<<<<<
15126  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
15127  *                     self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE)
15128  */
15129       __pyx_t_4 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15130       __pyx_t_6 = (__pyx_t_4 == 0);
15131       if (__pyx_t_6) {
15132         __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15133         __Pyx_GOTREF(__pyx_t_3);
15134         __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ZERO_LENGTH_ALLELE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15135         __Pyx_GOTREF(__pyx_t_9);
15136         __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;}
15137         __Pyx_GOTREF(__pyx_t_18);
15138         __Pyx_INCREF(__pyx_v_line);
15139         PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_line);
15140         __Pyx_GIVEREF(__pyx_v_line);
15141         PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_9);
15142         __Pyx_GIVEREF(__pyx_t_9);
15143         __pyx_t_9 = 0;
15144         __pyx_t_9 = PyObject_Call(__pyx_t_3, __pyx_t_18, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15145         __Pyx_GOTREF(__pyx_t_9);
15146         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15147         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15148         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15149         goto __pyx_L87;
15150       }
15151       __pyx_L87:;
15152
15153       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":754
15154  *             if len(allele) != len(ref):
15155  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
15156  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():             # <<<<<<<<<<<<<<
15157  *                     self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE)
15158  * 
15159  */
15160       __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15161       __Pyx_GOTREF(__pyx_t_9);
15162       __pyx_t_18 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__upper); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15163       __Pyx_GOTREF(__pyx_t_18);
15164       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15165       __pyx_t_9 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15166       __Pyx_GOTREF(__pyx_t_9);
15167       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15168       __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;}
15169       __Pyx_GOTREF(__pyx_t_18);
15170       __pyx_t_3 = PyObject_GetAttr(__pyx_t_18, __pyx_n_s__upper); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15171       __Pyx_GOTREF(__pyx_t_3);
15172       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15173       __pyx_t_18 = PyObject_Call(__pyx_t_3, ((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;}
15174       __Pyx_GOTREF(__pyx_t_18);
15175       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15176       __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_18, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15177       __Pyx_GOTREF(__pyx_t_3);
15178       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15179       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15180       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15181       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15182       if (__pyx_t_6) {
15183         __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15184         __Pyx_GOTREF(__pyx_t_3);
15185         __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;}
15186         __Pyx_GOTREF(__pyx_t_18);
15187         __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_18); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15188         __Pyx_GOTREF(__pyx_t_9);
15189         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15190         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15191         __pyx_t_18 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__upper); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15192         __Pyx_GOTREF(__pyx_t_18);
15193         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15194         __pyx_t_9 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15195         __Pyx_GOTREF(__pyx_t_9);
15196         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15197         __pyx_t_15 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_9, ((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;}
15198         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15199         __pyx_t_8 = __pyx_t_15;
15200       } else {
15201         __pyx_t_8 = __pyx_t_6;
15202       }
15203       if (__pyx_t_8) {
15204
15205         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":755
15206  *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
15207  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
15208  *                     self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE)             # <<<<<<<<<<<<<<
15209  * 
15210  *         # trim trailing bases in alleles
15211  */
15212         __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15213         __Pyx_GOTREF(__pyx_t_9);
15214         __pyx_t_18 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_67); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15215         __Pyx_GOTREF(__pyx_t_18);
15216         __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15217         __Pyx_GOTREF(__pyx_t_3);
15218         __Pyx_INCREF(__pyx_v_line);
15219         PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_line);
15220         __Pyx_GIVEREF(__pyx_v_line);
15221         PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_18);
15222         __Pyx_GIVEREF(__pyx_t_18);
15223         __pyx_t_18 = 0;
15224         __pyx_t_18 = PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15225         __Pyx_GOTREF(__pyx_t_18);
15226         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15227         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15228         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15229         goto __pyx_L88;
15230       }
15231       __pyx_L88:;
15232       goto __pyx_L86;
15233     }
15234     __pyx_L86:;
15235   }
15236   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15237
15238   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":758
15239  * 
15240  *         # trim trailing bases in alleles
15241  *         for i in range(1,min(len(ref),min(map(len,alt)))):             # <<<<<<<<<<<<<<
15242  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
15243  *                 break
15244  */
15245   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15246   __Pyx_GOTREF(__pyx_t_2);
15247   __Pyx_INCREF(__pyx_builtin_len);
15248   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_len);
15249   __Pyx_GIVEREF(__pyx_builtin_len);
15250   __Pyx_INCREF(__pyx_v_alt);
15251   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_alt);
15252   __Pyx_GIVEREF(__pyx_v_alt);
15253   __pyx_t_18 = PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15254   __Pyx_GOTREF(__pyx_t_18);
15255   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15256   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15257   __Pyx_GOTREF(__pyx_t_2);
15258   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_18);
15259   __Pyx_GIVEREF(__pyx_t_18);
15260   __pyx_t_18 = 0;
15261   __pyx_t_18 = PyObject_Call(__pyx_builtin_min, __pyx_t_2, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15262   __Pyx_GOTREF(__pyx_t_18);
15263   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15264   __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15265   __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15266   __Pyx_GOTREF(__pyx_t_3);
15267   __pyx_t_9 = PyObject_RichCompare(__pyx_t_18, __pyx_t_3, Py_LT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15268   __Pyx_GOTREF(__pyx_t_9);
15269   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15270   __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15271   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15272   if (__pyx_t_8) {
15273     __Pyx_INCREF(__pyx_t_18);
15274     __pyx_t_2 = __pyx_t_18;
15275   } else {
15276     __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15277     __Pyx_GOTREF(__pyx_t_9);
15278     __pyx_t_2 = __pyx_t_9;
15279     __pyx_t_9 = 0;
15280   }
15281   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15282   __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;}
15283   __Pyx_GOTREF(__pyx_t_18);
15284   __Pyx_INCREF(__pyx_int_1);
15285   PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_int_1);
15286   __Pyx_GIVEREF(__pyx_int_1);
15287   __Pyx_INCREF(__pyx_t_2);
15288   PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_2);
15289   __Pyx_GIVEREF(__pyx_t_2);
15290   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15291   __pyx_t_2 = PyObject_Call(__pyx_builtin_range, __pyx_t_18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15292   __Pyx_GOTREF(__pyx_t_2);
15293   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15294   if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
15295     __pyx_t_5 = 0; __pyx_t_18 = __pyx_t_2; __Pyx_INCREF(__pyx_t_18);
15296   } else {
15297     __pyx_t_5 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15298     __Pyx_GOTREF(__pyx_t_18);
15299   }
15300   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15301   for (;;) {
15302     if (likely(PyList_CheckExact(__pyx_t_18))) {
15303       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_18)) break;
15304       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
15305     } else if (likely(PyTuple_CheckExact(__pyx_t_18))) {
15306       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_18)) break;
15307       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
15308     } else {
15309       __pyx_t_2 = PyIter_Next(__pyx_t_18);
15310       if (!__pyx_t_2) {
15311         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15312         break;
15313       }
15314       __Pyx_GOTREF(__pyx_t_2);
15315     }
15316     __Pyx_DECREF(__pyx_v_i);
15317     __pyx_v_i = __pyx_t_2;
15318     __pyx_t_2 = 0;
15319
15320     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":759
15321  *         # trim trailing bases in alleles
15322  *         for i in range(1,min(len(ref),min(map(len,alt)))):
15323  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():             # <<<<<<<<<<<<<<
15324  *                 break
15325  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]
15326  */
15327     __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15328     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
15329     if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15330       __pyx_t_4 = 0; __pyx_t_9 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_9);
15331     } else {
15332       __pyx_t_4 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15333       __Pyx_GOTREF(__pyx_t_9);
15334     }
15335     for (;;) {
15336       if (likely(PyList_CheckExact(__pyx_t_9))) {
15337         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_9)) break;
15338         __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
15339       } else if (likely(PyTuple_CheckExact(__pyx_t_9))) {
15340         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
15341         __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
15342       } else {
15343         __pyx_t_3 = PyIter_Next(__pyx_t_9);
15344         if (!__pyx_t_3) {
15345           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15346           break;
15347         }
15348         __Pyx_GOTREF(__pyx_t_3);
15349       }
15350       __Pyx_DECREF(__pyx_8genexpr0__pyx_v_allele);
15351       __pyx_8genexpr0__pyx_v_allele = __pyx_t_3;
15352       __pyx_t_3 = 0;
15353       __pyx_t_3 = __Pyx_GetItemInt(__pyx_8genexpr0__pyx_v_allele, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15354       __Pyx_GOTREF(__pyx_t_3);
15355       __pyx_t_12 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__upper); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15356       __Pyx_GOTREF(__pyx_t_12);
15357       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15358       __pyx_t_3 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15359       __Pyx_GOTREF(__pyx_t_3);
15360       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15361       if (unlikely(PySet_Add(__pyx_t_2, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15362       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15363     }
15364     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15365     __pyx_t_4 = PySet_Size(((PyObject *)__pyx_t_2)); 
15366     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
15367     __pyx_t_8 = (__pyx_t_4 > 1);
15368     if (!__pyx_t_8) {
15369       __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ref, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15370       __Pyx_GOTREF(__pyx_t_2);
15371       __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_L1_error;}
15372       __Pyx_GOTREF(__pyx_t_9);
15373       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15374       __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_L1_error;}
15375       __Pyx_GOTREF(__pyx_t_2);
15376       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15377       __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15378       __Pyx_GOTREF(__pyx_t_9);
15379       __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15380       __Pyx_GOTREF(__pyx_t_3);
15381       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15382       __pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__upper); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15383       __Pyx_GOTREF(__pyx_t_9);
15384       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15385       __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15386       __Pyx_GOTREF(__pyx_t_3);
15387       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15388       __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15389       __Pyx_GOTREF(__pyx_t_9);
15390       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15391       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15392       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15393       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15394       __pyx_t_15 = __pyx_t_6;
15395     } else {
15396       __pyx_t_15 = __pyx_t_8;
15397     }
15398     if (__pyx_t_15) {
15399
15400       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":760
15401  *         for i in range(1,min(len(ref),min(map(len,alt)))):
15402  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
15403  *                 break             # <<<<<<<<<<<<<<
15404  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]
15405  * 
15406  */
15407       goto __pyx_L90_break;
15408       goto __pyx_L91;
15409     }
15410     __pyx_L91:;
15411
15412     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":761
15413  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
15414  *                 break
15415  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
15416  * 
15417  *         # left-align alleles, if a reference is available
15418  */
15419     __pyx_t_9 = PySequence_GetSlice(__pyx_v_ref, 0, -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15420     __Pyx_GOTREF(__pyx_t_9);
15421     __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15422     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
15423     if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15424       __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2);
15425     } else {
15426       __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15427       __Pyx_GOTREF(__pyx_t_2);
15428     }
15429     for (;;) {
15430       if (likely(PyList_CheckExact(__pyx_t_2))) {
15431         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
15432         __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
15433       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
15434         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
15435         __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_12); __pyx_t_4++;
15436       } else {
15437         __pyx_t_12 = PyIter_Next(__pyx_t_2);
15438         if (!__pyx_t_12) {
15439           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15440           break;
15441         }
15442         __Pyx_GOTREF(__pyx_t_12);
15443       }
15444       __Pyx_DECREF(__pyx_v_allele);
15445       __pyx_v_allele = __pyx_t_12;
15446       __pyx_t_12 = 0;
15447       __pyx_t_12 = PySequence_GetSlice(__pyx_v_allele, 0, -1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15448       __Pyx_GOTREF(__pyx_t_12);
15449       if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15450       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15451     }
15452     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15453     __pyx_t_2 = ((PyObject *)__pyx_t_3);
15454     __Pyx_INCREF(__pyx_t_2);
15455     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
15456     __Pyx_DECREF(__pyx_v_ref);
15457     __pyx_v_ref = __pyx_t_9;
15458     __pyx_t_9 = 0;
15459     __Pyx_DECREF(__pyx_v_alt);
15460     __pyx_v_alt = __pyx_t_2;
15461     __pyx_t_2 = 0;
15462   }
15463   __pyx_L90_break:;
15464   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15465
15466   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":764
15467  * 
15468  *         # left-align alleles, if a reference is available
15469  *         if self._leftalign and self._reference:             # <<<<<<<<<<<<<<
15470  *             while left < pos:
15471  *                 movable = True
15472  */
15473   __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;}
15474   __Pyx_GOTREF(__pyx_t_18);
15475   __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;}
15476   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15477   if (__pyx_t_15) {
15478     __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;}
15479     __Pyx_GOTREF(__pyx_t_18);
15480     __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15481     __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15482     __pyx_t_6 = __pyx_t_8;
15483   } else {
15484     __pyx_t_6 = __pyx_t_15;
15485   }
15486   if (__pyx_t_6) {
15487
15488     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":765
15489  *         # left-align alleles, if a reference is available
15490  *         if self._leftalign and self._reference:
15491  *             while left < pos:             # <<<<<<<<<<<<<<
15492  *                 movable = True
15493  *                 for allele in alt:
15494  */
15495     while (1) {
15496       __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;}
15497       __Pyx_GOTREF(__pyx_t_18);
15498       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15499       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15500       if (!__pyx_t_6) break;
15501
15502       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":766
15503  *         if self._leftalign and self._reference:
15504  *             while left < pos:
15505  *                 movable = True             # <<<<<<<<<<<<<<
15506  *                 for allele in alt:
15507  *                     if len(allele) > len(ref):
15508  */
15509       __pyx_v_movable = 1;
15510
15511       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":767
15512  *             while left < pos:
15513  *                 movable = True
15514  *                 for allele in alt:             # <<<<<<<<<<<<<<
15515  *                     if len(allele) > len(ref):
15516  *                         longest, shortest = allele, ref
15517  */
15518       if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15519         __pyx_t_5 = 0; __pyx_t_18 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_18);
15520       } else {
15521         __pyx_t_5 = -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;}
15522         __Pyx_GOTREF(__pyx_t_18);
15523       }
15524       for (;;) {
15525         if (likely(PyList_CheckExact(__pyx_t_18))) {
15526           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_18)) break;
15527           __pyx_t_2 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
15528         } else if (likely(PyTuple_CheckExact(__pyx_t_18))) {
15529           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_18)) break;
15530           __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
15531         } else {
15532           __pyx_t_2 = PyIter_Next(__pyx_t_18);
15533           if (!__pyx_t_2) {
15534             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15535             break;
15536           }
15537           __Pyx_GOTREF(__pyx_t_2);
15538         }
15539         __Pyx_DECREF(__pyx_v_allele);
15540         __pyx_v_allele = __pyx_t_2;
15541         __pyx_t_2 = 0;
15542
15543         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":768
15544  *                 movable = True
15545  *                 for allele in alt:
15546  *                     if len(allele) > len(ref):             # <<<<<<<<<<<<<<
15547  *                         longest, shortest = allele, ref
15548  *                     else:
15549  */
15550         __pyx_t_4 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15551         __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;}
15552         __pyx_t_6 = (__pyx_t_4 > __pyx_t_17);
15553         if (__pyx_t_6) {
15554
15555           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":769
15556  *                 for allele in alt:
15557  *                     if len(allele) > len(ref):
15558  *                         longest, shortest = allele, ref             # <<<<<<<<<<<<<<
15559  *                     else:
15560  *                         longest, shortest = ref, allele
15561  */
15562           __pyx_t_2 = __pyx_v_allele;
15563           __Pyx_INCREF(__pyx_t_2);
15564           __pyx_t_9 = __pyx_v_ref;
15565           __Pyx_INCREF(__pyx_t_9);
15566           __Pyx_DECREF(__pyx_v_longest);
15567           __pyx_v_longest = __pyx_t_2;
15568           __pyx_t_2 = 0;
15569           __Pyx_DECREF(__pyx_v_shortest);
15570           __pyx_v_shortest = __pyx_t_9;
15571           __pyx_t_9 = 0;
15572           goto __pyx_L101;
15573         }
15574         /*else*/ {
15575
15576           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":771
15577  *                         longest, shortest = allele, ref
15578  *                     else:
15579  *                         longest, shortest = ref, allele             # <<<<<<<<<<<<<<
15580  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
15581  *                         movable = False
15582  */
15583           __pyx_t_9 = __pyx_v_ref;
15584           __Pyx_INCREF(__pyx_t_9);
15585           __pyx_t_2 = __pyx_v_allele;
15586           __Pyx_INCREF(__pyx_t_2);
15587           __Pyx_DECREF(__pyx_v_longest);
15588           __pyx_v_longest = __pyx_t_9;
15589           __pyx_t_9 = 0;
15590           __Pyx_DECREF(__pyx_v_shortest);
15591           __pyx_v_shortest = __pyx_t_2;
15592           __pyx_t_2 = 0;
15593         }
15594         __pyx_L101:;
15595
15596         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":772
15597  *                     else:
15598  *                         longest, shortest = ref, allele
15599  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():             # <<<<<<<<<<<<<<
15600  *                         movable = False
15601  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
15602  */
15603         __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;}
15604         __pyx_t_4 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15605         __pyx_t_6 = (__pyx_t_17 == __pyx_t_4);
15606         if (!__pyx_t_6) {
15607           __pyx_t_4 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15608           __pyx_t_2 = PySequence_GetSlice(__pyx_v_longest, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15609           __Pyx_GOTREF(__pyx_t_2);
15610           __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__upper); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15611           __Pyx_GOTREF(__pyx_t_9);
15612           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15613           __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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15614           __Pyx_GOTREF(__pyx_t_2);
15615           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15616           __pyx_t_9 = PyObject_GetAttr(__pyx_v_shortest, __pyx_n_s__upper); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15617           __Pyx_GOTREF(__pyx_t_9);
15618           __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15619           __Pyx_GOTREF(__pyx_t_3);
15620           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15621           __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15622           __Pyx_GOTREF(__pyx_t_9);
15623           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15624           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15625           __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15626           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15627           __pyx_t_8 = __pyx_t_15;
15628         } else {
15629           __pyx_t_8 = __pyx_t_6;
15630         }
15631         if (__pyx_t_8) {
15632
15633           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":773
15634  *                         longest, shortest = ref, allele
15635  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
15636  *                         movable = False             # <<<<<<<<<<<<<<
15637  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
15638  *                         movable = False
15639  */
15640           __pyx_v_movable = 0;
15641           goto __pyx_L102;
15642         }
15643         __pyx_L102:;
15644
15645         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":774
15646  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
15647  *                         movable = False
15648  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():             # <<<<<<<<<<<<<<
15649  *                         movable = False
15650  *                 if not movable:
15651  */
15652         __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_longest, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15653         __Pyx_GOTREF(__pyx_t_9);
15654         __pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__upper); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15655         __Pyx_GOTREF(__pyx_t_3);
15656         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15657         __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15658         __Pyx_GOTREF(__pyx_t_9);
15659         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15660         __pyx_t_4 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15661         __pyx_t_17 = (__pyx_t_4 - 1);
15662         __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_longest, __pyx_t_17, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15663         __Pyx_GOTREF(__pyx_t_3);
15664         __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15665         __Pyx_GOTREF(__pyx_t_2);
15666         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15667         __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15668         __Pyx_GOTREF(__pyx_t_3);
15669         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15670         __pyx_t_2 = PyObject_RichCompare(__pyx_t_9, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15671         __Pyx_GOTREF(__pyx_t_2);
15672         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15673         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15674         __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15675         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15676         if (__pyx_t_8) {
15677
15678           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":775
15679  *                         movable = False
15680  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
15681  *                         movable = False             # <<<<<<<<<<<<<<
15682  *                 if not movable:
15683  *                     break
15684  */
15685           __pyx_v_movable = 0;
15686           goto __pyx_L103;
15687         }
15688         __pyx_L103:;
15689       }
15690       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15691
15692       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":776
15693  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
15694  *                         movable = False
15695  *                 if not movable:             # <<<<<<<<<<<<<<
15696  *                     break
15697  *                 ref = ref[:-1]
15698  */
15699       __pyx_t_8 = (!__pyx_v_movable);
15700       if (__pyx_t_8) {
15701
15702         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":777
15703  *                         movable = False
15704  *                 if not movable:
15705  *                     break             # <<<<<<<<<<<<<<
15706  *                 ref = ref[:-1]
15707  *                 alt = [allele[:-1] for allele in alt]
15708  */
15709         goto __pyx_L98_break;
15710         goto __pyx_L104;
15711       }
15712       __pyx_L104:;
15713
15714       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":778
15715  *                 if not movable:
15716  *                     break
15717  *                 ref = ref[:-1]             # <<<<<<<<<<<<<<
15718  *                 alt = [allele[:-1] for allele in alt]
15719  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
15720  */
15721       __pyx_t_18 = 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;}
15722       __Pyx_GOTREF(__pyx_t_18);
15723       __Pyx_DECREF(__pyx_v_ref);
15724       __pyx_v_ref = __pyx_t_18;
15725       __pyx_t_18 = 0;
15726
15727       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":779
15728  *                     break
15729  *                 ref = ref[:-1]
15730  *                 alt = [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
15731  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
15732  *                     ref = faref_leftflank[pos-left-1] + ref
15733  */
15734       __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;}
15735       __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15736       if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15737         __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2);
15738       } else {
15739         __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15740         __Pyx_GOTREF(__pyx_t_2);
15741       }
15742       for (;;) {
15743         if (likely(PyList_CheckExact(__pyx_t_2))) {
15744           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
15745           __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15746         } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
15747           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
15748           __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15749         } else {
15750           __pyx_t_3 = PyIter_Next(__pyx_t_2);
15751           if (!__pyx_t_3) {
15752             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15753             break;
15754           }
15755           __Pyx_GOTREF(__pyx_t_3);
15756         }
15757         __Pyx_DECREF(__pyx_v_allele);
15758         __pyx_v_allele = __pyx_t_3;
15759         __pyx_t_3 = 0;
15760         __pyx_t_3 = PySequence_GetSlice(__pyx_v_allele, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15761         __Pyx_GOTREF(__pyx_t_3);
15762         if (unlikely(PyList_Append(__pyx_t_18, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15763         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15764       }
15765       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15766       __Pyx_INCREF(((PyObject *)__pyx_t_18));
15767       __Pyx_DECREF(__pyx_v_alt);
15768       __pyx_v_alt = ((PyObject *)__pyx_t_18);
15769       __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15770
15771       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":780
15772  *                 ref = ref[:-1]
15773  *                 alt = [allele[:-1] for allele in alt]
15774  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:             # <<<<<<<<<<<<<<
15775  *                     ref = faref_leftflank[pos-left-1] + ref
15776  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
15777  */
15778       __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;}
15779       __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15780       if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15781         __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2);
15782       } else {
15783         __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15784         __Pyx_GOTREF(__pyx_t_2);
15785       }
15786       for (;;) {
15787         if (likely(PyList_CheckExact(__pyx_t_2))) {
15788           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
15789           __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15790         } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
15791           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
15792           __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15793         } else {
15794           __pyx_t_3 = PyIter_Next(__pyx_t_2);
15795           if (!__pyx_t_3) {
15796             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15797             break;
15798           }
15799           __Pyx_GOTREF(__pyx_t_3);
15800         }
15801         __Pyx_DECREF(__pyx_v_allele);
15802         __pyx_v_allele = __pyx_t_3;
15803         __pyx_t_3 = 0;
15804         __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;}
15805         __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_17); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15806         __Pyx_GOTREF(__pyx_t_3);
15807         if (unlikely(PyList_Append(__pyx_t_18, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15808         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15809       }
15810       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15811       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15812       __Pyx_GOTREF(__pyx_t_2);
15813       __Pyx_INCREF(((PyObject *)__pyx_t_18));
15814       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_18));
15815       __Pyx_GIVEREF(((PyObject *)__pyx_t_18));
15816       __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15817       __pyx_t_18 = PyObject_Call(__pyx_builtin_min, __pyx_t_2, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15818       __Pyx_GOTREF(__pyx_t_18);
15819       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15820       __pyx_t_2 = PyObject_RichCompare(__pyx_t_18, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15821       __Pyx_GOTREF(__pyx_t_2);
15822       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15823       __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15824       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15825       if (!__pyx_t_8) {
15826         __pyx_t_5 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15827         __pyx_t_6 = (__pyx_t_5 == 0);
15828         __pyx_t_15 = __pyx_t_6;
15829       } else {
15830         __pyx_t_15 = __pyx_t_8;
15831       }
15832       if (__pyx_t_15) {
15833
15834         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":781
15835  *                 alt = [allele[:-1] for allele in alt]
15836  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
15837  *                     ref = faref_leftflank[pos-left-1] + ref             # <<<<<<<<<<<<<<
15838  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
15839  *                     pos -= 1
15840  */
15841         __pyx_t_2 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15842         __Pyx_GOTREF(__pyx_t_2);
15843         __pyx_t_18 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15844         __Pyx_GOTREF(__pyx_t_18);
15845         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15846         __pyx_t_2 = PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_18); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15847         __Pyx_GOTREF(__pyx_t_2);
15848         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15849         __pyx_t_18 = PyNumber_Add(__pyx_t_2, __pyx_v_ref); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15850         __Pyx_GOTREF(__pyx_t_18);
15851         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15852         __Pyx_DECREF(__pyx_v_ref);
15853         __pyx_v_ref = __pyx_t_18;
15854         __pyx_t_18 = 0;
15855
15856         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":782
15857  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
15858  *                     ref = faref_leftflank[pos-left-1] + ref
15859  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]             # <<<<<<<<<<<<<<
15860  *                     pos -= 1
15861  * 
15862  */
15863         __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;}
15864         __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15865         if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
15866           __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_2);
15867         } else {
15868           __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15869           __Pyx_GOTREF(__pyx_t_2);
15870         }
15871         for (;;) {
15872           if (likely(PyList_CheckExact(__pyx_t_2))) {
15873             if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
15874             __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15875           } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
15876             if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
15877             __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
15878           } else {
15879             __pyx_t_3 = PyIter_Next(__pyx_t_2);
15880             if (!__pyx_t_3) {
15881               if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15882               break;
15883             }
15884             __Pyx_GOTREF(__pyx_t_3);
15885           }
15886           __Pyx_DECREF(__pyx_v_allele);
15887           __pyx_v_allele = __pyx_t_3;
15888           __pyx_t_3 = 0;
15889           __pyx_t_3 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15890           __Pyx_GOTREF(__pyx_t_3);
15891           __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15892           __Pyx_GOTREF(__pyx_t_9);
15893           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15894           __pyx_t_3 = PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_9); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15895           __Pyx_GOTREF(__pyx_t_3);
15896           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15897           __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_v_allele); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15898           __Pyx_GOTREF(__pyx_t_9);
15899           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15900           if (unlikely(PyList_Append(__pyx_t_18, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15901           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15902         }
15903         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15904         __Pyx_INCREF(((PyObject *)__pyx_t_18));
15905         __Pyx_DECREF(__pyx_v_alt);
15906         __pyx_v_alt = ((PyObject *)__pyx_t_18);
15907         __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
15908
15909         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":783
15910  *                     ref = faref_leftflank[pos-left-1] + ref
15911  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
15912  *                     pos -= 1             # <<<<<<<<<<<<<<
15913  * 
15914  *         # parse sample columns
15915  */
15916         __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;}
15917         __Pyx_GOTREF(__pyx_t_18);
15918         __Pyx_DECREF(__pyx_v_pos);
15919         __pyx_v_pos = __pyx_t_18;
15920         __pyx_t_18 = 0;
15921         goto __pyx_L107;
15922       }
15923       __pyx_L107:;
15924     }
15925     __pyx_L98_break:;
15926     goto __pyx_L96;
15927   }
15928   __pyx_L96:;
15929
15930   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":786
15931  * 
15932  *         # parse sample columns
15933  *         samples = []             # <<<<<<<<<<<<<<
15934  *         for sample in cols[9:]:
15935  *             dict = {}
15936  */
15937   __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;}
15938   __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15939   __Pyx_DECREF(((PyObject *)__pyx_v_samples));
15940   __pyx_v_samples = __pyx_t_18;
15941   __pyx_t_18 = 0;
15942
15943   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":787
15944  *         # parse sample columns
15945  *         samples = []
15946  *         for sample in cols[9:]:             # <<<<<<<<<<<<<<
15947  *             dict = {}
15948  *             values = sample.split(':')
15949  */
15950   __pyx_t_18 = 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;}
15951   __Pyx_GOTREF(__pyx_t_18);
15952   if (PyList_CheckExact(__pyx_t_18) || PyTuple_CheckExact(__pyx_t_18)) {
15953     __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_18; __Pyx_INCREF(__pyx_t_2);
15954   } else {
15955     __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_18); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15956     __Pyx_GOTREF(__pyx_t_2);
15957   }
15958   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15959   for (;;) {
15960     if (likely(PyList_CheckExact(__pyx_t_2))) {
15961       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
15962       __pyx_t_18 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_18); __pyx_t_5++;
15963     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
15964       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
15965       __pyx_t_18 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_18); __pyx_t_5++;
15966     } else {
15967       __pyx_t_18 = PyIter_Next(__pyx_t_2);
15968       if (!__pyx_t_18) {
15969         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15970         break;
15971       }
15972       __Pyx_GOTREF(__pyx_t_18);
15973     }
15974     __Pyx_DECREF(__pyx_v_sample);
15975     __pyx_v_sample = __pyx_t_18;
15976     __pyx_t_18 = 0;
15977
15978     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":788
15979  *         samples = []
15980  *         for sample in cols[9:]:
15981  *             dict = {}             # <<<<<<<<<<<<<<
15982  *             values = sample.split(':')
15983  *             if len(values) > len(format):
15984  */
15985     __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;}
15986     __Pyx_GOTREF(((PyObject *)__pyx_t_18));
15987     __Pyx_DECREF(((PyObject *)__pyx_v_dict));
15988     __pyx_v_dict = __pyx_t_18;
15989     __pyx_t_18 = 0;
15990
15991     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":789
15992  *         for sample in cols[9:]:
15993  *             dict = {}
15994  *             values = sample.split(':')             # <<<<<<<<<<<<<<
15995  *             if len(values) > len(format):
15996  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
15997  */
15998     __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;}
15999     __Pyx_GOTREF(__pyx_t_18);
16000     __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16001     __Pyx_GOTREF(__pyx_t_9);
16002     __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
16003     PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_3));
16004     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
16005     __pyx_t_3 = PyObject_Call(__pyx_t_18, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16006     __Pyx_GOTREF(__pyx_t_3);
16007     __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16008     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16009     __Pyx_DECREF(__pyx_v_values);
16010     __pyx_v_values = __pyx_t_3;
16011     __pyx_t_3 = 0;
16012
16013     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":790
16014  *             dict = {}
16015  *             values = sample.split(':')
16016  *             if len(values) > len(format):             # <<<<<<<<<<<<<<
16017  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
16018  *             for idx in range(len(format)):
16019  */
16020     __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;}
16021     __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16022     __pyx_t_15 = (__pyx_t_17 > __pyx_t_4);
16023     if (__pyx_t_15) {
16024
16025       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":791
16026  *             values = sample.split(':')
16027  *             if len(values) > len(format):
16028  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))             # <<<<<<<<<<<<<<
16029  *             for idx in range(len(format)):
16030  *                 expected = self.get_expected(format[idx], self._format, alt)
16031  */
16032       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16033       __Pyx_GOTREF(__pyx_t_3);
16034       __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16035       __Pyx_GOTREF(__pyx_t_9);
16036       __pyx_t_4 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16037       __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16038       __Pyx_GOTREF(__pyx_t_18);
16039       __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16040       __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16041       __Pyx_GOTREF(__pyx_t_12);
16042       __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;}
16043       __Pyx_GOTREF(__pyx_t_20);
16044       PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18);
16045       __Pyx_GIVEREF(__pyx_t_18);
16046       __Pyx_INCREF(__pyx_v_sample);
16047       PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_sample);
16048       __Pyx_GIVEREF(__pyx_v_sample);
16049       PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_12);
16050       __Pyx_GIVEREF(__pyx_t_12);
16051       __pyx_t_18 = 0;
16052       __pyx_t_12 = 0;
16053       __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_20); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16054       __Pyx_GOTREF(((PyObject *)__pyx_t_12));
16055       __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16056       __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;}
16057       __Pyx_GOTREF(__pyx_t_20);
16058       __Pyx_INCREF(__pyx_v_line);
16059       PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_line);
16060       __Pyx_GIVEREF(__pyx_v_line);
16061       PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_9);
16062       __Pyx_GIVEREF(__pyx_t_9);
16063       PyTuple_SET_ITEM(__pyx_t_20, 2, ((PyObject *)__pyx_t_12));
16064       __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
16065       __pyx_t_9 = 0;
16066       __pyx_t_12 = 0;
16067       __pyx_t_12 = PyObject_Call(__pyx_t_3, __pyx_t_20, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16068       __Pyx_GOTREF(__pyx_t_12);
16069       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16070       __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16071       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
16072       goto __pyx_L114;
16073     }
16074     __pyx_L114:;
16075
16076     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":792
16077  *             if len(values) > len(format):
16078  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
16079  *             for idx in range(len(format)):             # <<<<<<<<<<<<<<
16080  *                 expected = self.get_expected(format[idx], self._format, alt)
16081  *                 if idx < len(values): value = values[idx]
16082  */
16083     __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16084     for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_4; __pyx_t_17+=1) {
16085       __pyx_v_idx = __pyx_t_17;
16086
16087       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":793
16088  *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
16089  *             for idx in range(len(format)):
16090  *                 expected = self.get_expected(format[idx], self._format, alt)             # <<<<<<<<<<<<<<
16091  *                 if idx < len(values): value = values[idx]
16092  *                 else:
16093  */
16094       __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_expected); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16095       __Pyx_GOTREF(__pyx_t_12);
16096       __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;}
16097       __Pyx_GOTREF(__pyx_t_20);
16098       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16099       __Pyx_GOTREF(__pyx_t_3);
16100       __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16101       __Pyx_GOTREF(__pyx_t_9);
16102       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_20);
16103       __Pyx_GIVEREF(__pyx_t_20);
16104       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3);
16105       __Pyx_GIVEREF(__pyx_t_3);
16106       __Pyx_INCREF(__pyx_v_alt);
16107       PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_alt);
16108       __Pyx_GIVEREF(__pyx_v_alt);
16109       __pyx_t_20 = 0;
16110       __pyx_t_3 = 0;
16111       __pyx_t_3 = PyObject_Call(__pyx_t_12, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16112       __Pyx_GOTREF(__pyx_t_3);
16113       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
16114       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16115       __Pyx_DECREF(__pyx_v_expected);
16116       __pyx_v_expected = __pyx_t_3;
16117       __pyx_t_3 = 0;
16118
16119       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":794
16120  *             for idx in range(len(format)):
16121  *                 expected = self.get_expected(format[idx], self._format, alt)
16122  *                 if idx < len(values): value = values[idx]             # <<<<<<<<<<<<<<
16123  *                 else:
16124  *                     if expected == -1: value = "."
16125  */
16126       __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;}
16127       __pyx_t_15 = (__pyx_v_idx < __pyx_t_21);
16128       if (__pyx_t_15) {
16129         __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16130         __Pyx_GOTREF(__pyx_t_3);
16131         __Pyx_DECREF(__pyx_v_value);
16132         __pyx_v_value = __pyx_t_3;
16133         __pyx_t_3 = 0;
16134         goto __pyx_L117;
16135       }
16136       /*else*/ {
16137
16138         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":796
16139  *                 if idx < len(values): value = values[idx]
16140  *                 else:
16141  *                     if expected == -1: value = "."             # <<<<<<<<<<<<<<
16142  *                     else: value = ",".join(["."]*expected)
16143  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)
16144  */
16145         __pyx_t_3 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16146         __Pyx_GOTREF(__pyx_t_3);
16147         __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16148         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16149         if (__pyx_t_15) {
16150           __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
16151           __Pyx_DECREF(__pyx_v_value);
16152           __pyx_v_value = ((PyObject *)__pyx_kp_s_6);
16153           goto __pyx_L118;
16154         }
16155         /*else*/ {
16156
16157           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":797
16158  *                 else:
16159  *                     if expected == -1: value = "."
16160  *                     else: value = ",".join(["."]*expected)             # <<<<<<<<<<<<<<
16161  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)
16162  *                 if expected != -1 and len(dict[format[idx]]) != expected:
16163  */
16164           __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16165           __Pyx_GOTREF(__pyx_t_3);
16166           __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16167           __Pyx_GOTREF(((PyObject *)__pyx_t_9));
16168           __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
16169           PyList_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_6));
16170           __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
16171           __pyx_t_12 = PyNumber_Multiply(((PyObject *)__pyx_t_9), __pyx_v_expected); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16172           __Pyx_GOTREF(__pyx_t_12);
16173           __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
16174           __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16175           __Pyx_GOTREF(__pyx_t_9);
16176           PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12);
16177           __Pyx_GIVEREF(__pyx_t_12);
16178           __pyx_t_12 = 0;
16179           __pyx_t_12 = PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16180           __Pyx_GOTREF(__pyx_t_12);
16181           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16182           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16183           __Pyx_DECREF(__pyx_v_value);
16184           __pyx_v_value = __pyx_t_12;
16185           __pyx_t_12 = 0;
16186         }
16187         __pyx_L118:;
16188       }
16189       __pyx_L117:;
16190
16191       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":798
16192  *                     if expected == -1: value = "."
16193  *                     else: value = ",".join(["."]*expected)
16194  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)             # <<<<<<<<<<<<<<
16195  *                 if expected != -1 and len(dict[format[idx]]) != expected:
16196  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
16197  */
16198       __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_formatdata); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16199       __Pyx_GOTREF(__pyx_t_12);
16200       __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 = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16201       __Pyx_GOTREF(__pyx_t_9);
16202       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16203       __Pyx_GOTREF(__pyx_t_3);
16204       __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;}
16205       __Pyx_GOTREF(__pyx_t_20);
16206       PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_9);
16207       __Pyx_GIVEREF(__pyx_t_9);
16208       __Pyx_INCREF(__pyx_v_value);
16209       PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_value);
16210       __Pyx_GIVEREF(__pyx_v_value);
16211       PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_3);
16212       __Pyx_GIVEREF(__pyx_t_3);
16213       __Pyx_INCREF(__pyx_v_line);
16214       PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_v_line);
16215       __Pyx_GIVEREF(__pyx_v_line);
16216       __pyx_t_9 = 0;
16217       __pyx_t_3 = 0;
16218       __pyx_t_3 = PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16219       __Pyx_GOTREF(__pyx_t_3);
16220       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
16221       __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16222       __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;}
16223       __Pyx_GOTREF(__pyx_t_20);
16224       if (PyDict_SetItem(((PyObject *)__pyx_v_dict), __pyx_t_20, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16225       __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16226       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16227
16228       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":799
16229  *                     else: value = ",".join(["."]*expected)
16230  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)
16231  *                 if expected != -1 and len(dict[format[idx]]) != expected:             # <<<<<<<<<<<<<<
16232  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
16233  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
16234  */
16235       __pyx_t_3 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16236       __Pyx_GOTREF(__pyx_t_3);
16237       __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16238       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16239       if (__pyx_t_15) {
16240         __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16241         __Pyx_GOTREF(__pyx_t_3);
16242         __pyx_t_20 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_3); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16243         __Pyx_GOTREF(__pyx_t_20);
16244         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16245         __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;}
16246         __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16247         __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;}
16248         __Pyx_GOTREF(__pyx_t_20);
16249         __pyx_t_3 = PyObject_RichCompare(__pyx_t_20, __pyx_v_expected, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16250         __Pyx_GOTREF(__pyx_t_3);
16251         __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16252         __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16253         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16254         __pyx_t_6 = __pyx_t_8;
16255       } else {
16256         __pyx_t_6 = __pyx_t_15;
16257       }
16258       if (__pyx_t_6) {
16259
16260         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":800
16261  *                 dict[format[idx]] = self.parse_formatdata(format[idx], value, self._format, line)
16262  *                 if expected != -1 and len(dict[format[idx]]) != expected:
16263  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,             # <<<<<<<<<<<<<<
16264  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
16265  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
16266  */
16267         __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16268         __Pyx_GOTREF(__pyx_t_3);
16269         __pyx_t_20 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_11); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16270         __Pyx_GOTREF(__pyx_t_20);
16271
16272         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":801
16273  *                 if expected != -1 and len(dict[format[idx]]) != expected:
16274  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
16275  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))             # <<<<<<<<<<<<<<
16276  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
16277  *                     dict[format[idx]] = dict[format[idx]][:expected]
16278  */
16279         __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16280         __Pyx_GOTREF(__pyx_t_12);
16281         __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;}
16282         __Pyx_GOTREF(__pyx_t_9);
16283         __pyx_t_18 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_9); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16284         __Pyx_GOTREF(__pyx_t_18);
16285         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16286         __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16287         __Pyx_GOTREF(__pyx_t_9);
16288         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12);
16289         __Pyx_GIVEREF(__pyx_t_12);
16290         __Pyx_INCREF(__pyx_v_expected);
16291         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_expected);
16292         __Pyx_GIVEREF(__pyx_v_expected);
16293         PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_18);
16294         __Pyx_GIVEREF(__pyx_t_18);
16295         __pyx_t_12 = 0;
16296         __pyx_t_18 = 0;
16297         __pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), __pyx_t_9); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16298         __Pyx_GOTREF(((PyObject *)__pyx_t_18));
16299         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16300         __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16301         __Pyx_GOTREF(__pyx_t_9);
16302         __Pyx_INCREF(__pyx_v_line);
16303         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
16304         __Pyx_GIVEREF(__pyx_v_line);
16305         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_20);
16306         __Pyx_GIVEREF(__pyx_t_20);
16307         PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_t_18));
16308         __Pyx_GIVEREF(((PyObject *)__pyx_t_18));
16309         __pyx_t_20 = 0;
16310         __pyx_t_18 = 0;
16311         __pyx_t_18 = PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16312         __Pyx_GOTREF(__pyx_t_18);
16313         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16314         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16315         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16316
16317         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":802
16318  *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
16319  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
16320  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))             # <<<<<<<<<<<<<<
16321  *                     dict[format[idx]] = dict[format[idx]][:expected]
16322  *             samples.append( dict )
16323  */
16324         __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 = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16325         __Pyx_GOTREF(__pyx_t_18);
16326         __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_18); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16327         __Pyx_GOTREF(__pyx_t_9);
16328         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16329         __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;}
16330         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16331         __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;}
16332         __Pyx_GOTREF(__pyx_t_9);
16333         __pyx_t_18 = PyObject_RichCompare(__pyx_t_9, __pyx_v_expected, Py_LT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16334         __Pyx_GOTREF(__pyx_t_18);
16335         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16336         __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16337         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16338         if (__pyx_t_6) {
16339           __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 = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16340           __Pyx_GOTREF(__pyx_t_18);
16341           __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_18); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16342           __Pyx_GOTREF(__pyx_t_9);
16343           __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16344           __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_9, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16345           __Pyx_GOTREF(__pyx_t_18);
16346           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16347           __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16348           __Pyx_GOTREF(((PyObject *)__pyx_t_9));
16349           PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_18);
16350           __Pyx_GIVEREF(__pyx_t_18);
16351           __pyx_t_18 = 0;
16352           __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 = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16353           __Pyx_GOTREF(__pyx_t_18);
16354           __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_18); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16355           __Pyx_GOTREF(__pyx_t_3);
16356           __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16357           __pyx_t_21 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16358           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16359           __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_21); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16360           __Pyx_GOTREF(__pyx_t_3);
16361           __pyx_t_18 = PyNumber_Subtract(__pyx_v_expected, __pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16362           __Pyx_GOTREF(__pyx_t_18);
16363           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16364           __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_t_9), __pyx_t_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16365           __Pyx_GOTREF(__pyx_t_3);
16366           __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
16367           __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16368           __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 = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16369           __Pyx_GOTREF(__pyx_t_18);
16370           __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_18); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16371           __Pyx_GOTREF(__pyx_t_9);
16372           __pyx_t_20 = PyNumber_InPlaceAdd(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16373           __Pyx_GOTREF(__pyx_t_20);
16374           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16375           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16376           if (PyDict_SetItem(((PyObject *)__pyx_v_dict), __pyx_t_18, __pyx_t_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16377           __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16378           __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16379           goto __pyx_L120;
16380         }
16381         __pyx_L120:;
16382
16383         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":803
16384  *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
16385  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
16386  *                     dict[format[idx]] = dict[format[idx]][:expected]             # <<<<<<<<<<<<<<
16387  *             samples.append( dict )
16388  * 
16389  */
16390         __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 = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16391         __Pyx_GOTREF(__pyx_t_18);
16392         __pyx_t_20 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_dict), __pyx_t_18); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16393         __Pyx_GOTREF(__pyx_t_20);
16394         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16395         __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;}
16396         __pyx_t_18 = PySequence_GetSlice(__pyx_t_20, 0, __pyx_t_21); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16397         __Pyx_GOTREF(__pyx_t_18);
16398         __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16399         __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 = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16400         __Pyx_GOTREF(__pyx_t_20);
16401         if (PyDict_SetItem(((PyObject *)__pyx_v_dict), __pyx_t_20, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16402         __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
16403         __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16404         goto __pyx_L119;
16405       }
16406       __pyx_L119:;
16407     }
16408
16409     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":804
16410  *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
16411  *                     dict[format[idx]] = dict[format[idx]][:expected]
16412  *             samples.append( dict )             # <<<<<<<<<<<<<<
16413  * 
16414  *         # done
16415  */
16416     if (unlikely(__pyx_v_samples == Py_None)) {
16417       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;} 
16418     }
16419     __pyx_t_16 = PyList_Append(((PyObject *)__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;}
16420   }
16421   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16422
16423   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":807
16424  * 
16425  *         # done
16426  *         d = {'chrom':chrom,             # <<<<<<<<<<<<<<
16427  *              'pos':pos,      # return 0-based position
16428  *              'id':id,
16429  */
16430   __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16431   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16432   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__chrom), __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16433
16434   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":808
16435  *         # done
16436  *         d = {'chrom':chrom,
16437  *              'pos':pos,      # return 0-based position             # <<<<<<<<<<<<<<
16438  *              'id':id,
16439  *              'ref':ref,
16440  */
16441   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__pos), __pyx_v_pos) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16442
16443   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":809
16444  *         d = {'chrom':chrom,
16445  *              'pos':pos,      # return 0-based position
16446  *              'id':id,             # <<<<<<<<<<<<<<
16447  *              'ref':ref,
16448  *              'alt':alt,
16449  */
16450   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__id), __pyx_v_id) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16451
16452   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":810
16453  *              'pos':pos,      # return 0-based position
16454  *              'id':id,
16455  *              'ref':ref,             # <<<<<<<<<<<<<<
16456  *              'alt':alt,
16457  *              'qual':qual,
16458  */
16459   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ref), __pyx_v_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16460
16461   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":811
16462  *              'id':id,
16463  *              'ref':ref,
16464  *              'alt':alt,             # <<<<<<<<<<<<<<
16465  *              'qual':qual,
16466  *              'filter':filter,
16467  */
16468   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__alt), __pyx_v_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16469
16470   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":812
16471  *              'ref':ref,
16472  *              'alt':alt,
16473  *              'qual':qual,             # <<<<<<<<<<<<<<
16474  *              'filter':filter,
16475  *              'info':info,
16476  */
16477   __pyx_t_18 = PyFloat_FromDouble(__pyx_v_qual); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16478   __Pyx_GOTREF(__pyx_t_18);
16479   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__qual), __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16480   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16481
16482   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":813
16483  *              'alt':alt,
16484  *              'qual':qual,
16485  *              'filter':filter,             # <<<<<<<<<<<<<<
16486  *              'info':info,
16487  *              'format':format}
16488  */
16489   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__filter), __pyx_v_filter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16490
16491   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":814
16492  *              'qual':qual,
16493  *              'filter':filter,
16494  *              'info':info,             # <<<<<<<<<<<<<<
16495  *              'format':format}
16496  *         for key,value in zip(self._samples,samples):
16497  */
16498   if (PyDict_SetItem(__pyx_t_2, ((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;}
16499
16500   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":815
16501  *              'filter':filter,
16502  *              'info':info,
16503  *              'format':format}             # <<<<<<<<<<<<<<
16504  *         for key,value in zip(self._samples,samples):
16505  *             d[key] = value
16506  */
16507   if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__format), __pyx_v_format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16508   __Pyx_DECREF(((PyObject *)__pyx_v_d));
16509   __pyx_v_d = __pyx_t_2;
16510   __pyx_t_2 = 0;
16511
16512   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":816
16513  *              'info':info,
16514  *              'format':format}
16515  *         for key,value in zip(self._samples,samples):             # <<<<<<<<<<<<<<
16516  *             d[key] = value
16517  * 
16518  */
16519   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16520   __Pyx_GOTREF(__pyx_t_2);
16521   __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16522   __Pyx_GOTREF(__pyx_t_18);
16523   PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2);
16524   __Pyx_GIVEREF(__pyx_t_2);
16525   __Pyx_INCREF(((PyObject *)__pyx_v_samples));
16526   PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)__pyx_v_samples));
16527   __Pyx_GIVEREF(((PyObject *)__pyx_v_samples));
16528   __pyx_t_2 = 0;
16529   __pyx_t_2 = PyObject_Call(__pyx_builtin_zip, __pyx_t_18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16530   __Pyx_GOTREF(__pyx_t_2);
16531   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16532   if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
16533     __pyx_t_5 = 0; __pyx_t_18 = __pyx_t_2; __Pyx_INCREF(__pyx_t_18);
16534   } else {
16535     __pyx_t_5 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16536     __Pyx_GOTREF(__pyx_t_18);
16537   }
16538   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16539   for (;;) {
16540     if (likely(PyList_CheckExact(__pyx_t_18))) {
16541       if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_18)) break;
16542       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
16543     } else if (likely(PyTuple_CheckExact(__pyx_t_18))) {
16544       if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_18)) break;
16545       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++;
16546     } else {
16547       __pyx_t_2 = PyIter_Next(__pyx_t_18);
16548       if (!__pyx_t_2) {
16549         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16550         break;
16551       }
16552       __Pyx_GOTREF(__pyx_t_2);
16553     }
16554     if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
16555       PyObject* tuple = __pyx_t_2;
16556       __pyx_t_20 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_20);
16557       __pyx_t_9 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_9);
16558       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16559       __Pyx_DECREF(__pyx_v_key);
16560       __pyx_v_key = __pyx_t_20;
16561       __pyx_t_20 = 0;
16562       __Pyx_DECREF(__pyx_v_value);
16563       __pyx_v_value = __pyx_t_9;
16564       __pyx_t_9 = 0;
16565     } else {
16566       __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16567       __Pyx_GOTREF(__pyx_t_3);
16568       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16569       __pyx_t_20 = __Pyx_UnpackItem(__pyx_t_3, 0); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16570       __Pyx_GOTREF(__pyx_t_20);
16571       __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_3, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16572       __Pyx_GOTREF(__pyx_t_9);
16573       if (__Pyx_EndUnpack(__pyx_t_3, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16574       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16575       __Pyx_DECREF(__pyx_v_key);
16576       __pyx_v_key = __pyx_t_20;
16577       __pyx_t_20 = 0;
16578       __Pyx_DECREF(__pyx_v_value);
16579       __pyx_v_value = __pyx_t_9;
16580       __pyx_t_9 = 0;
16581     }
16582
16583     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":817
16584  *              'format':format}
16585  *         for key,value in zip(self._samples,samples):
16586  *             d[key] = value             # <<<<<<<<<<<<<<
16587  * 
16588  *         return d
16589  */
16590     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;}
16591   }
16592   __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16593
16594   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":819
16595  *             d[key] = value
16596  * 
16597  *         return d             # <<<<<<<<<<<<<<
16598  * 
16599  * 
16600  */
16601   __Pyx_XDECREF(__pyx_r);
16602   __Pyx_INCREF(((PyObject *)__pyx_v_d));
16603   __pyx_r = ((PyObject *)__pyx_v_d);
16604   goto __pyx_L0;
16605
16606   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16607   goto __pyx_L0;
16608   __pyx_L1_error:;
16609   __Pyx_XDECREF(__pyx_t_1);
16610   __Pyx_XDECREF(__pyx_t_2);
16611   __Pyx_XDECREF(__pyx_t_3);
16612   __Pyx_XDECREF(__pyx_t_9);
16613   __Pyx_XDECREF(__pyx_t_10);
16614   __Pyx_XDECREF(__pyx_t_11);
16615   __Pyx_XDECREF(__pyx_t_12);
16616   __Pyx_XDECREF(__pyx_t_18);
16617   __Pyx_XDECREF(__pyx_t_19);
16618   __Pyx_XDECREF(__pyx_t_20);
16619   __Pyx_AddTraceback("cvcf.VCF.parse_data");
16620   __pyx_r = NULL;
16621   __pyx_L0:;
16622   __Pyx_DECREF(__pyx_v_cols);
16623   __Pyx_DECREF(__pyx_v_chrom);
16624   __Pyx_DECREF(__pyx_v_pos);
16625   __Pyx_DECREF(__pyx_v_id);
16626   __Pyx_DECREF(__pyx_v_ref);
16627   __Pyx_DECREF(__pyx_v_c);
16628   __Pyx_DECREF(__pyx_v_left);
16629   __Pyx_DECREF(__pyx_v_faref_leftflank);
16630   __Pyx_DECREF(__pyx_v_faref);
16631   __Pyx_DECREF(__pyx_v_alt);
16632   __Pyx_DECREF(__pyx_v_filter);
16633   __Pyx_DECREF(__pyx_v_info);
16634   __Pyx_DECREF(__pyx_v_blurp);
16635   __Pyx_DECREF(__pyx_v_elts);
16636   __Pyx_DECREF(__pyx_v_v);
16637   __Pyx_DECREF(__pyx_v_format);
16638   __Pyx_DECREF(__pyx_v_f);
16639   __Pyx_DECREF(__pyx_v_newalts);
16640   __Pyx_DECREF(__pyx_v_a);
16641   __Pyx_DECREF(__pyx_v_l);
16642   __Pyx_DECREF(__pyx_v_addns);
16643   __Pyx_DECREF(__pyx_v_i);
16644   __Pyx_DECREF(__pyx_v_na);
16645   __Pyx_DECREF(__pyx_v_s);
16646   __Pyx_DECREF(__pyx_v_addn);
16647   __Pyx_DECREF(__pyx_v_allele);
16648   __Pyx_DECREF(__pyx_v_longest);
16649   __Pyx_DECREF(__pyx_v_shortest);
16650   __Pyx_DECREF(__pyx_v_samples);
16651   __Pyx_DECREF(__pyx_v_sample);
16652   __Pyx_DECREF(__pyx_v_dict);
16653   __Pyx_DECREF(__pyx_v_values);
16654   __Pyx_DECREF(__pyx_v_expected);
16655   __Pyx_DECREF(__pyx_v_value);
16656   __Pyx_DECREF(__pyx_v_d);
16657   __Pyx_DECREF(__pyx_v_key);
16658   __Pyx_DECREF(__pyx_8genexpr0__pyx_v_allele);
16659   __Pyx_XGIVEREF(__pyx_r);
16660   __Pyx_RefNannyFinishContext();
16661   return __pyx_r;
16662 }
16663
16664 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":822
16665  * 
16666  * 
16667  *     def write_data(self, stream, data):             # <<<<<<<<<<<<<<
16668  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
16669  *         for k in required:
16670  */
16671
16672 static PyObject *__pyx_pf_4cvcf_3VCF_write_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
16673 static PyMethodDef __pyx_mdef_4cvcf_3VCF_write_data = {__Pyx_NAMESTR("write_data"), (PyCFunction)__pyx_pf_4cvcf_3VCF_write_data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
16674 static PyObject *__pyx_pf_4cvcf_3VCF_write_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16675   PyObject *__pyx_v_self = 0;
16676   PyObject *__pyx_v_stream = 0;
16677   PyObject *__pyx_v_data = 0;
16678   PyObject *__pyx_v_required;
16679   PyObject *__pyx_v_k;
16680   PyObject *__pyx_v_alt;
16681   PyObject *__pyx_v_filter;
16682   PyObject *__pyx_v_qual;
16683   PyObject *__pyx_v_output;
16684   PyObject *__pyx_v_s;
16685   PyObject *__pyx_r = NULL;
16686   PyObject *__pyx_t_1 = NULL;
16687   PyObject *__pyx_t_2 = NULL;
16688   PyObject *__pyx_t_3 = NULL;
16689   Py_ssize_t __pyx_t_4;
16690   int __pyx_t_5;
16691   PyObject *__pyx_t_6 = NULL;
16692   PyObject *__pyx_t_7 = NULL;
16693   PyObject *__pyx_t_8 = NULL;
16694   PyObject *__pyx_t_9 = NULL;
16695   PyObject *__pyx_t_10 = NULL;
16696   PyObject *__pyx_t_11 = NULL;
16697   int __pyx_t_12;
16698   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,&__pyx_n_s__data,0};
16699   __Pyx_RefNannySetupContext("write_data");
16700   __pyx_self = __pyx_self;
16701   if (unlikely(__pyx_kwds)) {
16702     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
16703     PyObject* values[3] = {0,0,0};
16704     switch (PyTuple_GET_SIZE(__pyx_args)) {
16705       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16706       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16707       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16708       case  0: break;
16709       default: goto __pyx_L5_argtuple_error;
16710     }
16711     switch (PyTuple_GET_SIZE(__pyx_args)) {
16712       case  0:
16713       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
16714       if (likely(values[0])) kw_args--;
16715       else goto __pyx_L5_argtuple_error;
16716       case  1:
16717       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
16718       if (likely(values[1])) kw_args--;
16719       else {
16720         __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16721       }
16722       case  2:
16723       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
16724       if (likely(values[2])) kw_args--;
16725       else {
16726         __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
16727       }
16728     }
16729     if (unlikely(kw_args > 0)) {
16730       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;}
16731     }
16732     __pyx_v_self = values[0];
16733     __pyx_v_stream = values[1];
16734     __pyx_v_data = values[2];
16735   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
16736     goto __pyx_L5_argtuple_error;
16737   } else {
16738     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
16739     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
16740     __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 2);
16741   }
16742   goto __pyx_L4_argument_unpacking_done;
16743   __pyx_L5_argtuple_error:;
16744   __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;}
16745   __pyx_L3_error:;
16746   __Pyx_AddTraceback("cvcf.VCF.write_data");
16747   __Pyx_RefNannyFinishContext();
16748   return NULL;
16749   __pyx_L4_argument_unpacking_done:;
16750   __pyx_v_required = Py_None; __Pyx_INCREF(Py_None);
16751   __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
16752   __pyx_v_alt = Py_None; __Pyx_INCREF(Py_None);
16753   __pyx_v_filter = Py_None; __Pyx_INCREF(Py_None);
16754   __pyx_v_qual = Py_None; __Pyx_INCREF(Py_None);
16755   __pyx_v_output = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
16756   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
16757
16758   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":823
16759  * 
16760  *     def write_data(self, stream, data):
16761  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples             # <<<<<<<<<<<<<<
16762  *         for k in required:
16763  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
16764  */
16765   __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;}
16766   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
16767   __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
16768   PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__chrom));
16769   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
16770   __Pyx_INCREF(((PyObject *)__pyx_n_s__pos));
16771   PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__pos));
16772   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos));
16773   __Pyx_INCREF(((PyObject *)__pyx_n_s__id));
16774   PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__id));
16775   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__id));
16776   __Pyx_INCREF(((PyObject *)__pyx_n_s__ref));
16777   PyList_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__ref));
16778   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ref));
16779   __Pyx_INCREF(((PyObject *)__pyx_n_s__alt));
16780   PyList_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_s__alt));
16781   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__alt));
16782   __Pyx_INCREF(((PyObject *)__pyx_n_s__qual));
16783   PyList_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_n_s__qual));
16784   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__qual));
16785   __Pyx_INCREF(((PyObject *)__pyx_n_s__filter));
16786   PyList_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_n_s__filter));
16787   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__filter));
16788   __Pyx_INCREF(((PyObject *)__pyx_n_s__info));
16789   PyList_SET_ITEM(__pyx_t_1, 7, ((PyObject *)__pyx_n_s__info));
16790   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__info));
16791   __Pyx_INCREF(((PyObject *)__pyx_n_s__format));
16792   PyList_SET_ITEM(__pyx_t_1, 8, ((PyObject *)__pyx_n_s__format));
16793   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__format));
16794   __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;}
16795   __Pyx_GOTREF(__pyx_t_2);
16796   __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;}
16797   __Pyx_GOTREF(__pyx_t_3);
16798   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
16799   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16800   __Pyx_DECREF(__pyx_v_required);
16801   __pyx_v_required = __pyx_t_3;
16802   __pyx_t_3 = 0;
16803
16804   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":824
16805  *     def write_data(self, stream, data):
16806  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
16807  *         for k in required:             # <<<<<<<<<<<<<<
16808  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
16809  *         if data['alt'] == []: alt = "."
16810  */
16811   if (PyList_CheckExact(__pyx_v_required) || PyTuple_CheckExact(__pyx_v_required)) {
16812     __pyx_t_4 = 0; __pyx_t_3 = __pyx_v_required; __Pyx_INCREF(__pyx_t_3);
16813   } else {
16814     __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;}
16815     __Pyx_GOTREF(__pyx_t_3);
16816   }
16817   for (;;) {
16818     if (likely(PyList_CheckExact(__pyx_t_3))) {
16819       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
16820       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
16821     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
16822       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
16823       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
16824     } else {
16825       __pyx_t_2 = PyIter_Next(__pyx_t_3);
16826       if (!__pyx_t_2) {
16827         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16828         break;
16829       }
16830       __Pyx_GOTREF(__pyx_t_2);
16831     }
16832     __Pyx_DECREF(__pyx_v_k);
16833     __pyx_v_k = __pyx_t_2;
16834     __pyx_t_2 = 0;
16835
16836     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":825
16837  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
16838  *         for k in required:
16839  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))             # <<<<<<<<<<<<<<
16840  *         if data['alt'] == []: alt = "."
16841  *         else: alt = ",".join(data['alt'])
16842  */
16843     __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;}
16844     if (__pyx_t_5) {
16845       __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;}
16846       __Pyx_GOTREF(__pyx_t_2);
16847       __Pyx_INCREF(__pyx_v_k);
16848       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k);
16849       __Pyx_GIVEREF(__pyx_v_k);
16850       __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16851       __Pyx_GOTREF(__pyx_t_1);
16852       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16853       __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16854       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16855       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16856       __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;}
16857       __Pyx_GOTREF(__pyx_t_1);
16858       PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
16859       __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
16860       __pyx_t_2 = 0;
16861       __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16862       __Pyx_GOTREF(__pyx_t_2);
16863       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16864       __Pyx_Raise(__pyx_t_2, 0, 0);
16865       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16866       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16867       goto __pyx_L8;
16868     }
16869     __pyx_L8:;
16870   }
16871   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16872
16873   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":826
16874  *         for k in required:
16875  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
16876  *         if data['alt'] == []: alt = "."             # <<<<<<<<<<<<<<
16877  *         else: alt = ",".join(data['alt'])
16878  *         if data['filter'] == None: filter = "."
16879  */
16880   __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;}
16881   __Pyx_GOTREF(__pyx_t_3);
16882   __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;}
16883   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16884   __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;}
16885   __Pyx_GOTREF(__pyx_t_1);
16886   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16887   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
16888   __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;}
16889   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16890   if (__pyx_t_5) {
16891     __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
16892     __Pyx_DECREF(__pyx_v_alt);
16893     __pyx_v_alt = ((PyObject *)__pyx_kp_s_6);
16894     goto __pyx_L9;
16895   }
16896   /*else*/ {
16897
16898     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":827
16899  *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
16900  *         if data['alt'] == []: alt = "."
16901  *         else: alt = ",".join(data['alt'])             # <<<<<<<<<<<<<<
16902  *         if data['filter'] == None: filter = "."
16903  *         elif data['filter'] == []:
16904  */
16905     __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;}
16906     __Pyx_GOTREF(__pyx_t_1);
16907     __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;}
16908     __Pyx_GOTREF(__pyx_t_2);
16909     __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;}
16910     __Pyx_GOTREF(__pyx_t_3);
16911     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
16912     __Pyx_GIVEREF(__pyx_t_2);
16913     __pyx_t_2 = 0;
16914     __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16915     __Pyx_GOTREF(__pyx_t_2);
16916     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16917     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16918     __Pyx_DECREF(__pyx_v_alt);
16919     __pyx_v_alt = __pyx_t_2;
16920     __pyx_t_2 = 0;
16921   }
16922   __pyx_L9:;
16923
16924   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":828
16925  *         if data['alt'] == []: alt = "."
16926  *         else: alt = ",".join(data['alt'])
16927  *         if data['filter'] == None: filter = "."             # <<<<<<<<<<<<<<
16928  *         elif data['filter'] == []:
16929  *             if self._version == 33: filter = "0"
16930  */
16931   __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;}
16932   __Pyx_GOTREF(__pyx_t_2);
16933   __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;}
16934   __Pyx_GOTREF(__pyx_t_3);
16935   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16936   __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;}
16937   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16938   if (__pyx_t_5) {
16939     __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
16940     __Pyx_DECREF(__pyx_v_filter);
16941     __pyx_v_filter = ((PyObject *)__pyx_kp_s_6);
16942     goto __pyx_L10;
16943   }
16944
16945   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":829
16946  *         else: alt = ",".join(data['alt'])
16947  *         if data['filter'] == None: filter = "."
16948  *         elif data['filter'] == []:             # <<<<<<<<<<<<<<
16949  *             if self._version == 33: filter = "0"
16950  *             else: filter = "PASS"
16951  */
16952   __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;}
16953   __Pyx_GOTREF(__pyx_t_3);
16954   __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;}
16955   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
16956   __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;}
16957   __Pyx_GOTREF(__pyx_t_1);
16958   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16959   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
16960   __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;}
16961   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16962   if (__pyx_t_5) {
16963
16964     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":830
16965  *         if data['filter'] == None: filter = "."
16966  *         elif data['filter'] == []:
16967  *             if self._version == 33: filter = "0"             # <<<<<<<<<<<<<<
16968  *             else: filter = "PASS"
16969  *         else: filter = ';'.join(data['filter'])
16970  */
16971     __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;}
16972     __Pyx_GOTREF(__pyx_t_1);
16973     __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;}
16974     __Pyx_GOTREF(__pyx_t_2);
16975     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16976     __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;}
16977     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16978     if (__pyx_t_5) {
16979       __Pyx_INCREF(((PyObject *)__pyx_kp_s__0));
16980       __Pyx_DECREF(__pyx_v_filter);
16981       __pyx_v_filter = ((PyObject *)__pyx_kp_s__0);
16982       goto __pyx_L11;
16983     }
16984     /*else*/ {
16985
16986       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":831
16987  *         elif data['filter'] == []:
16988  *             if self._version == 33: filter = "0"
16989  *             else: filter = "PASS"             # <<<<<<<<<<<<<<
16990  *         else: filter = ';'.join(data['filter'])
16991  *         if data['qual'] == -1: qual = "."
16992  */
16993       __Pyx_INCREF(((PyObject *)__pyx_n_s__PASS));
16994       __Pyx_DECREF(__pyx_v_filter);
16995       __pyx_v_filter = ((PyObject *)__pyx_n_s__PASS);
16996     }
16997     __pyx_L11:;
16998     goto __pyx_L10;
16999   }
17000   /*else*/ {
17001
17002     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":832
17003  *             if self._version == 33: filter = "0"
17004  *             else: filter = "PASS"
17005  *         else: filter = ';'.join(data['filter'])             # <<<<<<<<<<<<<<
17006  *         if data['qual'] == -1: qual = "."
17007  *         else: qual = str(data['qual'])
17008  */
17009     __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17010     __Pyx_GOTREF(__pyx_t_2);
17011     __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;}
17012     __Pyx_GOTREF(__pyx_t_1);
17013     __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;}
17014     __Pyx_GOTREF(__pyx_t_3);
17015     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
17016     __Pyx_GIVEREF(__pyx_t_1);
17017     __pyx_t_1 = 0;
17018     __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17019     __Pyx_GOTREF(__pyx_t_1);
17020     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17021     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17022     __Pyx_DECREF(__pyx_v_filter);
17023     __pyx_v_filter = __pyx_t_1;
17024     __pyx_t_1 = 0;
17025   }
17026   __pyx_L10:;
17027
17028   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":833
17029  *             else: filter = "PASS"
17030  *         else: filter = ';'.join(data['filter'])
17031  *         if data['qual'] == -1: qual = "."             # <<<<<<<<<<<<<<
17032  *         else: qual = str(data['qual'])
17033  * 
17034  */
17035   __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;}
17036   __Pyx_GOTREF(__pyx_t_1);
17037   __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;}
17038   __Pyx_GOTREF(__pyx_t_3);
17039   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17040   __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;}
17041   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17042   if (__pyx_t_5) {
17043     __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
17044     __Pyx_DECREF(__pyx_v_qual);
17045     __pyx_v_qual = ((PyObject *)__pyx_kp_s_6);
17046     goto __pyx_L12;
17047   }
17048   /*else*/ {
17049
17050     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":834
17051  *         else: filter = ';'.join(data['filter'])
17052  *         if data['qual'] == -1: qual = "."
17053  *         else: qual = str(data['qual'])             # <<<<<<<<<<<<<<
17054  * 
17055  *         output = [data['chrom'],
17056  */
17057     __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;}
17058     __Pyx_GOTREF(__pyx_t_3);
17059     __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;}
17060     __Pyx_GOTREF(__pyx_t_1);
17061     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
17062     __Pyx_GIVEREF(__pyx_t_3);
17063     __pyx_t_3 = 0;
17064     __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17065     __Pyx_GOTREF(__pyx_t_3);
17066     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17067     __Pyx_DECREF(__pyx_v_qual);
17068     __pyx_v_qual = __pyx_t_3;
17069     __pyx_t_3 = 0;
17070   }
17071   __pyx_L12:;
17072
17073   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":836
17074  *         else: qual = str(data['qual'])
17075  * 
17076  *         output = [data['chrom'],             # <<<<<<<<<<<<<<
17077  *                   str(data['pos']+1),   # change to 1-based position
17078  *                   data['id'],
17079  */
17080   __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;}
17081   __Pyx_GOTREF(__pyx_t_3);
17082
17083   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":837
17084  * 
17085  *         output = [data['chrom'],
17086  *                   str(data['pos']+1),   # change to 1-based position             # <<<<<<<<<<<<<<
17087  *                   data['id'],
17088  *                   data['ref'],
17089  */
17090   __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;}
17091   __Pyx_GOTREF(__pyx_t_1);
17092   __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;}
17093   __Pyx_GOTREF(__pyx_t_2);
17094   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17095   __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;}
17096   __Pyx_GOTREF(__pyx_t_1);
17097   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
17098   __Pyx_GIVEREF(__pyx_t_2);
17099   __pyx_t_2 = 0;
17100   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17101   __Pyx_GOTREF(__pyx_t_2);
17102   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17103
17104   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":838
17105  *         output = [data['chrom'],
17106  *                   str(data['pos']+1),   # change to 1-based position
17107  *                   data['id'],             # <<<<<<<<<<<<<<
17108  *                   data['ref'],
17109  *                   alt,
17110  */
17111   __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;}
17112   __Pyx_GOTREF(__pyx_t_1);
17113
17114   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":839
17115  *                   str(data['pos']+1),   # change to 1-based position
17116  *                   data['id'],
17117  *                   data['ref'],             # <<<<<<<<<<<<<<
17118  *                   alt,
17119  *                   qual,
17120  */
17121   __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;}
17122   __Pyx_GOTREF(__pyx_t_6);
17123
17124   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":843
17125  *                   qual,
17126  *                   filter,
17127  *                   self.format_formatdata( data['info'], self._info, separator=";" ),             # <<<<<<<<<<<<<<
17128  *                   self.format_formatdata( data['format'], self._format, value=False ) ]
17129  * 
17130  */
17131   __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;}
17132   __Pyx_GOTREF(__pyx_t_7);
17133   __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;}
17134   __Pyx_GOTREF(__pyx_t_8);
17135   __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;}
17136   __Pyx_GOTREF(__pyx_t_9);
17137   __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;}
17138   __Pyx_GOTREF(__pyx_t_10);
17139   PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
17140   __Pyx_GIVEREF(__pyx_t_8);
17141   PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
17142   __Pyx_GIVEREF(__pyx_t_9);
17143   __pyx_t_8 = 0;
17144   __pyx_t_9 = 0;
17145   __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;}
17146   __Pyx_GOTREF(((PyObject *)__pyx_t_9));
17147   if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__separator), ((PyObject *)__pyx_kp_s_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17148   __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_7, __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;}
17149   __Pyx_GOTREF(__pyx_t_8);
17150   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17151   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17152   __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
17153
17154   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":844
17155  *                   filter,
17156  *                   self.format_formatdata( data['info'], self._info, separator=";" ),
17157  *                   self.format_formatdata( data['format'], self._format, value=False ) ]             # <<<<<<<<<<<<<<
17158  * 
17159  *         for s in self._samples:
17160  */
17161   __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;}
17162   __Pyx_GOTREF(__pyx_t_9);
17163   __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;}
17164   __Pyx_GOTREF(__pyx_t_10);
17165   __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;}
17166   __Pyx_GOTREF(__pyx_t_7);
17167   __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;}
17168   __Pyx_GOTREF(__pyx_t_11);
17169   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
17170   __Pyx_GIVEREF(__pyx_t_10);
17171   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7);
17172   __Pyx_GIVEREF(__pyx_t_7);
17173   __pyx_t_10 = 0;
17174   __pyx_t_7 = 0;
17175   __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;}
17176   __Pyx_GOTREF(((PyObject *)__pyx_t_7));
17177   __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;}
17178   __Pyx_GOTREF(__pyx_t_10);
17179   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;}
17180   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17181   __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_9, __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;}
17182   __Pyx_GOTREF(__pyx_t_10);
17183   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17184   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
17185   __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
17186   __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;}
17187   __Pyx_GOTREF(((PyObject *)__pyx_t_7));
17188   PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
17189   __Pyx_GIVEREF(__pyx_t_3);
17190   PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
17191   __Pyx_GIVEREF(__pyx_t_2);
17192   PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_1);
17193   __Pyx_GIVEREF(__pyx_t_1);
17194   PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_6);
17195   __Pyx_GIVEREF(__pyx_t_6);
17196   __Pyx_INCREF(__pyx_v_alt);
17197   PyList_SET_ITEM(__pyx_t_7, 4, __pyx_v_alt);
17198   __Pyx_GIVEREF(__pyx_v_alt);
17199   __Pyx_INCREF(__pyx_v_qual);
17200   PyList_SET_ITEM(__pyx_t_7, 5, __pyx_v_qual);
17201   __Pyx_GIVEREF(__pyx_v_qual);
17202   __Pyx_INCREF(__pyx_v_filter);
17203   PyList_SET_ITEM(__pyx_t_7, 6, __pyx_v_filter);
17204   __Pyx_GIVEREF(__pyx_v_filter);
17205   PyList_SET_ITEM(__pyx_t_7, 7, __pyx_t_8);
17206   __Pyx_GIVEREF(__pyx_t_8);
17207   PyList_SET_ITEM(__pyx_t_7, 8, __pyx_t_10);
17208   __Pyx_GIVEREF(__pyx_t_10);
17209   __pyx_t_3 = 0;
17210   __pyx_t_2 = 0;
17211   __pyx_t_1 = 0;
17212   __pyx_t_6 = 0;
17213   __pyx_t_8 = 0;
17214   __pyx_t_10 = 0;
17215   __Pyx_DECREF(((PyObject *)__pyx_v_output));
17216   __pyx_v_output = __pyx_t_7;
17217   __pyx_t_7 = 0;
17218
17219   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":846
17220  *                   self.format_formatdata( data['format'], self._format, value=False ) ]
17221  * 
17222  *         for s in self._samples:             # <<<<<<<<<<<<<<
17223  *             output.append( self.format_formatdata( data[s], self._format, key=False ) )
17224  * 
17225  */
17226   __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;}
17227   __Pyx_GOTREF(__pyx_t_7);
17228   if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
17229     __pyx_t_4 = 0; __pyx_t_10 = __pyx_t_7; __Pyx_INCREF(__pyx_t_10);
17230   } else {
17231     __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;}
17232     __Pyx_GOTREF(__pyx_t_10);
17233   }
17234   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17235   for (;;) {
17236     if (likely(PyList_CheckExact(__pyx_t_10))) {
17237       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_10)) break;
17238       __pyx_t_7 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++;
17239     } else if (likely(PyTuple_CheckExact(__pyx_t_10))) {
17240       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
17241       __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++;
17242     } else {
17243       __pyx_t_7 = PyIter_Next(__pyx_t_10);
17244       if (!__pyx_t_7) {
17245         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17246         break;
17247       }
17248       __Pyx_GOTREF(__pyx_t_7);
17249     }
17250     __Pyx_DECREF(__pyx_v_s);
17251     __pyx_v_s = __pyx_t_7;
17252     __pyx_t_7 = 0;
17253
17254     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":847
17255  * 
17256  *         for s in self._samples:
17257  *             output.append( self.format_formatdata( data[s], self._format, key=False ) )             # <<<<<<<<<<<<<<
17258  * 
17259  *         stream.write( "\t".join(output) + "\n" )
17260  */
17261     if (unlikely(__pyx_v_output == Py_None)) {
17262       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;} 
17263     }
17264     __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;}
17265     __Pyx_GOTREF(__pyx_t_7);
17266     __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;}
17267     __Pyx_GOTREF(__pyx_t_8);
17268     __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;}
17269     __Pyx_GOTREF(__pyx_t_6);
17270     __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;}
17271     __Pyx_GOTREF(__pyx_t_1);
17272     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
17273     __Pyx_GIVEREF(__pyx_t_8);
17274     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
17275     __Pyx_GIVEREF(__pyx_t_6);
17276     __pyx_t_8 = 0;
17277     __pyx_t_6 = 0;
17278     __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;}
17279     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
17280     __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;}
17281     __Pyx_GOTREF(__pyx_t_8);
17282     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;}
17283     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17284     __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_7, __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;}
17285     __Pyx_GOTREF(__pyx_t_8);
17286     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17287     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17288     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
17289     __pyx_t_12 = PyList_Append(((PyObject *)__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;}
17290     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17291   }
17292   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17293
17294   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":849
17295  *             output.append( self.format_formatdata( data[s], self._format, key=False ) )
17296  * 
17297  *         stream.write( "\t".join(output) + "\n" )             # <<<<<<<<<<<<<<
17298  * 
17299  *     def _parse_header(self, stream):
17300  */
17301   __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;}
17302   __Pyx_GOTREF(__pyx_t_10);
17303   __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_51), __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17304   __Pyx_GOTREF(__pyx_t_8);
17305   __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;}
17306   __Pyx_GOTREF(__pyx_t_6);
17307   __Pyx_INCREF(((PyObject *)__pyx_v_output));
17308   PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_output));
17309   __Pyx_GIVEREF(((PyObject *)__pyx_v_output));
17310   __pyx_t_1 = PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17311   __Pyx_GOTREF(__pyx_t_1);
17312   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17313   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17314   __pyx_t_6 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17315   __Pyx_GOTREF(__pyx_t_6);
17316   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17317   __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;}
17318   __Pyx_GOTREF(__pyx_t_1);
17319   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
17320   __Pyx_GIVEREF(__pyx_t_6);
17321   __pyx_t_6 = 0;
17322   __pyx_t_6 = PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17323   __Pyx_GOTREF(__pyx_t_6);
17324   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17325   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17326   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17327
17328   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17329   goto __pyx_L0;
17330   __pyx_L1_error:;
17331   __Pyx_XDECREF(__pyx_t_1);
17332   __Pyx_XDECREF(__pyx_t_2);
17333   __Pyx_XDECREF(__pyx_t_3);
17334   __Pyx_XDECREF(__pyx_t_6);
17335   __Pyx_XDECREF(__pyx_t_7);
17336   __Pyx_XDECREF(__pyx_t_8);
17337   __Pyx_XDECREF(__pyx_t_9);
17338   __Pyx_XDECREF(__pyx_t_10);
17339   __Pyx_XDECREF(__pyx_t_11);
17340   __Pyx_AddTraceback("cvcf.VCF.write_data");
17341   __pyx_r = NULL;
17342   __pyx_L0:;
17343   __Pyx_DECREF(__pyx_v_required);
17344   __Pyx_DECREF(__pyx_v_k);
17345   __Pyx_DECREF(__pyx_v_alt);
17346   __Pyx_DECREF(__pyx_v_filter);
17347   __Pyx_DECREF(__pyx_v_qual);
17348   __Pyx_DECREF(__pyx_v_output);
17349   __Pyx_DECREF(__pyx_v_s);
17350   __Pyx_XGIVEREF(__pyx_r);
17351   __Pyx_RefNannyFinishContext();
17352   return __pyx_r;
17353 }
17354
17355 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":851
17356  *         stream.write( "\t".join(output) + "\n" )
17357  * 
17358  *     def _parse_header(self, stream):             # <<<<<<<<<<<<<<
17359  *         self._lineno = 0
17360  *         for line in stream:
17361  */
17362
17363 static PyObject *__pyx_pf_4cvcf_3VCF__parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17364 static PyMethodDef __pyx_mdef_4cvcf_3VCF__parse_header = {__Pyx_NAMESTR("_parse_header"), (PyCFunction)__pyx_pf_4cvcf_3VCF__parse_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
17365 static PyObject *__pyx_pf_4cvcf_3VCF__parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17366   PyObject *__pyx_v_self = 0;
17367   PyObject *__pyx_v_stream = 0;
17368   PyObject *__pyx_v_line;
17369   PyObject *__pyx_r = NULL;
17370   Py_ssize_t __pyx_t_1;
17371   PyObject *__pyx_t_2 = NULL;
17372   PyObject *__pyx_t_3 = NULL;
17373   PyObject *__pyx_t_4 = NULL;
17374   PyObject *__pyx_t_5 = NULL;
17375   int __pyx_t_6;
17376   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
17377   __Pyx_RefNannySetupContext("_parse_header");
17378   __pyx_self = __pyx_self;
17379   if (unlikely(__pyx_kwds)) {
17380     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
17381     PyObject* values[2] = {0,0};
17382     switch (PyTuple_GET_SIZE(__pyx_args)) {
17383       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17384       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17385       case  0: break;
17386       default: goto __pyx_L5_argtuple_error;
17387     }
17388     switch (PyTuple_GET_SIZE(__pyx_args)) {
17389       case  0:
17390       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
17391       if (likely(values[0])) kw_args--;
17392       else goto __pyx_L5_argtuple_error;
17393       case  1:
17394       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
17395       if (likely(values[1])) kw_args--;
17396       else {
17397         __Pyx_RaiseArgtupleInvalid("_parse_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17398       }
17399     }
17400     if (unlikely(kw_args > 0)) {
17401       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;}
17402     }
17403     __pyx_v_self = values[0];
17404     __pyx_v_stream = values[1];
17405   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
17406     goto __pyx_L5_argtuple_error;
17407   } else {
17408     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
17409     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
17410   }
17411   goto __pyx_L4_argument_unpacking_done;
17412   __pyx_L5_argtuple_error:;
17413   __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;}
17414   __pyx_L3_error:;
17415   __Pyx_AddTraceback("cvcf.VCF._parse_header");
17416   __Pyx_RefNannyFinishContext();
17417   return NULL;
17418   __pyx_L4_argument_unpacking_done:;
17419   __pyx_v_line = Py_None; __Pyx_INCREF(Py_None);
17420
17421   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":852
17422  * 
17423  *     def _parse_header(self, stream):
17424  *         self._lineno = 0             # <<<<<<<<<<<<<<
17425  *         for line in stream:
17426  *             self._lineno += 1
17427  */
17428   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;}
17429
17430   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":853
17431  *     def _parse_header(self, stream):
17432  *         self._lineno = 0
17433  *         for line in stream:             # <<<<<<<<<<<<<<
17434  *             self._lineno += 1
17435  *             if line.startswith('##'):
17436  */
17437   if (PyList_CheckExact(__pyx_v_stream) || PyTuple_CheckExact(__pyx_v_stream)) {
17438     __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_stream; __Pyx_INCREF(__pyx_t_2);
17439   } else {
17440     __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;}
17441     __Pyx_GOTREF(__pyx_t_2);
17442   }
17443   for (;;) {
17444     if (likely(PyList_CheckExact(__pyx_t_2))) {
17445       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
17446       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
17447     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
17448       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
17449       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
17450     } else {
17451       __pyx_t_3 = PyIter_Next(__pyx_t_2);
17452       if (!__pyx_t_3) {
17453         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17454         break;
17455       }
17456       __Pyx_GOTREF(__pyx_t_3);
17457     }
17458     __Pyx_DECREF(__pyx_v_line);
17459     __pyx_v_line = __pyx_t_3;
17460     __pyx_t_3 = 0;
17461
17462     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":854
17463  *         self._lineno = 0
17464  *         for line in stream:
17465  *             self._lineno += 1             # <<<<<<<<<<<<<<
17466  *             if line.startswith('##'):
17467  *                 self.parse_header( line.strip() )
17468  */
17469     __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;}
17470     __Pyx_GOTREF(__pyx_t_3);
17471     __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;}
17472     __Pyx_GOTREF(__pyx_t_4);
17473     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17474     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;}
17475     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17476
17477     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":855
17478  *         for line in stream:
17479  *             self._lineno += 1
17480  *             if line.startswith('##'):             # <<<<<<<<<<<<<<
17481  *                 self.parse_header( line.strip() )
17482  *             elif line.startswith('#'):
17483  */
17484     __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;}
17485     __Pyx_GOTREF(__pyx_t_4);
17486     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17487     __Pyx_GOTREF(__pyx_t_3);
17488     __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
17489     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_43));
17490     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
17491     __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17492     __Pyx_GOTREF(__pyx_t_5);
17493     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17494     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17495     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17496     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17497     if (__pyx_t_6) {
17498
17499       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":856
17500  *             self._lineno += 1
17501  *             if line.startswith('##'):
17502  *                 self.parse_header( line.strip() )             # <<<<<<<<<<<<<<
17503  *             elif line.startswith('#'):
17504  *                 self.parse_heading( line.strip() )
17505  */
17506       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_header); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17507       __Pyx_GOTREF(__pyx_t_5);
17508       __pyx_t_3 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17509       __Pyx_GOTREF(__pyx_t_3);
17510       __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17511       __Pyx_GOTREF(__pyx_t_4);
17512       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17513       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17514       __Pyx_GOTREF(__pyx_t_3);
17515       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
17516       __Pyx_GIVEREF(__pyx_t_4);
17517       __pyx_t_4 = 0;
17518       __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17519       __Pyx_GOTREF(__pyx_t_4);
17520       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17521       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17522       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17523       goto __pyx_L8;
17524     }
17525
17526     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":857
17527  *             if line.startswith('##'):
17528  *                 self.parse_header( line.strip() )
17529  *             elif line.startswith('#'):             # <<<<<<<<<<<<<<
17530  *                 self.parse_heading( line.strip() )
17531  *                 self.enter_default_format()
17532  */
17533     __pyx_t_4 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17534     __Pyx_GOTREF(__pyx_t_4);
17535     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17536     __Pyx_GOTREF(__pyx_t_3);
17537     __Pyx_INCREF(((PyObject *)__pyx_kp_s_50));
17538     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_50));
17539     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_50));
17540     __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17541     __Pyx_GOTREF(__pyx_t_5);
17542     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17543     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17544     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17545     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17546     if (__pyx_t_6) {
17547
17548       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":858
17549  *                 self.parse_header( line.strip() )
17550  *             elif line.startswith('#'):
17551  *                 self.parse_heading( line.strip() )             # <<<<<<<<<<<<<<
17552  *                 self.enter_default_format()
17553  *             else:
17554  */
17555       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__parse_heading); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17556       __Pyx_GOTREF(__pyx_t_5);
17557       __pyx_t_3 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17558       __Pyx_GOTREF(__pyx_t_3);
17559       __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17560       __Pyx_GOTREF(__pyx_t_4);
17561       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17562       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17563       __Pyx_GOTREF(__pyx_t_3);
17564       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
17565       __Pyx_GIVEREF(__pyx_t_4);
17566       __pyx_t_4 = 0;
17567       __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17568       __Pyx_GOTREF(__pyx_t_4);
17569       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17570       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17571       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17572
17573       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":859
17574  *             elif line.startswith('#'):
17575  *                 self.parse_heading( line.strip() )
17576  *                 self.enter_default_format()             # <<<<<<<<<<<<<<
17577  *             else:
17578  *                 break
17579  */
17580       __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_69); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17581       __Pyx_GOTREF(__pyx_t_4);
17582       __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17583       __Pyx_GOTREF(__pyx_t_3);
17584       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17585       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17586       goto __pyx_L8;
17587     }
17588     /*else*/ {
17589
17590       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":861
17591  *                 self.enter_default_format()
17592  *             else:
17593  *                 break             # <<<<<<<<<<<<<<
17594  *         return line
17595  * 
17596  */
17597       goto __pyx_L7_break;
17598     }
17599     __pyx_L8:;
17600   }
17601   __pyx_L7_break:;
17602   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17603
17604   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":862
17605  *             else:
17606  *                 break
17607  *         return line             # <<<<<<<<<<<<<<
17608  * 
17609  *     def _parse(self, line, stream):
17610  */
17611   __Pyx_XDECREF(__pyx_r);
17612   __Pyx_INCREF(__pyx_v_line);
17613   __pyx_r = __pyx_v_line;
17614   goto __pyx_L0;
17615
17616   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17617   goto __pyx_L0;
17618   __pyx_L1_error:;
17619   __Pyx_XDECREF(__pyx_t_2);
17620   __Pyx_XDECREF(__pyx_t_3);
17621   __Pyx_XDECREF(__pyx_t_4);
17622   __Pyx_XDECREF(__pyx_t_5);
17623   __Pyx_AddTraceback("cvcf.VCF._parse_header");
17624   __pyx_r = NULL;
17625   __pyx_L0:;
17626   __Pyx_DECREF(__pyx_v_line);
17627   __Pyx_XGIVEREF(__pyx_r);
17628   __Pyx_RefNannyFinishContext();
17629   return __pyx_r;
17630 }
17631
17632 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":864
17633  *         return line
17634  * 
17635  *     def _parse(self, line, stream):             # <<<<<<<<<<<<<<
17636  *         if len(line.strip()) > 0:
17637  *             d = self.parse_data( line.strip() )
17638  */
17639
17640 static PyObject *__pyx_pf_4cvcf_3VCF__parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17641 static PyMethodDef __pyx_mdef_4cvcf_3VCF__parse = {__Pyx_NAMESTR("_parse"), (PyCFunction)__pyx_pf_4cvcf_3VCF__parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
17642 static PyObject *__pyx_pf_4cvcf_3VCF__parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17643   PyObject *__pyx_v_self = 0;
17644   PyObject *__pyx_v_line = 0;
17645   PyObject *__pyx_v_stream = 0;
17646   PyObject *__pyx_v_d;
17647   PyObject *__pyx_r = NULL;
17648   PyObject *__pyx_t_1 = NULL;
17649   PyObject *__pyx_t_2 = NULL;
17650   Py_ssize_t __pyx_t_3;
17651   int __pyx_t_4;
17652   PyObject *__pyx_t_5 = NULL;
17653   PyObject *__pyx_t_6 = NULL;
17654   int __pyx_t_7;
17655   int __pyx_t_8;
17656   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__line,&__pyx_n_s__stream,0};
17657   __Pyx_RefNannySetupContext("_parse");
17658   __pyx_self = __pyx_self;
17659   if (unlikely(__pyx_kwds)) {
17660     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
17661     PyObject* values[3] = {0,0,0};
17662     switch (PyTuple_GET_SIZE(__pyx_args)) {
17663       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17664       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17665       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17666       case  0: break;
17667       default: goto __pyx_L5_argtuple_error;
17668     }
17669     switch (PyTuple_GET_SIZE(__pyx_args)) {
17670       case  0:
17671       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
17672       if (likely(values[0])) kw_args--;
17673       else goto __pyx_L5_argtuple_error;
17674       case  1:
17675       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__line);
17676       if (likely(values[1])) kw_args--;
17677       else {
17678         __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17679       }
17680       case  2:
17681       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
17682       if (likely(values[2])) kw_args--;
17683       else {
17684         __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17685       }
17686     }
17687     if (unlikely(kw_args > 0)) {
17688       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;}
17689     }
17690     __pyx_v_self = values[0];
17691     __pyx_v_line = values[1];
17692     __pyx_v_stream = values[2];
17693   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
17694     goto __pyx_L5_argtuple_error;
17695   } else {
17696     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
17697     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 1);
17698     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 2);
17699   }
17700   goto __pyx_L4_argument_unpacking_done;
17701   __pyx_L5_argtuple_error:;
17702   __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;}
17703   __pyx_L3_error:;
17704   __Pyx_AddTraceback("cvcf.VCF._parse");
17705   __Pyx_RefNannyFinishContext();
17706   return NULL;
17707   __pyx_L4_argument_unpacking_done:;
17708   __Pyx_INCREF(__pyx_v_line);
17709   __pyx_v_d = Py_None; __Pyx_INCREF(Py_None);
17710
17711   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":865
17712  * 
17713  *     def _parse(self, line, stream):
17714  *         if len(line.strip()) > 0:             # <<<<<<<<<<<<<<
17715  *             d = self.parse_data( line.strip() )
17716  *             #if d: yield d
17717  */
17718   __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;}
17719   __Pyx_GOTREF(__pyx_t_1);
17720   __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;}
17721   __Pyx_GOTREF(__pyx_t_2);
17722   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17723   __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;}
17724   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17725   __pyx_t_4 = (__pyx_t_3 > 0);
17726   if (__pyx_t_4) {
17727
17728     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":866
17729  *     def _parse(self, line, stream):
17730  *         if len(line.strip()) > 0:
17731  *             d = self.parse_data( line.strip() )             # <<<<<<<<<<<<<<
17732  *             #if d: yield d
17733  *         for line in stream:
17734  */
17735     __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;}
17736     __Pyx_GOTREF(__pyx_t_2);
17737     __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;}
17738     __Pyx_GOTREF(__pyx_t_1);
17739     __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;}
17740     __Pyx_GOTREF(__pyx_t_5);
17741     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17742     __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;}
17743     __Pyx_GOTREF(__pyx_t_1);
17744     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
17745     __Pyx_GIVEREF(__pyx_t_5);
17746     __pyx_t_5 = 0;
17747     __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17748     __Pyx_GOTREF(__pyx_t_5);
17749     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17750     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17751     __Pyx_DECREF(__pyx_v_d);
17752     __pyx_v_d = __pyx_t_5;
17753     __pyx_t_5 = 0;
17754     goto __pyx_L6;
17755   }
17756   __pyx_L6:;
17757
17758   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":868
17759  *             d = self.parse_data( line.strip() )
17760  *             #if d: yield d
17761  *         for line in stream:             # <<<<<<<<<<<<<<
17762  *             self._lineno += 1
17763  *             if self._lines and self._lineno > self._lines: raise StopIteration
17764  */
17765   if (PyList_CheckExact(__pyx_v_stream) || PyTuple_CheckExact(__pyx_v_stream)) {
17766     __pyx_t_3 = 0; __pyx_t_5 = __pyx_v_stream; __Pyx_INCREF(__pyx_t_5);
17767   } else {
17768     __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;}
17769     __Pyx_GOTREF(__pyx_t_5);
17770   }
17771   for (;;) {
17772     if (likely(PyList_CheckExact(__pyx_t_5))) {
17773       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
17774       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
17775     } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
17776       if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
17777       __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
17778     } else {
17779       __pyx_t_1 = PyIter_Next(__pyx_t_5);
17780       if (!__pyx_t_1) {
17781         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17782         break;
17783       }
17784       __Pyx_GOTREF(__pyx_t_1);
17785     }
17786     __Pyx_DECREF(__pyx_v_line);
17787     __pyx_v_line = __pyx_t_1;
17788     __pyx_t_1 = 0;
17789
17790     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":869
17791  *             #if d: yield d
17792  *         for line in stream:
17793  *             self._lineno += 1             # <<<<<<<<<<<<<<
17794  *             if self._lines and self._lineno > self._lines: raise StopIteration
17795  *             d = self.parse_data( line.strip() )
17796  */
17797     __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;}
17798     __Pyx_GOTREF(__pyx_t_1);
17799     __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;}
17800     __Pyx_GOTREF(__pyx_t_2);
17801     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17802     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;}
17803     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17804
17805     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":870
17806  *         for line in stream:
17807  *             self._lineno += 1
17808  *             if self._lines and self._lineno > self._lines: raise StopIteration             # <<<<<<<<<<<<<<
17809  *             d = self.parse_data( line.strip() )
17810  *             #if d: yield d
17811  */
17812     __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;}
17813     __Pyx_GOTREF(__pyx_t_2);
17814     __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;}
17815     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17816     if (__pyx_t_4) {
17817       __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;}
17818       __Pyx_GOTREF(__pyx_t_2);
17819       __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;}
17820       __Pyx_GOTREF(__pyx_t_1);
17821       __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;}
17822       __Pyx_GOTREF(__pyx_t_6);
17823       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17824       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17825       __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;}
17826       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17827       __pyx_t_8 = __pyx_t_7;
17828     } else {
17829       __pyx_t_8 = __pyx_t_4;
17830     }
17831     if (__pyx_t_8) {
17832       __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
17833       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17834       goto __pyx_L9;
17835     }
17836     __pyx_L9:;
17837
17838     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":871
17839  *             self._lineno += 1
17840  *             if self._lines and self._lineno > self._lines: raise StopIteration
17841  *             d = self.parse_data( line.strip() )             # <<<<<<<<<<<<<<
17842  *             #if d: yield d
17843  * 
17844  */
17845     __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;}
17846     __Pyx_GOTREF(__pyx_t_6);
17847     __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;}
17848     __Pyx_GOTREF(__pyx_t_1);
17849     __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;}
17850     __Pyx_GOTREF(__pyx_t_2);
17851     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17852     __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;}
17853     __Pyx_GOTREF(__pyx_t_1);
17854     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
17855     __Pyx_GIVEREF(__pyx_t_2);
17856     __pyx_t_2 = 0;
17857     __pyx_t_2 = PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17858     __Pyx_GOTREF(__pyx_t_2);
17859     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17860     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17861     __Pyx_DECREF(__pyx_v_d);
17862     __pyx_v_d = __pyx_t_2;
17863     __pyx_t_2 = 0;
17864   }
17865   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17866
17867   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17868   goto __pyx_L0;
17869   __pyx_L1_error:;
17870   __Pyx_XDECREF(__pyx_t_1);
17871   __Pyx_XDECREF(__pyx_t_2);
17872   __Pyx_XDECREF(__pyx_t_5);
17873   __Pyx_XDECREF(__pyx_t_6);
17874   __Pyx_AddTraceback("cvcf.VCF._parse");
17875   __pyx_r = NULL;
17876   __pyx_L0:;
17877   __Pyx_DECREF(__pyx_v_d);
17878   __Pyx_DECREF(__pyx_v_line);
17879   __Pyx_XGIVEREF(__pyx_r);
17880   __Pyx_RefNannyFinishContext();
17881   return __pyx_r;
17882 }
17883
17884 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":880
17885  *     ######################################################################################################
17886  * 
17887  *     def getsamples(self):             # <<<<<<<<<<<<<<
17888  *         """ List of samples in VCF file """
17889  *         return self._samples
17890  */
17891
17892 static PyObject *__pyx_pf_4cvcf_3VCF_getsamples(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
17893 static char __pyx_doc_4cvcf_3VCF_getsamples[] = " List of samples in VCF file ";
17894 static PyMethodDef __pyx_mdef_4cvcf_3VCF_getsamples = {__Pyx_NAMESTR("getsamples"), (PyCFunction)__pyx_pf_4cvcf_3VCF_getsamples, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_getsamples)};
17895 static PyObject *__pyx_pf_4cvcf_3VCF_getsamples(PyObject *__pyx_self, PyObject *__pyx_v_self) {
17896   PyObject *__pyx_r = NULL;
17897   PyObject *__pyx_t_1 = NULL;
17898   __Pyx_RefNannySetupContext("getsamples");
17899   __pyx_self = __pyx_self;
17900
17901   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":882
17902  *     def getsamples(self):
17903  *         """ List of samples in VCF file """
17904  *         return self._samples             # <<<<<<<<<<<<<<
17905  * 
17906  *     def setsamples(self,samples):
17907  */
17908   __Pyx_XDECREF(__pyx_r);
17909   __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;}
17910   __Pyx_GOTREF(__pyx_t_1);
17911   __pyx_r = __pyx_t_1;
17912   __pyx_t_1 = 0;
17913   goto __pyx_L0;
17914
17915   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17916   goto __pyx_L0;
17917   __pyx_L1_error:;
17918   __Pyx_XDECREF(__pyx_t_1);
17919   __Pyx_AddTraceback("cvcf.VCF.getsamples");
17920   __pyx_r = NULL;
17921   __pyx_L0:;
17922   __Pyx_XGIVEREF(__pyx_r);
17923   __Pyx_RefNannyFinishContext();
17924   return __pyx_r;
17925 }
17926
17927 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":884
17928  *         return self._samples
17929  * 
17930  *     def setsamples(self,samples):             # <<<<<<<<<<<<<<
17931  *         """ List of samples in VCF file """
17932  *         self._samples = samples
17933  */
17934
17935 static PyObject *__pyx_pf_4cvcf_3VCF_setsamples(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17936 static char __pyx_doc_4cvcf_3VCF_setsamples[] = " List of samples in VCF file ";
17937 static PyMethodDef __pyx_mdef_4cvcf_3VCF_setsamples = {__Pyx_NAMESTR("setsamples"), (PyCFunction)__pyx_pf_4cvcf_3VCF_setsamples, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_setsamples)};
17938 static PyObject *__pyx_pf_4cvcf_3VCF_setsamples(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17939   PyObject *__pyx_v_self = 0;
17940   PyObject *__pyx_v_samples = 0;
17941   PyObject *__pyx_r = NULL;
17942   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__samples,0};
17943   __Pyx_RefNannySetupContext("setsamples");
17944   __pyx_self = __pyx_self;
17945   if (unlikely(__pyx_kwds)) {
17946     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
17947     PyObject* values[2] = {0,0};
17948     switch (PyTuple_GET_SIZE(__pyx_args)) {
17949       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17950       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17951       case  0: break;
17952       default: goto __pyx_L5_argtuple_error;
17953     }
17954     switch (PyTuple_GET_SIZE(__pyx_args)) {
17955       case  0:
17956       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
17957       if (likely(values[0])) kw_args--;
17958       else goto __pyx_L5_argtuple_error;
17959       case  1:
17960       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samples);
17961       if (likely(values[1])) kw_args--;
17962       else {
17963         __Pyx_RaiseArgtupleInvalid("setsamples", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17964       }
17965     }
17966     if (unlikely(kw_args > 0)) {
17967       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;}
17968     }
17969     __pyx_v_self = values[0];
17970     __pyx_v_samples = values[1];
17971   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
17972     goto __pyx_L5_argtuple_error;
17973   } else {
17974     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
17975     __pyx_v_samples = PyTuple_GET_ITEM(__pyx_args, 1);
17976   }
17977   goto __pyx_L4_argument_unpacking_done;
17978   __pyx_L5_argtuple_error:;
17979   __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;}
17980   __pyx_L3_error:;
17981   __Pyx_AddTraceback("cvcf.VCF.setsamples");
17982   __Pyx_RefNannyFinishContext();
17983   return NULL;
17984   __pyx_L4_argument_unpacking_done:;
17985
17986   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":886
17987  *     def setsamples(self,samples):
17988  *         """ List of samples in VCF file """
17989  *         self._samples = samples             # <<<<<<<<<<<<<<
17990  * 
17991  *     def getheader(self):
17992  */
17993   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;}
17994
17995   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17996   goto __pyx_L0;
17997   __pyx_L1_error:;
17998   __Pyx_AddTraceback("cvcf.VCF.setsamples");
17999   __pyx_r = NULL;
18000   __pyx_L0:;
18001   __Pyx_XGIVEREF(__pyx_r);
18002   __Pyx_RefNannyFinishContext();
18003   return __pyx_r;
18004 }
18005
18006 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":888
18007  *         self._samples = samples
18008  * 
18009  *     def getheader(self):             # <<<<<<<<<<<<<<
18010  *         """ List of header key-value pairs (strings) """
18011  *         return self._header
18012  */
18013
18014 static PyObject *__pyx_pf_4cvcf_3VCF_getheader(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
18015 static char __pyx_doc_4cvcf_3VCF_getheader[] = " List of header key-value pairs (strings) ";
18016 static PyMethodDef __pyx_mdef_4cvcf_3VCF_getheader = {__Pyx_NAMESTR("getheader"), (PyCFunction)__pyx_pf_4cvcf_3VCF_getheader, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_getheader)};
18017 static PyObject *__pyx_pf_4cvcf_3VCF_getheader(PyObject *__pyx_self, PyObject *__pyx_v_self) {
18018   PyObject *__pyx_r = NULL;
18019   PyObject *__pyx_t_1 = NULL;
18020   __Pyx_RefNannySetupContext("getheader");
18021   __pyx_self = __pyx_self;
18022
18023   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":890
18024  *     def getheader(self):
18025  *         """ List of header key-value pairs (strings) """
18026  *         return self._header             # <<<<<<<<<<<<<<
18027  * 
18028  *     def setheader(self,header):
18029  */
18030   __Pyx_XDECREF(__pyx_r);
18031   __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;}
18032   __Pyx_GOTREF(__pyx_t_1);
18033   __pyx_r = __pyx_t_1;
18034   __pyx_t_1 = 0;
18035   goto __pyx_L0;
18036
18037   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18038   goto __pyx_L0;
18039   __pyx_L1_error:;
18040   __Pyx_XDECREF(__pyx_t_1);
18041   __Pyx_AddTraceback("cvcf.VCF.getheader");
18042   __pyx_r = NULL;
18043   __pyx_L0:;
18044   __Pyx_XGIVEREF(__pyx_r);
18045   __Pyx_RefNannyFinishContext();
18046   return __pyx_r;
18047 }
18048
18049 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":892
18050  *         return self._header
18051  * 
18052  *     def setheader(self,header):             # <<<<<<<<<<<<<<
18053  *         """ List of header key-value pairs (strings) """
18054  *         self._header = header
18055  */
18056
18057 static PyObject *__pyx_pf_4cvcf_3VCF_setheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18058 static char __pyx_doc_4cvcf_3VCF_setheader[] = " List of header key-value pairs (strings) ";
18059 static PyMethodDef __pyx_mdef_4cvcf_3VCF_setheader = {__Pyx_NAMESTR("setheader"), (PyCFunction)__pyx_pf_4cvcf_3VCF_setheader, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_setheader)};
18060 static PyObject *__pyx_pf_4cvcf_3VCF_setheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18061   PyObject *__pyx_v_self = 0;
18062   PyObject *__pyx_v_header = 0;
18063   PyObject *__pyx_r = NULL;
18064   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__header,0};
18065   __Pyx_RefNannySetupContext("setheader");
18066   __pyx_self = __pyx_self;
18067   if (unlikely(__pyx_kwds)) {
18068     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18069     PyObject* values[2] = {0,0};
18070     switch (PyTuple_GET_SIZE(__pyx_args)) {
18071       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18072       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18073       case  0: break;
18074       default: goto __pyx_L5_argtuple_error;
18075     }
18076     switch (PyTuple_GET_SIZE(__pyx_args)) {
18077       case  0:
18078       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18079       if (likely(values[0])) kw_args--;
18080       else goto __pyx_L5_argtuple_error;
18081       case  1:
18082       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__header);
18083       if (likely(values[1])) kw_args--;
18084       else {
18085         __Pyx_RaiseArgtupleInvalid("setheader", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18086       }
18087     }
18088     if (unlikely(kw_args > 0)) {
18089       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;}
18090     }
18091     __pyx_v_self = values[0];
18092     __pyx_v_header = values[1];
18093   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18094     goto __pyx_L5_argtuple_error;
18095   } else {
18096     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18097     __pyx_v_header = PyTuple_GET_ITEM(__pyx_args, 1);
18098   }
18099   goto __pyx_L4_argument_unpacking_done;
18100   __pyx_L5_argtuple_error:;
18101   __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;}
18102   __pyx_L3_error:;
18103   __Pyx_AddTraceback("cvcf.VCF.setheader");
18104   __Pyx_RefNannyFinishContext();
18105   return NULL;
18106   __pyx_L4_argument_unpacking_done:;
18107
18108   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":894
18109  *     def setheader(self,header):
18110  *         """ List of header key-value pairs (strings) """
18111  *         self._header = header             # <<<<<<<<<<<<<<
18112  * 
18113  *     def getinfo(self):
18114  */
18115   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;}
18116
18117   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18118   goto __pyx_L0;
18119   __pyx_L1_error:;
18120   __Pyx_AddTraceback("cvcf.VCF.setheader");
18121   __pyx_r = NULL;
18122   __pyx_L0:;
18123   __Pyx_XGIVEREF(__pyx_r);
18124   __Pyx_RefNannyFinishContext();
18125   return __pyx_r;
18126 }
18127
18128 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":896
18129  *         self._header = header
18130  * 
18131  *     def getinfo(self):             # <<<<<<<<<<<<<<
18132  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
18133  *         return self._info
18134  */
18135
18136 static PyObject *__pyx_pf_4cvcf_3VCF_getinfo(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
18137 static char __pyx_doc_4cvcf_3VCF_getinfo[] = " Dictionary of ##INFO tags, as VCF.FORMAT values ";
18138 static PyMethodDef __pyx_mdef_4cvcf_3VCF_getinfo = {__Pyx_NAMESTR("getinfo"), (PyCFunction)__pyx_pf_4cvcf_3VCF_getinfo, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_getinfo)};
18139 static PyObject *__pyx_pf_4cvcf_3VCF_getinfo(PyObject *__pyx_self, PyObject *__pyx_v_self) {
18140   PyObject *__pyx_r = NULL;
18141   PyObject *__pyx_t_1 = NULL;
18142   __Pyx_RefNannySetupContext("getinfo");
18143   __pyx_self = __pyx_self;
18144
18145   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":898
18146  *     def getinfo(self):
18147  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
18148  *         return self._info             # <<<<<<<<<<<<<<
18149  * 
18150  *     def setinfo(self,info):
18151  */
18152   __Pyx_XDECREF(__pyx_r);
18153   __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;}
18154   __Pyx_GOTREF(__pyx_t_1);
18155   __pyx_r = __pyx_t_1;
18156   __pyx_t_1 = 0;
18157   goto __pyx_L0;
18158
18159   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18160   goto __pyx_L0;
18161   __pyx_L1_error:;
18162   __Pyx_XDECREF(__pyx_t_1);
18163   __Pyx_AddTraceback("cvcf.VCF.getinfo");
18164   __pyx_r = NULL;
18165   __pyx_L0:;
18166   __Pyx_XGIVEREF(__pyx_r);
18167   __Pyx_RefNannyFinishContext();
18168   return __pyx_r;
18169 }
18170
18171 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":900
18172  *         return self._info
18173  * 
18174  *     def setinfo(self,info):             # <<<<<<<<<<<<<<
18175  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
18176  *         self._info = info
18177  */
18178
18179 static PyObject *__pyx_pf_4cvcf_3VCF_setinfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18180 static char __pyx_doc_4cvcf_3VCF_setinfo[] = " Dictionary of ##INFO tags, as VCF.FORMAT values ";
18181 static PyMethodDef __pyx_mdef_4cvcf_3VCF_setinfo = {__Pyx_NAMESTR("setinfo"), (PyCFunction)__pyx_pf_4cvcf_3VCF_setinfo, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_setinfo)};
18182 static PyObject *__pyx_pf_4cvcf_3VCF_setinfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18183   PyObject *__pyx_v_self = 0;
18184   PyObject *__pyx_v_info = 0;
18185   PyObject *__pyx_r = NULL;
18186   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__info,0};
18187   __Pyx_RefNannySetupContext("setinfo");
18188   __pyx_self = __pyx_self;
18189   if (unlikely(__pyx_kwds)) {
18190     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18191     PyObject* values[2] = {0,0};
18192     switch (PyTuple_GET_SIZE(__pyx_args)) {
18193       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18194       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18195       case  0: break;
18196       default: goto __pyx_L5_argtuple_error;
18197     }
18198     switch (PyTuple_GET_SIZE(__pyx_args)) {
18199       case  0:
18200       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18201       if (likely(values[0])) kw_args--;
18202       else goto __pyx_L5_argtuple_error;
18203       case  1:
18204       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__info);
18205       if (likely(values[1])) kw_args--;
18206       else {
18207         __Pyx_RaiseArgtupleInvalid("setinfo", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18208       }
18209     }
18210     if (unlikely(kw_args > 0)) {
18211       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;}
18212     }
18213     __pyx_v_self = values[0];
18214     __pyx_v_info = values[1];
18215   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18216     goto __pyx_L5_argtuple_error;
18217   } else {
18218     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18219     __pyx_v_info = PyTuple_GET_ITEM(__pyx_args, 1);
18220   }
18221   goto __pyx_L4_argument_unpacking_done;
18222   __pyx_L5_argtuple_error:;
18223   __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;}
18224   __pyx_L3_error:;
18225   __Pyx_AddTraceback("cvcf.VCF.setinfo");
18226   __Pyx_RefNannyFinishContext();
18227   return NULL;
18228   __pyx_L4_argument_unpacking_done:;
18229
18230   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":902
18231  *     def setinfo(self,info):
18232  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
18233  *         self._info = info             # <<<<<<<<<<<<<<
18234  * 
18235  *     def getformat(self):
18236  */
18237   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;}
18238
18239   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18240   goto __pyx_L0;
18241   __pyx_L1_error:;
18242   __Pyx_AddTraceback("cvcf.VCF.setinfo");
18243   __pyx_r = NULL;
18244   __pyx_L0:;
18245   __Pyx_XGIVEREF(__pyx_r);
18246   __Pyx_RefNannyFinishContext();
18247   return __pyx_r;
18248 }
18249
18250 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":904
18251  *         self._info = info
18252  * 
18253  *     def getformat(self):             # <<<<<<<<<<<<<<
18254  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
18255  *         return self._format
18256  */
18257
18258 static PyObject *__pyx_pf_4cvcf_3VCF_getformat(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
18259 static char __pyx_doc_4cvcf_3VCF_getformat[] = " Dictionary of ##FORMAT tags, as VCF.FORMAT values ";
18260 static PyMethodDef __pyx_mdef_4cvcf_3VCF_getformat = {__Pyx_NAMESTR("getformat"), (PyCFunction)__pyx_pf_4cvcf_3VCF_getformat, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_getformat)};
18261 static PyObject *__pyx_pf_4cvcf_3VCF_getformat(PyObject *__pyx_self, PyObject *__pyx_v_self) {
18262   PyObject *__pyx_r = NULL;
18263   PyObject *__pyx_t_1 = NULL;
18264   __Pyx_RefNannySetupContext("getformat");
18265   __pyx_self = __pyx_self;
18266
18267   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":906
18268  *     def getformat(self):
18269  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
18270  *         return self._format             # <<<<<<<<<<<<<<
18271  * 
18272  *     def setformat(self,format):
18273  */
18274   __Pyx_XDECREF(__pyx_r);
18275   __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;}
18276   __Pyx_GOTREF(__pyx_t_1);
18277   __pyx_r = __pyx_t_1;
18278   __pyx_t_1 = 0;
18279   goto __pyx_L0;
18280
18281   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18282   goto __pyx_L0;
18283   __pyx_L1_error:;
18284   __Pyx_XDECREF(__pyx_t_1);
18285   __Pyx_AddTraceback("cvcf.VCF.getformat");
18286   __pyx_r = NULL;
18287   __pyx_L0:;
18288   __Pyx_XGIVEREF(__pyx_r);
18289   __Pyx_RefNannyFinishContext();
18290   return __pyx_r;
18291 }
18292
18293 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":908
18294  *         return self._format
18295  * 
18296  *     def setformat(self,format):             # <<<<<<<<<<<<<<
18297  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
18298  *         self._format = format
18299  */
18300
18301 static PyObject *__pyx_pf_4cvcf_3VCF_setformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18302 static char __pyx_doc_4cvcf_3VCF_setformat[] = " Dictionary of ##FORMAT tags, as VCF.FORMAT values ";
18303 static PyMethodDef __pyx_mdef_4cvcf_3VCF_setformat = {__Pyx_NAMESTR("setformat"), (PyCFunction)__pyx_pf_4cvcf_3VCF_setformat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_setformat)};
18304 static PyObject *__pyx_pf_4cvcf_3VCF_setformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18305   PyObject *__pyx_v_self = 0;
18306   PyObject *__pyx_v_format = 0;
18307   PyObject *__pyx_r = NULL;
18308   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__format,0};
18309   __Pyx_RefNannySetupContext("setformat");
18310   __pyx_self = __pyx_self;
18311   if (unlikely(__pyx_kwds)) {
18312     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18313     PyObject* values[2] = {0,0};
18314     switch (PyTuple_GET_SIZE(__pyx_args)) {
18315       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18316       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18317       case  0: break;
18318       default: goto __pyx_L5_argtuple_error;
18319     }
18320     switch (PyTuple_GET_SIZE(__pyx_args)) {
18321       case  0:
18322       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18323       if (likely(values[0])) kw_args--;
18324       else goto __pyx_L5_argtuple_error;
18325       case  1:
18326       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
18327       if (likely(values[1])) kw_args--;
18328       else {
18329         __Pyx_RaiseArgtupleInvalid("setformat", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18330       }
18331     }
18332     if (unlikely(kw_args > 0)) {
18333       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;}
18334     }
18335     __pyx_v_self = values[0];
18336     __pyx_v_format = values[1];
18337   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18338     goto __pyx_L5_argtuple_error;
18339   } else {
18340     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18341     __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 1);
18342   }
18343   goto __pyx_L4_argument_unpacking_done;
18344   __pyx_L5_argtuple_error:;
18345   __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;}
18346   __pyx_L3_error:;
18347   __Pyx_AddTraceback("cvcf.VCF.setformat");
18348   __Pyx_RefNannyFinishContext();
18349   return NULL;
18350   __pyx_L4_argument_unpacking_done:;
18351
18352   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":910
18353  *     def setformat(self,format):
18354  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
18355  *         self._format = format             # <<<<<<<<<<<<<<
18356  * 
18357  *     def getfilter(self):
18358  */
18359   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;}
18360
18361   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18362   goto __pyx_L0;
18363   __pyx_L1_error:;
18364   __Pyx_AddTraceback("cvcf.VCF.setformat");
18365   __pyx_r = NULL;
18366   __pyx_L0:;
18367   __Pyx_XGIVEREF(__pyx_r);
18368   __Pyx_RefNannyFinishContext();
18369   return __pyx_r;
18370 }
18371
18372 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":912
18373  *         self._format = format
18374  * 
18375  *     def getfilter(self):             # <<<<<<<<<<<<<<
18376  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
18377  *         return self._filter
18378  */
18379
18380 static PyObject *__pyx_pf_4cvcf_3VCF_getfilter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
18381 static char __pyx_doc_4cvcf_3VCF_getfilter[] = " Dictionary of ##FILTER tags, as VCF.FORMAT values ";
18382 static PyMethodDef __pyx_mdef_4cvcf_3VCF_getfilter = {__Pyx_NAMESTR("getfilter"), (PyCFunction)__pyx_pf_4cvcf_3VCF_getfilter, METH_O, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_getfilter)};
18383 static PyObject *__pyx_pf_4cvcf_3VCF_getfilter(PyObject *__pyx_self, PyObject *__pyx_v_self) {
18384   PyObject *__pyx_r = NULL;
18385   PyObject *__pyx_t_1 = NULL;
18386   __Pyx_RefNannySetupContext("getfilter");
18387   __pyx_self = __pyx_self;
18388
18389   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":914
18390  *     def getfilter(self):
18391  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
18392  *         return self._filter             # <<<<<<<<<<<<<<
18393  * 
18394  *     def setfilter(self,filter):
18395  */
18396   __Pyx_XDECREF(__pyx_r);
18397   __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;}
18398   __Pyx_GOTREF(__pyx_t_1);
18399   __pyx_r = __pyx_t_1;
18400   __pyx_t_1 = 0;
18401   goto __pyx_L0;
18402
18403   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18404   goto __pyx_L0;
18405   __pyx_L1_error:;
18406   __Pyx_XDECREF(__pyx_t_1);
18407   __Pyx_AddTraceback("cvcf.VCF.getfilter");
18408   __pyx_r = NULL;
18409   __pyx_L0:;
18410   __Pyx_XGIVEREF(__pyx_r);
18411   __Pyx_RefNannyFinishContext();
18412   return __pyx_r;
18413 }
18414
18415 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":916
18416  *         return self._filter
18417  * 
18418  *     def setfilter(self,filter):             # <<<<<<<<<<<<<<
18419  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
18420  *         self._filter = filter
18421  */
18422
18423 static PyObject *__pyx_pf_4cvcf_3VCF_setfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18424 static char __pyx_doc_4cvcf_3VCF_setfilter[] = " Dictionary of ##FILTER tags, as VCF.FORMAT values ";
18425 static PyMethodDef __pyx_mdef_4cvcf_3VCF_setfilter = {__Pyx_NAMESTR("setfilter"), (PyCFunction)__pyx_pf_4cvcf_3VCF_setfilter, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_setfilter)};
18426 static PyObject *__pyx_pf_4cvcf_3VCF_setfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18427   PyObject *__pyx_v_self = 0;
18428   PyObject *__pyx_v_filter = 0;
18429   PyObject *__pyx_r = NULL;
18430   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__filter,0};
18431   __Pyx_RefNannySetupContext("setfilter");
18432   __pyx_self = __pyx_self;
18433   if (unlikely(__pyx_kwds)) {
18434     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18435     PyObject* values[2] = {0,0};
18436     switch (PyTuple_GET_SIZE(__pyx_args)) {
18437       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18438       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18439       case  0: break;
18440       default: goto __pyx_L5_argtuple_error;
18441     }
18442     switch (PyTuple_GET_SIZE(__pyx_args)) {
18443       case  0:
18444       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18445       if (likely(values[0])) kw_args--;
18446       else goto __pyx_L5_argtuple_error;
18447       case  1:
18448       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
18449       if (likely(values[1])) kw_args--;
18450       else {
18451         __Pyx_RaiseArgtupleInvalid("setfilter", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18452       }
18453     }
18454     if (unlikely(kw_args > 0)) {
18455       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;}
18456     }
18457     __pyx_v_self = values[0];
18458     __pyx_v_filter = values[1];
18459   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18460     goto __pyx_L5_argtuple_error;
18461   } else {
18462     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18463     __pyx_v_filter = PyTuple_GET_ITEM(__pyx_args, 1);
18464   }
18465   goto __pyx_L4_argument_unpacking_done;
18466   __pyx_L5_argtuple_error:;
18467   __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;}
18468   __pyx_L3_error:;
18469   __Pyx_AddTraceback("cvcf.VCF.setfilter");
18470   __Pyx_RefNannyFinishContext();
18471   return NULL;
18472   __pyx_L4_argument_unpacking_done:;
18473
18474   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":918
18475  *     def setfilter(self,filter):
18476  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
18477  *         self._filter = filter             # <<<<<<<<<<<<<<
18478  * 
18479  *     def setversion(self, version):
18480  */
18481   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;}
18482
18483   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18484   goto __pyx_L0;
18485   __pyx_L1_error:;
18486   __Pyx_AddTraceback("cvcf.VCF.setfilter");
18487   __pyx_r = NULL;
18488   __pyx_L0:;
18489   __Pyx_XGIVEREF(__pyx_r);
18490   __Pyx_RefNannyFinishContext();
18491   return __pyx_r;
18492 }
18493
18494 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":920
18495  *         self._filter = filter
18496  * 
18497  *     def setversion(self, version):             # <<<<<<<<<<<<<<
18498  *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
18499  *         self._version = version
18500  */
18501
18502 static PyObject *__pyx_pf_4cvcf_3VCF_setversion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18503 static PyMethodDef __pyx_mdef_4cvcf_3VCF_setversion = {__Pyx_NAMESTR("setversion"), (PyCFunction)__pyx_pf_4cvcf_3VCF_setversion, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
18504 static PyObject *__pyx_pf_4cvcf_3VCF_setversion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18505   PyObject *__pyx_v_self = 0;
18506   PyObject *__pyx_v_version = 0;
18507   PyObject *__pyx_r = NULL;
18508   PyObject *__pyx_t_1 = NULL;
18509   int __pyx_t_2;
18510   int __pyx_t_3;
18511   int __pyx_t_4;
18512   PyObject *__pyx_t_5 = NULL;
18513   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__version,0};
18514   __Pyx_RefNannySetupContext("setversion");
18515   __pyx_self = __pyx_self;
18516   if (unlikely(__pyx_kwds)) {
18517     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18518     PyObject* values[2] = {0,0};
18519     switch (PyTuple_GET_SIZE(__pyx_args)) {
18520       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18521       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18522       case  0: break;
18523       default: goto __pyx_L5_argtuple_error;
18524     }
18525     switch (PyTuple_GET_SIZE(__pyx_args)) {
18526       case  0:
18527       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18528       if (likely(values[0])) kw_args--;
18529       else goto __pyx_L5_argtuple_error;
18530       case  1:
18531       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__version);
18532       if (likely(values[1])) kw_args--;
18533       else {
18534         __Pyx_RaiseArgtupleInvalid("setversion", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18535       }
18536     }
18537     if (unlikely(kw_args > 0)) {
18538       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;}
18539     }
18540     __pyx_v_self = values[0];
18541     __pyx_v_version = values[1];
18542   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18543     goto __pyx_L5_argtuple_error;
18544   } else {
18545     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18546     __pyx_v_version = PyTuple_GET_ITEM(__pyx_args, 1);
18547   }
18548   goto __pyx_L4_argument_unpacking_done;
18549   __pyx_L5_argtuple_error:;
18550   __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;}
18551   __pyx_L3_error:;
18552   __Pyx_AddTraceback("cvcf.VCF.setversion");
18553   __Pyx_RefNannyFinishContext();
18554   return NULL;
18555   __pyx_L4_argument_unpacking_done:;
18556
18557   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":921
18558  * 
18559  *     def setversion(self, version):
18560  *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")             # <<<<<<<<<<<<<<
18561  *         self._version = version
18562  * 
18563  */
18564   __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;}
18565   __Pyx_GOTREF(__pyx_t_1);
18566   __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;}
18567   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18568   if (__pyx_t_2) {
18569     __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;}
18570     __Pyx_GOTREF(__pyx_t_1);
18571     __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;}
18572     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18573     __pyx_t_4 = __pyx_t_3;
18574   } else {
18575     __pyx_t_4 = __pyx_t_2;
18576   }
18577   if (__pyx_t_4) {
18578     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18579     __Pyx_GOTREF(__pyx_t_1);
18580     __Pyx_INCREF(((PyObject *)__pyx_kp_s_70));
18581     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_70));
18582     __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_70));
18583     __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18584     __Pyx_GOTREF(__pyx_t_5);
18585     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18586     __Pyx_Raise(__pyx_t_5, 0, 0);
18587     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18588     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18589     goto __pyx_L6;
18590   }
18591   __pyx_L6:;
18592
18593   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":922
18594  *     def setversion(self, version):
18595  *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
18596  *         self._version = version             # <<<<<<<<<<<<<<
18597  * 
18598  *     def setregions(self, regions):
18599  */
18600   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;}
18601
18602   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18603   goto __pyx_L0;
18604   __pyx_L1_error:;
18605   __Pyx_XDECREF(__pyx_t_1);
18606   __Pyx_XDECREF(__pyx_t_5);
18607   __Pyx_AddTraceback("cvcf.VCF.setversion");
18608   __pyx_r = NULL;
18609   __pyx_L0:;
18610   __Pyx_XGIVEREF(__pyx_r);
18611   __Pyx_RefNannyFinishContext();
18612   return __pyx_r;
18613 }
18614
18615 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":924
18616  *         self._version = version
18617  * 
18618  *     def setregions(self, regions):             # <<<<<<<<<<<<<<
18619  *         self._regions = regions
18620  * 
18621  */
18622
18623 static PyObject *__pyx_pf_4cvcf_3VCF_setregions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18624 static PyMethodDef __pyx_mdef_4cvcf_3VCF_setregions = {__Pyx_NAMESTR("setregions"), (PyCFunction)__pyx_pf_4cvcf_3VCF_setregions, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
18625 static PyObject *__pyx_pf_4cvcf_3VCF_setregions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18626   PyObject *__pyx_v_self = 0;
18627   PyObject *__pyx_v_regions = 0;
18628   PyObject *__pyx_r = NULL;
18629   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__regions,0};
18630   __Pyx_RefNannySetupContext("setregions");
18631   __pyx_self = __pyx_self;
18632   if (unlikely(__pyx_kwds)) {
18633     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18634     PyObject* values[2] = {0,0};
18635     switch (PyTuple_GET_SIZE(__pyx_args)) {
18636       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18637       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18638       case  0: break;
18639       default: goto __pyx_L5_argtuple_error;
18640     }
18641     switch (PyTuple_GET_SIZE(__pyx_args)) {
18642       case  0:
18643       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18644       if (likely(values[0])) kw_args--;
18645       else goto __pyx_L5_argtuple_error;
18646       case  1:
18647       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__regions);
18648       if (likely(values[1])) kw_args--;
18649       else {
18650         __Pyx_RaiseArgtupleInvalid("setregions", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18651       }
18652     }
18653     if (unlikely(kw_args > 0)) {
18654       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;}
18655     }
18656     __pyx_v_self = values[0];
18657     __pyx_v_regions = values[1];
18658   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18659     goto __pyx_L5_argtuple_error;
18660   } else {
18661     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18662     __pyx_v_regions = PyTuple_GET_ITEM(__pyx_args, 1);
18663   }
18664   goto __pyx_L4_argument_unpacking_done;
18665   __pyx_L5_argtuple_error:;
18666   __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;}
18667   __pyx_L3_error:;
18668   __Pyx_AddTraceback("cvcf.VCF.setregions");
18669   __Pyx_RefNannyFinishContext();
18670   return NULL;
18671   __pyx_L4_argument_unpacking_done:;
18672
18673   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":925
18674  * 
18675  *     def setregions(self, regions):
18676  *         self._regions = regions             # <<<<<<<<<<<<<<
18677  * 
18678  *     def setreference(self, ref):
18679  */
18680   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;}
18681
18682   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18683   goto __pyx_L0;
18684   __pyx_L1_error:;
18685   __Pyx_AddTraceback("cvcf.VCF.setregions");
18686   __pyx_r = NULL;
18687   __pyx_L0:;
18688   __Pyx_XGIVEREF(__pyx_r);
18689   __Pyx_RefNannyFinishContext();
18690   return __pyx_r;
18691 }
18692
18693 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":927
18694  *         self._regions = regions
18695  * 
18696  *     def setreference(self, ref):             # <<<<<<<<<<<<<<
18697  *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
18698  *         self._reference = ref
18699  */
18700
18701 static PyObject *__pyx_pf_4cvcf_3VCF_setreference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18702 static char __pyx_doc_4cvcf_3VCF_setreference[] = " Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile ";
18703 static PyMethodDef __pyx_mdef_4cvcf_3VCF_setreference = {__Pyx_NAMESTR("setreference"), (PyCFunction)__pyx_pf_4cvcf_3VCF_setreference, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_setreference)};
18704 static PyObject *__pyx_pf_4cvcf_3VCF_setreference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18705   PyObject *__pyx_v_self = 0;
18706   PyObject *__pyx_v_ref = 0;
18707   PyObject *__pyx_r = NULL;
18708   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__ref,0};
18709   __Pyx_RefNannySetupContext("setreference");
18710   __pyx_self = __pyx_self;
18711   if (unlikely(__pyx_kwds)) {
18712     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18713     PyObject* values[2] = {0,0};
18714     switch (PyTuple_GET_SIZE(__pyx_args)) {
18715       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18716       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18717       case  0: break;
18718       default: goto __pyx_L5_argtuple_error;
18719     }
18720     switch (PyTuple_GET_SIZE(__pyx_args)) {
18721       case  0:
18722       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18723       if (likely(values[0])) kw_args--;
18724       else goto __pyx_L5_argtuple_error;
18725       case  1:
18726       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ref);
18727       if (likely(values[1])) kw_args--;
18728       else {
18729         __Pyx_RaiseArgtupleInvalid("setreference", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18730       }
18731     }
18732     if (unlikely(kw_args > 0)) {
18733       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;}
18734     }
18735     __pyx_v_self = values[0];
18736     __pyx_v_ref = values[1];
18737   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18738     goto __pyx_L5_argtuple_error;
18739   } else {
18740     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18741     __pyx_v_ref = PyTuple_GET_ITEM(__pyx_args, 1);
18742   }
18743   goto __pyx_L4_argument_unpacking_done;
18744   __pyx_L5_argtuple_error:;
18745   __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;}
18746   __pyx_L3_error:;
18747   __Pyx_AddTraceback("cvcf.VCF.setreference");
18748   __Pyx_RefNannyFinishContext();
18749   return NULL;
18750   __pyx_L4_argument_unpacking_done:;
18751
18752   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":929
18753  *     def setreference(self, ref):
18754  *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
18755  *         self._reference = ref             # <<<<<<<<<<<<<<
18756  * 
18757  *     def ignoreerror(self, errorstring):
18758  */
18759   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;}
18760
18761   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18762   goto __pyx_L0;
18763   __pyx_L1_error:;
18764   __Pyx_AddTraceback("cvcf.VCF.setreference");
18765   __pyx_r = NULL;
18766   __pyx_L0:;
18767   __Pyx_XGIVEREF(__pyx_r);
18768   __Pyx_RefNannyFinishContext();
18769   return __pyx_r;
18770 }
18771
18772 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":931
18773  *         self._reference = ref
18774  * 
18775  *     def ignoreerror(self, errorstring):             # <<<<<<<<<<<<<<
18776  *         try:             self._ignored_errors.add(self.__dict__[errorstring])
18777  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18778  */
18779
18780 static PyObject *__pyx_pf_4cvcf_3VCF_ignoreerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18781 static PyMethodDef __pyx_mdef_4cvcf_3VCF_ignoreerror = {__Pyx_NAMESTR("ignoreerror"), (PyCFunction)__pyx_pf_4cvcf_3VCF_ignoreerror, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
18782 static PyObject *__pyx_pf_4cvcf_3VCF_ignoreerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18783   PyObject *__pyx_v_self = 0;
18784   PyObject *__pyx_v_errorstring = 0;
18785   PyObject *__pyx_r = NULL;
18786   PyObject *__pyx_t_1 = NULL;
18787   PyObject *__pyx_t_2 = NULL;
18788   PyObject *__pyx_t_3 = NULL;
18789   int __pyx_t_4;
18790   PyObject *__pyx_t_5 = NULL;
18791   PyObject *__pyx_t_6 = NULL;
18792   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__errorstring,0};
18793   __Pyx_RefNannySetupContext("ignoreerror");
18794   __pyx_self = __pyx_self;
18795   if (unlikely(__pyx_kwds)) {
18796     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18797     PyObject* values[2] = {0,0};
18798     switch (PyTuple_GET_SIZE(__pyx_args)) {
18799       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18800       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18801       case  0: break;
18802       default: goto __pyx_L5_argtuple_error;
18803     }
18804     switch (PyTuple_GET_SIZE(__pyx_args)) {
18805       case  0:
18806       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18807       if (likely(values[0])) kw_args--;
18808       else goto __pyx_L5_argtuple_error;
18809       case  1:
18810       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__errorstring);
18811       if (likely(values[1])) kw_args--;
18812       else {
18813         __Pyx_RaiseArgtupleInvalid("ignoreerror", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18814       }
18815     }
18816     if (unlikely(kw_args > 0)) {
18817       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;}
18818     }
18819     __pyx_v_self = values[0];
18820     __pyx_v_errorstring = values[1];
18821   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18822     goto __pyx_L5_argtuple_error;
18823   } else {
18824     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18825     __pyx_v_errorstring = PyTuple_GET_ITEM(__pyx_args, 1);
18826   }
18827   goto __pyx_L4_argument_unpacking_done;
18828   __pyx_L5_argtuple_error:;
18829   __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;}
18830   __pyx_L3_error:;
18831   __Pyx_AddTraceback("cvcf.VCF.ignoreerror");
18832   __Pyx_RefNannyFinishContext();
18833   return NULL;
18834   __pyx_L4_argument_unpacking_done:;
18835
18836   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":932
18837  * 
18838  *     def ignoreerror(self, errorstring):
18839  *         try:             self._ignored_errors.add(self.__dict__[errorstring])             # <<<<<<<<<<<<<<
18840  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18841  * 
18842  */
18843   {
18844     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
18845     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
18846     __Pyx_XGOTREF(__pyx_save_exc_type);
18847     __Pyx_XGOTREF(__pyx_save_exc_value);
18848     __Pyx_XGOTREF(__pyx_save_exc_tb);
18849     /*try:*/ {
18850       __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;}
18851       __Pyx_GOTREF(__pyx_t_1);
18852       __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;}
18853       __Pyx_GOTREF(__pyx_t_2);
18854       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18855       __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;}
18856       __Pyx_GOTREF(__pyx_t_1);
18857       __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;}
18858       __Pyx_GOTREF(__pyx_t_3);
18859       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18860       __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;}
18861       __Pyx_GOTREF(__pyx_t_1);
18862       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
18863       __Pyx_GIVEREF(__pyx_t_3);
18864       __pyx_t_3 = 0;
18865       __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
18866       __Pyx_GOTREF(__pyx_t_3);
18867       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18868       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18869       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18870     }
18871     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
18872     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
18873     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
18874     goto __pyx_L13_try_end;
18875     __pyx_L6_error:;
18876     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18877     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18878     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18879
18880     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":933
18881  *     def ignoreerror(self, errorstring):
18882  *         try:             self._ignored_errors.add(self.__dict__[errorstring])
18883  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)             # <<<<<<<<<<<<<<
18884  * 
18885  *     def warnerror(self, errorstring):
18886  */
18887     __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
18888     if (__pyx_t_4) {
18889       __Pyx_AddTraceback("cvcf.VCF.ignoreerror");
18890       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;}
18891       __Pyx_GOTREF(__pyx_t_3);
18892       __Pyx_GOTREF(__pyx_t_1);
18893       __Pyx_GOTREF(__pyx_t_2);
18894       __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_71), __pyx_v_errorstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18895       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
18896       __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;}
18897       __Pyx_GOTREF(__pyx_t_6);
18898       PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
18899       __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
18900       __pyx_t_5 = 0;
18901       __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __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;}
18902       __Pyx_GOTREF(__pyx_t_5);
18903       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18904       __Pyx_Raise(__pyx_t_5, 0, 0);
18905       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18906       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
18907       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18908       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18909       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18910       goto __pyx_L7_exception_handled;
18911     }
18912     __pyx_L8_except_error:;
18913     __Pyx_XGIVEREF(__pyx_save_exc_type);
18914     __Pyx_XGIVEREF(__pyx_save_exc_value);
18915     __Pyx_XGIVEREF(__pyx_save_exc_tb);
18916     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
18917     goto __pyx_L1_error;
18918     __pyx_L7_exception_handled:;
18919     __Pyx_XGIVEREF(__pyx_save_exc_type);
18920     __Pyx_XGIVEREF(__pyx_save_exc_value);
18921     __Pyx_XGIVEREF(__pyx_save_exc_tb);
18922     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
18923     __pyx_L13_try_end:;
18924   }
18925
18926   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18927   goto __pyx_L0;
18928   __pyx_L1_error:;
18929   __Pyx_XDECREF(__pyx_t_1);
18930   __Pyx_XDECREF(__pyx_t_2);
18931   __Pyx_XDECREF(__pyx_t_3);
18932   __Pyx_XDECREF(__pyx_t_5);
18933   __Pyx_XDECREF(__pyx_t_6);
18934   __Pyx_AddTraceback("cvcf.VCF.ignoreerror");
18935   __pyx_r = NULL;
18936   __pyx_L0:;
18937   __Pyx_XGIVEREF(__pyx_r);
18938   __Pyx_RefNannyFinishContext();
18939   return __pyx_r;
18940 }
18941
18942 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":935
18943  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18944  * 
18945  *     def warnerror(self, errorstring):             # <<<<<<<<<<<<<<
18946  *         try:             self._warn_errors.add(self.__dict__[errorstring])
18947  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
18948  */
18949
18950 static PyObject *__pyx_pf_4cvcf_3VCF_warnerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18951 static PyMethodDef __pyx_mdef_4cvcf_3VCF_warnerror = {__Pyx_NAMESTR("warnerror"), (PyCFunction)__pyx_pf_4cvcf_3VCF_warnerror, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
18952 static PyObject *__pyx_pf_4cvcf_3VCF_warnerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18953   PyObject *__pyx_v_self = 0;
18954   PyObject *__pyx_v_errorstring = 0;
18955   PyObject *__pyx_r = NULL;
18956   PyObject *__pyx_t_1 = NULL;
18957   PyObject *__pyx_t_2 = NULL;
18958   PyObject *__pyx_t_3 = NULL;
18959   int __pyx_t_4;
18960   PyObject *__pyx_t_5 = NULL;
18961   PyObject *__pyx_t_6 = NULL;
18962   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__errorstring,0};
18963   __Pyx_RefNannySetupContext("warnerror");
18964   __pyx_self = __pyx_self;
18965   if (unlikely(__pyx_kwds)) {
18966     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
18967     PyObject* values[2] = {0,0};
18968     switch (PyTuple_GET_SIZE(__pyx_args)) {
18969       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18970       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18971       case  0: break;
18972       default: goto __pyx_L5_argtuple_error;
18973     }
18974     switch (PyTuple_GET_SIZE(__pyx_args)) {
18975       case  0:
18976       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
18977       if (likely(values[0])) kw_args--;
18978       else goto __pyx_L5_argtuple_error;
18979       case  1:
18980       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__errorstring);
18981       if (likely(values[1])) kw_args--;
18982       else {
18983         __Pyx_RaiseArgtupleInvalid("warnerror", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
18984       }
18985     }
18986     if (unlikely(kw_args > 0)) {
18987       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;}
18988     }
18989     __pyx_v_self = values[0];
18990     __pyx_v_errorstring = values[1];
18991   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18992     goto __pyx_L5_argtuple_error;
18993   } else {
18994     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
18995     __pyx_v_errorstring = PyTuple_GET_ITEM(__pyx_args, 1);
18996   }
18997   goto __pyx_L4_argument_unpacking_done;
18998   __pyx_L5_argtuple_error:;
18999   __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;}
19000   __pyx_L3_error:;
19001   __Pyx_AddTraceback("cvcf.VCF.warnerror");
19002   __Pyx_RefNannyFinishContext();
19003   return NULL;
19004   __pyx_L4_argument_unpacking_done:;
19005
19006   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":936
19007  * 
19008  *     def warnerror(self, errorstring):
19009  *         try:             self._warn_errors.add(self.__dict__[errorstring])             # <<<<<<<<<<<<<<
19010  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
19011  * 
19012  */
19013   {
19014     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
19015     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
19016     __Pyx_XGOTREF(__pyx_save_exc_type);
19017     __Pyx_XGOTREF(__pyx_save_exc_value);
19018     __Pyx_XGOTREF(__pyx_save_exc_tb);
19019     /*try:*/ {
19020       __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;}
19021       __Pyx_GOTREF(__pyx_t_1);
19022       __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;}
19023       __Pyx_GOTREF(__pyx_t_2);
19024       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19025       __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;}
19026       __Pyx_GOTREF(__pyx_t_1);
19027       __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;}
19028       __Pyx_GOTREF(__pyx_t_3);
19029       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19030       __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;}
19031       __Pyx_GOTREF(__pyx_t_1);
19032       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
19033       __Pyx_GIVEREF(__pyx_t_3);
19034       __pyx_t_3 = 0;
19035       __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
19036       __Pyx_GOTREF(__pyx_t_3);
19037       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19038       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19039       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19040     }
19041     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
19042     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
19043     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
19044     goto __pyx_L13_try_end;
19045     __pyx_L6_error:;
19046     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19047     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19048     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19049
19050     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":937
19051  *     def warnerror(self, errorstring):
19052  *         try:             self._warn_errors.add(self.__dict__[errorstring])
19053  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)             # <<<<<<<<<<<<<<
19054  * 
19055  *     def parse(self, stream):
19056  */
19057     __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
19058     if (__pyx_t_4) {
19059       __Pyx_AddTraceback("cvcf.VCF.warnerror");
19060       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;}
19061       __Pyx_GOTREF(__pyx_t_3);
19062       __Pyx_GOTREF(__pyx_t_1);
19063       __Pyx_GOTREF(__pyx_t_2);
19064       __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_71), __pyx_v_errorstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
19065       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
19066       __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;}
19067       __Pyx_GOTREF(__pyx_t_6);
19068       PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
19069       __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
19070       __pyx_t_5 = 0;
19071       __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __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;}
19072       __Pyx_GOTREF(__pyx_t_5);
19073       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19074       __Pyx_Raise(__pyx_t_5, 0, 0);
19075       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19076       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
19077       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19078       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19079       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19080       goto __pyx_L7_exception_handled;
19081     }
19082     __pyx_L8_except_error:;
19083     __Pyx_XGIVEREF(__pyx_save_exc_type);
19084     __Pyx_XGIVEREF(__pyx_save_exc_value);
19085     __Pyx_XGIVEREF(__pyx_save_exc_tb);
19086     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
19087     goto __pyx_L1_error;
19088     __pyx_L7_exception_handled:;
19089     __Pyx_XGIVEREF(__pyx_save_exc_type);
19090     __Pyx_XGIVEREF(__pyx_save_exc_value);
19091     __Pyx_XGIVEREF(__pyx_save_exc_tb);
19092     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
19093     __pyx_L13_try_end:;
19094   }
19095
19096   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19097   goto __pyx_L0;
19098   __pyx_L1_error:;
19099   __Pyx_XDECREF(__pyx_t_1);
19100   __Pyx_XDECREF(__pyx_t_2);
19101   __Pyx_XDECREF(__pyx_t_3);
19102   __Pyx_XDECREF(__pyx_t_5);
19103   __Pyx_XDECREF(__pyx_t_6);
19104   __Pyx_AddTraceback("cvcf.VCF.warnerror");
19105   __pyx_r = NULL;
19106   __pyx_L0:;
19107   __Pyx_XGIVEREF(__pyx_r);
19108   __Pyx_RefNannyFinishContext();
19109   return __pyx_r;
19110 }
19111
19112 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":939
19113  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
19114  * 
19115  *     def parse(self, stream):             # <<<<<<<<<<<<<<
19116  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
19117  *         last_line = self._parse_header(stream)
19118  */
19119
19120 static PyObject *__pyx_pf_4cvcf_3VCF_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19121 static char __pyx_doc_4cvcf_3VCF_parse[] = " Parse a stream of VCF-formatted lines.  Initializes class instance and return generator ";
19122 static PyMethodDef __pyx_mdef_4cvcf_3VCF_parse = {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pf_4cvcf_3VCF_parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_parse)};
19123 static PyObject *__pyx_pf_4cvcf_3VCF_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19124   PyObject *__pyx_v_self = 0;
19125   PyObject *__pyx_v_stream = 0;
19126   PyObject *__pyx_v_last_line;
19127   PyObject *__pyx_r = NULL;
19128   PyObject *__pyx_t_1 = NULL;
19129   PyObject *__pyx_t_2 = NULL;
19130   PyObject *__pyx_t_3 = NULL;
19131   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
19132   __Pyx_RefNannySetupContext("parse");
19133   __pyx_self = __pyx_self;
19134   if (unlikely(__pyx_kwds)) {
19135     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19136     PyObject* values[2] = {0,0};
19137     switch (PyTuple_GET_SIZE(__pyx_args)) {
19138       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19139       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19140       case  0: break;
19141       default: goto __pyx_L5_argtuple_error;
19142     }
19143     switch (PyTuple_GET_SIZE(__pyx_args)) {
19144       case  0:
19145       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19146       if (likely(values[0])) kw_args--;
19147       else goto __pyx_L5_argtuple_error;
19148       case  1:
19149       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
19150       if (likely(values[1])) kw_args--;
19151       else {
19152         __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19153       }
19154     }
19155     if (unlikely(kw_args > 0)) {
19156       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;}
19157     }
19158     __pyx_v_self = values[0];
19159     __pyx_v_stream = values[1];
19160   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
19161     goto __pyx_L5_argtuple_error;
19162   } else {
19163     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19164     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
19165   }
19166   goto __pyx_L4_argument_unpacking_done;
19167   __pyx_L5_argtuple_error:;
19168   __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;}
19169   __pyx_L3_error:;
19170   __Pyx_AddTraceback("cvcf.VCF.parse");
19171   __Pyx_RefNannyFinishContext();
19172   return NULL;
19173   __pyx_L4_argument_unpacking_done:;
19174   __pyx_v_last_line = Py_None; __Pyx_INCREF(Py_None);
19175
19176   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":941
19177  *     def parse(self, stream):
19178  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
19179  *         last_line = self._parse_header(stream)             # <<<<<<<<<<<<<<
19180  *         # now return a generator that does the actual work.  In this way the pre-processing is done
19181  *         # before the first piece of data is yielded
19182  */
19183   __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;}
19184   __Pyx_GOTREF(__pyx_t_1);
19185   __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;}
19186   __Pyx_GOTREF(__pyx_t_2);
19187   __Pyx_INCREF(__pyx_v_stream);
19188   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
19189   __Pyx_GIVEREF(__pyx_v_stream);
19190   __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19191   __Pyx_GOTREF(__pyx_t_3);
19192   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19193   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19194   __Pyx_DECREF(__pyx_v_last_line);
19195   __pyx_v_last_line = __pyx_t_3;
19196   __pyx_t_3 = 0;
19197
19198   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":944
19199  *         # now return a generator that does the actual work.  In this way the pre-processing is done
19200  *         # before the first piece of data is yielded
19201  *         return self._parse(last_line, stream)             # <<<<<<<<<<<<<<
19202  * 
19203  *     def write(self, stream, datagenerator):
19204  */
19205   __Pyx_XDECREF(__pyx_r);
19206   __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;}
19207   __Pyx_GOTREF(__pyx_t_3);
19208   __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;}
19209   __Pyx_GOTREF(__pyx_t_2);
19210   __Pyx_INCREF(__pyx_v_last_line);
19211   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_last_line);
19212   __Pyx_GIVEREF(__pyx_v_last_line);
19213   __Pyx_INCREF(__pyx_v_stream);
19214   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_stream);
19215   __Pyx_GIVEREF(__pyx_v_stream);
19216   __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19217   __Pyx_GOTREF(__pyx_t_1);
19218   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19219   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19220   __pyx_r = __pyx_t_1;
19221   __pyx_t_1 = 0;
19222   goto __pyx_L0;
19223
19224   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19225   goto __pyx_L0;
19226   __pyx_L1_error:;
19227   __Pyx_XDECREF(__pyx_t_1);
19228   __Pyx_XDECREF(__pyx_t_2);
19229   __Pyx_XDECREF(__pyx_t_3);
19230   __Pyx_AddTraceback("cvcf.VCF.parse");
19231   __pyx_r = NULL;
19232   __pyx_L0:;
19233   __Pyx_DECREF(__pyx_v_last_line);
19234   __Pyx_XGIVEREF(__pyx_r);
19235   __Pyx_RefNannyFinishContext();
19236   return __pyx_r;
19237 }
19238
19239 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":946
19240  *         return self._parse(last_line, stream)
19241  * 
19242  *     def write(self, stream, datagenerator):             # <<<<<<<<<<<<<<
19243  *         """ Writes a VCF file to a stream, using a data generator (or list) """
19244  *         self.write_header(stream)
19245  */
19246
19247 static PyObject *__pyx_pf_4cvcf_3VCF_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19248 static char __pyx_doc_4cvcf_3VCF_write[] = " Writes a VCF file to a stream, using a data generator (or list) ";
19249 static PyMethodDef __pyx_mdef_4cvcf_3VCF_write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_4cvcf_3VCF_write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_write)};
19250 static PyObject *__pyx_pf_4cvcf_3VCF_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19251   PyObject *__pyx_v_self = 0;
19252   PyObject *__pyx_v_stream = 0;
19253   PyObject *__pyx_v_datagenerator = 0;
19254   PyObject *__pyx_v_data;
19255   PyObject *__pyx_r = NULL;
19256   PyObject *__pyx_t_1 = NULL;
19257   PyObject *__pyx_t_2 = NULL;
19258   PyObject *__pyx_t_3 = NULL;
19259   Py_ssize_t __pyx_t_4;
19260   PyObject *__pyx_t_5 = NULL;
19261   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,&__pyx_n_s__datagenerator,0};
19262   __Pyx_RefNannySetupContext("write");
19263   __pyx_self = __pyx_self;
19264   if (unlikely(__pyx_kwds)) {
19265     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19266     PyObject* values[3] = {0,0,0};
19267     switch (PyTuple_GET_SIZE(__pyx_args)) {
19268       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19269       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19270       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19271       case  0: break;
19272       default: goto __pyx_L5_argtuple_error;
19273     }
19274     switch (PyTuple_GET_SIZE(__pyx_args)) {
19275       case  0:
19276       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19277       if (likely(values[0])) kw_args--;
19278       else goto __pyx_L5_argtuple_error;
19279       case  1:
19280       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
19281       if (likely(values[1])) kw_args--;
19282       else {
19283         __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19284       }
19285       case  2:
19286       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__datagenerator);
19287       if (likely(values[2])) kw_args--;
19288       else {
19289         __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19290       }
19291     }
19292     if (unlikely(kw_args > 0)) {
19293       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;}
19294     }
19295     __pyx_v_self = values[0];
19296     __pyx_v_stream = values[1];
19297     __pyx_v_datagenerator = values[2];
19298   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
19299     goto __pyx_L5_argtuple_error;
19300   } else {
19301     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19302     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
19303     __pyx_v_datagenerator = PyTuple_GET_ITEM(__pyx_args, 2);
19304   }
19305   goto __pyx_L4_argument_unpacking_done;
19306   __pyx_L5_argtuple_error:;
19307   __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;}
19308   __pyx_L3_error:;
19309   __Pyx_AddTraceback("cvcf.VCF.write");
19310   __Pyx_RefNannyFinishContext();
19311   return NULL;
19312   __pyx_L4_argument_unpacking_done:;
19313   __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
19314
19315   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":948
19316  *     def write(self, stream, datagenerator):
19317  *         """ Writes a VCF file to a stream, using a data generator (or list) """
19318  *         self.write_header(stream)             # <<<<<<<<<<<<<<
19319  *         self.write_heading(stream)
19320  *         for data in datagenerator: self.write_data(stream,data)
19321  */
19322   __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;}
19323   __Pyx_GOTREF(__pyx_t_1);
19324   __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;}
19325   __Pyx_GOTREF(__pyx_t_2);
19326   __Pyx_INCREF(__pyx_v_stream);
19327   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
19328   __Pyx_GIVEREF(__pyx_v_stream);
19329   __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19330   __Pyx_GOTREF(__pyx_t_3);
19331   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19332   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19333   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19334
19335   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":949
19336  *         """ Writes a VCF file to a stream, using a data generator (or list) """
19337  *         self.write_header(stream)
19338  *         self.write_heading(stream)             # <<<<<<<<<<<<<<
19339  *         for data in datagenerator: self.write_data(stream,data)
19340  * 
19341  */
19342   __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;}
19343   __Pyx_GOTREF(__pyx_t_3);
19344   __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;}
19345   __Pyx_GOTREF(__pyx_t_2);
19346   __Pyx_INCREF(__pyx_v_stream);
19347   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
19348   __Pyx_GIVEREF(__pyx_v_stream);
19349   __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19350   __Pyx_GOTREF(__pyx_t_1);
19351   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19352   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19353   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19354
19355   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":950
19356  *         self.write_header(stream)
19357  *         self.write_heading(stream)
19358  *         for data in datagenerator: self.write_data(stream,data)             # <<<<<<<<<<<<<<
19359  * 
19360  *     def writeheader(self, stream):
19361  */
19362   if (PyList_CheckExact(__pyx_v_datagenerator) || PyTuple_CheckExact(__pyx_v_datagenerator)) {
19363     __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_datagenerator; __Pyx_INCREF(__pyx_t_1);
19364   } else {
19365     __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;}
19366     __Pyx_GOTREF(__pyx_t_1);
19367   }
19368   for (;;) {
19369     if (likely(PyList_CheckExact(__pyx_t_1))) {
19370       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
19371       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
19372     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
19373       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
19374       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
19375     } else {
19376       __pyx_t_2 = PyIter_Next(__pyx_t_1);
19377       if (!__pyx_t_2) {
19378         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19379         break;
19380       }
19381       __Pyx_GOTREF(__pyx_t_2);
19382     }
19383     __Pyx_DECREF(__pyx_v_data);
19384     __pyx_v_data = __pyx_t_2;
19385     __pyx_t_2 = 0;
19386     __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;}
19387     __Pyx_GOTREF(__pyx_t_2);
19388     __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;}
19389     __Pyx_GOTREF(__pyx_t_3);
19390     __Pyx_INCREF(__pyx_v_stream);
19391     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_stream);
19392     __Pyx_GIVEREF(__pyx_v_stream);
19393     __Pyx_INCREF(__pyx_v_data);
19394     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_data);
19395     __Pyx_GIVEREF(__pyx_v_data);
19396     __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19397     __Pyx_GOTREF(__pyx_t_5);
19398     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19399     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19400     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19401   }
19402   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19403
19404   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19405   goto __pyx_L0;
19406   __pyx_L1_error:;
19407   __Pyx_XDECREF(__pyx_t_1);
19408   __Pyx_XDECREF(__pyx_t_2);
19409   __Pyx_XDECREF(__pyx_t_3);
19410   __Pyx_XDECREF(__pyx_t_5);
19411   __Pyx_AddTraceback("cvcf.VCF.write");
19412   __pyx_r = NULL;
19413   __pyx_L0:;
19414   __Pyx_DECREF(__pyx_v_data);
19415   __Pyx_XGIVEREF(__pyx_r);
19416   __Pyx_RefNannyFinishContext();
19417   return __pyx_r;
19418 }
19419
19420 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":952
19421  *         for data in datagenerator: self.write_data(stream,data)
19422  * 
19423  *     def writeheader(self, stream):             # <<<<<<<<<<<<<<
19424  *         """ Writes a VCF header """
19425  *         self.write_header(stream)
19426  */
19427
19428 static PyObject *__pyx_pf_4cvcf_3VCF_writeheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19429 static char __pyx_doc_4cvcf_3VCF_writeheader[] = " Writes a VCF header ";
19430 static PyMethodDef __pyx_mdef_4cvcf_3VCF_writeheader = {__Pyx_NAMESTR("writeheader"), (PyCFunction)__pyx_pf_4cvcf_3VCF_writeheader, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_writeheader)};
19431 static PyObject *__pyx_pf_4cvcf_3VCF_writeheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19432   PyObject *__pyx_v_self = 0;
19433   PyObject *__pyx_v_stream = 0;
19434   PyObject *__pyx_r = NULL;
19435   PyObject *__pyx_t_1 = NULL;
19436   PyObject *__pyx_t_2 = NULL;
19437   PyObject *__pyx_t_3 = NULL;
19438   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__stream,0};
19439   __Pyx_RefNannySetupContext("writeheader");
19440   __pyx_self = __pyx_self;
19441   if (unlikely(__pyx_kwds)) {
19442     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19443     PyObject* values[2] = {0,0};
19444     switch (PyTuple_GET_SIZE(__pyx_args)) {
19445       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19446       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19447       case  0: break;
19448       default: goto __pyx_L5_argtuple_error;
19449     }
19450     switch (PyTuple_GET_SIZE(__pyx_args)) {
19451       case  0:
19452       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19453       if (likely(values[0])) kw_args--;
19454       else goto __pyx_L5_argtuple_error;
19455       case  1:
19456       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream);
19457       if (likely(values[1])) kw_args--;
19458       else {
19459         __Pyx_RaiseArgtupleInvalid("writeheader", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19460       }
19461     }
19462     if (unlikely(kw_args > 0)) {
19463       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;}
19464     }
19465     __pyx_v_self = values[0];
19466     __pyx_v_stream = values[1];
19467   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
19468     goto __pyx_L5_argtuple_error;
19469   } else {
19470     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19471     __pyx_v_stream = PyTuple_GET_ITEM(__pyx_args, 1);
19472   }
19473   goto __pyx_L4_argument_unpacking_done;
19474   __pyx_L5_argtuple_error:;
19475   __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;}
19476   __pyx_L3_error:;
19477   __Pyx_AddTraceback("cvcf.VCF.writeheader");
19478   __Pyx_RefNannyFinishContext();
19479   return NULL;
19480   __pyx_L4_argument_unpacking_done:;
19481
19482   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":954
19483  *     def writeheader(self, stream):
19484  *         """ Writes a VCF header """
19485  *         self.write_header(stream)             # <<<<<<<<<<<<<<
19486  *         self.write_heading(stream)
19487  * 
19488  */
19489   __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;}
19490   __Pyx_GOTREF(__pyx_t_1);
19491   __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;}
19492   __Pyx_GOTREF(__pyx_t_2);
19493   __Pyx_INCREF(__pyx_v_stream);
19494   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
19495   __Pyx_GIVEREF(__pyx_v_stream);
19496   __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19497   __Pyx_GOTREF(__pyx_t_3);
19498   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19499   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19500   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19501
19502   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":955
19503  *         """ Writes a VCF header """
19504  *         self.write_header(stream)
19505  *         self.write_heading(stream)             # <<<<<<<<<<<<<<
19506  * 
19507  *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):
19508  */
19509   __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;}
19510   __Pyx_GOTREF(__pyx_t_3);
19511   __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;}
19512   __Pyx_GOTREF(__pyx_t_2);
19513   __Pyx_INCREF(__pyx_v_stream);
19514   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
19515   __Pyx_GIVEREF(__pyx_v_stream);
19516   __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19517   __Pyx_GOTREF(__pyx_t_1);
19518   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19519   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19520   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19521
19522   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19523   goto __pyx_L0;
19524   __pyx_L1_error:;
19525   __Pyx_XDECREF(__pyx_t_1);
19526   __Pyx_XDECREF(__pyx_t_2);
19527   __Pyx_XDECREF(__pyx_t_3);
19528   __Pyx_AddTraceback("cvcf.VCF.writeheader");
19529   __pyx_r = NULL;
19530   __pyx_L0:;
19531   __Pyx_XGIVEREF(__pyx_r);
19532   __Pyx_RefNannyFinishContext();
19533   return __pyx_r;
19534 }
19535
19536 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":957
19537  *         self.write_heading(stream)
19538  * 
19539  *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):             # <<<<<<<<<<<<<<
19540  *         """ Utility function: compares two calls for equality """
19541  *         # a variant should always be assigned to a unique position, one base before
19542  */
19543
19544 static PyObject *__pyx_pf_4cvcf_3VCF_compare_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19545 static char __pyx_doc_4cvcf_3VCF_compare_calls[] = " Utility function: compares two calls for equality ";
19546 static PyMethodDef __pyx_mdef_4cvcf_3VCF_compare_calls = {__Pyx_NAMESTR("compare_calls"), (PyCFunction)__pyx_pf_4cvcf_3VCF_compare_calls, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_compare_calls)};
19547 static PyObject *__pyx_pf_4cvcf_3VCF_compare_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19548   PyObject *__pyx_v_self = 0;
19549   PyObject *__pyx_v_pos1 = 0;
19550   PyObject *__pyx_v_ref1 = 0;
19551   PyObject *__pyx_v_alt1 = 0;
19552   PyObject *__pyx_v_pos2 = 0;
19553   PyObject *__pyx_v_ref2 = 0;
19554   PyObject *__pyx_v_alt2 = 0;
19555   PyObject *__pyx_r = NULL;
19556   PyObject *__pyx_t_1 = NULL;
19557   int __pyx_t_2;
19558   Py_ssize_t __pyx_t_3;
19559   int __pyx_t_4;
19560   PyObject *__pyx_t_5 = NULL;
19561   PyObject *__pyx_t_6 = NULL;
19562   int __pyx_t_7;
19563   int __pyx_t_8;
19564   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};
19565   __Pyx_RefNannySetupContext("compare_calls");
19566   __pyx_self = __pyx_self;
19567   if (unlikely(__pyx_kwds)) {
19568     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19569     PyObject* values[7] = {0,0,0,0,0,0,0};
19570     switch (PyTuple_GET_SIZE(__pyx_args)) {
19571       case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19572       case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19573       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19574       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19575       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19576       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19577       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19578       case  0: break;
19579       default: goto __pyx_L5_argtuple_error;
19580     }
19581     switch (PyTuple_GET_SIZE(__pyx_args)) {
19582       case  0:
19583       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19584       if (likely(values[0])) kw_args--;
19585       else goto __pyx_L5_argtuple_error;
19586       case  1:
19587       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
19588       if (likely(values[1])) kw_args--;
19589       else {
19590         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19591       }
19592       case  2:
19593       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ref1);
19594       if (likely(values[2])) kw_args--;
19595       else {
19596         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19597       }
19598       case  3:
19599       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alt1);
19600       if (likely(values[3])) kw_args--;
19601       else {
19602         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19603       }
19604       case  4:
19605       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos2);
19606       if (likely(values[4])) kw_args--;
19607       else {
19608         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19609       }
19610       case  5:
19611       values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ref2);
19612       if (likely(values[5])) kw_args--;
19613       else {
19614         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19615       }
19616       case  6:
19617       values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alt2);
19618       if (likely(values[6])) kw_args--;
19619       else {
19620         __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19621       }
19622     }
19623     if (unlikely(kw_args > 0)) {
19624       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;}
19625     }
19626     __pyx_v_self = values[0];
19627     __pyx_v_pos1 = values[1];
19628     __pyx_v_ref1 = values[2];
19629     __pyx_v_alt1 = values[3];
19630     __pyx_v_pos2 = values[4];
19631     __pyx_v_ref2 = values[5];
19632     __pyx_v_alt2 = values[6];
19633   } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
19634     goto __pyx_L5_argtuple_error;
19635   } else {
19636     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19637     __pyx_v_pos1 = PyTuple_GET_ITEM(__pyx_args, 1);
19638     __pyx_v_ref1 = PyTuple_GET_ITEM(__pyx_args, 2);
19639     __pyx_v_alt1 = PyTuple_GET_ITEM(__pyx_args, 3);
19640     __pyx_v_pos2 = PyTuple_GET_ITEM(__pyx_args, 4);
19641     __pyx_v_ref2 = PyTuple_GET_ITEM(__pyx_args, 5);
19642     __pyx_v_alt2 = PyTuple_GET_ITEM(__pyx_args, 6);
19643   }
19644   goto __pyx_L4_argument_unpacking_done;
19645   __pyx_L5_argtuple_error:;
19646   __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;}
19647   __pyx_L3_error:;
19648   __Pyx_AddTraceback("cvcf.VCF.compare_calls");
19649   __Pyx_RefNannyFinishContext();
19650   return NULL;
19651   __pyx_L4_argument_unpacking_done:;
19652   __Pyx_INCREF(__pyx_v_ref1);
19653   __Pyx_INCREF(__pyx_v_alt1);
19654   __Pyx_INCREF(__pyx_v_ref2);
19655   __Pyx_INCREF(__pyx_v_alt2);
19656
19657   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":962
19658  *         # the leftmost position of the alignment gap.  If this rule is implemented
19659  *         # correctly, the two positions must be equal for the calls to be identical.
19660  *         if pos1 != pos2: return False             # <<<<<<<<<<<<<<
19661  *         # from both calls, trim rightmost bases when identical.  Do this safely, i.e.
19662  *         # only when the reference bases are not Ns
19663  */
19664   __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;}
19665   __Pyx_GOTREF(__pyx_t_1);
19666   __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;}
19667   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19668   if (__pyx_t_2) {
19669     __Pyx_XDECREF(__pyx_r);
19670     __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;}
19671     __Pyx_GOTREF(__pyx_t_1);
19672     __pyx_r = __pyx_t_1;
19673     __pyx_t_1 = 0;
19674     goto __pyx_L0;
19675     goto __pyx_L6;
19676   }
19677   __pyx_L6:;
19678
19679   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":965
19680  *         # from both calls, trim rightmost bases when identical.  Do this safely, i.e.
19681  *         # only when the reference bases are not Ns
19682  *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:             # <<<<<<<<<<<<<<
19683  *             ref1 = ref1[:-1]
19684  *             alt1 = alt1[:-1]
19685  */
19686   while (1) {
19687     __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;}
19688     __pyx_t_2 = (__pyx_t_3 > 0);
19689     if (__pyx_t_2) {
19690       __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;}
19691       __pyx_t_4 = (__pyx_t_3 > 0);
19692       if (__pyx_t_4) {
19693         __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;}
19694         __Pyx_GOTREF(__pyx_t_1);
19695         __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;}
19696         __Pyx_GOTREF(__pyx_t_5);
19697         __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;}
19698         __Pyx_GOTREF(__pyx_t_6);
19699         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19700         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19701         __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;}
19702         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19703         __pyx_t_8 = __pyx_t_7;
19704       } else {
19705         __pyx_t_8 = __pyx_t_4;
19706       }
19707       __pyx_t_4 = __pyx_t_8;
19708     } else {
19709       __pyx_t_4 = __pyx_t_2;
19710     }
19711     if (!__pyx_t_4) break;
19712
19713     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":966
19714  *         # only when the reference bases are not Ns
19715  *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:
19716  *             ref1 = ref1[:-1]             # <<<<<<<<<<<<<<
19717  *             alt1 = alt1[:-1]
19718  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
19719  */
19720     __pyx_t_6 = 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;}
19721     __Pyx_GOTREF(__pyx_t_6);
19722     __Pyx_DECREF(__pyx_v_ref1);
19723     __pyx_v_ref1 = __pyx_t_6;
19724     __pyx_t_6 = 0;
19725
19726     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":967
19727  *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:
19728  *             ref1 = ref1[:-1]
19729  *             alt1 = alt1[:-1]             # <<<<<<<<<<<<<<
19730  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
19731  *             ref2 = ref2[:-1]
19732  */
19733     __pyx_t_6 = 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;}
19734     __Pyx_GOTREF(__pyx_t_6);
19735     __Pyx_DECREF(__pyx_v_alt1);
19736     __pyx_v_alt1 = __pyx_t_6;
19737     __pyx_t_6 = 0;
19738   }
19739
19740   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":968
19741  *             ref1 = ref1[:-1]
19742  *             alt1 = alt1[:-1]
19743  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:             # <<<<<<<<<<<<<<
19744  *             ref2 = ref2[:-1]
19745  *             alt2 = alt2[:-1]
19746  */
19747   while (1) {
19748     __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;}
19749     __pyx_t_4 = (__pyx_t_3 > 0);
19750     if (__pyx_t_4) {
19751       __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;}
19752       __pyx_t_2 = (__pyx_t_3 > 0);
19753       if (__pyx_t_2) {
19754         __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;}
19755         __Pyx_GOTREF(__pyx_t_6);
19756         __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;}
19757         __Pyx_GOTREF(__pyx_t_5);
19758         __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;}
19759         __Pyx_GOTREF(__pyx_t_1);
19760         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19761         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19762         __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;}
19763         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19764         __pyx_t_7 = __pyx_t_8;
19765       } else {
19766         __pyx_t_7 = __pyx_t_2;
19767       }
19768       __pyx_t_2 = __pyx_t_7;
19769     } else {
19770       __pyx_t_2 = __pyx_t_4;
19771     }
19772     if (!__pyx_t_2) break;
19773
19774     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":969
19775  *             alt1 = alt1[:-1]
19776  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
19777  *             ref2 = ref2[:-1]             # <<<<<<<<<<<<<<
19778  *             alt2 = alt2[:-1]
19779  *         # now, the alternative alleles must be identical
19780  */
19781     __pyx_t_1 = 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;}
19782     __Pyx_GOTREF(__pyx_t_1);
19783     __Pyx_DECREF(__pyx_v_ref2);
19784     __pyx_v_ref2 = __pyx_t_1;
19785     __pyx_t_1 = 0;
19786
19787     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":970
19788  *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
19789  *             ref2 = ref2[:-1]
19790  *             alt2 = alt2[:-1]             # <<<<<<<<<<<<<<
19791  *         # now, the alternative alleles must be identical
19792  *         return alt1 == alt2
19793  */
19794     __pyx_t_1 = 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;}
19795     __Pyx_GOTREF(__pyx_t_1);
19796     __Pyx_DECREF(__pyx_v_alt2);
19797     __pyx_v_alt2 = __pyx_t_1;
19798     __pyx_t_1 = 0;
19799   }
19800
19801   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":972
19802  *             alt2 = alt2[:-1]
19803  *         # now, the alternative alleles must be identical
19804  *         return alt1 == alt2             # <<<<<<<<<<<<<<
19805  * 
19806  * ###########################################################################################################
19807  */
19808   __Pyx_XDECREF(__pyx_r);
19809   __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;}
19810   __Pyx_GOTREF(__pyx_t_1);
19811   __pyx_r = __pyx_t_1;
19812   __pyx_t_1 = 0;
19813   goto __pyx_L0;
19814
19815   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19816   goto __pyx_L0;
19817   __pyx_L1_error:;
19818   __Pyx_XDECREF(__pyx_t_1);
19819   __Pyx_XDECREF(__pyx_t_5);
19820   __Pyx_XDECREF(__pyx_t_6);
19821   __Pyx_AddTraceback("cvcf.VCF.compare_calls");
19822   __pyx_r = NULL;
19823   __pyx_L0:;
19824   __Pyx_DECREF(__pyx_v_ref1);
19825   __Pyx_DECREF(__pyx_v_alt1);
19826   __Pyx_DECREF(__pyx_v_ref2);
19827   __Pyx_DECREF(__pyx_v_alt2);
19828   __Pyx_XGIVEREF(__pyx_r);
19829   __Pyx_RefNannyFinishContext();
19830   return __pyx_r;
19831 }
19832
19833 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":979
19834  * ###########################################################################################################
19835  * 
19836  *     def connect( self, filename ):             # <<<<<<<<<<<<<<
19837  *         '''connect to tabix file.'''
19838  *         self.tabixfile = pysam.Tabixfile( filename )
19839  */
19840
19841 static PyObject *__pyx_pf_4cvcf_3VCF_connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19842 static char __pyx_doc_4cvcf_3VCF_connect[] = "connect to tabix file.";
19843 static PyMethodDef __pyx_mdef_4cvcf_3VCF_connect = {__Pyx_NAMESTR("connect"), (PyCFunction)__pyx_pf_4cvcf_3VCF_connect, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_connect)};
19844 static PyObject *__pyx_pf_4cvcf_3VCF_connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19845   PyObject *__pyx_v_self = 0;
19846   PyObject *__pyx_v_filename = 0;
19847   PyObject *__pyx_r = NULL;
19848   PyObject *__pyx_t_1 = NULL;
19849   PyObject *__pyx_t_2 = NULL;
19850   PyObject *__pyx_t_3 = NULL;
19851   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__filename,0};
19852   __Pyx_RefNannySetupContext("connect");
19853   __pyx_self = __pyx_self;
19854   if (unlikely(__pyx_kwds)) {
19855     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19856     PyObject* values[2] = {0,0};
19857     switch (PyTuple_GET_SIZE(__pyx_args)) {
19858       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19859       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19860       case  0: break;
19861       default: goto __pyx_L5_argtuple_error;
19862     }
19863     switch (PyTuple_GET_SIZE(__pyx_args)) {
19864       case  0:
19865       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
19866       if (likely(values[0])) kw_args--;
19867       else goto __pyx_L5_argtuple_error;
19868       case  1:
19869       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
19870       if (likely(values[1])) kw_args--;
19871       else {
19872         __Pyx_RaiseArgtupleInvalid("connect", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
19873       }
19874     }
19875     if (unlikely(kw_args > 0)) {
19876       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;}
19877     }
19878     __pyx_v_self = values[0];
19879     __pyx_v_filename = values[1];
19880   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
19881     goto __pyx_L5_argtuple_error;
19882   } else {
19883     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
19884     __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 1);
19885   }
19886   goto __pyx_L4_argument_unpacking_done;
19887   __pyx_L5_argtuple_error:;
19888   __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;}
19889   __pyx_L3_error:;
19890   __Pyx_AddTraceback("cvcf.VCF.connect");
19891   __Pyx_RefNannyFinishContext();
19892   return NULL;
19893   __pyx_L4_argument_unpacking_done:;
19894
19895   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":981
19896  *     def connect( self, filename ):
19897  *         '''connect to tabix file.'''
19898  *         self.tabixfile = pysam.Tabixfile( filename )             # <<<<<<<<<<<<<<
19899  *         self._parse_header(self.tabixfile.header)
19900  * 
19901  */
19902   __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;}
19903   __Pyx_GOTREF(__pyx_t_1);
19904   __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;}
19905   __Pyx_GOTREF(__pyx_t_2);
19906   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19907   __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;}
19908   __Pyx_GOTREF(__pyx_t_1);
19909   __Pyx_INCREF(__pyx_v_filename);
19910   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
19911   __Pyx_GIVEREF(__pyx_v_filename);
19912   __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19913   __Pyx_GOTREF(__pyx_t_3);
19914   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19915   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19916   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;}
19917   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19918
19919   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":982
19920  *         '''connect to tabix file.'''
19921  *         self.tabixfile = pysam.Tabixfile( filename )
19922  *         self._parse_header(self.tabixfile.header)             # <<<<<<<<<<<<<<
19923  * 
19924  *     def fetch(self,
19925  */
19926   __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;}
19927   __Pyx_GOTREF(__pyx_t_3);
19928   __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;}
19929   __Pyx_GOTREF(__pyx_t_1);
19930   __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;}
19931   __Pyx_GOTREF(__pyx_t_2);
19932   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19933   __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;}
19934   __Pyx_GOTREF(__pyx_t_1);
19935   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
19936   __Pyx_GIVEREF(__pyx_t_2);
19937   __pyx_t_2 = 0;
19938   __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19939   __Pyx_GOTREF(__pyx_t_2);
19940   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19941   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19942   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19943
19944   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19945   goto __pyx_L0;
19946   __pyx_L1_error:;
19947   __Pyx_XDECREF(__pyx_t_1);
19948   __Pyx_XDECREF(__pyx_t_2);
19949   __Pyx_XDECREF(__pyx_t_3);
19950   __Pyx_AddTraceback("cvcf.VCF.connect");
19951   __pyx_r = NULL;
19952   __pyx_L0:;
19953   __Pyx_XGIVEREF(__pyx_r);
19954   __Pyx_RefNannyFinishContext();
19955   return __pyx_r;
19956 }
19957
19958 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":984
19959  *         self._parse_header(self.tabixfile.header)
19960  * 
19961  *     def fetch(self,             # <<<<<<<<<<<<<<
19962  *               reference = None,
19963  *               start = None,
19964  */
19965
19966 static PyObject *__pyx_pf_4cvcf_3VCF_fetch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19967 static char __pyx_doc_4cvcf_3VCF_fetch[] = " Parse a stream of VCF-formatted lines.  Initializes class instance and return generator ";
19968 static PyMethodDef __pyx_mdef_4cvcf_3VCF_fetch = {__Pyx_NAMESTR("fetch"), (PyCFunction)__pyx_pf_4cvcf_3VCF_fetch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_fetch)};
19969 static PyObject *__pyx_pf_4cvcf_3VCF_fetch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19970   PyObject *__pyx_v_self = 0;
19971   PyObject *__pyx_v_reference = 0;
19972   PyObject *__pyx_v_start = 0;
19973   PyObject *__pyx_v_end = 0;
19974   PyObject *__pyx_v_region = 0;
19975   PyObject *__pyx_r = NULL;
19976   PyObject *__pyx_t_1 = NULL;
19977   PyObject *__pyx_t_2 = NULL;
19978   PyObject *__pyx_t_3 = NULL;
19979   PyObject *__pyx_t_4 = NULL;
19980   PyObject *__pyx_t_5 = NULL;
19981   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};
19982   __Pyx_RefNannySetupContext("fetch");
19983   __pyx_self = __pyx_self;
19984   if (unlikely(__pyx_kwds)) {
19985     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
19986     PyObject* values[5] = {0,0,0,0,0};
19987
19988     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":985
19989  * 
19990  *     def fetch(self,
19991  *               reference = None,             # <<<<<<<<<<<<<<
19992  *               start = None,
19993  *               end = None,
19994  */
19995     values[1] = ((PyObject *)Py_None);
19996
19997     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":986
19998  *     def fetch(self,
19999  *               reference = None,
20000  *               start = None,             # <<<<<<<<<<<<<<
20001  *               end = None,
20002  *               region = None ):
20003  */
20004     values[2] = ((PyObject *)Py_None);
20005
20006     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":987
20007  *               reference = None,
20008  *               start = None,
20009  *               end = None,             # <<<<<<<<<<<<<<
20010  *               region = None ):
20011  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
20012  */
20013     values[3] = ((PyObject *)Py_None);
20014
20015     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":988
20016  *               start = None,
20017  *               end = None,
20018  *               region = None ):             # <<<<<<<<<<<<<<
20019  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
20020  * 
20021  */
20022     values[4] = ((PyObject *)Py_None);
20023     switch (PyTuple_GET_SIZE(__pyx_args)) {
20024       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
20025       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
20026       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20027       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20028       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20029       case  0: break;
20030       default: goto __pyx_L5_argtuple_error;
20031     }
20032     switch (PyTuple_GET_SIZE(__pyx_args)) {
20033       case  0:
20034       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
20035       if (likely(values[0])) kw_args--;
20036       else goto __pyx_L5_argtuple_error;
20037       case  1:
20038       if (kw_args > 0) {
20039         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
20040         if (value) { values[1] = value; kw_args--; }
20041       }
20042       case  2:
20043       if (kw_args > 0) {
20044         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
20045         if (value) { values[2] = value; kw_args--; }
20046       }
20047       case  3:
20048       if (kw_args > 0) {
20049         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
20050         if (value) { values[3] = value; kw_args--; }
20051       }
20052       case  4:
20053       if (kw_args > 0) {
20054         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__region);
20055         if (value) { values[4] = value; kw_args--; }
20056       }
20057     }
20058     if (unlikely(kw_args > 0)) {
20059       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;}
20060     }
20061     __pyx_v_self = values[0];
20062     __pyx_v_reference = values[1];
20063     __pyx_v_start = values[2];
20064     __pyx_v_end = values[3];
20065     __pyx_v_region = values[4];
20066   } else {
20067
20068     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":985
20069  * 
20070  *     def fetch(self,
20071  *               reference = None,             # <<<<<<<<<<<<<<
20072  *               start = None,
20073  *               end = None,
20074  */
20075     __pyx_v_reference = ((PyObject *)Py_None);
20076
20077     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":986
20078  *     def fetch(self,
20079  *               reference = None,
20080  *               start = None,             # <<<<<<<<<<<<<<
20081  *               end = None,
20082  *               region = None ):
20083  */
20084     __pyx_v_start = ((PyObject *)Py_None);
20085
20086     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":987
20087  *               reference = None,
20088  *               start = None,
20089  *               end = None,             # <<<<<<<<<<<<<<
20090  *               region = None ):
20091  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
20092  */
20093     __pyx_v_end = ((PyObject *)Py_None);
20094
20095     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":988
20096  *               start = None,
20097  *               end = None,
20098  *               region = None ):             # <<<<<<<<<<<<<<
20099  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
20100  * 
20101  */
20102     __pyx_v_region = ((PyObject *)Py_None);
20103     switch (PyTuple_GET_SIZE(__pyx_args)) {
20104       case  5: __pyx_v_region = PyTuple_GET_ITEM(__pyx_args, 4);
20105       case  4: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 3);
20106       case  3: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 2);
20107       case  2: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 1);
20108       case  1: __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
20109       break;
20110       default: goto __pyx_L5_argtuple_error;
20111     }
20112   }
20113   goto __pyx_L4_argument_unpacking_done;
20114   __pyx_L5_argtuple_error:;
20115   __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;}
20116   __pyx_L3_error:;
20117   __Pyx_AddTraceback("cvcf.VCF.fetch");
20118   __Pyx_RefNannyFinishContext();
20119   return NULL;
20120   __pyx_L4_argument_unpacking_done:;
20121
20122   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":991
20123  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
20124  * 
20125  *         return self.tabixfile.fetch( reference, start, end, region, parser = asVCFRecord( self ) )             # <<<<<<<<<<<<<<
20126  * 
20127  *     def validate( self, record ):
20128  */
20129   __Pyx_XDECREF(__pyx_r);
20130   __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;}
20131   __Pyx_GOTREF(__pyx_t_1);
20132   __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;}
20133   __Pyx_GOTREF(__pyx_t_2);
20134   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20135   __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;}
20136   __Pyx_GOTREF(__pyx_t_1);
20137   __Pyx_INCREF(__pyx_v_reference);
20138   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_reference);
20139   __Pyx_GIVEREF(__pyx_v_reference);
20140   __Pyx_INCREF(__pyx_v_start);
20141   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start);
20142   __Pyx_GIVEREF(__pyx_v_start);
20143   __Pyx_INCREF(__pyx_v_end);
20144   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
20145   __Pyx_GIVEREF(__pyx_v_end);
20146   __Pyx_INCREF(__pyx_v_region);
20147   PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_region);
20148   __Pyx_GIVEREF(__pyx_v_region);
20149   __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;}
20150   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
20151   __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;}
20152   __Pyx_GOTREF(__pyx_t_4);
20153   __Pyx_INCREF(__pyx_v_self);
20154   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self);
20155   __Pyx_GIVEREF(__pyx_v_self);
20156   __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cvcf_asVCFRecord)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20157   __Pyx_GOTREF(__pyx_t_5);
20158   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20159   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;}
20160   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20161   __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __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;}
20162   __Pyx_GOTREF(__pyx_t_5);
20163   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20164   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20165   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
20166   __pyx_r = __pyx_t_5;
20167   __pyx_t_5 = 0;
20168   goto __pyx_L0;
20169
20170   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20171   goto __pyx_L0;
20172   __pyx_L1_error:;
20173   __Pyx_XDECREF(__pyx_t_1);
20174   __Pyx_XDECREF(__pyx_t_2);
20175   __Pyx_XDECREF(__pyx_t_3);
20176   __Pyx_XDECREF(__pyx_t_4);
20177   __Pyx_XDECREF(__pyx_t_5);
20178   __Pyx_AddTraceback("cvcf.VCF.fetch");
20179   __pyx_r = NULL;
20180   __pyx_L0:;
20181   __Pyx_XGIVEREF(__pyx_r);
20182   __Pyx_RefNannyFinishContext();
20183   return __pyx_r;
20184 }
20185
20186 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":993
20187  *         return self.tabixfile.fetch( reference, start, end, region, parser = asVCFRecord( self ) )
20188  * 
20189  *     def validate( self, record ):             # <<<<<<<<<<<<<<
20190  *         '''validate vcf record.
20191  * 
20192  */
20193
20194 static PyObject *__pyx_pf_4cvcf_3VCF_validate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20195 static char __pyx_doc_4cvcf_3VCF_validate[] = "validate vcf record.\n\n        returns a validated record.\n        ";
20196 static PyMethodDef __pyx_mdef_4cvcf_3VCF_validate = {__Pyx_NAMESTR("validate"), (PyCFunction)__pyx_pf_4cvcf_3VCF_validate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cvcf_3VCF_validate)};
20197 static PyObject *__pyx_pf_4cvcf_3VCF_validate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20198   PyObject *__pyx_v_self = 0;
20199   PyObject *__pyx_v_record = 0;
20200   PyObject *__pyx_v_chrom;
20201   PyObject *__pyx_v_pos;
20202   PyObject *__pyx_v_ref;
20203   PyObject *__pyx_v_c;
20204   PyObject *__pyx_v_left;
20205   PyObject *__pyx_v_faref_leftflank;
20206   PyObject *__pyx_v_faref;
20207   PyObject *__pyx_v_f;
20208   PyObject *__pyx_v_newalts;
20209   int __pyx_v_have_deletions;
20210   PyObject *__pyx_v_a;
20211   PyObject *__pyx_v_l;
20212   PyObject *__pyx_v_addns;
20213   PyObject *__pyx_v_i;
20214   PyObject *__pyx_v_na;
20215   PyObject *__pyx_v_s;
20216   PyObject *__pyx_v_alt;
20217   PyObject *__pyx_v_addn;
20218   PyObject *__pyx_v_allele;
20219   int __pyx_v_movable;
20220   PyObject *__pyx_v_longest;
20221   PyObject *__pyx_v_shortest;
20222   PyObject *__pyx_8genexpr1__pyx_v_allele;
20223   PyObject *__pyx_r = NULL;
20224   PyObject *__pyx_t_1 = NULL;
20225   PyObject *__pyx_t_2 = NULL;
20226   int __pyx_t_3;
20227   PyObject *__pyx_t_4 = NULL;
20228   PyObject *__pyx_t_5 = NULL;
20229   Py_ssize_t __pyx_t_6;
20230   PyObject *__pyx_t_7 = NULL;
20231   Py_ssize_t __pyx_t_8;
20232   long __pyx_t_9;
20233   PyObject *__pyx_t_10 = NULL;
20234   int __pyx_t_11;
20235   Py_ssize_t __pyx_t_12;
20236   PyObject *__pyx_t_13 = NULL;
20237   PyObject *__pyx_t_14 = NULL;
20238   PyObject *__pyx_t_15 = NULL;
20239   int __pyx_t_16;
20240   int __pyx_t_17;
20241   PyObject *__pyx_t_18 = NULL;
20242   PyObject *__pyx_t_19 = NULL;
20243   static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__record,0};
20244   __Pyx_RefNannySetupContext("validate");
20245   __pyx_self = __pyx_self;
20246   if (unlikely(__pyx_kwds)) {
20247     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
20248     PyObject* values[2] = {0,0};
20249     switch (PyTuple_GET_SIZE(__pyx_args)) {
20250       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20251       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20252       case  0: break;
20253       default: goto __pyx_L5_argtuple_error;
20254     }
20255     switch (PyTuple_GET_SIZE(__pyx_args)) {
20256       case  0:
20257       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
20258       if (likely(values[0])) kw_args--;
20259       else goto __pyx_L5_argtuple_error;
20260       case  1:
20261       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__record);
20262       if (likely(values[1])) kw_args--;
20263       else {
20264         __Pyx_RaiseArgtupleInvalid("validate", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
20265       }
20266     }
20267     if (unlikely(kw_args > 0)) {
20268       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;}
20269     }
20270     __pyx_v_self = values[0];
20271     __pyx_v_record = values[1];
20272   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
20273     goto __pyx_L5_argtuple_error;
20274   } else {
20275     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
20276     __pyx_v_record = PyTuple_GET_ITEM(__pyx_args, 1);
20277   }
20278   goto __pyx_L4_argument_unpacking_done;
20279   __pyx_L5_argtuple_error:;
20280   __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;}
20281   __pyx_L3_error:;
20282   __Pyx_AddTraceback("cvcf.VCF.validate");
20283   __Pyx_RefNannyFinishContext();
20284   return NULL;
20285   __pyx_L4_argument_unpacking_done:;
20286   __pyx_v_chrom = Py_None; __Pyx_INCREF(Py_None);
20287   __pyx_v_pos = Py_None; __Pyx_INCREF(Py_None);
20288   __pyx_v_ref = Py_None; __Pyx_INCREF(Py_None);
20289   __pyx_v_c = Py_None; __Pyx_INCREF(Py_None);
20290   __pyx_v_left = Py_None; __Pyx_INCREF(Py_None);
20291   __pyx_v_faref_leftflank = Py_None; __Pyx_INCREF(Py_None);
20292   __pyx_v_faref = Py_None; __Pyx_INCREF(Py_None);
20293   __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
20294   __pyx_v_newalts = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
20295   __pyx_v_a = Py_None; __Pyx_INCREF(Py_None);
20296   __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
20297   __pyx_v_addns = Py_None; __Pyx_INCREF(Py_None);
20298   __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
20299   __pyx_v_na = Py_None; __Pyx_INCREF(Py_None);
20300   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
20301   __pyx_v_alt = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
20302   __pyx_v_addn = Py_None; __Pyx_INCREF(Py_None);
20303   __pyx_v_allele = Py_None; __Pyx_INCREF(Py_None);
20304   __pyx_v_longest = Py_None; __Pyx_INCREF(Py_None);
20305   __pyx_v_shortest = Py_None; __Pyx_INCREF(Py_None);
20306   __pyx_8genexpr1__pyx_v_allele = Py_None; __Pyx_INCREF(Py_None);
20307
20308   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":999
20309  *         '''
20310  * 
20311  *         raise NotImplementedError( "needs to be checked" )             # <<<<<<<<<<<<<<
20312  * 
20313  *         chrom, pos = record.chrom, record.pos
20314  */
20315   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20316   __Pyx_GOTREF(__pyx_t_1);
20317   __Pyx_INCREF(((PyObject *)__pyx_kp_s_72));
20318   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_72));
20319   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_72));
20320   __pyx_t_2 = PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20321   __Pyx_GOTREF(__pyx_t_2);
20322   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20323   __Pyx_Raise(__pyx_t_2, 0, 0);
20324   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20325   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20326
20327   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1001
20328  *         raise NotImplementedError( "needs to be checked" )
20329  * 
20330  *         chrom, pos = record.chrom, record.pos             # <<<<<<<<<<<<<<
20331  * 
20332  *         # check reference
20333  */
20334   __pyx_t_2 = PyObject_GetAttr(__pyx_v_record, __pyx_n_s__chrom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20335   __Pyx_GOTREF(__pyx_t_2);
20336   __pyx_t_1 = PyObject_GetAttr(__pyx_v_record, __pyx_n_s__pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20337   __Pyx_GOTREF(__pyx_t_1);
20338   __Pyx_DECREF(__pyx_v_chrom);
20339   __pyx_v_chrom = __pyx_t_2;
20340   __pyx_t_2 = 0;
20341   __Pyx_DECREF(__pyx_v_pos);
20342   __pyx_v_pos = __pyx_t_1;
20343   __pyx_t_1 = 0;
20344
20345   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1004
20346  * 
20347  *         # check reference
20348  *         ref = record.ref             # <<<<<<<<<<<<<<
20349  *         if ref == ".":
20350  *             self.error(str(record),self.MISSING_REF)
20351  */
20352   __pyx_t_1 = PyObject_GetAttr(__pyx_v_record, __pyx_n_s__ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20353   __Pyx_GOTREF(__pyx_t_1);
20354   __Pyx_DECREF(__pyx_v_ref);
20355   __pyx_v_ref = __pyx_t_1;
20356   __pyx_t_1 = 0;
20357
20358   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1005
20359  *         # check reference
20360  *         ref = record.ref
20361  *         if ref == ".":             # <<<<<<<<<<<<<<
20362  *             self.error(str(record),self.MISSING_REF)
20363  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
20364  */
20365   __pyx_t_1 = PyObject_RichCompare(__pyx_v_ref, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20366   __Pyx_GOTREF(__pyx_t_1);
20367   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20368   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20369   if (__pyx_t_3) {
20370
20371     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1006
20372  *         ref = record.ref
20373  *         if ref == ".":
20374  *             self.error(str(record),self.MISSING_REF)             # <<<<<<<<<<<<<<
20375  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
20376  *             else:                   ref = ""
20377  */
20378     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20379     __Pyx_GOTREF(__pyx_t_1);
20380     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20381     __Pyx_GOTREF(__pyx_t_2);
20382     __Pyx_INCREF(__pyx_v_record);
20383     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_record);
20384     __Pyx_GIVEREF(__pyx_v_record);
20385     __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20386     __Pyx_GOTREF(__pyx_t_4);
20387     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20388     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__MISSING_REF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20389     __Pyx_GOTREF(__pyx_t_2);
20390     __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;}
20391     __Pyx_GOTREF(__pyx_t_5);
20392     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
20393     __Pyx_GIVEREF(__pyx_t_4);
20394     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
20395     __Pyx_GIVEREF(__pyx_t_2);
20396     __pyx_t_4 = 0;
20397     __pyx_t_2 = 0;
20398     __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20399     __Pyx_GOTREF(__pyx_t_2);
20400     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20401     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20402     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20403
20404     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1007
20405  *         if ref == ".":
20406  *             self.error(str(record),self.MISSING_REF)
20407  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)             # <<<<<<<<<<<<<<
20408  *             else:                   ref = ""
20409  *         else:
20410  */
20411     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20412     __Pyx_GOTREF(__pyx_t_2);
20413     __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __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;}
20414     __Pyx_GOTREF(__pyx_t_5);
20415     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20416     __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;}
20417     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20418     if (__pyx_t_3) {
20419       __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;}
20420       __Pyx_GOTREF(__pyx_t_5);
20421       __pyx_t_2 = PyNumber_Add(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20422       __Pyx_GOTREF(__pyx_t_2);
20423       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20424       __Pyx_GOTREF(__pyx_t_1);
20425       __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;}
20426       __Pyx_GOTREF(__pyx_t_4);
20427       __Pyx_INCREF(__pyx_v_chrom);
20428       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
20429       __Pyx_GIVEREF(__pyx_v_chrom);
20430       __Pyx_INCREF(__pyx_v_pos);
20431       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_pos);
20432       __Pyx_GIVEREF(__pyx_v_pos);
20433       PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
20434       __Pyx_GIVEREF(__pyx_t_2);
20435       PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1);
20436       __Pyx_GIVEREF(__pyx_t_1);
20437       __pyx_t_2 = 0;
20438       __pyx_t_1 = 0;
20439       __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20440       __Pyx_GOTREF(__pyx_t_1);
20441       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20442       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20443       __Pyx_DECREF(__pyx_v_ref);
20444       __pyx_v_ref = __pyx_t_1;
20445       __pyx_t_1 = 0;
20446       goto __pyx_L7;
20447     }
20448     /*else*/ {
20449
20450       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1008
20451  *             self.error(str(record),self.MISSING_REF)
20452  *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
20453  *             else:                   ref = ""             # <<<<<<<<<<<<<<
20454  *         else:
20455  *             for c in ref:
20456  */
20457       __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
20458       __Pyx_DECREF(__pyx_v_ref);
20459       __pyx_v_ref = ((PyObject *)__pyx_kp_s_1);
20460     }
20461     __pyx_L7:;
20462     goto __pyx_L6;
20463   }
20464   /*else*/ {
20465
20466     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1010
20467  *             else:                   ref = ""
20468  *         else:
20469  *             for c in ref:             # <<<<<<<<<<<<<<
20470  *                 if c not in "ACGTN": self.error(str(record),self.UNKNOWN_CHAR_IN_REF)
20471  *                 if "N" in ref: ref = get_sequence(chrom,
20472  */
20473     if (PyList_CheckExact(__pyx_v_ref) || PyTuple_CheckExact(__pyx_v_ref)) {
20474       __pyx_t_6 = 0; __pyx_t_1 = __pyx_v_ref; __Pyx_INCREF(__pyx_t_1);
20475     } else {
20476       __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20477       __Pyx_GOTREF(__pyx_t_1);
20478     }
20479     for (;;) {
20480       if (likely(PyList_CheckExact(__pyx_t_1))) {
20481         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
20482         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
20483       } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
20484         if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
20485         __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
20486       } else {
20487         __pyx_t_4 = PyIter_Next(__pyx_t_1);
20488         if (!__pyx_t_4) {
20489           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20490           break;
20491         }
20492         __Pyx_GOTREF(__pyx_t_4);
20493       }
20494       __Pyx_DECREF(__pyx_v_c);
20495       __pyx_v_c = __pyx_t_4;
20496       __pyx_t_4 = 0;
20497
20498       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1011
20499  *         else:
20500  *             for c in ref:
20501  *                 if c not in "ACGTN": self.error(str(record),self.UNKNOWN_CHAR_IN_REF)             # <<<<<<<<<<<<<<
20502  *                 if "N" in ref: ref = get_sequence(chrom,
20503  *                                                   pos,
20504  */
20505       __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;}
20506       if (__pyx_t_3) {
20507         __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;}
20508         __Pyx_GOTREF(__pyx_t_4);
20509         __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;}
20510         __Pyx_GOTREF(__pyx_t_5);
20511         __Pyx_INCREF(__pyx_v_record);
20512         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_record);
20513         __Pyx_GIVEREF(__pyx_v_record);
20514         __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20515         __Pyx_GOTREF(__pyx_t_2);
20516         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20517         __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;}
20518         __Pyx_GOTREF(__pyx_t_5);
20519         __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;}
20520         __Pyx_GOTREF(__pyx_t_7);
20521         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
20522         __Pyx_GIVEREF(__pyx_t_2);
20523         PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
20524         __Pyx_GIVEREF(__pyx_t_5);
20525         __pyx_t_2 = 0;
20526         __pyx_t_5 = 0;
20527         __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20528         __Pyx_GOTREF(__pyx_t_5);
20529         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20530         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20531         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20532         goto __pyx_L10;
20533       }
20534       __pyx_L10:;
20535
20536       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1012
20537  *             for c in ref:
20538  *                 if c not in "ACGTN": self.error(str(record),self.UNKNOWN_CHAR_IN_REF)
20539  *                 if "N" in ref: ref = get_sequence(chrom,             # <<<<<<<<<<<<<<
20540  *                                                   pos,
20541  *                                                   pos+len(ref),
20542  */
20543       __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;}
20544       if (__pyx_t_3) {
20545         __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;}
20546         __Pyx_GOTREF(__pyx_t_5);
20547
20548         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1014
20549  *                 if "N" in ref: ref = get_sequence(chrom,
20550  *                                                   pos,
20551  *                                                   pos+len(ref),             # <<<<<<<<<<<<<<
20552  *                                                   self._reference)
20553  * 
20554  */
20555         __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;}
20556         __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;}
20557         __Pyx_GOTREF(__pyx_t_7);
20558         __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;}
20559         __Pyx_GOTREF(__pyx_t_4);
20560         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20561
20562         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1015
20563  *                                                   pos,
20564  *                                                   pos+len(ref),
20565  *                                                   self._reference)             # <<<<<<<<<<<<<<
20566  * 
20567  *         # make sure reference is sane
20568  */
20569         __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;}
20570         __Pyx_GOTREF(__pyx_t_7);
20571         __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20572         __Pyx_GOTREF(__pyx_t_2);
20573         __Pyx_INCREF(__pyx_v_chrom);
20574         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
20575         __Pyx_GIVEREF(__pyx_v_chrom);
20576         __Pyx_INCREF(__pyx_v_pos);
20577         PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_pos);
20578         __Pyx_GIVEREF(__pyx_v_pos);
20579         PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
20580         __Pyx_GIVEREF(__pyx_t_4);
20581         PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_7);
20582         __Pyx_GIVEREF(__pyx_t_7);
20583         __pyx_t_4 = 0;
20584         __pyx_t_7 = 0;
20585         __pyx_t_7 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20586         __Pyx_GOTREF(__pyx_t_7);
20587         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20588         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20589         __Pyx_DECREF(__pyx_v_ref);
20590         __pyx_v_ref = __pyx_t_7;
20591         __pyx_t_7 = 0;
20592         goto __pyx_L11;
20593       }
20594       __pyx_L11:;
20595     }
20596     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20597   }
20598   __pyx_L6:;
20599
20600   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1018
20601  * 
20602  *         # make sure reference is sane
20603  *         if self._reference:             # <<<<<<<<<<<<<<
20604  *             left = max(0,self.pos-100)
20605  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)
20606  */
20607   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20608   __Pyx_GOTREF(__pyx_t_1);
20609   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20610   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20611   if (__pyx_t_3) {
20612
20613     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1019
20614  *         # make sure reference is sane
20615  *         if self._reference:
20616  *             left = max(0,self.pos-100)             # <<<<<<<<<<<<<<
20617  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)
20618  *             faref = faref_leftflank[pos-left:]
20619  */
20620     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20621     __Pyx_GOTREF(__pyx_t_1);
20622     __pyx_t_7 = PyNumber_Subtract(__pyx_t_1, __pyx_int_100); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20623     __Pyx_GOTREF(__pyx_t_7);
20624     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20625     __pyx_t_9 = 0;
20626     __pyx_t_2 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20627     __Pyx_GOTREF(__pyx_t_2);
20628     __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_GT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20629     __Pyx_GOTREF(__pyx_t_5);
20630     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20631     __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;}
20632     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20633     if (__pyx_t_3) {
20634       __Pyx_INCREF(__pyx_t_7);
20635       __pyx_t_1 = __pyx_t_7;
20636     } else {
20637       __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;}
20638       __Pyx_GOTREF(__pyx_t_5);
20639       __pyx_t_1 = __pyx_t_5;
20640       __pyx_t_5 = 0;
20641     }
20642     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20643     __Pyx_INCREF(__pyx_t_1);
20644     __Pyx_DECREF(__pyx_v_left);
20645     __pyx_v_left = __pyx_t_1;
20646     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20647
20648     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1020
20649  *         if self._reference:
20650  *             left = max(0,self.pos-100)
20651  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)             # <<<<<<<<<<<<<<
20652  *             faref = faref_leftflank[pos-left:]
20653  *             if faref != ref: self.error(str(record),self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
20654  */
20655     __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20656     __Pyx_GOTREF(__pyx_t_1);
20657     __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;}
20658     __Pyx_GOTREF(__pyx_t_7);
20659     __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;}
20660     __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;}
20661     __Pyx_GOTREF(__pyx_t_5);
20662     __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20663     __Pyx_GOTREF(__pyx_t_2);
20664     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20665     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20666     __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;}
20667     __Pyx_GOTREF(__pyx_t_5);
20668     __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;}
20669     __Pyx_GOTREF(__pyx_t_7);
20670     __Pyx_INCREF(__pyx_v_chrom);
20671     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chrom);
20672     __Pyx_GIVEREF(__pyx_v_chrom);
20673     __Pyx_INCREF(__pyx_v_left);
20674     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_left);
20675     __Pyx_GIVEREF(__pyx_v_left);
20676     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2);
20677     __Pyx_GIVEREF(__pyx_t_2);
20678     PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
20679     __Pyx_GIVEREF(__pyx_t_5);
20680     __pyx_t_2 = 0;
20681     __pyx_t_5 = 0;
20682     __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20683     __Pyx_GOTREF(__pyx_t_5);
20684     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20685     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20686     __Pyx_DECREF(__pyx_v_faref_leftflank);
20687     __pyx_v_faref_leftflank = __pyx_t_5;
20688     __pyx_t_5 = 0;
20689
20690     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1021
20691  *             left = max(0,self.pos-100)
20692  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)
20693  *             faref = faref_leftflank[pos-left:]             # <<<<<<<<<<<<<<
20694  *             if faref != ref: self.error(str(record),self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
20695  *             ref = faref
20696  */
20697     __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;}
20698     __Pyx_GOTREF(__pyx_t_5);
20699     __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;}
20700     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20701     __pyx_t_5 = 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;}
20702     __Pyx_GOTREF(__pyx_t_5);
20703     __Pyx_DECREF(__pyx_v_faref);
20704     __pyx_v_faref = __pyx_t_5;
20705     __pyx_t_5 = 0;
20706
20707     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1022
20708  *             faref_leftflank = get_sequence(chrom,left,self.pos+len(ref),self._reference)
20709  *             faref = faref_leftflank[pos-left:]
20710  *             if faref != ref: self.error(str(record),self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))             # <<<<<<<<<<<<<<
20711  *             ref = faref
20712  * 
20713  */
20714     __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;}
20715     __Pyx_GOTREF(__pyx_t_5);
20716     __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;}
20717     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20718     if (__pyx_t_3) {
20719       __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;}
20720       __Pyx_GOTREF(__pyx_t_5);
20721       __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;}
20722       __Pyx_GOTREF(__pyx_t_7);
20723       __Pyx_INCREF(__pyx_v_record);
20724       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_record);
20725       __Pyx_GIVEREF(__pyx_v_record);
20726       __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20727       __Pyx_GOTREF(__pyx_t_1);
20728       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20729       __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;}
20730       __Pyx_GOTREF(__pyx_t_7);
20731       __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20732       __Pyx_GOTREF(__pyx_t_2);
20733       __Pyx_INCREF(__pyx_v_faref);
20734       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_faref);
20735       __Pyx_GIVEREF(__pyx_v_faref);
20736       __Pyx_INCREF(__pyx_v_ref);
20737       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ref);
20738       __Pyx_GIVEREF(__pyx_v_ref);
20739       __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_64), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20740       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
20741       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20742       __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20743       __Pyx_GOTREF(__pyx_t_2);
20744       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
20745       __Pyx_GIVEREF(__pyx_t_1);
20746       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
20747       __Pyx_GIVEREF(__pyx_t_7);
20748       PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_4));
20749       __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
20750       __pyx_t_1 = 0;
20751       __pyx_t_7 = 0;
20752       __pyx_t_4 = 0;
20753       __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20754       __Pyx_GOTREF(__pyx_t_4);
20755       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20756       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20757       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20758       goto __pyx_L13;
20759     }
20760     __pyx_L13:;
20761
20762     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1023
20763  *             faref = faref_leftflank[pos-left:]
20764  *             if faref != ref: self.error(str(record),self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
20765  *             ref = faref             # <<<<<<<<<<<<<<
20766  * 
20767  *         # check: format fields are defined
20768  */
20769     __Pyx_INCREF(__pyx_v_faref);
20770     __Pyx_DECREF(__pyx_v_ref);
20771     __pyx_v_ref = __pyx_v_faref;
20772     goto __pyx_L12;
20773   }
20774   __pyx_L12:;
20775
20776   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1026
20777  * 
20778  *         # check: format fields are defined
20779  *         for f in record.format:             # <<<<<<<<<<<<<<
20780  *             if f not in self._format: self.error(str(record),self.FORMAT_NOT_DEFINED, f)
20781  * 
20782  */
20783   __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;}
20784   __Pyx_GOTREF(__pyx_t_4);
20785   if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
20786     __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2);
20787   } else {
20788     __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20789     __Pyx_GOTREF(__pyx_t_2);
20790   }
20791   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20792   for (;;) {
20793     if (likely(PyList_CheckExact(__pyx_t_2))) {
20794       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
20795       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
20796     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
20797       if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
20798       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
20799     } else {
20800       __pyx_t_4 = PyIter_Next(__pyx_t_2);
20801       if (!__pyx_t_4) {
20802         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20803         break;
20804       }
20805       __Pyx_GOTREF(__pyx_t_4);
20806     }
20807     __Pyx_DECREF(__pyx_v_f);
20808     __pyx_v_f = __pyx_t_4;
20809     __pyx_t_4 = 0;
20810
20811     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1027
20812  *         # check: format fields are defined
20813  *         for f in record.format:
20814  *             if f not in self._format: self.error(str(record),self.FORMAT_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
20815  * 
20816  *         # check: all filters are defined
20817  */
20818     __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;}
20819     __Pyx_GOTREF(__pyx_t_4);
20820     __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;}
20821     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20822     if (__pyx_t_3) {
20823       __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;}
20824       __Pyx_GOTREF(__pyx_t_4);
20825       __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;}
20826       __Pyx_GOTREF(__pyx_t_5);
20827       __Pyx_INCREF(__pyx_v_record);
20828       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_record);
20829       __Pyx_GIVEREF(__pyx_v_record);
20830       __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20831       __Pyx_GOTREF(__pyx_t_7);
20832       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20833       __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;}
20834       __Pyx_GOTREF(__pyx_t_5);
20835       __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20836       __Pyx_GOTREF(__pyx_t_1);
20837       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
20838       __Pyx_GIVEREF(__pyx_t_7);
20839       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
20840       __Pyx_GIVEREF(__pyx_t_5);
20841       __Pyx_INCREF(__pyx_v_f);
20842       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_f);
20843       __Pyx_GIVEREF(__pyx_v_f);
20844       __pyx_t_7 = 0;
20845       __pyx_t_5 = 0;
20846       __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20847       __Pyx_GOTREF(__pyx_t_5);
20848       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20849       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20850       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20851       goto __pyx_L16;
20852     }
20853     __pyx_L16:;
20854   }
20855   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20856
20857   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1030
20858  * 
20859  *         # check: all filters are defined
20860  *         for f in record.filter:             # <<<<<<<<<<<<<<
20861  *             if f not in self._filter: self.error(str(record),self.FILTER_NOT_DEFINED, f)
20862  * 
20863  */
20864   __pyx_t_2 = PyObject_GetAttr(__pyx_v_record, __pyx_n_s__filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20865   __Pyx_GOTREF(__pyx_t_2);
20866   if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
20867     __pyx_t_6 = 0; __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5);
20868   } else {
20869     __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20870     __Pyx_GOTREF(__pyx_t_5);
20871   }
20872   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20873   for (;;) {
20874     if (likely(PyList_CheckExact(__pyx_t_5))) {
20875       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
20876       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++;
20877     } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
20878       if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
20879       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++;
20880     } else {
20881       __pyx_t_2 = PyIter_Next(__pyx_t_5);
20882       if (!__pyx_t_2) {
20883         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20884         break;
20885       }
20886       __Pyx_GOTREF(__pyx_t_2);
20887     }
20888     __Pyx_DECREF(__pyx_v_f);
20889     __pyx_v_f = __pyx_t_2;
20890     __pyx_t_2 = 0;
20891
20892     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1031
20893  *         # check: all filters are defined
20894  *         for f in record.filter:
20895  *             if f not in self._filter: self.error(str(record),self.FILTER_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
20896  * 
20897  *         # convert v3.3 alleles
20898  */
20899     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20900     __Pyx_GOTREF(__pyx_t_2);
20901     __pyx_t_3 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_2, __pyx_v_f))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20902     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20903     if (__pyx_t_3) {
20904       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20905       __Pyx_GOTREF(__pyx_t_2);
20906       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20907       __Pyx_GOTREF(__pyx_t_1);
20908       __Pyx_INCREF(__pyx_v_record);
20909       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_record);
20910       __Pyx_GIVEREF(__pyx_v_record);
20911       __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20912       __Pyx_GOTREF(__pyx_t_4);
20913       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20914       __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 = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20915       __Pyx_GOTREF(__pyx_t_1);
20916       __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;}
20917       __Pyx_GOTREF(__pyx_t_7);
20918       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
20919       __Pyx_GIVEREF(__pyx_t_4);
20920       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
20921       __Pyx_GIVEREF(__pyx_t_1);
20922       __Pyx_INCREF(__pyx_v_f);
20923       PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_f);
20924       __Pyx_GIVEREF(__pyx_v_f);
20925       __pyx_t_4 = 0;
20926       __pyx_t_1 = 0;
20927       __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20928       __Pyx_GOTREF(__pyx_t_1);
20929       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20930       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20931       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20932       goto __pyx_L19;
20933     }
20934     __pyx_L19:;
20935   }
20936   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20937
20938   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1034
20939  * 
20940  *         # convert v3.3 alleles
20941  *         if self._version == 33:             # <<<<<<<<<<<<<<
20942  *             if len(ref) != 1: self.error(str(record),self.V33_BAD_REF)
20943  *             newalts = []
20944  */
20945   __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;}
20946   __Pyx_GOTREF(__pyx_t_5);
20947   __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_int_33, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20948   __Pyx_GOTREF(__pyx_t_1);
20949   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20950   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20951   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20952   if (__pyx_t_3) {
20953
20954     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1035
20955  *         # convert v3.3 alleles
20956  *         if self._version == 33:
20957  *             if len(ref) != 1: self.error(str(record),self.V33_BAD_REF)             # <<<<<<<<<<<<<<
20958  *             newalts = []
20959  *             have_deletions = False
20960  */
20961     __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;}
20962     __pyx_t_3 = (__pyx_t_6 != 1);
20963     if (__pyx_t_3) {
20964       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20965       __Pyx_GOTREF(__pyx_t_1);
20966       __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;}
20967       __Pyx_GOTREF(__pyx_t_5);
20968       __Pyx_INCREF(__pyx_v_record);
20969       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_record);
20970       __Pyx_GIVEREF(__pyx_v_record);
20971       __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20972       __Pyx_GOTREF(__pyx_t_7);
20973       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20974       __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;}
20975       __Pyx_GOTREF(__pyx_t_5);
20976       __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20977       __Pyx_GOTREF(__pyx_t_2);
20978       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
20979       __Pyx_GIVEREF(__pyx_t_7);
20980       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
20981       __Pyx_GIVEREF(__pyx_t_5);
20982       __pyx_t_7 = 0;
20983       __pyx_t_5 = 0;
20984       __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20985       __Pyx_GOTREF(__pyx_t_5);
20986       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20987       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20988       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20989       goto __pyx_L21;
20990     }
20991     __pyx_L21:;
20992
20993     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1036
20994  *         if self._version == 33:
20995  *             if len(ref) != 1: self.error(str(record),self.V33_BAD_REF)
20996  *             newalts = []             # <<<<<<<<<<<<<<
20997  *             have_deletions = False
20998  *             for a in alt:
20999  */
21000     __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;}
21001     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
21002     __Pyx_DECREF(((PyObject *)__pyx_v_newalts));
21003     __pyx_v_newalts = __pyx_t_5;
21004     __pyx_t_5 = 0;
21005
21006     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1037
21007  *             if len(ref) != 1: self.error(str(record),self.V33_BAD_REF)
21008  *             newalts = []
21009  *             have_deletions = False             # <<<<<<<<<<<<<<
21010  *             for a in alt:
21011  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
21012  */
21013     __pyx_v_have_deletions = 0;
21014
21015     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1038
21016  *             newalts = []
21017  *             have_deletions = False
21018  *             for a in alt:             # <<<<<<<<<<<<<<
21019  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
21020  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
21021  */
21022     if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
21023       __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
21024     } else {
21025       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21026     }
21027     for (;;) {
21028       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
21029       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++;
21030       __Pyx_DECREF(__pyx_v_a);
21031       __pyx_v_a = __pyx_t_2;
21032       __pyx_t_2 = 0;
21033
21034       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1039
21035  *             have_deletions = False
21036  *             for a in alt:
21037  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference             # <<<<<<<<<<<<<<
21038  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
21039  *                 elif a.startswith('D'): # allow D<seq> and D<num>
21040  */
21041       __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;}
21042       __pyx_t_3 = (__pyx_t_8 == 1);
21043       if (__pyx_t_3) {
21044         __pyx_t_2 = PySequence_GetSlice(__pyx_v_ref, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21045         __Pyx_GOTREF(__pyx_t_2);
21046         __pyx_t_1 = PyNumber_Add(__pyx_v_a, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21047         __Pyx_GOTREF(__pyx_t_1);
21048         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21049         __Pyx_DECREF(__pyx_v_a);
21050         __pyx_v_a = __pyx_t_1;
21051         __pyx_t_1 = 0;
21052         goto __pyx_L24;
21053       }
21054
21055       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1040
21056  *             for a in alt:
21057  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
21058  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference             # <<<<<<<<<<<<<<
21059  *                 elif a.startswith('D'): # allow D<seq> and D<num>
21060  *                     have_deletions = True
21061  */
21062       __pyx_t_1 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21063       __Pyx_GOTREF(__pyx_t_1);
21064       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21065       __Pyx_GOTREF(__pyx_t_2);
21066       __Pyx_INCREF(((PyObject *)__pyx_n_s__I));
21067       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__I));
21068       __Pyx_GIVEREF(((PyObject *)__pyx_n_s__I));
21069       __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21070       __Pyx_GOTREF(__pyx_t_7);
21071       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21072       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21073       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21074       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21075       if (__pyx_t_3) {
21076         __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21077         __Pyx_GOTREF(__pyx_t_7);
21078         __pyx_t_2 = 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;}
21079         __Pyx_GOTREF(__pyx_t_2);
21080         __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;}
21081         __Pyx_GOTREF(__pyx_t_1);
21082         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21083         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21084         __pyx_t_2 = 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;}
21085         __Pyx_GOTREF(__pyx_t_2);
21086         __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;}
21087         __Pyx_GOTREF(__pyx_t_7);
21088         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21089         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21090         __Pyx_DECREF(__pyx_v_a);
21091         __pyx_v_a = __pyx_t_7;
21092         __pyx_t_7 = 0;
21093         goto __pyx_L24;
21094       }
21095
21096       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1041
21097  *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
21098  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
21099  *                 elif a.startswith('D'): # allow D<seq> and D<num>             # <<<<<<<<<<<<<<
21100  *                     have_deletions = True
21101  *                     try:
21102  */
21103       __pyx_t_7 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__startswith); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21104       __Pyx_GOTREF(__pyx_t_7);
21105       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21106       __Pyx_GOTREF(__pyx_t_2);
21107       __Pyx_INCREF(((PyObject *)__pyx_n_s__D));
21108       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__D));
21109       __Pyx_GIVEREF(((PyObject *)__pyx_n_s__D));
21110       __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21111       __Pyx_GOTREF(__pyx_t_1);
21112       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21113       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21114       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21115       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21116       if (__pyx_t_3) {
21117
21118         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1042
21119  *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
21120  *                 elif a.startswith('D'): # allow D<seq> and D<num>
21121  *                     have_deletions = True             # <<<<<<<<<<<<<<
21122  *                     try:
21123  *                         l = int(a[1:])          # throws ValueError if sequence
21124  */
21125         __pyx_v_have_deletions = 1;
21126
21127         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1043
21128  *                 elif a.startswith('D'): # allow D<seq> and D<num>
21129  *                     have_deletions = True
21130  *                     try:             # <<<<<<<<<<<<<<
21131  *                         l = int(a[1:])          # throws ValueError if sequence
21132  *                         if len(ref) < l:        # add to reference if necessary
21133  */
21134         {
21135           PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
21136           __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
21137           __Pyx_XGOTREF(__pyx_save_exc_type);
21138           __Pyx_XGOTREF(__pyx_save_exc_value);
21139           __Pyx_XGOTREF(__pyx_save_exc_tb);
21140           /*try:*/ {
21141
21142             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1044
21143  *                     have_deletions = True
21144  *                     try:
21145  *                         l = int(a[1:])          # throws ValueError if sequence             # <<<<<<<<<<<<<<
21146  *                         if len(ref) < l:        # add to reference if necessary
21147  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
21148  */
21149             __pyx_t_1 = PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21150             __Pyx_GOTREF(__pyx_t_1);
21151             __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21152             __Pyx_GOTREF(__pyx_t_2);
21153             PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
21154             __Pyx_GIVEREF(__pyx_t_1);
21155             __pyx_t_1 = 0;
21156             __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21157             __Pyx_GOTREF(__pyx_t_1);
21158             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21159             __Pyx_DECREF(__pyx_v_l);
21160             __pyx_v_l = __pyx_t_1;
21161             __pyx_t_1 = 0;
21162
21163             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1045
21164  *                     try:
21165  *                         l = int(a[1:])          # throws ValueError if sequence
21166  *                         if len(ref) < l:        # add to reference if necessary             # <<<<<<<<<<<<<<
21167  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
21168  *                             ref += addns
21169  */
21170             __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;}
21171             __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21172             __Pyx_GOTREF(__pyx_t_1);
21173             __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_l, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21174             __Pyx_GOTREF(__pyx_t_2);
21175             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21176             __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21177             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21178             if (__pyx_t_3) {
21179
21180               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1046
21181  *                         l = int(a[1:])          # throws ValueError if sequence
21182  *                         if len(ref) < l:        # add to reference if necessary
21183  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)             # <<<<<<<<<<<<<<
21184  *                             ref += addns
21185  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21186  */
21187               __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21188               __Pyx_GOTREF(__pyx_t_2);
21189               __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;}
21190               __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21191               __Pyx_GOTREF(__pyx_t_1);
21192               __pyx_t_7 = PyNumber_Add(__pyx_v_pos, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21193               __Pyx_GOTREF(__pyx_t_7);
21194               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21195               __pyx_t_1 = PyNumber_Add(__pyx_v_pos, __pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21196               __Pyx_GOTREF(__pyx_t_1);
21197               __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;}
21198               __Pyx_GOTREF(__pyx_t_4);
21199               __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;}
21200               __Pyx_GOTREF(__pyx_t_10);
21201               __Pyx_INCREF(__pyx_v_chrom);
21202               PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
21203               __Pyx_GIVEREF(__pyx_v_chrom);
21204               PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
21205               __Pyx_GIVEREF(__pyx_t_7);
21206               PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
21207               __Pyx_GIVEREF(__pyx_t_1);
21208               PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
21209               __Pyx_GIVEREF(__pyx_t_4);
21210               __pyx_t_7 = 0;
21211               __pyx_t_1 = 0;
21212               __pyx_t_4 = 0;
21213               __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21214               __Pyx_GOTREF(__pyx_t_4);
21215               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21216               __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21217               __Pyx_DECREF(__pyx_v_addns);
21218               __pyx_v_addns = __pyx_t_4;
21219               __pyx_t_4 = 0;
21220
21221               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1047
21222  *                         if len(ref) < l:        # add to reference if necessary
21223  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
21224  *                             ref += addns             # <<<<<<<<<<<<<<
21225  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21226  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
21227  */
21228               __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;}
21229               __Pyx_GOTREF(__pyx_t_4);
21230               __Pyx_DECREF(__pyx_v_ref);
21231               __pyx_v_ref = __pyx_t_4;
21232               __pyx_t_4 = 0;
21233
21234               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1048
21235  *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
21236  *                             ref += addns
21237  *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
21238  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
21239  *                     except ValueError:
21240  */
21241               __Pyx_INCREF(__pyx_int_0);
21242               __pyx_t_4 = __pyx_int_0;
21243               if (likely(((PyObject *)__pyx_v_newalts) != Py_None)) {
21244                 __pyx_t_8 = 0; __pyx_t_10 = ((PyObject *)__pyx_v_newalts); __Pyx_INCREF(__pyx_t_10);
21245               } else {
21246                 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21247               }
21248               for (;;) {
21249                 if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break;
21250                 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++;
21251                 __Pyx_DECREF(__pyx_v_na);
21252                 __pyx_v_na = __pyx_t_2;
21253                 __pyx_t_2 = 0;
21254                 __Pyx_INCREF(__pyx_t_4);
21255                 __Pyx_DECREF(__pyx_v_i);
21256                 __pyx_v_i = __pyx_t_4;
21257                 __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21258                 __Pyx_GOTREF(__pyx_t_2);
21259                 __Pyx_DECREF(__pyx_t_4);
21260                 __pyx_t_4 = __pyx_t_2;
21261                 __pyx_t_2 = 0;
21262                 __pyx_t_2 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21263                 __Pyx_GOTREF(__pyx_t_2);
21264                 if (PyObject_SetItem(((PyObject *)__pyx_v_newalts), __pyx_v_i, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
21265                 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21266               }
21267               __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21268               __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21269               goto __pyx_L33;
21270             }
21271             __pyx_L33:;
21272
21273             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1049
21274  *                             ref += addns
21275  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21276  *                         a = ref[l:]             # new deletion, deleting pos...pos+l             # <<<<<<<<<<<<<<
21277  *                     except ValueError:
21278  *                         s = a[1:]
21279  */
21280             __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;}
21281             __pyx_t_4 = 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;}
21282             __Pyx_GOTREF(__pyx_t_4);
21283             __Pyx_DECREF(__pyx_v_a);
21284             __pyx_v_a = __pyx_t_4;
21285             __pyx_t_4 = 0;
21286           }
21287           __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
21288           __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
21289           __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
21290           goto __pyx_L32_try_end;
21291           __pyx_L25_error:;
21292           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
21293           __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21294           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21295           __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21296           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21297
21298           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1050
21299  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21300  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
21301  *                     except ValueError:             # <<<<<<<<<<<<<<
21302  *                         s = a[1:]
21303  *                         if len(ref) < len(s):   # add Ns to reference if necessary
21304  */
21305           __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
21306           if (__pyx_t_11) {
21307             __Pyx_AddTraceback("cvcf.VCF.validate");
21308             if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21309             __Pyx_GOTREF(__pyx_t_4);
21310             __Pyx_GOTREF(__pyx_t_10);
21311             __Pyx_GOTREF(__pyx_t_2);
21312
21313             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1051
21314  *                         a = ref[l:]             # new deletion, deleting pos...pos+l
21315  *                     except ValueError:
21316  *                         s = a[1:]             # <<<<<<<<<<<<<<
21317  *                         if len(ref) < len(s):   # add Ns to reference if necessary
21318  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
21319  */
21320             __pyx_t_1 = PySequence_GetSlice(__pyx_v_a, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21321             __Pyx_GOTREF(__pyx_t_1);
21322             __Pyx_DECREF(__pyx_v_s);
21323             __pyx_v_s = __pyx_t_1;
21324             __pyx_t_1 = 0;
21325
21326             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1052
21327  *                     except ValueError:
21328  *                         s = a[1:]
21329  *                         if len(ref) < len(s):   # add Ns to reference if necessary             # <<<<<<<<<<<<<<
21330  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
21331  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
21332  */
21333             __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;}
21334             __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;}
21335             __pyx_t_3 = (__pyx_t_8 < __pyx_t_12);
21336             if (__pyx_t_3) {
21337
21338               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1053
21339  *                         s = a[1:]
21340  *                         if len(ref) < len(s):   # add Ns to reference if necessary
21341  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)             # <<<<<<<<<<<<<<
21342  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
21343  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,
21344  */
21345               __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21346               __Pyx_GOTREF(__pyx_t_1);
21347               __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;}
21348               __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;}
21349               __Pyx_GOTREF(__pyx_t_7);
21350               __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;}
21351               __Pyx_GOTREF(__pyx_t_13);
21352               __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21353               __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;}
21354               __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;}
21355               __Pyx_GOTREF(__pyx_t_7);
21356               __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;}
21357               __Pyx_GOTREF(__pyx_t_14);
21358               __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21359               __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;}
21360               __Pyx_GOTREF(__pyx_t_7);
21361               __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;}
21362               __Pyx_GOTREF(__pyx_t_15);
21363               __Pyx_INCREF(__pyx_v_chrom);
21364               PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_chrom);
21365               __Pyx_GIVEREF(__pyx_v_chrom);
21366               PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_13);
21367               __Pyx_GIVEREF(__pyx_t_13);
21368               PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_14);
21369               __Pyx_GIVEREF(__pyx_t_14);
21370               PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_7);
21371               __Pyx_GIVEREF(__pyx_t_7);
21372               __pyx_t_13 = 0;
21373               __pyx_t_14 = 0;
21374               __pyx_t_7 = 0;
21375               __pyx_t_7 = PyObject_Call(__pyx_t_1, __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;}
21376               __Pyx_GOTREF(__pyx_t_7);
21377               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21378               __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
21379               __Pyx_DECREF(__pyx_v_addns);
21380               __pyx_v_addns = __pyx_t_7;
21381               __pyx_t_7 = 0;
21382
21383               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1054
21384  *                         if len(ref) < len(s):   # add Ns to reference if necessary
21385  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
21386  *                             if not s.endswith(addns) and addns != 'N'*len(addns):             # <<<<<<<<<<<<<<
21387  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,
21388  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
21389  */
21390               __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;}
21391               __Pyx_GOTREF(__pyx_t_7);
21392               __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;}
21393               __Pyx_GOTREF(__pyx_t_15);
21394               __Pyx_INCREF(__pyx_v_addns);
21395               PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_addns);
21396               __Pyx_GIVEREF(__pyx_v_addns);
21397               __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21398               __Pyx_GOTREF(__pyx_t_1);
21399               __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21400               __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
21401               __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21402               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21403               __pyx_t_16 = (!__pyx_t_3);
21404               if (__pyx_t_16) {
21405                 __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;}
21406                 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21407                 __Pyx_GOTREF(__pyx_t_1);
21408                 __pyx_t_15 = PyNumber_Multiply(((PyObject *)__pyx_n_s__N), __pyx_t_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21409                 __Pyx_GOTREF(((PyObject *)__pyx_t_15));
21410                 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21411                 __pyx_t_1 = PyObject_RichCompare(__pyx_v_addns, ((PyObject *)__pyx_t_15), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21412                 __Pyx_GOTREF(__pyx_t_1);
21413                 __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
21414                 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21415                 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21416                 __pyx_t_17 = __pyx_t_3;
21417               } else {
21418                 __pyx_t_17 = __pyx_t_16;
21419               }
21420               if (__pyx_t_17) {
21421
21422                 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1055
21423  *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
21424  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
21425  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,             # <<<<<<<<<<<<<<
21426  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
21427  *                             ref += addns
21428  */
21429                 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21430                 __Pyx_GOTREF(__pyx_t_1);
21431                 __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;}
21432                 __Pyx_GOTREF(__pyx_t_15);
21433                 __Pyx_INCREF(__pyx_v_record);
21434                 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_record);
21435                 __Pyx_GIVEREF(__pyx_v_record);
21436                 __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __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;}
21437                 __Pyx_GOTREF(__pyx_t_7);
21438                 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
21439                 __pyx_t_15 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_65); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21440                 __Pyx_GOTREF(__pyx_t_15);
21441
21442                 /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1056
21443  *                             if not s.endswith(addns) and addns != 'N'*len(addns):
21444  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,
21445  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))             # <<<<<<<<<<<<<<
21446  *                             ref += addns
21447  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21448  */
21449                 __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;}
21450                 __Pyx_GOTREF(__pyx_t_14);
21451                 __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;}
21452                 __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;}
21453                 __Pyx_GOTREF(__pyx_t_13);
21454                 __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;}
21455                 __Pyx_GOTREF(__pyx_t_18);
21456                 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21457                 __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;}
21458                 __Pyx_GOTREF(__pyx_t_13);
21459                 __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;}
21460                 __Pyx_GOTREF(__pyx_t_19);
21461                 __Pyx_INCREF(__pyx_v_chrom);
21462                 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_chrom);
21463                 __Pyx_GIVEREF(__pyx_v_chrom);
21464                 __Pyx_INCREF(__pyx_v_pos);
21465                 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_pos);
21466                 __Pyx_GIVEREF(__pyx_v_pos);
21467                 PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_18);
21468                 __Pyx_GIVEREF(__pyx_t_18);
21469                 PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_13);
21470                 __Pyx_GIVEREF(__pyx_t_13);
21471                 __pyx_t_18 = 0;
21472                 __pyx_t_13 = 0;
21473                 __pyx_t_13 = PyObject_Call(__pyx_t_14, __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;}
21474                 __Pyx_GOTREF(__pyx_t_13);
21475                 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
21476                 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
21477                 __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;}
21478                 __Pyx_GOTREF(__pyx_t_19);
21479                 __Pyx_INCREF(__pyx_v_a);
21480                 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_a);
21481                 __Pyx_GIVEREF(__pyx_v_a);
21482                 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_13);
21483                 __Pyx_GIVEREF(__pyx_t_13);
21484                 __pyx_t_13 = 0;
21485                 __pyx_t_13 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_66), __pyx_t_19); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21486                 __Pyx_GOTREF(((PyObject *)__pyx_t_13));
21487                 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
21488                 __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;}
21489                 __Pyx_GOTREF(__pyx_t_19);
21490                 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_7);
21491                 __Pyx_GIVEREF(__pyx_t_7);
21492                 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_15);
21493                 __Pyx_GIVEREF(__pyx_t_15);
21494                 PyTuple_SET_ITEM(__pyx_t_19, 2, ((PyObject *)__pyx_t_13));
21495                 __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
21496                 __pyx_t_7 = 0;
21497                 __pyx_t_15 = 0;
21498                 __pyx_t_13 = 0;
21499                 __pyx_t_13 = PyObject_Call(__pyx_t_1, __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;}
21500                 __Pyx_GOTREF(__pyx_t_13);
21501                 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21502                 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
21503                 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21504                 goto __pyx_L39;
21505               }
21506               __pyx_L39:;
21507
21508               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1057
21509  *                                 self.error(str(record),self.V33_UNMATCHED_DELETION,
21510  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
21511  *                             ref += addns             # <<<<<<<<<<<<<<
21512  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21513  *                         a = ref[len(s):]        # new deletion, deleting from pos
21514  */
21515               __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;}
21516               __Pyx_GOTREF(__pyx_t_13);
21517               __Pyx_DECREF(__pyx_v_ref);
21518               __pyx_v_ref = __pyx_t_13;
21519               __pyx_t_13 = 0;
21520
21521               /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1058
21522  *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
21523  *                             ref += addns
21524  *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
21525  *                         a = ref[len(s):]        # new deletion, deleting from pos
21526  *                 else:
21527  */
21528               __Pyx_INCREF(__pyx_int_0);
21529               __pyx_t_13 = __pyx_int_0;
21530               if (likely(((PyObject *)__pyx_v_newalts) != Py_None)) {
21531                 __pyx_t_12 = 0; __pyx_t_19 = ((PyObject *)__pyx_v_newalts); __Pyx_INCREF(__pyx_t_19);
21532               } else {
21533                 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21534               }
21535               for (;;) {
21536                 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_19)) break;
21537                 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++;
21538                 __Pyx_DECREF(__pyx_v_na);
21539                 __pyx_v_na = __pyx_t_1;
21540                 __pyx_t_1 = 0;
21541                 __Pyx_INCREF(__pyx_t_13);
21542                 __Pyx_DECREF(__pyx_v_i);
21543                 __pyx_v_i = __pyx_t_13;
21544                 __pyx_t_1 = PyNumber_Add(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21545                 __Pyx_GOTREF(__pyx_t_1);
21546                 __Pyx_DECREF(__pyx_t_13);
21547                 __pyx_t_13 = __pyx_t_1;
21548                 __pyx_t_1 = 0;
21549                 __pyx_t_1 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21550                 __Pyx_GOTREF(__pyx_t_1);
21551                 if (PyObject_SetItem(((PyObject *)__pyx_v_newalts), __pyx_v_i, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
21552                 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21553               }
21554               __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
21555               __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21556               goto __pyx_L38;
21557             }
21558             __pyx_L38:;
21559
21560             /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1059
21561  *                             ref += addns
21562  *                             for i,na in enumerate(newalts): newalts[i] = na+addns
21563  *                         a = ref[len(s):]        # new deletion, deleting from pos             # <<<<<<<<<<<<<<
21564  *                 else:
21565  *                     self.error(str(record),self.V33_BAD_ALLELE)
21566  */
21567             __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;}
21568             __pyx_t_13 = 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;}
21569             __Pyx_GOTREF(__pyx_t_13);
21570             __Pyx_DECREF(__pyx_v_a);
21571             __pyx_v_a = __pyx_t_13;
21572             __pyx_t_13 = 0;
21573             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21574             __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21575             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21576             goto __pyx_L26_exception_handled;
21577           }
21578           __pyx_L27_except_error:;
21579           __Pyx_XGIVEREF(__pyx_save_exc_type);
21580           __Pyx_XGIVEREF(__pyx_save_exc_value);
21581           __Pyx_XGIVEREF(__pyx_save_exc_tb);
21582           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
21583           goto __pyx_L1_error;
21584           __pyx_L26_exception_handled:;
21585           __Pyx_XGIVEREF(__pyx_save_exc_type);
21586           __Pyx_XGIVEREF(__pyx_save_exc_value);
21587           __Pyx_XGIVEREF(__pyx_save_exc_tb);
21588           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
21589           __pyx_L32_try_end:;
21590         }
21591         goto __pyx_L24;
21592       }
21593       /*else*/ {
21594
21595         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1061
21596  *                         a = ref[len(s):]        # new deletion, deleting from pos
21597  *                 else:
21598  *                     self.error(str(record),self.V33_BAD_ALLELE)             # <<<<<<<<<<<<<<
21599  *                 newalts.append(a)
21600  *             alt = newalts
21601  */
21602         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21603         __Pyx_GOTREF(__pyx_t_2);
21604         __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;}
21605         __Pyx_GOTREF(__pyx_t_10);
21606         __Pyx_INCREF(__pyx_v_record);
21607         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_record);
21608         __Pyx_GIVEREF(__pyx_v_record);
21609         __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21610         __Pyx_GOTREF(__pyx_t_4);
21611         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21612         __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;}
21613         __Pyx_GOTREF(__pyx_t_10);
21614         __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;}
21615         __Pyx_GOTREF(__pyx_t_13);
21616         PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4);
21617         __Pyx_GIVEREF(__pyx_t_4);
21618         PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10);
21619         __Pyx_GIVEREF(__pyx_t_10);
21620         __pyx_t_4 = 0;
21621         __pyx_t_10 = 0;
21622         __pyx_t_10 = PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21623         __Pyx_GOTREF(__pyx_t_10);
21624         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21625         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21626         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21627       }
21628       __pyx_L24:;
21629
21630       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1062
21631  *                 else:
21632  *                     self.error(str(record),self.V33_BAD_ALLELE)
21633  *                 newalts.append(a)             # <<<<<<<<<<<<<<
21634  *             alt = newalts
21635  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
21636  */
21637       if (unlikely(__pyx_v_newalts == Py_None)) {
21638         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;} 
21639       }
21640       __pyx_t_11 = PyList_Append(((PyObject *)__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;}
21641     }
21642     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21643
21644     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1063
21645  *                     self.error(str(record),self.V33_BAD_ALLELE)
21646  *                 newalts.append(a)
21647  *             alt = newalts             # <<<<<<<<<<<<<<
21648  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
21649  *             if have_deletions:
21650  */
21651     __Pyx_INCREF(((PyObject *)__pyx_v_newalts));
21652     __Pyx_DECREF(((PyObject *)__pyx_v_alt));
21653     __pyx_v_alt = __pyx_v_newalts;
21654
21655     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1065
21656  *             alt = newalts
21657  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
21658  *             if have_deletions:             # <<<<<<<<<<<<<<
21659  *                 if pos == 0:
21660  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
21661  */
21662     if (__pyx_v_have_deletions) {
21663
21664       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1066
21665  *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
21666  *             if have_deletions:
21667  *                 if pos == 0:             # <<<<<<<<<<<<<<
21668  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
21669  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
21670  */
21671       __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;}
21672       __Pyx_GOTREF(__pyx_t_5);
21673       __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;}
21674       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21675       if (__pyx_t_17) {
21676
21677         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1068
21678  *                 if pos == 0:
21679  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
21680  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)             # <<<<<<<<<<<<<<
21681  *                     ref += addn
21682  *                     alt = [allele+addn for allele in alt]
21683  */
21684         __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;}
21685         __Pyx_GOTREF(__pyx_t_5);
21686         __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;}
21687         __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;}
21688         __Pyx_GOTREF(__pyx_t_10);
21689         __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;}
21690         __Pyx_GOTREF(__pyx_t_13);
21691         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21692         __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;}
21693         __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;}
21694         __Pyx_GOTREF(__pyx_t_10);
21695         __pyx_t_2 = PyNumber_Add(__pyx_v_pos, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21696         __Pyx_GOTREF(__pyx_t_2);
21697         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21698         __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21699         __Pyx_GOTREF(__pyx_t_10);
21700         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21701         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21702         __Pyx_GOTREF(__pyx_t_2);
21703         __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;}
21704         __Pyx_GOTREF(__pyx_t_4);
21705         __Pyx_INCREF(__pyx_v_chrom);
21706         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
21707         __Pyx_GIVEREF(__pyx_v_chrom);
21708         PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_13);
21709         __Pyx_GIVEREF(__pyx_t_13);
21710         PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10);
21711         __Pyx_GIVEREF(__pyx_t_10);
21712         PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2);
21713         __Pyx_GIVEREF(__pyx_t_2);
21714         __pyx_t_13 = 0;
21715         __pyx_t_10 = 0;
21716         __pyx_t_2 = 0;
21717         __pyx_t_2 = PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21718         __Pyx_GOTREF(__pyx_t_2);
21719         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21720         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21721         __Pyx_DECREF(__pyx_v_addn);
21722         __pyx_v_addn = __pyx_t_2;
21723         __pyx_t_2 = 0;
21724
21725         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1069
21726  *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
21727  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
21728  *                     ref += addn             # <<<<<<<<<<<<<<
21729  *                     alt = [allele+addn for allele in alt]
21730  *                 else:
21731  */
21732         __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21733         __Pyx_GOTREF(__pyx_t_2);
21734         __Pyx_DECREF(__pyx_v_ref);
21735         __pyx_v_ref = __pyx_t_2;
21736         __pyx_t_2 = 0;
21737
21738         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1070
21739  *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
21740  *                     ref += addn
21741  *                     alt = [allele+addn for allele in alt]             # <<<<<<<<<<<<<<
21742  *                 else:
21743  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
21744  */
21745         __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21746         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
21747         if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
21748           __pyx_t_6 = 0; __pyx_t_4 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_4);
21749         } else {
21750           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21751         }
21752         for (;;) {
21753           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
21754           __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
21755           __Pyx_DECREF(__pyx_v_allele);
21756           __pyx_v_allele = __pyx_t_5;
21757           __pyx_t_5 = 0;
21758           __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;}
21759           __Pyx_GOTREF(__pyx_t_5);
21760           if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21761           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21762         }
21763         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21764         __Pyx_INCREF(((PyObject *)__pyx_t_2));
21765         __Pyx_DECREF(((PyObject *)__pyx_v_alt));
21766         __pyx_v_alt = __pyx_t_2;
21767         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
21768         goto __pyx_L43;
21769       }
21770       /*else*/ {
21771
21772         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1072
21773  *                     alt = [allele+addn for allele in alt]
21774  *                 else:
21775  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)             # <<<<<<<<<<<<<<
21776  *                     ref = addn + ref
21777  *                     alt = [addn + allele for allele in alt]
21778  */
21779         __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_sequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21780         __Pyx_GOTREF(__pyx_t_2);
21781         __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;}
21782         __Pyx_GOTREF(__pyx_t_4);
21783         __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;}
21784         __Pyx_GOTREF(__pyx_t_5);
21785         __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;}
21786         __Pyx_GOTREF(__pyx_t_10);
21787         __Pyx_INCREF(__pyx_v_chrom);
21788         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
21789         __Pyx_GIVEREF(__pyx_v_chrom);
21790         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
21791         __Pyx_GIVEREF(__pyx_t_4);
21792         __Pyx_INCREF(__pyx_v_pos);
21793         PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_pos);
21794         __Pyx_GIVEREF(__pyx_v_pos);
21795         PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_5);
21796         __Pyx_GIVEREF(__pyx_t_5);
21797         __pyx_t_4 = 0;
21798         __pyx_t_5 = 0;
21799         __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21800         __Pyx_GOTREF(__pyx_t_5);
21801         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21802         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21803         __Pyx_DECREF(__pyx_v_addn);
21804         __pyx_v_addn = __pyx_t_5;
21805         __pyx_t_5 = 0;
21806
21807         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1073
21808  *                 else:
21809  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
21810  *                     ref = addn + ref             # <<<<<<<<<<<<<<
21811  *                     alt = [addn + allele for allele in alt]
21812  *                     pos -= 1
21813  */
21814         __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;}
21815         __Pyx_GOTREF(__pyx_t_5);
21816         __Pyx_DECREF(__pyx_v_ref);
21817         __pyx_v_ref = __pyx_t_5;
21818         __pyx_t_5 = 0;
21819
21820         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1074
21821  *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
21822  *                     ref = addn + ref
21823  *                     alt = [addn + allele for allele in alt]             # <<<<<<<<<<<<<<
21824  *                     pos -= 1
21825  *         else:
21826  */
21827         __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;}
21828         __Pyx_GOTREF(((PyObject *)__pyx_t_5));
21829         if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
21830           __pyx_t_6 = 0; __pyx_t_10 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_10);
21831         } else {
21832           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21833         }
21834         for (;;) {
21835           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break;
21836           __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++;
21837           __Pyx_DECREF(__pyx_v_allele);
21838           __pyx_v_allele = __pyx_t_2;
21839           __pyx_t_2 = 0;
21840           __pyx_t_2 = PyNumber_Add(__pyx_v_addn, __pyx_v_allele); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21841           __Pyx_GOTREF(__pyx_t_2);
21842           if (unlikely(PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21843           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21844         }
21845         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21846         __Pyx_INCREF(((PyObject *)__pyx_t_5));
21847         __Pyx_DECREF(((PyObject *)__pyx_v_alt));
21848         __pyx_v_alt = __pyx_t_5;
21849         __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
21850
21851         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1075
21852  *                     ref = addn + ref
21853  *                     alt = [addn + allele for allele in alt]
21854  *                     pos -= 1             # <<<<<<<<<<<<<<
21855  *         else:
21856  *             # format v4.0 -- just check for nucleotides
21857  */
21858         __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;}
21859         __Pyx_GOTREF(__pyx_t_5);
21860         __Pyx_DECREF(__pyx_v_pos);
21861         __pyx_v_pos = __pyx_t_5;
21862         __pyx_t_5 = 0;
21863       }
21864       __pyx_L43:;
21865       goto __pyx_L42;
21866     }
21867     __pyx_L42:;
21868     goto __pyx_L20;
21869   }
21870   /*else*/ {
21871
21872     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1078
21873  *         else:
21874  *             # format v4.0 -- just check for nucleotides
21875  *             for allele in alt:             # <<<<<<<<<<<<<<
21876  *                 if not alleleRegEx.match(allele):
21877  *                     self.error(str(record),self.V40_BAD_ALLELE,allele)
21878  */
21879     if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
21880       __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
21881     } else {
21882       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21883     }
21884     for (;;) {
21885       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
21886       __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_10); __pyx_t_6++;
21887       __Pyx_DECREF(__pyx_v_allele);
21888       __pyx_v_allele = __pyx_t_10;
21889       __pyx_t_10 = 0;
21890
21891       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1079
21892  *             # format v4.0 -- just check for nucleotides
21893  *             for allele in alt:
21894  *                 if not alleleRegEx.match(allele):             # <<<<<<<<<<<<<<
21895  *                     self.error(str(record),self.V40_BAD_ALLELE,allele)
21896  * 
21897  */
21898       __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;}
21899       __Pyx_GOTREF(__pyx_t_10);
21900       __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__match); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21901       __Pyx_GOTREF(__pyx_t_2);
21902       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21903       __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;}
21904       __Pyx_GOTREF(__pyx_t_10);
21905       __Pyx_INCREF(__pyx_v_allele);
21906       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_allele);
21907       __Pyx_GIVEREF(__pyx_v_allele);
21908       __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21909       __Pyx_GOTREF(__pyx_t_4);
21910       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21911       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21912       __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;}
21913       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21914       __pyx_t_16 = (!__pyx_t_17);
21915       if (__pyx_t_16) {
21916
21917         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1080
21918  *             for allele in alt:
21919  *                 if not alleleRegEx.match(allele):
21920  *                     self.error(str(record),self.V40_BAD_ALLELE,allele)             # <<<<<<<<<<<<<<
21921  * 
21922  * 
21923  */
21924         __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;}
21925         __Pyx_GOTREF(__pyx_t_4);
21926         __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;}
21927         __Pyx_GOTREF(__pyx_t_10);
21928         __Pyx_INCREF(__pyx_v_record);
21929         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_record);
21930         __Pyx_GIVEREF(__pyx_v_record);
21931         __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21932         __Pyx_GOTREF(__pyx_t_2);
21933         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21934         __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;}
21935         __Pyx_GOTREF(__pyx_t_10);
21936         __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;}
21937         __Pyx_GOTREF(__pyx_t_13);
21938         PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2);
21939         __Pyx_GIVEREF(__pyx_t_2);
21940         PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10);
21941         __Pyx_GIVEREF(__pyx_t_10);
21942         __Pyx_INCREF(__pyx_v_allele);
21943         PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_allele);
21944         __Pyx_GIVEREF(__pyx_v_allele);
21945         __pyx_t_2 = 0;
21946         __pyx_t_10 = 0;
21947         __pyx_t_10 = PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21948         __Pyx_GOTREF(__pyx_t_10);
21949         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21950         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
21951         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21952         goto __pyx_L50;
21953       }
21954       __pyx_L50:;
21955     }
21956     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21957   }
21958   __pyx_L20:;
21959
21960   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1084
21961  * 
21962  *         # check for leading nucleotide in indel calls
21963  *         for allele in alt:             # <<<<<<<<<<<<<<
21964  *             if len(allele) != len(ref):
21965  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)
21966  */
21967   if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
21968     __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
21969   } else {
21970     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21971   }
21972   for (;;) {
21973     if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
21974     __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_10); __pyx_t_6++;
21975     __Pyx_DECREF(__pyx_v_allele);
21976     __pyx_v_allele = __pyx_t_10;
21977     __pyx_t_10 = 0;
21978
21979     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1085
21980  *         # check for leading nucleotide in indel calls
21981  *         for allele in alt:
21982  *             if len(allele) != len(ref):             # <<<<<<<<<<<<<<
21983  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)
21984  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
21985  */
21986     __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;}
21987     __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;}
21988     __pyx_t_16 = (__pyx_t_12 != __pyx_t_8);
21989     if (__pyx_t_16) {
21990
21991       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1086
21992  *         for allele in alt:
21993  *             if len(allele) != len(ref):
21994  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)             # <<<<<<<<<<<<<<
21995  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
21996  *                     self.error(str(record),self.MISSING_INDEL_ALLELE_REF_BASE)
21997  */
21998       __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;}
21999       __pyx_t_16 = (__pyx_t_8 == 0);
22000       if (__pyx_t_16) {
22001         __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;}
22002         __Pyx_GOTREF(__pyx_t_10);
22003         __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;}
22004         __Pyx_GOTREF(__pyx_t_13);
22005         __Pyx_INCREF(__pyx_v_record);
22006         PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_record);
22007         __Pyx_GIVEREF(__pyx_v_record);
22008         __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22009         __Pyx_GOTREF(__pyx_t_4);
22010         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22011         __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;}
22012         __Pyx_GOTREF(__pyx_t_13);
22013         __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22014         __Pyx_GOTREF(__pyx_t_2);
22015         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
22016         __Pyx_GIVEREF(__pyx_t_4);
22017         PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13);
22018         __Pyx_GIVEREF(__pyx_t_13);
22019         __pyx_t_4 = 0;
22020         __pyx_t_13 = 0;
22021         __pyx_t_13 = PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22022         __Pyx_GOTREF(__pyx_t_13);
22023         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22024         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22025         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22026         goto __pyx_L54;
22027       }
22028       __pyx_L54:;
22029
22030       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1087
22031  *             if len(allele) != len(ref):
22032  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)
22033  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():             # <<<<<<<<<<<<<<
22034  *                     self.error(str(record),self.MISSING_INDEL_ALLELE_REF_BASE)
22035  * 
22036  */
22037       __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;}
22038       __Pyx_GOTREF(__pyx_t_13);
22039       __pyx_t_2 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22040       __Pyx_GOTREF(__pyx_t_2);
22041       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22042       __pyx_t_13 = PyObject_Call(__pyx_t_2, ((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;}
22043       __Pyx_GOTREF(__pyx_t_13);
22044       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22045       __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_allele, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22046       __Pyx_GOTREF(__pyx_t_2);
22047       __pyx_t_10 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__upper); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22048       __Pyx_GOTREF(__pyx_t_10);
22049       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22050       __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 = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22051       __Pyx_GOTREF(__pyx_t_2);
22052       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22053       __pyx_t_10 = PyObject_RichCompare(__pyx_t_13, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22054       __Pyx_GOTREF(__pyx_t_10);
22055       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22056       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22057       __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;}
22058       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22059       if (__pyx_t_16) {
22060         __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;}
22061         __Pyx_GOTREF(__pyx_t_10);
22062         __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_allele, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22063         __Pyx_GOTREF(__pyx_t_2);
22064         __pyx_t_13 = PyNumber_Add(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22065         __Pyx_GOTREF(__pyx_t_13);
22066         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22067         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22068         __pyx_t_2 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22069         __Pyx_GOTREF(__pyx_t_2);
22070         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22071         __pyx_t_13 = PyObject_Call(__pyx_t_2, ((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;}
22072         __Pyx_GOTREF(__pyx_t_13);
22073         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22074         __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;}
22075         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22076         __pyx_t_3 = __pyx_t_17;
22077       } else {
22078         __pyx_t_3 = __pyx_t_16;
22079       }
22080       if (__pyx_t_3) {
22081
22082         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1088
22083  *                 if len(allele) == 0: self.error(str(record),self.ZERO_LENGTH_ALLELE)
22084  *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
22085  *                     self.error(str(record),self.MISSING_INDEL_ALLELE_REF_BASE)             # <<<<<<<<<<<<<<
22086  * 
22087  *         # trim trailing bases in alleles
22088  */
22089         __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;}
22090         __Pyx_GOTREF(__pyx_t_13);
22091         __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22092         __Pyx_GOTREF(__pyx_t_2);
22093         __Pyx_INCREF(__pyx_v_record);
22094         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_record);
22095         __Pyx_GIVEREF(__pyx_v_record);
22096         __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22097         __Pyx_GOTREF(__pyx_t_10);
22098         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22099         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_67); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22100         __Pyx_GOTREF(__pyx_t_2);
22101         __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;}
22102         __Pyx_GOTREF(__pyx_t_4);
22103         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10);
22104         __Pyx_GIVEREF(__pyx_t_10);
22105         PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
22106         __Pyx_GIVEREF(__pyx_t_2);
22107         __pyx_t_10 = 0;
22108         __pyx_t_2 = 0;
22109         __pyx_t_2 = PyObject_Call(__pyx_t_13, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22110         __Pyx_GOTREF(__pyx_t_2);
22111         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22112         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22113         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22114         goto __pyx_L55;
22115       }
22116       __pyx_L55:;
22117       goto __pyx_L53;
22118     }
22119     __pyx_L53:;
22120   }
22121   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22122
22123   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1091
22124  * 
22125  *         # trim trailing bases in alleles
22126  *         for i in range(1,min(len(ref),min(map(len,alt)))):             # <<<<<<<<<<<<<<
22127  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
22128  *                 break
22129  */
22130   __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;}
22131   __Pyx_GOTREF(__pyx_t_5);
22132   __Pyx_INCREF(__pyx_builtin_len);
22133   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_builtin_len);
22134   __Pyx_GIVEREF(__pyx_builtin_len);
22135   __Pyx_INCREF(((PyObject *)__pyx_v_alt));
22136   PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_alt));
22137   __Pyx_GIVEREF(((PyObject *)__pyx_v_alt));
22138   __pyx_t_2 = PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22139   __Pyx_GOTREF(__pyx_t_2);
22140   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22141   __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;}
22142   __Pyx_GOTREF(__pyx_t_5);
22143   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
22144   __Pyx_GIVEREF(__pyx_t_2);
22145   __pyx_t_2 = 0;
22146   __pyx_t_2 = PyObject_Call(__pyx_builtin_min, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22147   __Pyx_GOTREF(__pyx_t_2);
22148   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22149   __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;}
22150   __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;}
22151   __Pyx_GOTREF(__pyx_t_4);
22152   __pyx_t_13 = PyObject_RichCompare(__pyx_t_2, __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;}
22153   __Pyx_GOTREF(__pyx_t_13);
22154   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22155   __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;}
22156   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22157   if (__pyx_t_3) {
22158     __Pyx_INCREF(__pyx_t_2);
22159     __pyx_t_5 = __pyx_t_2;
22160   } else {
22161     __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;}
22162     __Pyx_GOTREF(__pyx_t_13);
22163     __pyx_t_5 = __pyx_t_13;
22164     __pyx_t_13 = 0;
22165   }
22166   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22167   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22168   __Pyx_GOTREF(__pyx_t_2);
22169   __Pyx_INCREF(__pyx_int_1);
22170   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_1);
22171   __Pyx_GIVEREF(__pyx_int_1);
22172   __Pyx_INCREF(__pyx_t_5);
22173   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
22174   __Pyx_GIVEREF(__pyx_t_5);
22175   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22176   __pyx_t_5 = PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22177   __Pyx_GOTREF(__pyx_t_5);
22178   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22179   if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
22180     __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2);
22181   } else {
22182     __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22183     __Pyx_GOTREF(__pyx_t_2);
22184   }
22185   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22186   for (;;) {
22187     if (likely(PyList_CheckExact(__pyx_t_2))) {
22188       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
22189       __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
22190     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
22191       if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
22192       __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
22193     } else {
22194       __pyx_t_5 = PyIter_Next(__pyx_t_2);
22195       if (!__pyx_t_5) {
22196         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22197         break;
22198       }
22199       __Pyx_GOTREF(__pyx_t_5);
22200     }
22201     __Pyx_DECREF(__pyx_v_i);
22202     __pyx_v_i = __pyx_t_5;
22203     __pyx_t_5 = 0;
22204
22205     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1092
22206  *         # trim trailing bases in alleles
22207  *         for i in range(1,min(len(ref),min(map(len,alt)))):
22208  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():             # <<<<<<<<<<<<<<
22209  *                 break
22210  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]
22211  */
22212     __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22213     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
22214     if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
22215       __pyx_t_8 = 0; __pyx_t_13 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_13);
22216     } else {
22217       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22218     }
22219     for (;;) {
22220       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_13)) break;
22221       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++;
22222       __Pyx_DECREF(__pyx_8genexpr1__pyx_v_allele);
22223       __pyx_8genexpr1__pyx_v_allele = __pyx_t_4;
22224       __pyx_t_4 = 0;
22225       __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_L1_error;}
22226       __Pyx_GOTREF(__pyx_t_4);
22227       __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_L1_error;}
22228       __Pyx_GOTREF(__pyx_t_10);
22229       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22230       __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_L1_error;}
22231       __Pyx_GOTREF(__pyx_t_4);
22232       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22233       if (unlikely(PySet_Add(__pyx_t_5, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22234       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22235     }
22236     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22237     __pyx_t_8 = PySet_Size(((PyObject *)__pyx_t_5)); 
22238     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
22239     __pyx_t_3 = (__pyx_t_8 > 1);
22240     if (!__pyx_t_3) {
22241       __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;}
22242       __Pyx_GOTREF(__pyx_t_5);
22243       __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;}
22244       __Pyx_GOTREF(__pyx_t_13);
22245       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22246       __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;}
22247       __Pyx_GOTREF(__pyx_t_5);
22248       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22249       __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;}
22250       __Pyx_GOTREF(__pyx_t_13);
22251       __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;}
22252       __Pyx_GOTREF(__pyx_t_4);
22253       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22254       __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;}
22255       __Pyx_GOTREF(__pyx_t_13);
22256       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22257       __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;}
22258       __Pyx_GOTREF(__pyx_t_4);
22259       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22260       __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;}
22261       __Pyx_GOTREF(__pyx_t_13);
22262       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22263       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22264       __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;}
22265       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22266       __pyx_t_17 = __pyx_t_16;
22267     } else {
22268       __pyx_t_17 = __pyx_t_3;
22269     }
22270     if (__pyx_t_17) {
22271
22272       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1093
22273  *         for i in range(1,min(len(ref),min(map(len,alt)))):
22274  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
22275  *                 break             # <<<<<<<<<<<<<<
22276  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]
22277  * 
22278  */
22279       goto __pyx_L57_break;
22280       goto __pyx_L58;
22281     }
22282     __pyx_L58:;
22283
22284     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1094
22285  *             if len(set(allele[-1].upper() for allele in alt)) > 1 or ref[-1].upper() != alt[0][-1].upper():
22286  *                 break
22287  *             ref, alt = ref[:-1], [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
22288  * 
22289  *         # left-align alleles, if a reference is available
22290  */
22291     __pyx_t_13 = 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;}
22292     __Pyx_GOTREF(__pyx_t_13);
22293     __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;}
22294     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
22295     if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
22296       __pyx_t_8 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
22297     } else {
22298       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22299     }
22300     for (;;) {
22301       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
22302       __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++;
22303       __Pyx_DECREF(__pyx_v_allele);
22304       __pyx_v_allele = __pyx_t_10;
22305       __pyx_t_10 = 0;
22306       __pyx_t_10 = 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;}
22307       __Pyx_GOTREF(__pyx_t_10);
22308       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;}
22309       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22310     }
22311     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22312     __pyx_t_5 = ((PyObject *)__pyx_t_4);
22313     __Pyx_INCREF(__pyx_t_5);
22314     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
22315     __Pyx_DECREF(__pyx_v_ref);
22316     __pyx_v_ref = __pyx_t_13;
22317     __pyx_t_13 = 0;
22318     __Pyx_DECREF(((PyObject *)__pyx_v_alt));
22319     __pyx_v_alt = ((PyObject *)__pyx_t_5);
22320     __pyx_t_5 = 0;
22321   }
22322   __pyx_L57_break:;
22323   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22324
22325   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1097
22326  * 
22327  *         # left-align alleles, if a reference is available
22328  *         if self._leftalign and self._reference:             # <<<<<<<<<<<<<<
22329  *             while left < pos:
22330  *                 movable = True
22331  */
22332   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___leftalign); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22333   __Pyx_GOTREF(__pyx_t_2);
22334   __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22335   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22336   if (__pyx_t_17) {
22337     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22338     __Pyx_GOTREF(__pyx_t_2);
22339     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22340     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22341     __pyx_t_16 = __pyx_t_3;
22342   } else {
22343     __pyx_t_16 = __pyx_t_17;
22344   }
22345   if (__pyx_t_16) {
22346
22347     /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1098
22348  *         # left-align alleles, if a reference is available
22349  *         if self._leftalign and self._reference:
22350  *             while left < pos:             # <<<<<<<<<<<<<<
22351  *                 movable = True
22352  *                 for allele in alt:
22353  */
22354     while (1) {
22355       __pyx_t_2 = PyObject_RichCompare(__pyx_v_left, __pyx_v_pos, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22356       __Pyx_GOTREF(__pyx_t_2);
22357       __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22358       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22359       if (!__pyx_t_16) break;
22360
22361       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1099
22362  *         if self._leftalign and self._reference:
22363  *             while left < pos:
22364  *                 movable = True             # <<<<<<<<<<<<<<
22365  *                 for allele in alt:
22366  *                     if len(allele) > len(ref):
22367  */
22368       __pyx_v_movable = 1;
22369
22370       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1100
22371  *             while left < pos:
22372  *                 movable = True
22373  *                 for allele in alt:             # <<<<<<<<<<<<<<
22374  *                     if len(allele) > len(ref):
22375  *                         longest, shortest = allele, ref
22376  */
22377       if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
22378         __pyx_t_6 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_2);
22379       } else {
22380         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22381       }
22382       for (;;) {
22383         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
22384         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
22385         __Pyx_DECREF(__pyx_v_allele);
22386         __pyx_v_allele = __pyx_t_5;
22387         __pyx_t_5 = 0;
22388
22389         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1101
22390  *                 movable = True
22391  *                 for allele in alt:
22392  *                     if len(allele) > len(ref):             # <<<<<<<<<<<<<<
22393  *                         longest, shortest = allele, ref
22394  *                     else:
22395  */
22396         __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;}
22397         __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;}
22398         __pyx_t_16 = (__pyx_t_8 > __pyx_t_12);
22399         if (__pyx_t_16) {
22400
22401           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1102
22402  *                 for allele in alt:
22403  *                     if len(allele) > len(ref):
22404  *                         longest, shortest = allele, ref             # <<<<<<<<<<<<<<
22405  *                     else:
22406  *                         longest, shortest = ref, allele
22407  */
22408           __pyx_t_5 = __pyx_v_allele;
22409           __Pyx_INCREF(__pyx_t_5);
22410           __pyx_t_13 = __pyx_v_ref;
22411           __Pyx_INCREF(__pyx_t_13);
22412           __Pyx_DECREF(__pyx_v_longest);
22413           __pyx_v_longest = __pyx_t_5;
22414           __pyx_t_5 = 0;
22415           __Pyx_DECREF(__pyx_v_shortest);
22416           __pyx_v_shortest = __pyx_t_13;
22417           __pyx_t_13 = 0;
22418           goto __pyx_L68;
22419         }
22420         /*else*/ {
22421
22422           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1104
22423  *                         longest, shortest = allele, ref
22424  *                     else:
22425  *                         longest, shortest = ref, allele             # <<<<<<<<<<<<<<
22426  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
22427  *                         movable = False
22428  */
22429           __pyx_t_13 = __pyx_v_ref;
22430           __Pyx_INCREF(__pyx_t_13);
22431           __pyx_t_5 = __pyx_v_allele;
22432           __Pyx_INCREF(__pyx_t_5);
22433           __Pyx_DECREF(__pyx_v_longest);
22434           __pyx_v_longest = __pyx_t_13;
22435           __pyx_t_13 = 0;
22436           __Pyx_DECREF(__pyx_v_shortest);
22437           __pyx_v_shortest = __pyx_t_5;
22438           __pyx_t_5 = 0;
22439         }
22440         __pyx_L68:;
22441
22442         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1105
22443  *                     else:
22444  *                         longest, shortest = ref, allele
22445  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():             # <<<<<<<<<<<<<<
22446  *                         movable = False
22447  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
22448  */
22449         __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;}
22450         __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;}
22451         __pyx_t_16 = (__pyx_t_12 == __pyx_t_8);
22452         if (!__pyx_t_16) {
22453           __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;}
22454           __pyx_t_5 = 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;}
22455           __Pyx_GOTREF(__pyx_t_5);
22456           __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;}
22457           __Pyx_GOTREF(__pyx_t_13);
22458           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22459           __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;}
22460           __Pyx_GOTREF(__pyx_t_5);
22461           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22462           __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;}
22463           __Pyx_GOTREF(__pyx_t_13);
22464           __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;}
22465           __Pyx_GOTREF(__pyx_t_4);
22466           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22467           __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;}
22468           __Pyx_GOTREF(__pyx_t_13);
22469           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22470           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22471           __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;}
22472           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22473           __pyx_t_3 = __pyx_t_17;
22474         } else {
22475           __pyx_t_3 = __pyx_t_16;
22476         }
22477         if (__pyx_t_3) {
22478
22479           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1106
22480  *                         longest, shortest = ref, allele
22481  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
22482  *                         movable = False             # <<<<<<<<<<<<<<
22483  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
22484  *                         movable = False
22485  */
22486           __pyx_v_movable = 0;
22487           goto __pyx_L69;
22488         }
22489         __pyx_L69:;
22490
22491         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1107
22492  *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
22493  *                         movable = False
22494  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():             # <<<<<<<<<<<<<<
22495  *                         movable = False
22496  *                 if not movable:
22497  */
22498         __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;}
22499         __Pyx_GOTREF(__pyx_t_13);
22500         __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;}
22501         __Pyx_GOTREF(__pyx_t_4);
22502         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22503         __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;}
22504         __Pyx_GOTREF(__pyx_t_13);
22505         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22506         __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;}
22507         __pyx_t_12 = (__pyx_t_8 - 1);
22508         __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;}
22509         __Pyx_GOTREF(__pyx_t_4);
22510         __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;}
22511         __Pyx_GOTREF(__pyx_t_5);
22512         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22513         __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;}
22514         __Pyx_GOTREF(__pyx_t_4);
22515         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22516         __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;}
22517         __Pyx_GOTREF(__pyx_t_5);
22518         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22519         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22520         __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;}
22521         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22522         if (__pyx_t_3) {
22523
22524           /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1108
22525  *                         movable = False
22526  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
22527  *                         movable = False             # <<<<<<<<<<<<<<
22528  *                 if not movable:
22529  *                     break
22530  */
22531           __pyx_v_movable = 0;
22532           goto __pyx_L70;
22533         }
22534         __pyx_L70:;
22535       }
22536       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22537
22538       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1109
22539  *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
22540  *                         movable = False
22541  *                 if not movable:             # <<<<<<<<<<<<<<
22542  *                     break
22543  *                 ref = ref[:-1]
22544  */
22545       __pyx_t_3 = (!__pyx_v_movable);
22546       if (__pyx_t_3) {
22547
22548         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1110
22549  *                         movable = False
22550  *                 if not movable:
22551  *                     break             # <<<<<<<<<<<<<<
22552  *                 ref = ref[:-1]
22553  *                 alt = [allele[:-1] for allele in alt]
22554  */
22555         goto __pyx_L65_break;
22556         goto __pyx_L71;
22557       }
22558       __pyx_L71:;
22559
22560       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1111
22561  *                 if not movable:
22562  *                     break
22563  *                 ref = ref[:-1]             # <<<<<<<<<<<<<<
22564  *                 alt = [allele[:-1] for allele in alt]
22565  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
22566  */
22567       __pyx_t_2 = PySequence_GetSlice(__pyx_v_ref, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22568       __Pyx_GOTREF(__pyx_t_2);
22569       __Pyx_DECREF(__pyx_v_ref);
22570       __pyx_v_ref = __pyx_t_2;
22571       __pyx_t_2 = 0;
22572
22573       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1112
22574  *                     break
22575  *                 ref = ref[:-1]
22576  *                 alt = [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
22577  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
22578  *                     ref = faref_leftflank[pos-left-1] + ref
22579  */
22580       __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22581       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
22582       if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
22583         __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
22584       } else {
22585         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22586       }
22587       for (;;) {
22588         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
22589         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
22590         __Pyx_DECREF(__pyx_v_allele);
22591         __pyx_v_allele = __pyx_t_4;
22592         __pyx_t_4 = 0;
22593         __pyx_t_4 = 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;}
22594         __Pyx_GOTREF(__pyx_t_4);
22595         if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22596         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22597       }
22598       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22599       __Pyx_INCREF(((PyObject *)__pyx_t_2));
22600       __Pyx_DECREF(((PyObject *)__pyx_v_alt));
22601       __pyx_v_alt = __pyx_t_2;
22602       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
22603
22604       /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1113
22605  *                 ref = ref[:-1]
22606  *                 alt = [allele[:-1] for allele in alt]
22607  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:             # <<<<<<<<<<<<<<
22608  *                     ref = faref_leftflank[pos-left-1] + ref
22609  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
22610  */
22611       __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22612       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
22613       if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
22614         __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
22615       } else {
22616         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22617       }
22618       for (;;) {
22619         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
22620         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
22621         __Pyx_DECREF(__pyx_v_allele);
22622         __pyx_v_allele = __pyx_t_4;
22623         __pyx_t_4 = 0;
22624         __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;}
22625         __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;}
22626         __Pyx_GOTREF(__pyx_t_4);
22627         if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22628         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22629       }
22630       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22631       __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;}
22632       __Pyx_GOTREF(__pyx_t_5);
22633       __Pyx_INCREF(((PyObject *)__pyx_t_2));
22634       PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
22635       __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
22636       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
22637       __pyx_t_2 = PyObject_Call(__pyx_builtin_min, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22638       __Pyx_GOTREF(__pyx_t_2);
22639       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22640       __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __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;}
22641       __Pyx_GOTREF(__pyx_t_5);
22642       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22643       __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;}
22644       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22645       if (!__pyx_t_3) {
22646         __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;}
22647         __pyx_t_16 = (__pyx_t_6 == 0);
22648         __pyx_t_17 = __pyx_t_16;
22649       } else {
22650         __pyx_t_17 = __pyx_t_3;
22651       }
22652       if (__pyx_t_17) {
22653
22654         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1114
22655  *                 alt = [allele[:-1] for allele in alt]
22656  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
22657  *                     ref = faref_leftflank[pos-left-1] + ref             # <<<<<<<<<<<<<<
22658  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
22659  *                     pos -= 1
22660  */
22661         __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;}
22662         __Pyx_GOTREF(__pyx_t_5);
22663         __pyx_t_2 = PyNumber_Subtract(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22664         __Pyx_GOTREF(__pyx_t_2);
22665         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22666         __pyx_t_5 = PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22667         __Pyx_GOTREF(__pyx_t_5);
22668         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22669         __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_v_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22670         __Pyx_GOTREF(__pyx_t_2);
22671         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22672         __Pyx_DECREF(__pyx_v_ref);
22673         __pyx_v_ref = __pyx_t_2;
22674         __pyx_t_2 = 0;
22675
22676         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1115
22677  *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
22678  *                     ref = faref_leftflank[pos-left-1] + ref
22679  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]             # <<<<<<<<<<<<<<
22680  *                     pos -= 1
22681  * 
22682  */
22683         __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22684         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
22685         if (likely(((PyObject *)__pyx_v_alt) != Py_None)) {
22686           __pyx_t_6 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_alt); __Pyx_INCREF(__pyx_t_5);
22687         } else {
22688           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22689         }
22690         for (;;) {
22691           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
22692           __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
22693           __Pyx_DECREF(__pyx_v_allele);
22694           __pyx_v_allele = __pyx_t_4;
22695           __pyx_t_4 = 0;
22696           __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;}
22697           __Pyx_GOTREF(__pyx_t_4);
22698           __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;}
22699           __Pyx_GOTREF(__pyx_t_13);
22700           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22701           __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;}
22702           __Pyx_GOTREF(__pyx_t_4);
22703           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22704           __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;}
22705           __Pyx_GOTREF(__pyx_t_13);
22706           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22707           if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_13))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22708           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22709         }
22710         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22711         __Pyx_INCREF(((PyObject *)__pyx_t_2));
22712         __Pyx_DECREF(((PyObject *)__pyx_v_alt));
22713         __pyx_v_alt = __pyx_t_2;
22714         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
22715
22716         /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1116
22717  *                     ref = faref_leftflank[pos-left-1] + ref
22718  *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
22719  *                     pos -= 1             # <<<<<<<<<<<<<<
22720  * 
22721  * __all__ = [
22722  */
22723         __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22724         __Pyx_GOTREF(__pyx_t_2);
22725         __Pyx_DECREF(__pyx_v_pos);
22726         __pyx_v_pos = __pyx_t_2;
22727         __pyx_t_2 = 0;
22728         goto __pyx_L74;
22729       }
22730       __pyx_L74:;
22731     }
22732     __pyx_L65_break:;
22733     goto __pyx_L63;
22734   }
22735   __pyx_L63:;
22736
22737   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22738   goto __pyx_L0;
22739   __pyx_L1_error:;
22740   __Pyx_XDECREF(__pyx_t_1);
22741   __Pyx_XDECREF(__pyx_t_2);
22742   __Pyx_XDECREF(__pyx_t_4);
22743   __Pyx_XDECREF(__pyx_t_5);
22744   __Pyx_XDECREF(__pyx_t_7);
22745   __Pyx_XDECREF(__pyx_t_10);
22746   __Pyx_XDECREF(__pyx_t_13);
22747   __Pyx_XDECREF(__pyx_t_14);
22748   __Pyx_XDECREF(__pyx_t_15);
22749   __Pyx_XDECREF(__pyx_t_18);
22750   __Pyx_XDECREF(__pyx_t_19);
22751   __Pyx_AddTraceback("cvcf.VCF.validate");
22752   __pyx_r = NULL;
22753   __pyx_L0:;
22754   __Pyx_DECREF(__pyx_v_chrom);
22755   __Pyx_DECREF(__pyx_v_pos);
22756   __Pyx_DECREF(__pyx_v_ref);
22757   __Pyx_DECREF(__pyx_v_c);
22758   __Pyx_DECREF(__pyx_v_left);
22759   __Pyx_DECREF(__pyx_v_faref_leftflank);
22760   __Pyx_DECREF(__pyx_v_faref);
22761   __Pyx_DECREF(__pyx_v_f);
22762   __Pyx_DECREF(__pyx_v_newalts);
22763   __Pyx_DECREF(__pyx_v_a);
22764   __Pyx_DECREF(__pyx_v_l);
22765   __Pyx_DECREF(__pyx_v_addns);
22766   __Pyx_DECREF(__pyx_v_i);
22767   __Pyx_DECREF(__pyx_v_na);
22768   __Pyx_DECREF(__pyx_v_s);
22769   __Pyx_DECREF(__pyx_v_alt);
22770   __Pyx_DECREF(__pyx_v_addn);
22771   __Pyx_DECREF(__pyx_v_allele);
22772   __Pyx_DECREF(__pyx_v_longest);
22773   __Pyx_DECREF(__pyx_v_shortest);
22774   __Pyx_DECREF(__pyx_8genexpr1__pyx_v_allele);
22775   __Pyx_XGIVEREF(__pyx_r);
22776   __Pyx_RefNannyFinishContext();
22777   return __pyx_r;
22778 }
22779 static struct __pyx_vtabstruct_4cvcf_VCFRecord __pyx_vtable_4cvcf_VCFRecord;
22780
22781 static PyObject *__pyx_tp_new_4cvcf_VCFRecord(PyTypeObject *t, PyObject *a, PyObject *k) {
22782   struct __pyx_obj_4cvcf_VCFRecord *p;
22783   PyObject *o = __pyx_ptype_10TabProxies_TupleProxy->tp_new(t, a, k);
22784   if (!o) return 0;
22785   p = ((struct __pyx_obj_4cvcf_VCFRecord *)o);
22786   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10TabProxies_TupleProxy*)__pyx_vtabptr_4cvcf_VCFRecord;
22787   p->vcf = Py_None; Py_INCREF(Py_None);
22788   if (__pyx_pf_4cvcf_9VCFRecord___cinit__(o, a, k) < 0) {
22789     Py_DECREF(o); o = 0;
22790   }
22791   return o;
22792 }
22793
22794 static void __pyx_tp_dealloc_4cvcf_VCFRecord(PyObject *o) {
22795   struct __pyx_obj_4cvcf_VCFRecord *p = (struct __pyx_obj_4cvcf_VCFRecord *)o;
22796   Py_XDECREF(p->vcf);
22797   __pyx_ptype_10TabProxies_TupleProxy->tp_dealloc(o);
22798 }
22799
22800 static int __pyx_tp_traverse_4cvcf_VCFRecord(PyObject *o, visitproc v, void *a) {
22801   int e;
22802   struct __pyx_obj_4cvcf_VCFRecord *p = (struct __pyx_obj_4cvcf_VCFRecord *)o;
22803   if (__pyx_ptype_10TabProxies_TupleProxy->tp_traverse) {
22804     e = __pyx_ptype_10TabProxies_TupleProxy->tp_traverse(o, v, a); if (e) return e;
22805   }
22806   if (p->vcf) {
22807     e = (*v)(p->vcf, a); if (e) return e;
22808   }
22809   return 0;
22810 }
22811
22812 static int __pyx_tp_clear_4cvcf_VCFRecord(PyObject *o) {
22813   struct __pyx_obj_4cvcf_VCFRecord *p = (struct __pyx_obj_4cvcf_VCFRecord *)o;
22814   PyObject* tmp;
22815   if (__pyx_ptype_10TabProxies_TupleProxy->tp_clear) {
22816     __pyx_ptype_10TabProxies_TupleProxy->tp_clear(o);
22817   }
22818   tmp = ((PyObject*)p->vcf);
22819   p->vcf = Py_None; Py_INCREF(Py_None);
22820   Py_XDECREF(tmp);
22821   return 0;
22822 }
22823 static PyObject *__pyx_sq_item_4cvcf_VCFRecord(PyObject *o, Py_ssize_t i) {
22824   PyObject *r;
22825   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22826   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22827   Py_DECREF(x);
22828   return r;
22829 }
22830
22831 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_contig(PyObject *o, void *x) {
22832   return __pyx_pf_4cvcf_9VCFRecord_6contig___get__(o);
22833 }
22834
22835 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_pos(PyObject *o, void *x) {
22836   return __pyx_pf_4cvcf_9VCFRecord_3pos___get__(o);
22837 }
22838
22839 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_id(PyObject *o, void *x) {
22840   return __pyx_pf_4cvcf_9VCFRecord_2id___get__(o);
22841 }
22842
22843 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_ref(PyObject *o, void *x) {
22844   return __pyx_pf_4cvcf_9VCFRecord_3ref___get__(o);
22845 }
22846
22847 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_alt(PyObject *o, void *x) {
22848   return __pyx_pf_4cvcf_9VCFRecord_3alt___get__(o);
22849 }
22850
22851 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_qual(PyObject *o, void *x) {
22852   return __pyx_pf_4cvcf_9VCFRecord_4qual___get__(o);
22853 }
22854
22855 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_filter(PyObject *o, void *x) {
22856   return __pyx_pf_4cvcf_9VCFRecord_6filter___get__(o);
22857 }
22858
22859 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_info(PyObject *o, void *x) {
22860   return __pyx_pf_4cvcf_9VCFRecord_4info___get__(o);
22861 }
22862
22863 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_format(PyObject *o, void *x) {
22864   return __pyx_pf_4cvcf_9VCFRecord_6format___get__(o);
22865 }
22866
22867 static PyObject *__pyx_getprop_4cvcf_9VCFRecord_samples(PyObject *o, void *x) {
22868   return __pyx_pf_4cvcf_9VCFRecord_7samples___get__(o);
22869 }
22870
22871 static PyMethodDef __pyx_methods_4cvcf_VCFRecord[] = {
22872   {0, 0, 0, 0}
22873 };
22874
22875 static struct PyGetSetDef __pyx_getsets_4cvcf_VCFRecord[] = {
22876   {(char *)"contig", __pyx_getprop_4cvcf_9VCFRecord_contig, 0, 0, 0},
22877   {(char *)"pos", __pyx_getprop_4cvcf_9VCFRecord_pos, 0, 0, 0},
22878   {(char *)"id", __pyx_getprop_4cvcf_9VCFRecord_id, 0, 0, 0},
22879   {(char *)"ref", __pyx_getprop_4cvcf_9VCFRecord_ref, 0, 0, 0},
22880   {(char *)"alt", __pyx_getprop_4cvcf_9VCFRecord_alt, 0, 0, 0},
22881   {(char *)"qual", __pyx_getprop_4cvcf_9VCFRecord_qual, 0, 0, 0},
22882   {(char *)"filter", __pyx_getprop_4cvcf_9VCFRecord_filter, 0, 0, 0},
22883   {(char *)"info", __pyx_getprop_4cvcf_9VCFRecord_info, 0, 0, 0},
22884   {(char *)"format", __pyx_getprop_4cvcf_9VCFRecord_format, 0, 0, 0},
22885   {(char *)"samples", __pyx_getprop_4cvcf_9VCFRecord_samples, 0, 0, 0},
22886   {0, 0, 0, 0, 0}
22887 };
22888
22889 static PyNumberMethods __pyx_tp_as_number_VCFRecord = {
22890   0, /*nb_add*/
22891   0, /*nb_subtract*/
22892   0, /*nb_multiply*/
22893   #if PY_MAJOR_VERSION < 3
22894   0, /*nb_divide*/
22895   #endif
22896   0, /*nb_remainder*/
22897   0, /*nb_divmod*/
22898   0, /*nb_power*/
22899   0, /*nb_negative*/
22900   0, /*nb_positive*/
22901   0, /*nb_absolute*/
22902   0, /*nb_nonzero*/
22903   0, /*nb_invert*/
22904   0, /*nb_lshift*/
22905   0, /*nb_rshift*/
22906   0, /*nb_and*/
22907   0, /*nb_xor*/
22908   0, /*nb_or*/
22909   #if PY_MAJOR_VERSION < 3
22910   0, /*nb_coerce*/
22911   #endif
22912   0, /*nb_int*/
22913   #if PY_MAJOR_VERSION < 3
22914   0, /*nb_long*/
22915   #else
22916   0, /*reserved*/
22917   #endif
22918   0, /*nb_float*/
22919   #if PY_MAJOR_VERSION < 3
22920   0, /*nb_oct*/
22921   #endif
22922   #if PY_MAJOR_VERSION < 3
22923   0, /*nb_hex*/
22924   #endif
22925   0, /*nb_inplace_add*/
22926   0, /*nb_inplace_subtract*/
22927   0, /*nb_inplace_multiply*/
22928   #if PY_MAJOR_VERSION < 3
22929   0, /*nb_inplace_divide*/
22930   #endif
22931   0, /*nb_inplace_remainder*/
22932   0, /*nb_inplace_power*/
22933   0, /*nb_inplace_lshift*/
22934   0, /*nb_inplace_rshift*/
22935   0, /*nb_inplace_and*/
22936   0, /*nb_inplace_xor*/
22937   0, /*nb_inplace_or*/
22938   0, /*nb_floor_divide*/
22939   0, /*nb_true_divide*/
22940   0, /*nb_inplace_floor_divide*/
22941   0, /*nb_inplace_true_divide*/
22942   #if PY_VERSION_HEX >= 0x02050000
22943   0, /*nb_index*/
22944   #endif
22945 };
22946
22947 static PySequenceMethods __pyx_tp_as_sequence_VCFRecord = {
22948   __pyx_pf_4cvcf_9VCFRecord___len__, /*sq_length*/
22949   0, /*sq_concat*/
22950   0, /*sq_repeat*/
22951   __pyx_sq_item_4cvcf_VCFRecord, /*sq_item*/
22952   0, /*sq_slice*/
22953   0, /*sq_ass_item*/
22954   0, /*sq_ass_slice*/
22955   0, /*sq_contains*/
22956   0, /*sq_inplace_concat*/
22957   0, /*sq_inplace_repeat*/
22958 };
22959
22960 static PyMappingMethods __pyx_tp_as_mapping_VCFRecord = {
22961   __pyx_pf_4cvcf_9VCFRecord___len__, /*mp_length*/
22962   __pyx_pf_4cvcf_9VCFRecord___getitem__, /*mp_subscript*/
22963   0, /*mp_ass_subscript*/
22964 };
22965
22966 static PyBufferProcs __pyx_tp_as_buffer_VCFRecord = {
22967   #if PY_MAJOR_VERSION < 3
22968   0, /*bf_getreadbuffer*/
22969   #endif
22970   #if PY_MAJOR_VERSION < 3
22971   0, /*bf_getwritebuffer*/
22972   #endif
22973   #if PY_MAJOR_VERSION < 3
22974   0, /*bf_getsegcount*/
22975   #endif
22976   #if PY_MAJOR_VERSION < 3
22977   0, /*bf_getcharbuffer*/
22978   #endif
22979   #if PY_VERSION_HEX >= 0x02060000
22980   0, /*bf_getbuffer*/
22981   #endif
22982   #if PY_VERSION_HEX >= 0x02060000
22983   0, /*bf_releasebuffer*/
22984   #endif
22985 };
22986
22987 PyTypeObject __pyx_type_4cvcf_VCFRecord = {
22988   PyVarObject_HEAD_INIT(0, 0)
22989   __Pyx_NAMESTR("cvcf.VCFRecord"), /*tp_name*/
22990   sizeof(struct __pyx_obj_4cvcf_VCFRecord), /*tp_basicsize*/
22991   0, /*tp_itemsize*/
22992   __pyx_tp_dealloc_4cvcf_VCFRecord, /*tp_dealloc*/
22993   0, /*tp_print*/
22994   0, /*tp_getattr*/
22995   0, /*tp_setattr*/
22996   #if PY_MAJOR_VERSION < 3
22997   0, /*tp_compare*/
22998   #else
22999   0, /*reserved*/
23000   #endif
23001   0, /*tp_repr*/
23002   &__pyx_tp_as_number_VCFRecord, /*tp_as_number*/
23003   &__pyx_tp_as_sequence_VCFRecord, /*tp_as_sequence*/
23004   &__pyx_tp_as_mapping_VCFRecord, /*tp_as_mapping*/
23005   0, /*tp_hash*/
23006   0, /*tp_call*/
23007   0, /*tp_str*/
23008   0, /*tp_getattro*/
23009   0, /*tp_setattro*/
23010   &__pyx_tp_as_buffer_VCFRecord, /*tp_as_buffer*/
23011   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
23012   __Pyx_DOCSTR("vcf record.\n\n    initialized from data and vcf meta \n    "), /*tp_doc*/
23013   __pyx_tp_traverse_4cvcf_VCFRecord, /*tp_traverse*/
23014   __pyx_tp_clear_4cvcf_VCFRecord, /*tp_clear*/
23015   0, /*tp_richcompare*/
23016   0, /*tp_weaklistoffset*/
23017   0, /*tp_iter*/
23018   0, /*tp_iternext*/
23019   __pyx_methods_4cvcf_VCFRecord, /*tp_methods*/
23020   0, /*tp_members*/
23021   __pyx_getsets_4cvcf_VCFRecord, /*tp_getset*/
23022   0, /*tp_base*/
23023   0, /*tp_dict*/
23024   0, /*tp_descr_get*/
23025   0, /*tp_descr_set*/
23026   0, /*tp_dictoffset*/
23027   __pyx_pf_4cvcf_9VCFRecord___init__, /*tp_init*/
23028   0, /*tp_alloc*/
23029   __pyx_tp_new_4cvcf_VCFRecord, /*tp_new*/
23030   0, /*tp_free*/
23031   0, /*tp_is_gc*/
23032   0, /*tp_bases*/
23033   0, /*tp_mro*/
23034   0, /*tp_cache*/
23035   0, /*tp_subclasses*/
23036   0, /*tp_weaklist*/
23037   0, /*tp_del*/
23038   #if PY_VERSION_HEX >= 0x02060000
23039   0, /*tp_version_tag*/
23040   #endif
23041 };
23042
23043 static PyObject *__pyx_tp_new_4cvcf_asVCFRecord(PyTypeObject *t, PyObject *a, PyObject *k) {
23044   struct __pyx_obj_4cvcf_asVCFRecord *p;
23045   PyObject *o = __pyx_ptype_6ctabix_Parser->tp_new(t, a, k);
23046   if (!o) return 0;
23047   p = ((struct __pyx_obj_4cvcf_asVCFRecord *)o);
23048   p->vcffile = Py_None; Py_INCREF(Py_None);
23049   return o;
23050 }
23051
23052 static void __pyx_tp_dealloc_4cvcf_asVCFRecord(PyObject *o) {
23053   struct __pyx_obj_4cvcf_asVCFRecord *p = (struct __pyx_obj_4cvcf_asVCFRecord *)o;
23054   Py_XDECREF(p->vcffile);
23055   __pyx_ptype_6ctabix_Parser->tp_dealloc(o);
23056 }
23057
23058 static int __pyx_tp_traverse_4cvcf_asVCFRecord(PyObject *o, visitproc v, void *a) {
23059   int e;
23060   struct __pyx_obj_4cvcf_asVCFRecord *p = (struct __pyx_obj_4cvcf_asVCFRecord *)o;
23061   if (__pyx_ptype_6ctabix_Parser->tp_traverse) {
23062     e = __pyx_ptype_6ctabix_Parser->tp_traverse(o, v, a); if (e) return e;
23063   }
23064   if (p->vcffile) {
23065     e = (*v)(p->vcffile, a); if (e) return e;
23066   }
23067   return 0;
23068 }
23069
23070 static int __pyx_tp_clear_4cvcf_asVCFRecord(PyObject *o) {
23071   struct __pyx_obj_4cvcf_asVCFRecord *p = (struct __pyx_obj_4cvcf_asVCFRecord *)o;
23072   PyObject* tmp;
23073   if (__pyx_ptype_6ctabix_Parser->tp_clear) {
23074     __pyx_ptype_6ctabix_Parser->tp_clear(o);
23075   }
23076   tmp = ((PyObject*)p->vcffile);
23077   p->vcffile = Py_None; Py_INCREF(Py_None);
23078   Py_XDECREF(tmp);
23079   return 0;
23080 }
23081
23082 static PyMethodDef __pyx_methods_4cvcf_asVCFRecord[] = {
23083   {0, 0, 0, 0}
23084 };
23085
23086 static PyNumberMethods __pyx_tp_as_number_asVCFRecord = {
23087   0, /*nb_add*/
23088   0, /*nb_subtract*/
23089   0, /*nb_multiply*/
23090   #if PY_MAJOR_VERSION < 3
23091   0, /*nb_divide*/
23092   #endif
23093   0, /*nb_remainder*/
23094   0, /*nb_divmod*/
23095   0, /*nb_power*/
23096   0, /*nb_negative*/
23097   0, /*nb_positive*/
23098   0, /*nb_absolute*/
23099   0, /*nb_nonzero*/
23100   0, /*nb_invert*/
23101   0, /*nb_lshift*/
23102   0, /*nb_rshift*/
23103   0, /*nb_and*/
23104   0, /*nb_xor*/
23105   0, /*nb_or*/
23106   #if PY_MAJOR_VERSION < 3
23107   0, /*nb_coerce*/
23108   #endif
23109   0, /*nb_int*/
23110   #if PY_MAJOR_VERSION < 3
23111   0, /*nb_long*/
23112   #else
23113   0, /*reserved*/
23114   #endif
23115   0, /*nb_float*/
23116   #if PY_MAJOR_VERSION < 3
23117   0, /*nb_oct*/
23118   #endif
23119   #if PY_MAJOR_VERSION < 3
23120   0, /*nb_hex*/
23121   #endif
23122   0, /*nb_inplace_add*/
23123   0, /*nb_inplace_subtract*/
23124   0, /*nb_inplace_multiply*/
23125   #if PY_MAJOR_VERSION < 3
23126   0, /*nb_inplace_divide*/
23127   #endif
23128   0, /*nb_inplace_remainder*/
23129   0, /*nb_inplace_power*/
23130   0, /*nb_inplace_lshift*/
23131   0, /*nb_inplace_rshift*/
23132   0, /*nb_inplace_and*/
23133   0, /*nb_inplace_xor*/
23134   0, /*nb_inplace_or*/
23135   0, /*nb_floor_divide*/
23136   0, /*nb_true_divide*/
23137   0, /*nb_inplace_floor_divide*/
23138   0, /*nb_inplace_true_divide*/
23139   #if PY_VERSION_HEX >= 0x02050000
23140   0, /*nb_index*/
23141   #endif
23142 };
23143
23144 static PySequenceMethods __pyx_tp_as_sequence_asVCFRecord = {
23145   0, /*sq_length*/
23146   0, /*sq_concat*/
23147   0, /*sq_repeat*/
23148   0, /*sq_item*/
23149   0, /*sq_slice*/
23150   0, /*sq_ass_item*/
23151   0, /*sq_ass_slice*/
23152   0, /*sq_contains*/
23153   0, /*sq_inplace_concat*/
23154   0, /*sq_inplace_repeat*/
23155 };
23156
23157 static PyMappingMethods __pyx_tp_as_mapping_asVCFRecord = {
23158   0, /*mp_length*/
23159   0, /*mp_subscript*/
23160   0, /*mp_ass_subscript*/
23161 };
23162
23163 static PyBufferProcs __pyx_tp_as_buffer_asVCFRecord = {
23164   #if PY_MAJOR_VERSION < 3
23165   0, /*bf_getreadbuffer*/
23166   #endif
23167   #if PY_MAJOR_VERSION < 3
23168   0, /*bf_getwritebuffer*/
23169   #endif
23170   #if PY_MAJOR_VERSION < 3
23171   0, /*bf_getsegcount*/
23172   #endif
23173   #if PY_MAJOR_VERSION < 3
23174   0, /*bf_getcharbuffer*/
23175   #endif
23176   #if PY_VERSION_HEX >= 0x02060000
23177   0, /*bf_getbuffer*/
23178   #endif
23179   #if PY_VERSION_HEX >= 0x02060000
23180   0, /*bf_releasebuffer*/
23181   #endif
23182 };
23183
23184 PyTypeObject __pyx_type_4cvcf_asVCFRecord = {
23185   PyVarObject_HEAD_INIT(0, 0)
23186   __Pyx_NAMESTR("cvcf.asVCFRecord"), /*tp_name*/
23187   sizeof(struct __pyx_obj_4cvcf_asVCFRecord), /*tp_basicsize*/
23188   0, /*tp_itemsize*/
23189   __pyx_tp_dealloc_4cvcf_asVCFRecord, /*tp_dealloc*/
23190   0, /*tp_print*/
23191   0, /*tp_getattr*/
23192   0, /*tp_setattr*/
23193   #if PY_MAJOR_VERSION < 3
23194   0, /*tp_compare*/
23195   #else
23196   0, /*reserved*/
23197   #endif
23198   0, /*tp_repr*/
23199   &__pyx_tp_as_number_asVCFRecord, /*tp_as_number*/
23200   &__pyx_tp_as_sequence_asVCFRecord, /*tp_as_sequence*/
23201   &__pyx_tp_as_mapping_asVCFRecord, /*tp_as_mapping*/
23202   0, /*tp_hash*/
23203   __pyx_pf_4cvcf_11asVCFRecord___call__, /*tp_call*/
23204   0, /*tp_str*/
23205   0, /*tp_getattro*/
23206   0, /*tp_setattro*/
23207   &__pyx_tp_as_buffer_asVCFRecord, /*tp_as_buffer*/
23208   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
23209   __Pyx_DOCSTR("converts a :term:`tabix row` into a VCF record."), /*tp_doc*/
23210   __pyx_tp_traverse_4cvcf_asVCFRecord, /*tp_traverse*/
23211   __pyx_tp_clear_4cvcf_asVCFRecord, /*tp_clear*/
23212   0, /*tp_richcompare*/
23213   0, /*tp_weaklistoffset*/
23214   0, /*tp_iter*/
23215   0, /*tp_iternext*/
23216   __pyx_methods_4cvcf_asVCFRecord, /*tp_methods*/
23217   0, /*tp_members*/
23218   0, /*tp_getset*/
23219   0, /*tp_base*/
23220   0, /*tp_dict*/
23221   0, /*tp_descr_get*/
23222   0, /*tp_descr_set*/
23223   0, /*tp_dictoffset*/
23224   __pyx_pf_4cvcf_11asVCFRecord___init__, /*tp_init*/
23225   0, /*tp_alloc*/
23226   __pyx_tp_new_4cvcf_asVCFRecord, /*tp_new*/
23227   0, /*tp_free*/
23228   0, /*tp_is_gc*/
23229   0, /*tp_bases*/
23230   0, /*tp_mro*/
23231   0, /*tp_cache*/
23232   0, /*tp_subclasses*/
23233   0, /*tp_weaklist*/
23234   0, /*tp_del*/
23235   #if PY_VERSION_HEX >= 0x02060000
23236   0, /*tp_version_tag*/
23237   #endif
23238 };
23239
23240 static PyMethodDef __pyx_methods[] = {
23241   {__Pyx_NAMESTR("get_sequence"), (PyCFunction)__pyx_pf_4cvcf_get_sequence, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
23242   {__Pyx_NAMESTR("parse_regions"), (PyCFunction)__pyx_pf_4cvcf_parse_regions, METH_O, __Pyx_DOCSTR(0)},
23243   {0, 0, 0, 0}
23244 };
23245
23246 #if PY_MAJOR_VERSION >= 3
23247 static struct PyModuleDef __pyx_moduledef = {
23248     PyModuleDef_HEAD_INIT,
23249     __Pyx_NAMESTR("cvcf"),
23250     0, /* m_doc */
23251     -1, /* m_size */
23252     __pyx_methods /* m_methods */,
23253     NULL, /* m_reload */
23254     NULL, /* m_traverse */
23255     NULL, /* m_clear */
23256     NULL /* m_free */
23257 };
23258 #endif
23259
23260 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23261   {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
23262   {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
23263   {&__pyx_kp_s_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 1, 0},
23264   {&__pyx_kp_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 0},
23265   {&__pyx_kp_s_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 1, 0},
23266   {&__pyx_kp_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 0},
23267   {&__pyx_kp_s_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 1, 0},
23268   {&__pyx_kp_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 0},
23269   {&__pyx_kp_s_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 1, 0},
23270   {&__pyx_kp_u_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 1, 0, 0},
23271   {&__pyx_kp_u_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 1, 0, 0},
23272   {&__pyx_kp_u_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 1, 0, 0},
23273   {&__pyx_n_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 1},
23274   {&__pyx_kp_u_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 1, 0, 0},
23275   {&__pyx_kp_u_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 1, 0, 0},
23276   {&__pyx_kp_u_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 1, 0, 0},
23277   {&__pyx_kp_u_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 1, 0, 0},
23278   {&__pyx_kp_u_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 1, 0, 0},
23279   {&__pyx_kp_u_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 1, 0, 0},
23280   {&__pyx_kp_u_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 1, 0, 0},
23281   {&__pyx_kp_u_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 1, 0, 0},
23282   {&__pyx_kp_u_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 1, 0, 0},
23283   {&__pyx_kp_u_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 1, 0, 0},
23284   {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
23285   {&__pyx_kp_u_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 1, 0, 0},
23286   {&__pyx_kp_u_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 1, 0, 0},
23287   {&__pyx_kp_u_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 1, 0, 0},
23288   {&__pyx_kp_u_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 1, 0, 0},
23289   {&__pyx_kp_u_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 1, 0, 0},
23290   {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
23291   {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
23292   {&__pyx_n_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 1},
23293   {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
23294   {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
23295   {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
23296   {&__pyx_n_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 1},
23297   {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1},
23298   {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
23299   {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
23300   {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
23301   {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
23302   {&__pyx_n_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 1},
23303   {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
23304   {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
23305   {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
23306   {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
23307   {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
23308   {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
23309   {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
23310   {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
23311   {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
23312   {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
23313   {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
23314   {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
23315   {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
23316   {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
23317   {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
23318   {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
23319   {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
23320   {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
23321   {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
23322   {&__pyx_n_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 1},
23323   {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
23324   {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
23325   {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
23326   {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0},
23327   {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0},
23328   {&__pyx_n_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 1},
23329   {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0},
23330   {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0},
23331   {&__pyx_n_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 1},
23332   {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
23333   {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 0},
23334   {&__pyx_n_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 1},
23335   {&__pyx_n_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 1},
23336   {&__pyx_kp_b_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 0, 0},
23337   {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
23338   {&__pyx_n_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 1},
23339   {&__pyx_n_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 1},
23340   {&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
23341   {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
23342   {&__pyx_n_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 1},
23343   {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
23344   {&__pyx_n_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 1},
23345   {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
23346   {&__pyx_n_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 1},
23347   {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
23348   {&__pyx_kp_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 0},
23349   {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
23350   {&__pyx_kp_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 0},
23351   {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0},
23352   {&__pyx_kp_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 0},
23353   {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
23354   {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0},
23355   {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
23356   {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0},
23357   {&__pyx_kp_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 0},
23358   {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
23359   {&__pyx_kp_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 0},
23360   {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
23361   {&__pyx_kp_s_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 1, 0},
23362   {&__pyx_kp_s_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 1, 0},
23363   {&__pyx_kp_s_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 0, 1, 0},
23364   {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0},
23365   {&__pyx_kp_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 0},
23366   {&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0},
23367   {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0},
23368   {&__pyx_kp_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 0},
23369   {&__pyx_n_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 1},
23370   {&__pyx_kp_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 0},
23371   {&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0},
23372   {&__pyx_kp_s_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 1, 0},
23373   {&__pyx_kp_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 0},
23374   {&__pyx_kp_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 0},
23375   {&__pyx_kp_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 0},
23376   {&__pyx_kp_s_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 1, 0},
23377   {&__pyx_kp_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 0},
23378   {&__pyx_kp_s_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 1, 0},
23379   {&__pyx_kp_s_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 1, 0},
23380   {&__pyx_kp_s__0, __pyx_k__0, sizeof(__pyx_k__0), 0, 0, 1, 0},
23381   {&__pyx_n_s__ACGTN, __pyx_k__ACGTN, sizeof(__pyx_k__ACGTN), 0, 0, 1, 1},
23382   {&__pyx_n_s__ALT, __pyx_k__ALT, sizeof(__pyx_k__ALT), 0, 0, 1, 1},
23383   {&__pyx_n_s__BAD_GENOTYPE, __pyx_k__BAD_GENOTYPE, sizeof(__pyx_k__BAD_GENOTYPE), 0, 0, 1, 1},
23384   {&__pyx_n_s__CHROM, __pyx_k__CHROM, sizeof(__pyx_k__CHROM), 0, 0, 1, 1},
23385   {&__pyx_n_s__Character, __pyx_k__Character, sizeof(__pyx_k__Character), 0, 0, 1, 1},
23386   {&__pyx_n_s__D, __pyx_k__D, sizeof(__pyx_k__D), 0, 0, 1, 1},
23387   {&__pyx_n_s__DP, __pyx_k__DP, sizeof(__pyx_k__DP), 0, 0, 1, 1},
23388   {&__pyx_n_s__Description, __pyx_k__Description, sizeof(__pyx_k__Description), 0, 0, 1, 1},
23389   {&__pyx_n_s__ERROR_INFO_STRING, __pyx_k__ERROR_INFO_STRING, sizeof(__pyx_k__ERROR_INFO_STRING), 0, 0, 1, 1},
23390   {&__pyx_n_s__ERROR_TRAILING_DATA, __pyx_k__ERROR_TRAILING_DATA, sizeof(__pyx_k__ERROR_TRAILING_DATA), 0, 0, 1, 1},
23391   {&__pyx_n_s__ERROR_UNKNOWN_KEY, __pyx_k__ERROR_UNKNOWN_KEY, sizeof(__pyx_k__ERROR_UNKNOWN_KEY), 0, 0, 1, 1},
23392   {&__pyx_n_s__Error, __pyx_k__Error, sizeof(__pyx_k__Error), 0, 0, 1, 1},
23393   {&__pyx_n_s__FILTER, __pyx_k__FILTER, sizeof(__pyx_k__FILTER), 0, 0, 1, 1},
23394   {&__pyx_n_s__FILTER_NOT_DEFINED, __pyx_k__FILTER_NOT_DEFINED, sizeof(__pyx_k__FILTER_NOT_DEFINED), 0, 0, 1, 1},
23395   {&__pyx_n_s__FORMAT, __pyx_k__FORMAT, sizeof(__pyx_k__FORMAT), 0, 0, 1, 1},
23396   {&__pyx_n_s__FORMAT_NOT_DEFINED, __pyx_k__FORMAT_NOT_DEFINED, sizeof(__pyx_k__FORMAT_NOT_DEFINED), 0, 0, 1, 1},
23397   {&__pyx_n_s__FT, __pyx_k__FT, sizeof(__pyx_k__FT), 0, 0, 1, 1},
23398   {&__pyx_n_s__Flag, __pyx_k__Flag, sizeof(__pyx_k__Flag), 0, 0, 1, 1},
23399   {&__pyx_n_s__Float, __pyx_k__Float, sizeof(__pyx_k__Float), 0, 0, 1, 1},
23400   {&__pyx_n_s__GQ, __pyx_k__GQ, sizeof(__pyx_k__GQ), 0, 0, 1, 1},
23401   {&__pyx_n_s__GT, __pyx_k__GT, sizeof(__pyx_k__GT), 0, 0, 1, 1},
23402   {&__pyx_n_s__GTdata, __pyx_k__GTdata, sizeof(__pyx_k__GTdata), 0, 0, 1, 1},
23403   {&__pyx_n_s__GTstring, __pyx_k__GTstring, sizeof(__pyx_k__GTstring), 0, 0, 1, 1},
23404   {&__pyx_n_s__Genotype, __pyx_k__Genotype, sizeof(__pyx_k__Genotype), 0, 0, 1, 1},
23405   {&__pyx_n_s__HQ, __pyx_k__HQ, sizeof(__pyx_k__HQ), 0, 0, 1, 1},
23406   {&__pyx_n_s__I, __pyx_k__I, sizeof(__pyx_k__I), 0, 0, 1, 1},
23407   {&__pyx_n_s__ID, __pyx_k__ID, sizeof(__pyx_k__ID), 0, 0, 1, 1},
23408   {&__pyx_n_s__INFO, __pyx_k__INFO, sizeof(__pyx_k__INFO), 0, 0, 1, 1},
23409   {&__pyx_n_s__Integer, __pyx_k__Integer, sizeof(__pyx_k__Integer), 0, 0, 1, 1},
23410   {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
23411   {&__pyx_n_s__MISSING_REF, __pyx_k__MISSING_REF, sizeof(__pyx_k__MISSING_REF), 0, 0, 1, 1},
23412   {&__pyx_n_s__N, __pyx_k__N, sizeof(__pyx_k__N), 0, 0, 1, 1},
23413   {&__pyx_n_s__NT_ALLELES, __pyx_k__NT_ALLELES, sizeof(__pyx_k__NT_ALLELES), 0, 0, 1, 1},
23414   {&__pyx_n_s__NT_GENOTYPES, __pyx_k__NT_GENOTYPES, sizeof(__pyx_k__NT_GENOTYPES), 0, 0, 1, 1},
23415   {&__pyx_n_s__NT_NR_ALLELES, __pyx_k__NT_NR_ALLELES, sizeof(__pyx_k__NT_NR_ALLELES), 0, 0, 1, 1},
23416   {&__pyx_n_s__NT_NUMBER, __pyx_k__NT_NUMBER, sizeof(__pyx_k__NT_NUMBER), 0, 0, 1, 1},
23417   {&__pyx_n_s__NT_PHASED_GENOTYPES, __pyx_k__NT_PHASED_GENOTYPES, sizeof(__pyx_k__NT_PHASED_GENOTYPES), 0, 0, 1, 1},
23418   {&__pyx_n_s__NT_UNKNOWN, __pyx_k__NT_UNKNOWN, sizeof(__pyx_k__NT_UNKNOWN), 0, 0, 1, 1},
23419   {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
23420   {&__pyx_n_s__Number, __pyx_k__Number, sizeof(__pyx_k__Number), 0, 0, 1, 1},
23421   {&__pyx_n_s__PASS, __pyx_k__PASS, sizeof(__pyx_k__PASS), 0, 0, 1, 1},
23422   {&__pyx_n_s__POS, __pyx_k__POS, sizeof(__pyx_k__POS), 0, 0, 1, 1},
23423   {&__pyx_n_s__POS_NOT_NUMERICAL, __pyx_k__POS_NOT_NUMERICAL, sizeof(__pyx_k__POS_NOT_NUMERICAL), 0, 0, 1, 1},
23424   {&__pyx_n_s__POS_NOT_POSITIVE, __pyx_k__POS_NOT_POSITIVE, sizeof(__pyx_k__POS_NOT_POSITIVE), 0, 0, 1, 1},
23425   {&__pyx_n_s__QUAL, __pyx_k__QUAL, sizeof(__pyx_k__QUAL), 0, 0, 1, 1},
23426   {&__pyx_n_s__QUAL_NOT_NUMERICAL, __pyx_k__QUAL_NOT_NUMERICAL, sizeof(__pyx_k__QUAL_NOT_NUMERICAL), 0, 0, 1, 1},
23427   {&__pyx_n_s__REF, __pyx_k__REF, sizeof(__pyx_k__REF), 0, 0, 1, 1},
23428   {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
23429   {&__pyx_n_s__String, __pyx_k__String, sizeof(__pyx_k__String), 0, 0, 1, 1},
23430   {&__pyx_n_s__Tabixfile, __pyx_k__Tabixfile, sizeof(__pyx_k__Tabixfile), 0, 0, 1, 1},
23431   {&__pyx_n_s__Type, __pyx_k__Type, sizeof(__pyx_k__Type), 0, 0, 1, 1},
23432   {&__pyx_n_s__UNKNOWN_CHAR_IN_REF, __pyx_k__UNKNOWN_CHAR_IN_REF, sizeof(__pyx_k__UNKNOWN_CHAR_IN_REF), 0, 0, 1, 1},
23433   {&__pyx_n_s__V33_BAD_ALLELE, __pyx_k__V33_BAD_ALLELE, sizeof(__pyx_k__V33_BAD_ALLELE), 0, 0, 1, 1},
23434   {&__pyx_n_s__V33_BAD_REF, __pyx_k__V33_BAD_REF, sizeof(__pyx_k__V33_BAD_REF), 0, 0, 1, 1},
23435   {&__pyx_n_s__V40_BAD_ALLELE, __pyx_k__V40_BAD_ALLELE, sizeof(__pyx_k__V40_BAD_ALLELE), 0, 0, 1, 1},
23436   {&__pyx_n_s__VCF, __pyx_k__VCF, sizeof(__pyx_k__VCF), 0, 0, 1, 1},
23437   {&__pyx_n_s__VCFRecord, __pyx_k__VCFRecord, sizeof(__pyx_k__VCFRecord), 0, 0, 1, 1},
23438   {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
23439   {&__pyx_n_s__WRONG_REF, __pyx_k__WRONG_REF, sizeof(__pyx_k__WRONG_REF), 0, 0, 1, 1},
23440   {&__pyx_n_s__Warning, __pyx_k__Warning, sizeof(__pyx_k__Warning), 0, 0, 1, 1},
23441   {&__pyx_n_s__ZERO_LENGTH_ALLELE, __pyx_k__ZERO_LENGTH_ALLELE, sizeof(__pyx_k__ZERO_LENGTH_ALLELE), 0, 0, 1, 1},
23442   {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
23443   {&__pyx_n_s____dict__, __pyx_k____dict__, sizeof(__pyx_k____dict__), 0, 0, 1, 1},
23444   {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
23445   {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
23446   {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
23447   {&__pyx_n_s___add_definition, __pyx_k___add_definition, sizeof(__pyx_k___add_definition), 0, 0, 1, 1},
23448   {&__pyx_n_s___copy, __pyx_k___copy, sizeof(__pyx_k___copy), 0, 0, 1, 1},
23449   {&__pyx_n_s___errors, __pyx_k___errors, sizeof(__pyx_k___errors), 0, 0, 1, 1},
23450   {&__pyx_n_s___filter, __pyx_k___filter, sizeof(__pyx_k___filter), 0, 0, 1, 1},
23451   {&__pyx_n_s___format, __pyx_k___format, sizeof(__pyx_k___format), 0, 0, 1, 1},
23452   {&__pyx_n_s___header, __pyx_k___header, sizeof(__pyx_k___header), 0, 0, 1, 1},
23453   {&__pyx_n_s___ignored_errors, __pyx_k___ignored_errors, sizeof(__pyx_k___ignored_errors), 0, 0, 1, 1},
23454   {&__pyx_n_s___info, __pyx_k___info, sizeof(__pyx_k___info), 0, 0, 1, 1},
23455   {&__pyx_n_s___leftalign, __pyx_k___leftalign, sizeof(__pyx_k___leftalign), 0, 0, 1, 1},
23456   {&__pyx_n_s___line, __pyx_k___line, sizeof(__pyx_k___line), 0, 0, 1, 1},
23457   {&__pyx_n_s___lineno, __pyx_k___lineno, sizeof(__pyx_k___lineno), 0, 0, 1, 1},
23458   {&__pyx_n_s___lines, __pyx_k___lines, sizeof(__pyx_k___lines), 0, 0, 1, 1},
23459   {&__pyx_n_s___parse, __pyx_k___parse, sizeof(__pyx_k___parse), 0, 0, 1, 1},
23460   {&__pyx_n_s___parse_header, __pyx_k___parse_header, sizeof(__pyx_k___parse_header), 0, 0, 1, 1},
23461   {&__pyx_n_s___reference, __pyx_k___reference, sizeof(__pyx_k___reference), 0, 0, 1, 1},
23462   {&__pyx_n_s___regions, __pyx_k___regions, sizeof(__pyx_k___regions), 0, 0, 1, 1},
23463   {&__pyx_n_s___required, __pyx_k___required, sizeof(__pyx_k___required), 0, 0, 1, 1},
23464   {&__pyx_n_s___sample2column, __pyx_k___sample2column, sizeof(__pyx_k___sample2column), 0, 0, 1, 1},
23465   {&__pyx_n_s___samples, __pyx_k___samples, sizeof(__pyx_k___samples), 0, 0, 1, 1},
23466   {&__pyx_n_s___version, __pyx_k___version, sizeof(__pyx_k___version), 0, 0, 1, 1},
23467   {&__pyx_n_s___warn_errors, __pyx_k___warn_errors, sizeof(__pyx_k___warn_errors), 0, 0, 1, 1},
23468   {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1},
23469   {&__pyx_n_s__alleleRegEx, __pyx_k__alleleRegEx, sizeof(__pyx_k__alleleRegEx), 0, 0, 1, 1},
23470   {&__pyx_n_s__alt, __pyx_k__alt, sizeof(__pyx_k__alt), 0, 0, 1, 1},
23471   {&__pyx_n_s__alt1, __pyx_k__alt1, sizeof(__pyx_k__alt1), 0, 0, 1, 1},
23472   {&__pyx_n_s__alt2, __pyx_k__alt2, sizeof(__pyx_k__alt2), 0, 0, 1, 1},
23473   {&__pyx_n_s__bisect, __pyx_k__bisect, sizeof(__pyx_k__bisect), 0, 0, 1, 1},
23474   {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1},
23475   {&__pyx_n_s__chrom, __pyx_k__chrom, sizeof(__pyx_k__chrom), 0, 0, 1, 1},
23476   {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1},
23477   {&__pyx_n_s__compare_calls, __pyx_k__compare_calls, sizeof(__pyx_k__compare_calls), 0, 0, 1, 1},
23478   {&__pyx_n_s__compile, __pyx_k__compile, sizeof(__pyx_k__compile), 0, 0, 1, 1},
23479   {&__pyx_n_s__connect, __pyx_k__connect, sizeof(__pyx_k__connect), 0, 0, 1, 1},
23480   {&__pyx_n_s__contig, __pyx_k__contig, sizeof(__pyx_k__contig), 0, 0, 1, 1},
23481   {&__pyx_n_s__convertGT, __pyx_k__convertGT, sizeof(__pyx_k__convertGT), 0, 0, 1, 1},
23482   {&__pyx_n_s__convertGTback, __pyx_k__convertGTback, sizeof(__pyx_k__convertGTback), 0, 0, 1, 1},
23483   {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1},
23484   {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
23485   {&__pyx_n_s__datagenerator, __pyx_k__datagenerator, sizeof(__pyx_k__datagenerator), 0, 0, 1, 1},
23486   {&__pyx_n_s__deepcopy, __pyx_k__deepcopy, sizeof(__pyx_k__deepcopy), 0, 0, 1, 1},
23487   {&__pyx_n_s__defaultdict, __pyx_k__defaultdict, sizeof(__pyx_k__defaultdict), 0, 0, 1, 1},
23488   {&__pyx_n_s__descr, __pyx_k__descr, sizeof(__pyx_k__descr), 0, 0, 1, 1},
23489   {&__pyx_n_s__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
23490   {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
23491   {&__pyx_n_s__endswith, __pyx_k__endswith, sizeof(__pyx_k__endswith), 0, 0, 1, 1},
23492   {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
23493   {&__pyx_n_s__error, __pyx_k__error, sizeof(__pyx_k__error), 0, 0, 1, 1},
23494   {&__pyx_n_s__errorstring, __pyx_k__errorstring, sizeof(__pyx_k__errorstring), 0, 0, 1, 1},
23495   {&__pyx_n_s__fa, __pyx_k__fa, sizeof(__pyx_k__fa), 0, 0, 1, 1},
23496   {&__pyx_n_s__fetch, __pyx_k__fetch, sizeof(__pyx_k__fetch), 0, 0, 1, 1},
23497   {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
23498   {&__pyx_n_s__fileformat, __pyx_k__fileformat, sizeof(__pyx_k__fileformat), 0, 0, 1, 1},
23499   {&__pyx_n_s__filename, __pyx_k__filename, sizeof(__pyx_k__filename), 0, 0, 1, 1},
23500   {&__pyx_n_s__filter, __pyx_k__filter, sizeof(__pyx_k__filter), 0, 0, 1, 1},
23501   {&__pyx_n_s__find, __pyx_k__find, sizeof(__pyx_k__find), 0, 0, 1, 1},
23502   {&__pyx_n_s__fmt, __pyx_k__fmt, sizeof(__pyx_k__fmt), 0, 0, 1, 1},
23503   {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
23504   {&__pyx_n_s__format_format, __pyx_k__format_format, sizeof(__pyx_k__format_format), 0, 0, 1, 1},
23505   {&__pyx_n_s__format_formatdata, __pyx_k__format_formatdata, sizeof(__pyx_k__format_formatdata), 0, 0, 1, 1},
23506   {&__pyx_n_s__formatdict, __pyx_k__formatdict, sizeof(__pyx_k__formatdict), 0, 0, 1, 1},
23507   {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
23508   {&__pyx_n_s__get_expected, __pyx_k__get_expected, sizeof(__pyx_k__get_expected), 0, 0, 1, 1},
23509   {&__pyx_n_s__get_sequence, __pyx_k__get_sequence, sizeof(__pyx_k__get_sequence), 0, 0, 1, 1},
23510   {&__pyx_n_s__getfilter, __pyx_k__getfilter, sizeof(__pyx_k__getfilter), 0, 0, 1, 1},
23511   {&__pyx_n_s__getformat, __pyx_k__getformat, sizeof(__pyx_k__getformat), 0, 0, 1, 1},
23512   {&__pyx_n_s__getheader, __pyx_k__getheader, sizeof(__pyx_k__getheader), 0, 0, 1, 1},
23513   {&__pyx_n_s__getinfo, __pyx_k__getinfo, sizeof(__pyx_k__getinfo), 0, 0, 1, 1},
23514   {&__pyx_n_s__getsamples, __pyx_k__getsamples, sizeof(__pyx_k__getsamples), 0, 0, 1, 1},
23515   {&__pyx_n_s__gtsRegEx, __pyx_k__gtsRegEx, sizeof(__pyx_k__gtsRegEx), 0, 0, 1, 1},
23516   {&__pyx_n_s__header, __pyx_k__header, sizeof(__pyx_k__header), 0, 0, 1, 1},
23517   {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
23518   {&__pyx_n_s__ignoreerror, __pyx_k__ignoreerror, sizeof(__pyx_k__ignoreerror), 0, 0, 1, 1},
23519   {&__pyx_n_s__info, __pyx_k__info, sizeof(__pyx_k__info), 0, 0, 1, 1},
23520   {&__pyx_n_s__inregion, __pyx_k__inregion, sizeof(__pyx_k__inregion), 0, 0, 1, 1},
23521   {&__pyx_n_s__itemgetter, __pyx_k__itemgetter, sizeof(__pyx_k__itemgetter), 0, 0, 1, 1},
23522   {&__pyx_n_s__itervalues, __pyx_k__itervalues, sizeof(__pyx_k__itervalues), 0, 0, 1, 1},
23523   {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
23524   {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
23525   {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
23526   {&__pyx_n_s__leftalign, __pyx_k__leftalign, sizeof(__pyx_k__leftalign), 0, 0, 1, 1},
23527   {&__pyx_n_s__len, __pyx_k__len, sizeof(__pyx_k__len), 0, 0, 1, 1},
23528   {&__pyx_n_s__line, __pyx_k__line, sizeof(__pyx_k__line), 0, 0, 1, 1},
23529   {&__pyx_n_s__lineparse, __pyx_k__lineparse, sizeof(__pyx_k__lineparse), 0, 0, 1, 1},
23530   {&__pyx_n_s__lines, __pyx_k__lines, sizeof(__pyx_k__lines), 0, 0, 1, 1},
23531   {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1},
23532   {&__pyx_n_s__match, __pyx_k__match, sizeof(__pyx_k__match), 0, 0, 1, 1},
23533   {&__pyx_n_s__min, __pyx_k__min, sizeof(__pyx_k__min), 0, 0, 1, 1},
23534   {&__pyx_n_s__missing, __pyx_k__missing, sizeof(__pyx_k__missing), 0, 0, 1, 1},
23535   {&__pyx_n_s__missingvalue, __pyx_k__missingvalue, sizeof(__pyx_k__missingvalue), 0, 0, 1, 1},
23536   {&__pyx_n_s__namedtuple, __pyx_k__namedtuple, sizeof(__pyx_k__namedtuple), 0, 0, 1, 1},
23537   {&__pyx_n_s__nfields, __pyx_k__nfields, sizeof(__pyx_k__nfields), 0, 0, 1, 1},
23538   {&__pyx_n_s__number, __pyx_k__number, sizeof(__pyx_k__number), 0, 0, 1, 1},
23539   {&__pyx_n_s__numbertype, __pyx_k__numbertype, sizeof(__pyx_k__numbertype), 0, 0, 1, 1},
23540   {&__pyx_n_s__object, __pyx_k__object, sizeof(__pyx_k__object), 0, 0, 1, 1},
23541   {&__pyx_n_s__offset, __pyx_k__offset, sizeof(__pyx_k__offset), 0, 0, 1, 1},
23542   {&__pyx_n_s__operator, __pyx_k__operator, sizeof(__pyx_k__operator), 0, 0, 1, 1},
23543   {&__pyx_n_s__opt, __pyx_k__opt, sizeof(__pyx_k__opt), 0, 0, 1, 1},
23544   {&__pyx_n_s__parse, __pyx_k__parse, sizeof(__pyx_k__parse), 0, 0, 1, 1},
23545   {&__pyx_n_s__parse_data, __pyx_k__parse_data, sizeof(__pyx_k__parse_data), 0, 0, 1, 1},
23546   {&__pyx_n_s__parse_format, __pyx_k__parse_format, sizeof(__pyx_k__parse_format), 0, 0, 1, 1},
23547   {&__pyx_n_s__parse_formatdata, __pyx_k__parse_formatdata, sizeof(__pyx_k__parse_formatdata), 0, 0, 1, 1},
23548   {&__pyx_n_s__parse_header, __pyx_k__parse_header, sizeof(__pyx_k__parse_header), 0, 0, 1, 1},
23549   {&__pyx_n_s__parse_heading, __pyx_k__parse_heading, sizeof(__pyx_k__parse_heading), 0, 0, 1, 1},
23550   {&__pyx_n_s__parser, __pyx_k__parser, sizeof(__pyx_k__parser), 0, 0, 1, 1},
23551   {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1},
23552   {&__pyx_n_s__pos1, __pyx_k__pos1, sizeof(__pyx_k__pos1), 0, 0, 1, 1},
23553   {&__pyx_n_s__pos2, __pyx_k__pos2, sizeof(__pyx_k__pos2), 0, 0, 1, 1},
23554   {&__pyx_n_s__pysam, __pyx_k__pysam, sizeof(__pyx_k__pysam), 0, 0, 1, 1},
23555   {&__pyx_n_s__qual, __pyx_k__qual, sizeof(__pyx_k__qual), 0, 0, 1, 1},
23556   {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
23557   {&__pyx_n_s__re, __pyx_k__re, sizeof(__pyx_k__re), 0, 0, 1, 1},
23558   {&__pyx_n_s__record, __pyx_k__record, sizeof(__pyx_k__record), 0, 0, 1, 1},
23559   {&__pyx_n_s__ref, __pyx_k__ref, sizeof(__pyx_k__ref), 0, 0, 1, 1},
23560   {&__pyx_n_s__ref1, __pyx_k__ref1, sizeof(__pyx_k__ref1), 0, 0, 1, 1},
23561   {&__pyx_n_s__ref2, __pyx_k__ref2, sizeof(__pyx_k__ref2), 0, 0, 1, 1},
23562   {&__pyx_n_s__reference, __pyx_k__reference, sizeof(__pyx_k__reference), 0, 0, 1, 1},
23563   {&__pyx_n_s__region, __pyx_k__region, sizeof(__pyx_k__region), 0, 0, 1, 1},
23564   {&__pyx_n_s__regions, __pyx_k__regions, sizeof(__pyx_k__regions), 0, 0, 1, 1},
23565   {&__pyx_n_s__replace, __pyx_k__replace, sizeof(__pyx_k__replace), 0, 0, 1, 1},
23566   {&__pyx_n_s__samples, __pyx_k__samples, sizeof(__pyx_k__samples), 0, 0, 1, 1},
23567   {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
23568   {&__pyx_n_s__separator, __pyx_k__separator, sizeof(__pyx_k__separator), 0, 0, 1, 1},
23569   {&__pyx_n_s__setfilter, __pyx_k__setfilter, sizeof(__pyx_k__setfilter), 0, 0, 1, 1},
23570   {&__pyx_n_s__setformat, __pyx_k__setformat, sizeof(__pyx_k__setformat), 0, 0, 1, 1},
23571   {&__pyx_n_s__setheader, __pyx_k__setheader, sizeof(__pyx_k__setheader), 0, 0, 1, 1},
23572   {&__pyx_n_s__setinfo, __pyx_k__setinfo, sizeof(__pyx_k__setinfo), 0, 0, 1, 1},
23573   {&__pyx_n_s__setreference, __pyx_k__setreference, sizeof(__pyx_k__setreference), 0, 0, 1, 1},
23574   {&__pyx_n_s__setregions, __pyx_k__setregions, sizeof(__pyx_k__setregions), 0, 0, 1, 1},
23575   {&__pyx_n_s__setsamples, __pyx_k__setsamples, sizeof(__pyx_k__setsamples), 0, 0, 1, 1},
23576   {&__pyx_n_s__setversion, __pyx_k__setversion, sizeof(__pyx_k__setversion), 0, 0, 1, 1},
23577   {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
23578   {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
23579   {&__pyx_n_s__startswith, __pyx_k__startswith, sizeof(__pyx_k__startswith), 0, 0, 1, 1},
23580   {&__pyx_n_s__stderr, __pyx_k__stderr, sizeof(__pyx_k__stderr), 0, 0, 1, 1},
23581   {&__pyx_n_s__stream, __pyx_k__stream, sizeof(__pyx_k__stream), 0, 0, 1, 1},
23582   {&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1},
23583   {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
23584   {&__pyx_n_s__tabixfile, __pyx_k__tabixfile, sizeof(__pyx_k__tabixfile), 0, 0, 1, 1},
23585   {&__pyx_n_s__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1},
23586   {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1},
23587   {&__pyx_n_s__validate, __pyx_k__validate, sizeof(__pyx_k__validate), 0, 0, 1, 1},
23588   {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
23589   {&__pyx_n_s__vcf, __pyx_k__vcf, sizeof(__pyx_k__vcf), 0, 0, 1, 1},
23590   {&__pyx_n_s__vcffile, __pyx_k__vcffile, sizeof(__pyx_k__vcffile), 0, 0, 1, 1},
23591   {&__pyx_n_s__version, __pyx_k__version, sizeof(__pyx_k__version), 0, 0, 1, 1},
23592   {&__pyx_n_s__warnerror, __pyx_k__warnerror, sizeof(__pyx_k__warnerror), 0, 0, 1, 1},
23593   {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
23594   {&__pyx_n_s__write_data, __pyx_k__write_data, sizeof(__pyx_k__write_data), 0, 0, 1, 1},
23595   {&__pyx_n_s__write_header, __pyx_k__write_header, sizeof(__pyx_k__write_header), 0, 0, 1, 1},
23596   {&__pyx_n_s__write_heading, __pyx_k__write_heading, sizeof(__pyx_k__write_heading), 0, 0, 1, 1},
23597   {&__pyx_n_s__writeheader, __pyx_k__writeheader, sizeof(__pyx_k__writeheader), 0, 0, 1, 1},
23598   {&__pyx_n_s__zip, __pyx_k__zip, sizeof(__pyx_k__zip), 0, 0, 1, 1},
23599   {0, 0, 0, 0, 0, 0, 0}
23600 };
23601 static int __Pyx_InitCachedBuiltins(void) {
23602   __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;}
23603   __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;}
23604   __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;}
23605   __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;}
23606   __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;}
23607   __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;}
23608   __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;}
23609   __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;}
23610   __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;}
23611   __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;}
23612   __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;}
23613   return 0;
23614   __pyx_L1_error:;
23615   return -1;
23616 }
23617
23618 static int __Pyx_InitGlobals(void) {
23619   #if PY_VERSION_HEX < 0x02040000
23620   if (unlikely(__Pyx_Py23SetsImport() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23621   #endif
23622   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
23623   __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;};
23624   __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;};
23625   __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;};
23626   __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;};
23627   __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;};
23628   __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;};
23629   __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;};
23630   __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;};
23631   __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;};
23632   __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;};
23633   __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;};
23634   __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;};
23635   __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;};
23636   __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;};
23637   __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;};
23638   __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;};
23639   __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;};
23640   __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;};
23641   __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;};
23642   __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;};
23643   __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;};
23644   __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;};
23645   __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;};
23646   __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;};
23647   __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;};
23648   __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;};
23649   __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;};
23650   __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;};
23651   __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;};
23652   __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;};
23653   __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;};
23654   __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;};
23655   __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;};
23656   __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;};
23657   __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;};
23658   __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;};
23659   return 0;
23660   __pyx_L1_error:;
23661   return -1;
23662 }
23663
23664 #if PY_MAJOR_VERSION < 3
23665 PyMODINIT_FUNC initcvcf(void); /*proto*/
23666 PyMODINIT_FUNC initcvcf(void)
23667 #else
23668 PyMODINIT_FUNC PyInit_cvcf(void); /*proto*/
23669 PyMODINIT_FUNC PyInit_cvcf(void)
23670 #endif
23671 {
23672   PyObject *__pyx_t_1 = NULL;
23673   PyObject *__pyx_t_2 = NULL;
23674   PyObject *__pyx_t_3 = NULL;
23675   PyObject *__pyx_t_4 = NULL;
23676   #if CYTHON_REFNANNY
23677   void* __pyx_refnanny = NULL;
23678   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23679   if (!__Pyx_RefNanny) {
23680       PyErr_Clear();
23681       __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23682       if (!__Pyx_RefNanny)
23683           Py_FatalError("failed to import 'refnanny' module");
23684   }
23685   __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_cvcf(void)", __LINE__, __FILE__);
23686   #endif
23687   __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;}
23688   __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;}
23689   #ifdef __pyx_binding_PyCFunctionType_USED
23690   if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23691   #endif
23692   /*--- Library function declarations ---*/
23693   /*--- Threads initialization code ---*/
23694   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23695   #ifdef WITH_THREAD /* Python build with threading support? */
23696   PyEval_InitThreads();
23697   #endif
23698   #endif
23699   /*--- Module creation code ---*/
23700   #if PY_MAJOR_VERSION < 3
23701   __pyx_m = Py_InitModule4(__Pyx_NAMESTR("cvcf"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
23702   #else
23703   __pyx_m = PyModule_Create(&__pyx_moduledef);
23704   #endif
23705   if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
23706   #if PY_MAJOR_VERSION < 3
23707   Py_INCREF(__pyx_m);
23708   #endif
23709   __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
23710   if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
23711   if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
23712   /*--- Initialize various global constants etc. ---*/
23713   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23714   if (__pyx_module_is_main_cvcf) {
23715     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;};
23716   }
23717   /*--- Builtin init code ---*/
23718   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23719   /*--- Global init code ---*/
23720   /*--- Function export code ---*/
23721   /*--- Type init code ---*/
23722   __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;}
23723   if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_TupleProxy->tp_dict, &__pyx_vtabptr_10TabProxies_TupleProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23724   __pyx_vtabptr_4cvcf_VCFRecord = &__pyx_vtable_4cvcf_VCFRecord;
23725   __pyx_vtable_4cvcf_VCFRecord.__pyx_base = *__pyx_vtabptr_10TabProxies_TupleProxy;
23726   #if PY_MAJOR_VERSION >= 3
23727   __pyx_vtable_4cvcf_VCFRecord.__pyx_base.update = (PyObject *(*)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t))__pyx_f_4cvcf_9VCFRecord_update;
23728   #else
23729   *(void(**)(void))&__pyx_vtable_4cvcf_VCFRecord.__pyx_base.update = (void(*)(void))__pyx_f_4cvcf_9VCFRecord_update;
23730   #endif
23731   __pyx_type_4cvcf_VCFRecord.tp_base = __pyx_ptype_10TabProxies_TupleProxy;
23732   if (PyType_Ready(&__pyx_type_4cvcf_VCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23733   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;}
23734   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;}
23735   __pyx_ptype_4cvcf_VCFRecord = &__pyx_type_4cvcf_VCFRecord;
23736   __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;}
23737   __pyx_type_4cvcf_asVCFRecord.tp_base = __pyx_ptype_6ctabix_Parser;
23738   if (PyType_Ready(&__pyx_type_4cvcf_asVCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23739   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;}
23740   __pyx_ptype_4cvcf_asVCFRecord = &__pyx_type_4cvcf_asVCFRecord;
23741   /*--- Type import code ---*/
23742   __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;}
23743   __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;}
23744   if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_GTFProxy->tp_dict, &__pyx_vtabptr_10TabProxies_GTFProxy) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23745   __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;}
23746   if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_NamedTupleProxy->tp_dict, &__pyx_vtabptr_10TabProxies_NamedTupleProxy) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23747   __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;}
23748   if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_BedProxy->tp_dict, &__pyx_vtabptr_10TabProxies_BedProxy) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23749   __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;}
23750   if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_VCFProxy->tp_dict, &__pyx_vtabptr_10TabProxies_VCFProxy) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23751   /*--- Function import code ---*/
23752   /*--- Execution code ---*/
23753
23754   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":46
23755  * #
23756  * 
23757  * from collections import namedtuple, defaultdict             # <<<<<<<<<<<<<<
23758  * from operator import itemgetter
23759  * import sys, re, copy, bisect
23760  */
23761   __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;}
23762   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
23763   __Pyx_INCREF(((PyObject *)__pyx_n_s__namedtuple));
23764   PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__namedtuple));
23765   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__namedtuple));
23766   __Pyx_INCREF(((PyObject *)__pyx_n_s__defaultdict));
23767   PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__defaultdict));
23768   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__defaultdict));
23769   __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;}
23770   __Pyx_GOTREF(__pyx_t_2);
23771   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
23772   __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;}
23773   __Pyx_GOTREF(__pyx_t_1);
23774   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;}
23775   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23776   __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;}
23777   __Pyx_GOTREF(__pyx_t_1);
23778   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;}
23779   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23780   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23781
23782   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":47
23783  * 
23784  * from collections import namedtuple, defaultdict
23785  * from operator import itemgetter             # <<<<<<<<<<<<<<
23786  * import sys, re, copy, bisect
23787  * 
23788  */
23789   __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;}
23790   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
23791   __Pyx_INCREF(((PyObject *)__pyx_n_s__itemgetter));
23792   PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__itemgetter));
23793   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__itemgetter));
23794   __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;}
23795   __Pyx_GOTREF(__pyx_t_1);
23796   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
23797   __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;}
23798   __Pyx_GOTREF(__pyx_t_2);
23799   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;}
23800   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23801   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23802
23803   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":48
23804  * from collections import namedtuple, defaultdict
23805  * from operator import itemgetter
23806  * import sys, re, copy, bisect             # <<<<<<<<<<<<<<
23807  * 
23808  * cimport ctabix
23809  */
23810   __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;}
23811   __Pyx_GOTREF(__pyx_t_1);
23812   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;}
23813   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23814   __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;}
23815   __Pyx_GOTREF(__pyx_t_1);
23816   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;}
23817   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23818   __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;}
23819   __Pyx_GOTREF(__pyx_t_1);
23820   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;}
23821   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23822   __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;}
23823   __Pyx_GOTREF(__pyx_t_1);
23824   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;}
23825   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23826
23827   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":52
23828  * cimport ctabix
23829  * cimport TabProxies
23830  * import pysam             # <<<<<<<<<<<<<<
23831  * 
23832  * gtsRegEx = re.compile("[|/\\\\]")
23833  */
23834   __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;}
23835   __Pyx_GOTREF(__pyx_t_1);
23836   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;}
23837   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23838
23839   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":54
23840  * import pysam
23841  * 
23842  * gtsRegEx = re.compile("[|/\\\\]")             # <<<<<<<<<<<<<<
23843  * alleleRegEx = re.compile('^[ACGTN]+$')
23844  * 
23845  */
23846   __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;}
23847   __Pyx_GOTREF(__pyx_t_1);
23848   __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;}
23849   __Pyx_GOTREF(__pyx_t_2);
23850   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23851   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23852   __Pyx_GOTREF(__pyx_t_1);
23853   __Pyx_INCREF(((PyObject *)__pyx_kp_s_73));
23854   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_73));
23855   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_73));
23856   __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23857   __Pyx_GOTREF(__pyx_t_3);
23858   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23859   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23860   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gtsRegEx, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23861   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23862
23863   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":55
23864  * 
23865  * gtsRegEx = re.compile("[|/\\\\]")
23866  * alleleRegEx = re.compile('^[ACGTN]+$')             # <<<<<<<<<<<<<<
23867  * 
23868  * # Utility function.  Uses 0-based coordinates
23869  */
23870   __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23871   __Pyx_GOTREF(__pyx_t_3);
23872   __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23873   __Pyx_GOTREF(__pyx_t_1);
23874   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23875   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23876   __Pyx_GOTREF(__pyx_t_3);
23877   __Pyx_INCREF(((PyObject *)__pyx_kp_s_74));
23878   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_74));
23879   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_74));
23880   __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23881   __Pyx_GOTREF(__pyx_t_2);
23882   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23883   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23884   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__alleleRegEx, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23885   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23886
23887   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":86
23888  * 
23889  * 
23890  * FORMAT = namedtuple('FORMAT','id numbertype number type description missingvalue')             # <<<<<<<<<<<<<<
23891  * 
23892  * ###########################################################################################################
23893  */
23894   __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23895   __Pyx_GOTREF(__pyx_t_2);
23896   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23897   __Pyx_GOTREF(__pyx_t_3);
23898   __Pyx_INCREF(((PyObject *)__pyx_n_s__FORMAT));
23899   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__FORMAT));
23900   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FORMAT));
23901   __Pyx_INCREF(((PyObject *)__pyx_kp_s_75));
23902   PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_kp_s_75));
23903   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_75));
23904   __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23905   __Pyx_GOTREF(__pyx_t_1);
23906   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23907   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23908   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FORMAT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23909   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23910
23911   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":232
23912  *         return r
23913  * 
23914  * class VCF(object):             # <<<<<<<<<<<<<<
23915  * 
23916  *     # types
23917  */
23918   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23919   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
23920   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23921   __Pyx_GOTREF(__pyx_t_3);
23922   __Pyx_INCREF(__pyx_builtin_object);
23923   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object);
23924   __Pyx_GIVEREF(__pyx_builtin_object);
23925   __pyx_t_2 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_1), __pyx_n_s__VCF, "cvcf"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23926   __Pyx_GOTREF(__pyx_t_2);
23927   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23928
23929   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":235
23930  * 
23931  *     # types
23932  *     NT_UNKNOWN = 0             # <<<<<<<<<<<<<<
23933  *     NT_NUMBER = 1
23934  *     NT_ALLELES = 2
23935  */
23936   if (PyObject_SetAttr(__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;}
23937
23938   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":236
23939  *     # types
23940  *     NT_UNKNOWN = 0
23941  *     NT_NUMBER = 1             # <<<<<<<<<<<<<<
23942  *     NT_ALLELES = 2
23943  *     NT_NR_ALLELES = 3
23944  */
23945   if (PyObject_SetAttr(__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;}
23946
23947   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":237
23948  *     NT_UNKNOWN = 0
23949  *     NT_NUMBER = 1
23950  *     NT_ALLELES = 2             # <<<<<<<<<<<<<<
23951  *     NT_NR_ALLELES = 3
23952  *     NT_GENOTYPES = 4
23953  */
23954   if (PyObject_SetAttr(__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;}
23955
23956   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":238
23957  *     NT_NUMBER = 1
23958  *     NT_ALLELES = 2
23959  *     NT_NR_ALLELES = 3             # <<<<<<<<<<<<<<
23960  *     NT_GENOTYPES = 4
23961  *     NT_PHASED_GENOTYPES = 5
23962  */
23963   if (PyObject_SetAttr(__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;}
23964
23965   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":239
23966  *     NT_ALLELES = 2
23967  *     NT_NR_ALLELES = 3
23968  *     NT_GENOTYPES = 4             # <<<<<<<<<<<<<<
23969  *     NT_PHASED_GENOTYPES = 5
23970  * 
23971  */
23972   if (PyObject_SetAttr(__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;}
23973
23974   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":240
23975  *     NT_NR_ALLELES = 3
23976  *     NT_GENOTYPES = 4
23977  *     NT_PHASED_GENOTYPES = 5             # <<<<<<<<<<<<<<
23978  * 
23979  *     _errors = { 0:"UNKNOWN_FORMAT_STRING:Unknown file format identifier",
23980  */
23981   if (PyObject_SetAttr(__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;}
23982
23983   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":242
23984  *     NT_PHASED_GENOTYPES = 5
23985  * 
23986  *     _errors = { 0:"UNKNOWN_FORMAT_STRING:Unknown file format identifier",             # <<<<<<<<<<<<<<
23987  *                 1:"BADLY_FORMATTED_FORMAT_STRING:Formatting error in the format string",
23988  *                 2:"BADLY_FORMATTED_HEADING:Did not find 9 required headings (CHROM, POS, ..., FORMAT) %s",
23989  */
23990   __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23991   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
23992   if (PyDict_SetItem(__pyx_t_3, __pyx_int_0, ((PyObject *)__pyx_kp_s_76)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23993   if (PyDict_SetItem(__pyx_t_3, __pyx_int_1, ((PyObject *)__pyx_kp_s_77)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23994   if (PyDict_SetItem(__pyx_t_3, __pyx_int_2, ((PyObject *)__pyx_kp_s_78)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23995   if (PyDict_SetItem(__pyx_t_3, __pyx_int_3, ((PyObject *)__pyx_kp_s_79)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23996   if (PyDict_SetItem(__pyx_t_3, __pyx_int_4, ((PyObject *)__pyx_kp_s_80)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23997   if (PyDict_SetItem(__pyx_t_3, __pyx_int_5, ((PyObject *)__pyx_kp_s_81)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23998   if (PyDict_SetItem(__pyx_t_3, __pyx_int_6, ((PyObject *)__pyx_kp_s_82)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23999   if (PyDict_SetItem(__pyx_t_3, __pyx_int_7, ((PyObject *)__pyx_kp_s_83)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24000   if (PyDict_SetItem(__pyx_t_3, __pyx_int_8, ((PyObject *)__pyx_kp_s_84)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24001   if (PyDict_SetItem(__pyx_t_3, __pyx_int_9, ((PyObject *)__pyx_kp_s_85)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24002   if (PyDict_SetItem(__pyx_t_3, __pyx_int_10, ((PyObject *)__pyx_kp_s_86)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24003   if (PyDict_SetItem(__pyx_t_3, __pyx_int_11, ((PyObject *)__pyx_kp_s_87)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24004   if (PyDict_SetItem(__pyx_t_3, __pyx_int_12, ((PyObject *)__pyx_kp_s_88)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24005   if (PyDict_SetItem(__pyx_t_3, __pyx_int_13, ((PyObject *)__pyx_kp_s_89)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24006   if (PyDict_SetItem(__pyx_t_3, __pyx_int_14, ((PyObject *)__pyx_kp_s_90)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24007   if (PyDict_SetItem(__pyx_t_3, __pyx_int_15, ((PyObject *)__pyx_kp_s_91)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24008   if (PyDict_SetItem(__pyx_t_3, __pyx_int_16, ((PyObject *)__pyx_kp_s_92)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24009   if (PyDict_SetItem(__pyx_t_3, __pyx_int_17, ((PyObject *)__pyx_kp_s_93)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24010   if (PyDict_SetItem(__pyx_t_3, __pyx_int_18, ((PyObject *)__pyx_kp_s_94)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24011   if (PyDict_SetItem(__pyx_t_3, __pyx_int_19, ((PyObject *)__pyx_kp_s_95)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24012   if (PyDict_SetItem(__pyx_t_3, __pyx_int_20, ((PyObject *)__pyx_kp_s_96)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24013   if (PyDict_SetItem(__pyx_t_3, __pyx_int_21, ((PyObject *)__pyx_kp_s_97)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24014   if (PyDict_SetItem(__pyx_t_3, __pyx_int_22, ((PyObject *)__pyx_kp_s_98)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24015   if (PyDict_SetItem(__pyx_t_3, __pyx_int_23, ((PyObject *)__pyx_kp_s_99)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24016   if (PyDict_SetItem(__pyx_t_3, __pyx_int_24, ((PyObject *)__pyx_kp_s_100)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24017   if (PyDict_SetItem(__pyx_t_3, __pyx_int_25, ((PyObject *)__pyx_kp_s_101)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24018   if (PyDict_SetItem(__pyx_t_3, __pyx_int_26, ((PyObject *)__pyx_kp_s_102)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24019   if (PyDict_SetItem(__pyx_t_3, __pyx_int_27, ((PyObject *)__pyx_kp_s_103)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24020   if (PyDict_SetItem(__pyx_t_3, __pyx_int_28, ((PyObject *)__pyx_kp_s_104)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24021   if (PyDict_SetItem(__pyx_t_3, __pyx_int_29, ((PyObject *)__pyx_kp_s_105)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24022   if (PyDict_SetItem(__pyx_t_3, __pyx_int_30, ((PyObject *)__pyx_kp_s_106)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24023   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___errors, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24024   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24025
24026   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":276
24027  * 
24028  *     # tag-value pairs; tags are not unique; does not include fileformat, INFO, FILTER or FORMAT fields
24029  *     _header = []             # <<<<<<<<<<<<<<
24030  * 
24031  *     # version number; 33=v3.3; 40=v4.0
24032  */
24033   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24034   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24035   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___header, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24036   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24037
24038   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":279
24039  * 
24040  *     # version number; 33=v3.3; 40=v4.0
24041  *     _version = 40             # <<<<<<<<<<<<<<
24042  * 
24043  *     # info, filter and format data
24044  */
24045   if (PyObject_SetAttr(__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;}
24046
24047   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":282
24048  * 
24049  *     # info, filter and format data
24050  *     _info = {}             # <<<<<<<<<<<<<<
24051  *     _filter = {}
24052  *     _format = {}
24053  */
24054   __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24055   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24056   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___info, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24057   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24058
24059   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":283
24060  *     # info, filter and format data
24061  *     _info = {}
24062  *     _filter = {}             # <<<<<<<<<<<<<<
24063  *     _format = {}
24064  * 
24065  */
24066   __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24067   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24068   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___filter, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24069   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24070
24071   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":284
24072  *     _info = {}
24073  *     _filter = {}
24074  *     _format = {}             # <<<<<<<<<<<<<<
24075  * 
24076  *     # header; and required columns
24077  */
24078   __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24079   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24080   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___format, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24081   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24082
24083   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":287
24084  * 
24085  *     # header; and required columns
24086  *     _required = ["CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO","FORMAT"]             # <<<<<<<<<<<<<<
24087  *     _samples = []
24088  * 
24089  */
24090   __pyx_t_3 = PyList_New(9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24091   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24092   __Pyx_INCREF(((PyObject *)__pyx_n_s__CHROM));
24093   PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__CHROM));
24094   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CHROM));
24095   __Pyx_INCREF(((PyObject *)__pyx_n_s__POS));
24096   PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__POS));
24097   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__POS));
24098   __Pyx_INCREF(((PyObject *)__pyx_n_s__ID));
24099   PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__ID));
24100   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ID));
24101   __Pyx_INCREF(((PyObject *)__pyx_n_s__REF));
24102   PyList_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_n_s__REF));
24103   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__REF));
24104   __Pyx_INCREF(((PyObject *)__pyx_n_s__ALT));
24105   PyList_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_n_s__ALT));
24106   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ALT));
24107   __Pyx_INCREF(((PyObject *)__pyx_n_s__QUAL));
24108   PyList_SET_ITEM(__pyx_t_3, 5, ((PyObject *)__pyx_n_s__QUAL));
24109   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__QUAL));
24110   __Pyx_INCREF(((PyObject *)__pyx_n_s__FILTER));
24111   PyList_SET_ITEM(__pyx_t_3, 6, ((PyObject *)__pyx_n_s__FILTER));
24112   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FILTER));
24113   __Pyx_INCREF(((PyObject *)__pyx_n_s__INFO));
24114   PyList_SET_ITEM(__pyx_t_3, 7, ((PyObject *)__pyx_n_s__INFO));
24115   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__INFO));
24116   __Pyx_INCREF(((PyObject *)__pyx_n_s__FORMAT));
24117   PyList_SET_ITEM(__pyx_t_3, 8, ((PyObject *)__pyx_n_s__FORMAT));
24118   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FORMAT));
24119   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___required, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24120   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24121
24122   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":288
24123  *     # header; and required columns
24124  *     _required = ["CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO","FORMAT"]
24125  *     _samples = []             # <<<<<<<<<<<<<<
24126  * 
24127  *     # control behaviour
24128  */
24129   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24130   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24131   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___samples, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24132   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24133
24134   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":291
24135  * 
24136  *     # control behaviour
24137  *     _ignored_errors = set([11])   # ERROR_UNKNOWN_KEY             # <<<<<<<<<<<<<<
24138  *     _warn_errors = set([])
24139  *     _leftalign = False
24140  */
24141   __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24142   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24143   __Pyx_INCREF(__pyx_int_11);
24144   PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_11);
24145   __Pyx_GIVEREF(__pyx_int_11);
24146   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24147   __Pyx_GOTREF(__pyx_t_4);
24148   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
24149   __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
24150   __pyx_t_3 = 0;
24151   __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PySet_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24152   __Pyx_GOTREF(__pyx_t_3);
24153   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24154   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___ignored_errors, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24155   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24156
24157   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":292
24158  *     # control behaviour
24159  *     _ignored_errors = set([11])   # ERROR_UNKNOWN_KEY
24160  *     _warn_errors = set([])             # <<<<<<<<<<<<<<
24161  *     _leftalign = False
24162  * 
24163  */
24164   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24165   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24166   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24167   __Pyx_GOTREF(__pyx_t_4);
24168   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
24169   __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
24170   __pyx_t_3 = 0;
24171   __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PySet_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24172   __Pyx_GOTREF(__pyx_t_3);
24173   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24174   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___warn_errors, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24175   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24176
24177   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":293
24178  *     _ignored_errors = set([11])   # ERROR_UNKNOWN_KEY
24179  *     _warn_errors = set([])
24180  *     _leftalign = False             # <<<<<<<<<<<<<<
24181  * 
24182  *     # reference sequence
24183  */
24184   __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24185   __Pyx_GOTREF(__pyx_t_3);
24186   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___leftalign, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24187   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24188
24189   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":296
24190  * 
24191  *     # reference sequence
24192  *     _reference = None             # <<<<<<<<<<<<<<
24193  * 
24194  *     # regions to include; None includes everything
24195  */
24196   if (PyObject_SetAttr(__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;}
24197
24198   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":299
24199  * 
24200  *     # regions to include; None includes everything
24201  *     _regions = None             # <<<<<<<<<<<<<<
24202  * 
24203  *     # statefull stuff
24204  */
24205   if (PyObject_SetAttr(__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;}
24206
24207   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":302
24208  * 
24209  *     # statefull stuff
24210  *     _lineno = -1             # <<<<<<<<<<<<<<
24211  *     _line = None
24212  *     _lines = None
24213  */
24214   if (PyObject_SetAttr(__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;}
24215
24216   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":303
24217  *     # statefull stuff
24218  *     _lineno = -1
24219  *     _line = None             # <<<<<<<<<<<<<<
24220  *     _lines = None
24221  * 
24222  */
24223   if (PyObject_SetAttr(__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;}
24224
24225   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":304
24226  *     _lineno = -1
24227  *     _line = None
24228  *     _lines = None             # <<<<<<<<<<<<<<
24229  * 
24230  *     def __init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False):
24231  */
24232   if (PyObject_SetAttr(__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;}
24233
24234   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":306
24235  *     _lines = None
24236  * 
24237  *     def __init__(self, _copy=None, reference=None, regions=None, lines=None, leftalign=False):             # <<<<<<<<<<<<<<
24238  *         # make error identifiers accessible by name
24239  *         for id in self._errors.keys(): self.__dict__[self._errors[id].split(':')[0]] = id
24240  */
24241   __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24242   __Pyx_GOTREF(__pyx_t_3);
24243   __pyx_k_13 = __pyx_t_3;
24244   __Pyx_GIVEREF(__pyx_t_3);
24245   __pyx_t_3 = 0;
24246   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF___init__, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24247   __Pyx_GOTREF(__pyx_t_3);
24248   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24249   __Pyx_GOTREF(__pyx_t_4);
24250   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24251   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24252   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24253
24254   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":327
24255  *         self._lines = lines
24256  * 
24257  *     def error(self,line,error,opt=None):             # <<<<<<<<<<<<<<
24258  *         if error in self._ignored_errors: return
24259  *         errorlabel, errorstring = self._errors[error].split(':')
24260  */
24261   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_error, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24262   __Pyx_GOTREF(__pyx_t_4);
24263   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24264   __Pyx_GOTREF(__pyx_t_3);
24265   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24266   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__error, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24267   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24268
24269   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":336
24270  *         raise ValueError(errorstring)
24271  * 
24272  *     def parse_format(self,line,format,filter=False):             # <<<<<<<<<<<<<<
24273  *         if self._version == 40:
24274  *             if not format.startswith('<'):
24275  */
24276   __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24277   __Pyx_GOTREF(__pyx_t_3);
24278   __pyx_k_15 = __pyx_t_3;
24279   __Pyx_GIVEREF(__pyx_t_3);
24280   __pyx_t_3 = 0;
24281   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_parse_format, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24282   __Pyx_GOTREF(__pyx_t_3);
24283   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24284   __Pyx_GOTREF(__pyx_t_4);
24285   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24286   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__parse_format, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24287   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24288
24289   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":398
24290  * 
24291  * 
24292  *     def format_format( self, fmt, filter=False ):             # <<<<<<<<<<<<<<
24293  *         values = [('ID',fmt.id)]
24294  *         if fmt.number != None and not filter:
24295  */
24296   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24297   __Pyx_GOTREF(__pyx_t_4);
24298   __pyx_k_32 = __pyx_t_4;
24299   __Pyx_GIVEREF(__pyx_t_4);
24300   __pyx_t_4 = 0;
24301   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_format_format, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24302   __Pyx_GOTREF(__pyx_t_4);
24303   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24304   __Pyx_GOTREF(__pyx_t_3);
24305   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24306   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__format_format, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24307   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24308
24309   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":418
24310  *         return format
24311  * 
24312  *     def get_expected(self, format, formatdict, alt):             # <<<<<<<<<<<<<<
24313  *         fmt = formatdict[format]
24314  *         if fmt.numbertype == self.NT_UNKNOWN: return -1
24315  */
24316   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_get_expected, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24317   __Pyx_GOTREF(__pyx_t_3);
24318   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24319   __Pyx_GOTREF(__pyx_t_4);
24320   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24321   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__get_expected, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24322   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24323
24324   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":429
24325  * 
24326  * 
24327  *     def _add_definition(self, formatdict, key, data, line ):             # <<<<<<<<<<<<<<
24328  *         if key in formatdict: return
24329  *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
24330  */
24331   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF__add_definition, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24332   __Pyx_GOTREF(__pyx_t_4);
24333   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24334   __Pyx_GOTREF(__pyx_t_3);
24335   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24336   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___add_definition, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24337   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24338
24339   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":446
24340  * 
24341  *     # todo: trim trailing missing values
24342  *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):             # <<<<<<<<<<<<<<
24343  *         output, sdata = [], []
24344  *         if type(data) == type([]): # for FORMAT field, make data with dummy values
24345  */
24346   __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24347   __Pyx_GOTREF(__pyx_t_3);
24348   __pyx_k_36 = __pyx_t_3;
24349   __Pyx_GIVEREF(__pyx_t_3);
24350   __pyx_t_3 = 0;
24351   __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24352   __Pyx_GOTREF(__pyx_t_3);
24353   __pyx_k_37 = __pyx_t_3;
24354   __Pyx_GIVEREF(__pyx_t_3);
24355   __pyx_t_3 = 0;
24356   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_format_formatdata, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24357   __Pyx_GOTREF(__pyx_t_3);
24358   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24359   __Pyx_GOTREF(__pyx_t_4);
24360   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24361   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__format_formatdata, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24362   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24363
24364   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":480
24365  * 
24366  * 
24367  *     def enter_default_format(self):             # <<<<<<<<<<<<<<
24368  *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
24369  *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
24370  */
24371   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_enter_default_format, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24372   __Pyx_GOTREF(__pyx_t_4);
24373   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24374   __Pyx_GOTREF(__pyx_t_3);
24375   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24376   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s_69, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24377   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24378
24379   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":489
24380  *                 self._format[f.id] = f
24381  * 
24382  *     def parse_header( self, line ):             # <<<<<<<<<<<<<<
24383  *         assert line.startswith('##')
24384  *         elts = line[2:].split('=')
24385  */
24386   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_parse_header, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24387   __Pyx_GOTREF(__pyx_t_3);
24388   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24389   __Pyx_GOTREF(__pyx_t_4);
24390   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24391   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__parse_header, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24392   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24393
24394   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":518
24395  * 
24396  * 
24397  *     def write_header( self, stream ):             # <<<<<<<<<<<<<<
24398  *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
24399  *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
24400  */
24401   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_write_header, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24402   __Pyx_GOTREF(__pyx_t_4);
24403   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24404   __Pyx_GOTREF(__pyx_t_3);
24405   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24406   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__write_header, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24407   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24408
24409   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":525
24410  * 
24411  * 
24412  *     def parse_heading( self, line ):             # <<<<<<<<<<<<<<
24413  *         assert line.startswith('#')
24414  *         assert not line.startswith('##')
24415  */
24416   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_parse_heading, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24417   __Pyx_GOTREF(__pyx_t_3);
24418   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24419   __Pyx_GOTREF(__pyx_t_4);
24420   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24421   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__parse_heading, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24422   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24423
24424   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":553
24425  *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
24426  * 
24427  *     def write_heading( self, stream ):             # <<<<<<<<<<<<<<
24428  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
24429  * 
24430  */
24431   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_write_heading, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24432   __Pyx_GOTREF(__pyx_t_4);
24433   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24434   __Pyx_GOTREF(__pyx_t_3);
24435   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24436   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__write_heading, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24437   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24438
24439   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":556
24440  *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
24441  * 
24442  *     def convertGT(self, GTstring):             # <<<<<<<<<<<<<<
24443  *         if GTstring == ".": return ["."]
24444  *         try:
24445  */
24446   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_convertGT, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24447   __Pyx_GOTREF(__pyx_t_3);
24448   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24449   __Pyx_GOTREF(__pyx_t_4);
24450   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24451   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__convertGT, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24452   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24453
24454   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":569
24455  * 
24456  * 
24457  *     def convertGTback(self, GTdata):             # <<<<<<<<<<<<<<
24458  *         return ''.join(map(str,GTdata))
24459  * 
24460  */
24461   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_convertGTback, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24462   __Pyx_GOTREF(__pyx_t_4);
24463   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24464   __Pyx_GOTREF(__pyx_t_3);
24465   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24466   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__convertGTback, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24467   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24468
24469   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":572
24470  *         return ''.join(map(str,GTdata))
24471  * 
24472  *     def parse_formatdata( self, key, value, formatdict, line ):             # <<<<<<<<<<<<<<
24473  *         # To do: check that the right number of values is present
24474  *         f = formatdict.get(key,None)
24475  */
24476   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_parse_formatdata, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24477   __Pyx_GOTREF(__pyx_t_3);
24478   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24479   __Pyx_GOTREF(__pyx_t_4);
24480   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24481   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__parse_formatdata, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24482   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24483
24484   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":615
24485  * 
24486  * 
24487  *     def inregion(self, chrom, pos):             # <<<<<<<<<<<<<<
24488  *         if not self._regions: return True
24489  *         for r in self._regions:
24490  */
24491   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_inregion, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24492   __Pyx_GOTREF(__pyx_t_4);
24493   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24494   __Pyx_GOTREF(__pyx_t_3);
24495   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24496   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__inregion, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24497   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24498
24499   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":622
24500  * 
24501  * 
24502  *     def parse_data( self, line, lineparse=False ):             # <<<<<<<<<<<<<<
24503  *         cols = line.split('\t')
24504  *         if len(cols) != len(self._samples)+9:
24505  */
24506   __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24507   __Pyx_GOTREF(__pyx_t_3);
24508   __pyx_k_61 = __pyx_t_3;
24509   __Pyx_GIVEREF(__pyx_t_3);
24510   __pyx_t_3 = 0;
24511   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_parse_data, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24512   __Pyx_GOTREF(__pyx_t_3);
24513   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24514   __Pyx_GOTREF(__pyx_t_4);
24515   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24516   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__parse_data, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24517   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24518
24519   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":822
24520  * 
24521  * 
24522  *     def write_data(self, stream, data):             # <<<<<<<<<<<<<<
24523  *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
24524  *         for k in required:
24525  */
24526   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_write_data, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24527   __Pyx_GOTREF(__pyx_t_4);
24528   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24529   __Pyx_GOTREF(__pyx_t_3);
24530   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24531   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__write_data, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24532   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24533
24534   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":851
24535  *         stream.write( "\t".join(output) + "\n" )
24536  * 
24537  *     def _parse_header(self, stream):             # <<<<<<<<<<<<<<
24538  *         self._lineno = 0
24539  *         for line in stream:
24540  */
24541   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF__parse_header, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24542   __Pyx_GOTREF(__pyx_t_3);
24543   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24544   __Pyx_GOTREF(__pyx_t_4);
24545   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24546   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___parse_header, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24547   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24548
24549   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":864
24550  *         return line
24551  * 
24552  *     def _parse(self, line, stream):             # <<<<<<<<<<<<<<
24553  *         if len(line.strip()) > 0:
24554  *             d = self.parse_data( line.strip() )
24555  */
24556   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF__parse, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24557   __Pyx_GOTREF(__pyx_t_4);
24558   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24559   __Pyx_GOTREF(__pyx_t_3);
24560   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24561   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___parse, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24562   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24563
24564   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":880
24565  *     ######################################################################################################
24566  * 
24567  *     def getsamples(self):             # <<<<<<<<<<<<<<
24568  *         """ List of samples in VCF file """
24569  *         return self._samples
24570  */
24571   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_getsamples, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24572   __Pyx_GOTREF(__pyx_t_3);
24573   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24574   __Pyx_GOTREF(__pyx_t_4);
24575   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24576   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__getsamples, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24577   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24578
24579   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":884
24580  *         return self._samples
24581  * 
24582  *     def setsamples(self,samples):             # <<<<<<<<<<<<<<
24583  *         """ List of samples in VCF file """
24584  *         self._samples = samples
24585  */
24586   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_setsamples, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24587   __Pyx_GOTREF(__pyx_t_4);
24588   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24589   __Pyx_GOTREF(__pyx_t_3);
24590   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24591   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__setsamples, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24592   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24593
24594   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":888
24595  *         self._samples = samples
24596  * 
24597  *     def getheader(self):             # <<<<<<<<<<<<<<
24598  *         """ List of header key-value pairs (strings) """
24599  *         return self._header
24600  */
24601   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_getheader, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24602   __Pyx_GOTREF(__pyx_t_3);
24603   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24604   __Pyx_GOTREF(__pyx_t_4);
24605   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24606   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__getheader, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24607   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24608
24609   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":892
24610  *         return self._header
24611  * 
24612  *     def setheader(self,header):             # <<<<<<<<<<<<<<
24613  *         """ List of header key-value pairs (strings) """
24614  *         self._header = header
24615  */
24616   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_setheader, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24617   __Pyx_GOTREF(__pyx_t_4);
24618   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24619   __Pyx_GOTREF(__pyx_t_3);
24620   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24621   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__setheader, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24622   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24623
24624   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":896
24625  *         self._header = header
24626  * 
24627  *     def getinfo(self):             # <<<<<<<<<<<<<<
24628  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
24629  *         return self._info
24630  */
24631   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_getinfo, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24632   __Pyx_GOTREF(__pyx_t_3);
24633   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24634   __Pyx_GOTREF(__pyx_t_4);
24635   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24636   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__getinfo, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24637   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24638
24639   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":900
24640  *         return self._info
24641  * 
24642  *     def setinfo(self,info):             # <<<<<<<<<<<<<<
24643  *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
24644  *         self._info = info
24645  */
24646   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_setinfo, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24647   __Pyx_GOTREF(__pyx_t_4);
24648   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24649   __Pyx_GOTREF(__pyx_t_3);
24650   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24651   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__setinfo, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24652   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24653
24654   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":904
24655  *         self._info = info
24656  * 
24657  *     def getformat(self):             # <<<<<<<<<<<<<<
24658  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
24659  *         return self._format
24660  */
24661   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_getformat, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24662   __Pyx_GOTREF(__pyx_t_3);
24663   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24664   __Pyx_GOTREF(__pyx_t_4);
24665   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24666   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__getformat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24667   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24668
24669   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":908
24670  *         return self._format
24671  * 
24672  *     def setformat(self,format):             # <<<<<<<<<<<<<<
24673  *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
24674  *         self._format = format
24675  */
24676   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_setformat, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24677   __Pyx_GOTREF(__pyx_t_4);
24678   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24679   __Pyx_GOTREF(__pyx_t_3);
24680   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24681   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__setformat, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24682   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24683
24684   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":912
24685  *         self._format = format
24686  * 
24687  *     def getfilter(self):             # <<<<<<<<<<<<<<
24688  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
24689  *         return self._filter
24690  */
24691   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_getfilter, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24692   __Pyx_GOTREF(__pyx_t_3);
24693   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24694   __Pyx_GOTREF(__pyx_t_4);
24695   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24696   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__getfilter, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24697   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24698
24699   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":916
24700  *         return self._filter
24701  * 
24702  *     def setfilter(self,filter):             # <<<<<<<<<<<<<<
24703  *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
24704  *         self._filter = filter
24705  */
24706   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_setfilter, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24707   __Pyx_GOTREF(__pyx_t_4);
24708   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24709   __Pyx_GOTREF(__pyx_t_3);
24710   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24711   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__setfilter, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24712   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24713
24714   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":920
24715  *         self._filter = filter
24716  * 
24717  *     def setversion(self, version):             # <<<<<<<<<<<<<<
24718  *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
24719  *         self._version = version
24720  */
24721   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_setversion, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24722   __Pyx_GOTREF(__pyx_t_3);
24723   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24724   __Pyx_GOTREF(__pyx_t_4);
24725   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24726   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__setversion, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24727   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24728
24729   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":924
24730  *         self._version = version
24731  * 
24732  *     def setregions(self, regions):             # <<<<<<<<<<<<<<
24733  *         self._regions = regions
24734  * 
24735  */
24736   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_setregions, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24737   __Pyx_GOTREF(__pyx_t_4);
24738   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24739   __Pyx_GOTREF(__pyx_t_3);
24740   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24741   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__setregions, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24742   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24743
24744   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":927
24745  *         self._regions = regions
24746  * 
24747  *     def setreference(self, ref):             # <<<<<<<<<<<<<<
24748  *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
24749  *         self._reference = ref
24750  */
24751   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_setreference, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24752   __Pyx_GOTREF(__pyx_t_3);
24753   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24754   __Pyx_GOTREF(__pyx_t_4);
24755   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24756   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__setreference, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24757   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24758
24759   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":931
24760  *         self._reference = ref
24761  * 
24762  *     def ignoreerror(self, errorstring):             # <<<<<<<<<<<<<<
24763  *         try:             self._ignored_errors.add(self.__dict__[errorstring])
24764  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
24765  */
24766   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_ignoreerror, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24767   __Pyx_GOTREF(__pyx_t_4);
24768   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24769   __Pyx_GOTREF(__pyx_t_3);
24770   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24771   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__ignoreerror, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24772   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24773
24774   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":935
24775  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
24776  * 
24777  *     def warnerror(self, errorstring):             # <<<<<<<<<<<<<<
24778  *         try:             self._warn_errors.add(self.__dict__[errorstring])
24779  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
24780  */
24781   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_warnerror, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24782   __Pyx_GOTREF(__pyx_t_3);
24783   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24784   __Pyx_GOTREF(__pyx_t_4);
24785   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24786   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__warnerror, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24787   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24788
24789   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":939
24790  *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
24791  * 
24792  *     def parse(self, stream):             # <<<<<<<<<<<<<<
24793  *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
24794  *         last_line = self._parse_header(stream)
24795  */
24796   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_parse, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24797   __Pyx_GOTREF(__pyx_t_4);
24798   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24799   __Pyx_GOTREF(__pyx_t_3);
24800   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24801   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__parse, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24802   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24803
24804   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":946
24805  *         return self._parse(last_line, stream)
24806  * 
24807  *     def write(self, stream, datagenerator):             # <<<<<<<<<<<<<<
24808  *         """ Writes a VCF file to a stream, using a data generator (or list) """
24809  *         self.write_header(stream)
24810  */
24811   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_write, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24812   __Pyx_GOTREF(__pyx_t_3);
24813   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24814   __Pyx_GOTREF(__pyx_t_4);
24815   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24816   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__write, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24817   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24818
24819   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":952
24820  *         for data in datagenerator: self.write_data(stream,data)
24821  * 
24822  *     def writeheader(self, stream):             # <<<<<<<<<<<<<<
24823  *         """ Writes a VCF header """
24824  *         self.write_header(stream)
24825  */
24826   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_writeheader, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24827   __Pyx_GOTREF(__pyx_t_4);
24828   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24829   __Pyx_GOTREF(__pyx_t_3);
24830   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24831   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__writeheader, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24832   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24833
24834   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":957
24835  *         self.write_heading(stream)
24836  * 
24837  *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):             # <<<<<<<<<<<<<<
24838  *         """ Utility function: compares two calls for equality """
24839  *         # a variant should always be assigned to a unique position, one base before
24840  */
24841   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_compare_calls, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24842   __Pyx_GOTREF(__pyx_t_3);
24843   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24844   __Pyx_GOTREF(__pyx_t_4);
24845   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24846   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__compare_calls, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24847   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24848
24849   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":979
24850  * ###########################################################################################################
24851  * 
24852  *     def connect( self, filename ):             # <<<<<<<<<<<<<<
24853  *         '''connect to tabix file.'''
24854  *         self.tabixfile = pysam.Tabixfile( filename )
24855  */
24856   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_connect, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24857   __Pyx_GOTREF(__pyx_t_4);
24858   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24859   __Pyx_GOTREF(__pyx_t_3);
24860   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24861   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__connect, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24862   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24863
24864   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":984
24865  *         self._parse_header(self.tabixfile.header)
24866  * 
24867  *     def fetch(self,             # <<<<<<<<<<<<<<
24868  *               reference = None,
24869  *               start = None,
24870  */
24871   __pyx_t_3 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_fetch, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24872   __Pyx_GOTREF(__pyx_t_3);
24873   __pyx_t_4 = PyMethod_New(__pyx_t_3, 0, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24874   __Pyx_GOTREF(__pyx_t_4);
24875   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24876   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__fetch, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24877   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24878
24879   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":993
24880  *         return self.tabixfile.fetch( reference, start, end, region, parser = asVCFRecord( self ) )
24881  * 
24882  *     def validate( self, record ):             # <<<<<<<<<<<<<<
24883  *         '''validate vcf record.
24884  * 
24885  */
24886   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4cvcf_3VCF_validate, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24887   __Pyx_GOTREF(__pyx_t_4);
24888   __pyx_t_3 = PyMethod_New(__pyx_t_4, 0, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24889   __Pyx_GOTREF(__pyx_t_3);
24890   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24891   if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__validate, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24892   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24893   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VCF, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24894   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24895   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24896
24897   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1118
24898  *                     pos -= 1
24899  * 
24900  * __all__ = [             # <<<<<<<<<<<<<<
24901  *     "VCF", "VCFRecord", ]
24902  * 
24903  */
24904   __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24905   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24906   __Pyx_INCREF(((PyObject *)__pyx_n_s__VCF));
24907   PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__VCF));
24908   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__VCF));
24909   __Pyx_INCREF(((PyObject *)__pyx_n_s__VCFRecord));
24910   PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__VCFRecord));
24911   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__VCFRecord));
24912   if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24913   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24914
24915   /* "/ifs/devel/pysam/pysam/pysam/cvcf.pyx":1
24916  * #             # <<<<<<<<<<<<<<
24917  * # Code to read, write and edit VCF files
24918  * #
24919  */
24920   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24921   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24922   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24923   __Pyx_GOTREF(__pyx_t_2);
24924   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__getsamples); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24925   __Pyx_GOTREF(__pyx_t_3);
24926   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24927   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24928   __Pyx_GOTREF(__pyx_t_2);
24929   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24930   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_107), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24931   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24932   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24933   __Pyx_GOTREF(__pyx_t_2);
24934   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__setsamples); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24935   __Pyx_GOTREF(__pyx_t_3);
24936   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24937   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24938   __Pyx_GOTREF(__pyx_t_2);
24939   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24940   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_108), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24941   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24942   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24943   __Pyx_GOTREF(__pyx_t_2);
24944   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__getheader); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24945   __Pyx_GOTREF(__pyx_t_3);
24946   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24947   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24948   __Pyx_GOTREF(__pyx_t_2);
24949   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24950   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_109), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24951   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24952   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24953   __Pyx_GOTREF(__pyx_t_2);
24954   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__setheader); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24955   __Pyx_GOTREF(__pyx_t_3);
24956   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24957   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24958   __Pyx_GOTREF(__pyx_t_2);
24959   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24960   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_110), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24961   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24962   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24963   __Pyx_GOTREF(__pyx_t_2);
24964   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__getinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24965   __Pyx_GOTREF(__pyx_t_3);
24966   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24967   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24968   __Pyx_GOTREF(__pyx_t_2);
24969   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24970   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_111), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24971   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24972   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24973   __Pyx_GOTREF(__pyx_t_2);
24974   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__setinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24975   __Pyx_GOTREF(__pyx_t_3);
24976   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24977   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24978   __Pyx_GOTREF(__pyx_t_2);
24979   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24980   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_112), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24981   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24982   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24983   __Pyx_GOTREF(__pyx_t_2);
24984   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__getformat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24985   __Pyx_GOTREF(__pyx_t_3);
24986   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24987   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24988   __Pyx_GOTREF(__pyx_t_2);
24989   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24990   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_113), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24991   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24992   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24993   __Pyx_GOTREF(__pyx_t_2);
24994   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__setformat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24995   __Pyx_GOTREF(__pyx_t_3);
24996   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24997   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24998   __Pyx_GOTREF(__pyx_t_2);
24999   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25000   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_114), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25001   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25002   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25003   __Pyx_GOTREF(__pyx_t_2);
25004   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__getfilter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25005   __Pyx_GOTREF(__pyx_t_3);
25006   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25007   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25008   __Pyx_GOTREF(__pyx_t_2);
25009   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25010   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_115), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25011   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25012   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25013   __Pyx_GOTREF(__pyx_t_2);
25014   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__setfilter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25015   __Pyx_GOTREF(__pyx_t_3);
25016   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25017   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25018   __Pyx_GOTREF(__pyx_t_2);
25019   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25020   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_116), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25021   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25022   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25023   __Pyx_GOTREF(__pyx_t_2);
25024   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__setreference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25025   __Pyx_GOTREF(__pyx_t_3);
25026   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25027   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25028   __Pyx_GOTREF(__pyx_t_2);
25029   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25030   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_117), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25031   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25032   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25033   __Pyx_GOTREF(__pyx_t_2);
25034   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__parse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25035   __Pyx_GOTREF(__pyx_t_3);
25036   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25037   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25038   __Pyx_GOTREF(__pyx_t_2);
25039   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25040   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_118), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25041   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25042   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25043   __Pyx_GOTREF(__pyx_t_2);
25044   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25045   __Pyx_GOTREF(__pyx_t_3);
25046   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25047   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25048   __Pyx_GOTREF(__pyx_t_2);
25049   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25050   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_119), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25051   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25052   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25053   __Pyx_GOTREF(__pyx_t_2);
25054   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__writeheader); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25055   __Pyx_GOTREF(__pyx_t_3);
25056   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25057   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25058   __Pyx_GOTREF(__pyx_t_2);
25059   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25060   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_120), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25061   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25062   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25063   __Pyx_GOTREF(__pyx_t_2);
25064   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__compare_calls); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25065   __Pyx_GOTREF(__pyx_t_3);
25066   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25067   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25068   __Pyx_GOTREF(__pyx_t_2);
25069   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25070   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_121), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25071   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25072   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25073   __Pyx_GOTREF(__pyx_t_2);
25074   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__connect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25075   __Pyx_GOTREF(__pyx_t_3);
25076   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25077   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25078   __Pyx_GOTREF(__pyx_t_2);
25079   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25080   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_122), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25081   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25082   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25083   __Pyx_GOTREF(__pyx_t_2);
25084   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__fetch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25085   __Pyx_GOTREF(__pyx_t_3);
25086   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25087   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25088   __Pyx_GOTREF(__pyx_t_2);
25089   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25090   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_123), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25091   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25092   __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VCF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25093   __Pyx_GOTREF(__pyx_t_2);
25094   __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__validate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25095   __Pyx_GOTREF(__pyx_t_3);
25096   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25097   __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25098   __Pyx_GOTREF(__pyx_t_2);
25099   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25100   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_124), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25101   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25102   if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25103   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
25104
25105   /* "pysam/ctabix.pxd":2
25106  * 
25107  * cdef extern from "string.h":             # <<<<<<<<<<<<<<
25108  *   ctypedef int size_t
25109  *   void *memcpy(void *dst,void *src,size_t len)
25110  */
25111   goto __pyx_L0;
25112   __pyx_L1_error:;
25113   __Pyx_XDECREF(__pyx_t_1);
25114   __Pyx_XDECREF(__pyx_t_2);
25115   __Pyx_XDECREF(__pyx_t_3);
25116   __Pyx_XDECREF(__pyx_t_4);
25117   if (__pyx_m) {
25118     __Pyx_AddTraceback("init cvcf");
25119     Py_DECREF(__pyx_m); __pyx_m = 0;
25120   } else if (!PyErr_Occurred()) {
25121     PyErr_SetString(PyExc_ImportError, "init cvcf");
25122   }
25123   __pyx_L0:;
25124   __Pyx_RefNannyFinishContext();
25125   #if PY_MAJOR_VERSION < 3
25126   return;
25127   #else
25128   return __pyx_m;
25129   #endif
25130 }
25131
25132 /* Runtime support code */
25133
25134 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
25135     PyObject *result;
25136     result = PyObject_GetAttr(dict, name);
25137     if (!result)
25138         PyErr_SetObject(PyExc_NameError, name);
25139     return result;
25140 }
25141
25142 static void __Pyx_RaiseDoubleKeywordsError(
25143     const char* func_name,
25144     PyObject* kw_name)
25145 {
25146     PyErr_Format(PyExc_TypeError,
25147         #if PY_MAJOR_VERSION >= 3
25148         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
25149         #else
25150         "%s() got multiple values for keyword argument '%s'", func_name,
25151         PyString_AS_STRING(kw_name));
25152         #endif
25153 }
25154
25155 static void __Pyx_RaiseArgtupleInvalid(
25156     const char* func_name,
25157     int exact,
25158     Py_ssize_t num_min,
25159     Py_ssize_t num_max,
25160     Py_ssize_t num_found)
25161 {
25162     Py_ssize_t num_expected;
25163     const char *number, *more_or_less;
25164
25165     if (num_found < num_min) {
25166         num_expected = num_min;
25167         more_or_less = "at least";
25168     } else {
25169         num_expected = num_max;
25170         more_or_less = "at most";
25171     }
25172     if (exact) {
25173         more_or_less = "exactly";
25174     }
25175     number = (num_expected == 1) ? "" : "s";
25176     PyErr_Format(PyExc_TypeError,
25177         #if PY_VERSION_HEX < 0x02050000
25178             "%s() takes %s %d positional argument%s (%d given)",
25179         #else
25180             "%s() takes %s %zd positional argument%s (%zd given)",
25181         #endif
25182         func_name, more_or_less, num_expected, number, num_found);
25183 }
25184
25185 static int __Pyx_ParseOptionalKeywords(
25186     PyObject *kwds,
25187     PyObject **argnames[],
25188     PyObject *kwds2,
25189     PyObject *values[],
25190     Py_ssize_t num_pos_args,
25191     const char* function_name)
25192 {
25193     PyObject *key = 0, *value = 0;
25194     Py_ssize_t pos = 0;
25195     PyObject*** name;
25196     PyObject*** first_kw_arg = argnames + num_pos_args;
25197
25198     while (PyDict_Next(kwds, &pos, &key, &value)) {
25199         name = first_kw_arg;
25200         while (*name && (**name != key)) name++;
25201         if (*name) {
25202             values[name-argnames] = value;
25203         } else {
25204             #if PY_MAJOR_VERSION < 3
25205             if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
25206             #else
25207             if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
25208             #endif
25209                 goto invalid_keyword_type;
25210             } else {
25211                 for (name = first_kw_arg; *name; name++) {
25212                     #if PY_MAJOR_VERSION >= 3
25213                     if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
25214                         PyUnicode_Compare(**name, key) == 0) break;
25215                     #else
25216                     if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
25217                         _PyString_Eq(**name, key)) break;
25218                     #endif
25219                 }
25220                 if (*name) {
25221                     values[name-argnames] = value;
25222                 } else {
25223                     /* unexpected keyword found */
25224                     for (name=argnames; name != first_kw_arg; name++) {
25225                         if (**name == key) goto arg_passed_twice;
25226                         #if PY_MAJOR_VERSION >= 3
25227                         if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
25228                             PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
25229                         #else
25230                         if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
25231                             _PyString_Eq(**name, key)) goto arg_passed_twice;
25232                         #endif
25233                     }
25234                     if (kwds2) {
25235                         if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
25236                     } else {
25237                         goto invalid_keyword;
25238                     }
25239                 }
25240             }
25241         }
25242     }
25243     return 0;
25244 arg_passed_twice:
25245     __Pyx_RaiseDoubleKeywordsError(function_name, **name);
25246     goto bad;
25247 invalid_keyword_type:
25248     PyErr_Format(PyExc_TypeError,
25249         "%s() keywords must be strings", function_name);
25250     goto bad;
25251 invalid_keyword:
25252     PyErr_Format(PyExc_TypeError,
25253     #if PY_MAJOR_VERSION < 3
25254         "%s() got an unexpected keyword argument '%s'",
25255         function_name, PyString_AsString(key));
25256     #else
25257         "%s() got an unexpected keyword argument '%U'",
25258         function_name, key);
25259     #endif
25260 bad:
25261     return -1;
25262 }
25263
25264
25265 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
25266     PyObject *local_type, *local_value, *local_tb;
25267     PyObject *tmp_type, *tmp_value, *tmp_tb;
25268     PyThreadState *tstate = PyThreadState_GET();
25269     local_type = tstate->curexc_type;
25270     local_value = tstate->curexc_value;
25271     local_tb = tstate->curexc_traceback;
25272     tstate->curexc_type = 0;
25273     tstate->curexc_value = 0;
25274     tstate->curexc_traceback = 0;
25275     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25276     if (unlikely(tstate->curexc_type))
25277         goto bad;
25278     #if PY_MAJOR_VERSION >= 3
25279     if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25280         goto bad;
25281     #endif
25282     *type = local_type;
25283     *value = local_value;
25284     *tb = local_tb;
25285     Py_INCREF(local_type);
25286     Py_INCREF(local_value);
25287     Py_INCREF(local_tb);
25288     tmp_type = tstate->exc_type;
25289     tmp_value = tstate->exc_value;
25290     tmp_tb = tstate->exc_traceback;
25291     tstate->exc_type = local_type;
25292     tstate->exc_value = local_value;
25293     tstate->exc_traceback = local_tb;
25294     /* Make sure tstate is in a consistent state when we XDECREF
25295        these objects (XDECREF may run arbitrary code). */
25296     Py_XDECREF(tmp_type);
25297     Py_XDECREF(tmp_value);
25298     Py_XDECREF(tmp_tb);
25299     return 0;
25300 bad:
25301     *type = 0;
25302     *value = 0;
25303     *tb = 0;
25304     Py_XDECREF(local_type);
25305     Py_XDECREF(local_value);
25306     Py_XDECREF(local_tb);
25307     return -1;
25308 }
25309
25310
25311 static double __Pyx__PyObject_AsDouble(PyObject* obj) {
25312     PyObject* float_value;
25313     if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) {
25314         return PyFloat_AsDouble(obj);
25315     } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
25316 #if PY_MAJOR_VERSION >= 3
25317         float_value = PyFloat_FromString(obj);
25318 #else
25319         float_value = PyFloat_FromString(obj, 0);
25320 #endif
25321     } else {
25322         PyObject* args = PyTuple_New(1);
25323         if (unlikely(!args)) goto bad;
25324         PyTuple_SET_ITEM(args, 0, obj);
25325         float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
25326         PyTuple_SET_ITEM(args, 0, 0);
25327         Py_DECREF(args);
25328     }
25329     if (likely(float_value)) {
25330         double value = PyFloat_AS_DOUBLE(float_value);
25331         Py_DECREF(float_value);
25332         return value;
25333     }
25334 bad:
25335     return (double)-1;
25336 }
25337
25338 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
25339     PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
25340 }
25341
25342 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25343     PyErr_Format(PyExc_ValueError,
25344         #if PY_VERSION_HEX < 0x02050000
25345                  "need more than %d value%s to unpack", (int)index,
25346         #else
25347                  "need more than %zd value%s to unpack", index,
25348         #endif
25349                  (index == 1) ? "" : "s");
25350 }
25351
25352 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25353     PyErr_Format(PyExc_ValueError,
25354         #if PY_VERSION_HEX < 0x02050000
25355             "too many values to unpack (expected %d)", (int)expected);
25356         #else
25357             "too many values to unpack (expected %zd)", expected);
25358         #endif
25359 }
25360
25361 static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
25362     PyObject *item;
25363     if (!(item = PyIter_Next(iter))) {
25364         if (!PyErr_Occurred()) {
25365             __Pyx_RaiseNeedMoreValuesError(index);
25366         }
25367     }
25368     return item;
25369 }
25370
25371 static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
25372     PyObject *item;
25373     if ((item = PyIter_Next(iter))) {
25374         Py_DECREF(item);
25375         __Pyx_RaiseTooManyValuesError(expected);
25376         return -1;
25377     }
25378     else if (!PyErr_Occurred())
25379         return 0;
25380     else
25381         return -1;
25382 }
25383
25384 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25385     Py_ssize_t q = a / b;
25386     Py_ssize_t r = a - q*b;
25387     q -= ((r != 0) & ((r ^ b) < 0));
25388     return q;
25389 }
25390
25391
25392 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
25393     PyThreadState *tstate = PyThreadState_GET();
25394     *type = tstate->exc_type;
25395     *value = tstate->exc_value;
25396     *tb = tstate->exc_traceback;
25397     Py_XINCREF(*type);
25398     Py_XINCREF(*value);
25399     Py_XINCREF(*tb);
25400 }
25401
25402 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
25403     PyObject *tmp_type, *tmp_value, *tmp_tb;
25404     PyThreadState *tstate = PyThreadState_GET();
25405     tmp_type = tstate->exc_type;
25406     tmp_value = tstate->exc_value;
25407     tmp_tb = tstate->exc_traceback;
25408     tstate->exc_type = type;
25409     tstate->exc_value = value;
25410     tstate->exc_traceback = tb;
25411     Py_XDECREF(tmp_type);
25412     Py_XDECREF(tmp_value);
25413     Py_XDECREF(tmp_tb);
25414 }
25415
25416 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
25417     PyObject *py_import = 0;
25418     PyObject *empty_list = 0;
25419     PyObject *module = 0;
25420     PyObject *global_dict = 0;
25421     PyObject *empty_dict = 0;
25422     PyObject *list;
25423     py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
25424     if (!py_import)
25425         goto bad;
25426     if (from_list)
25427         list = from_list;
25428     else {
25429         empty_list = PyList_New(0);
25430         if (!empty_list)
25431             goto bad;
25432         list = empty_list;
25433     }
25434     global_dict = PyModule_GetDict(__pyx_m);
25435     if (!global_dict)
25436         goto bad;
25437     empty_dict = PyDict_New();
25438     if (!empty_dict)
25439         goto bad;
25440     module = PyObject_CallFunctionObjArgs(py_import,
25441         name, global_dict, empty_dict, list, NULL);
25442 bad:
25443     Py_XDECREF(empty_list);
25444     Py_XDECREF(py_import);
25445     Py_XDECREF(empty_dict);
25446     return module;
25447 }
25448
25449 static PyObject *__Pyx_CreateClass(
25450     PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
25451 {
25452     PyObject *py_modname;
25453     PyObject *result = 0;
25454
25455     #if PY_MAJOR_VERSION < 3
25456     py_modname = PyString_FromString(modname);
25457     #else
25458     py_modname = PyUnicode_FromString(modname);
25459     #endif
25460     if (!py_modname)
25461         goto bad;
25462     if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
25463         goto bad;
25464     #if PY_MAJOR_VERSION < 3
25465     result = PyClass_New(bases, dict, name);
25466     #else
25467     result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
25468     #endif
25469 bad:
25470     Py_XDECREF(py_modname);
25471     return result;
25472 }
25473
25474 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
25475     PyObject *tmp_type, *tmp_value, *tmp_tb;
25476     PyThreadState *tstate = PyThreadState_GET();
25477
25478     tmp_type = tstate->curexc_type;
25479     tmp_value = tstate->curexc_value;
25480     tmp_tb = tstate->curexc_traceback;
25481     tstate->curexc_type = type;
25482     tstate->curexc_value = value;
25483     tstate->curexc_traceback = tb;
25484     Py_XDECREF(tmp_type);
25485     Py_XDECREF(tmp_value);
25486     Py_XDECREF(tmp_tb);
25487 }
25488
25489 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
25490     PyThreadState *tstate = PyThreadState_GET();
25491     *type = tstate->curexc_type;
25492     *value = tstate->curexc_value;
25493     *tb = tstate->curexc_traceback;
25494
25495     tstate->curexc_type = 0;
25496     tstate->curexc_value = 0;
25497     tstate->curexc_traceback = 0;
25498 }
25499
25500
25501 #if PY_MAJOR_VERSION < 3
25502 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
25503     Py_XINCREF(type);
25504     Py_XINCREF(value);
25505     Py_XINCREF(tb);
25506     /* First, check the traceback argument, replacing None with NULL. */
25507     if (tb == Py_None) {
25508         Py_DECREF(tb);
25509         tb = 0;
25510     }
25511     else if (tb != NULL && !PyTraceBack_Check(tb)) {
25512         PyErr_SetString(PyExc_TypeError,
25513             "raise: arg 3 must be a traceback or None");
25514         goto raise_error;
25515     }
25516     /* Next, replace a missing value with None */
25517     if (value == NULL) {
25518         value = Py_None;
25519         Py_INCREF(value);
25520     }
25521     #if PY_VERSION_HEX < 0x02050000
25522     if (!PyClass_Check(type))
25523     #else
25524     if (!PyType_Check(type))
25525     #endif
25526     {
25527         /* Raising an instance.  The value should be a dummy. */
25528         if (value != Py_None) {
25529             PyErr_SetString(PyExc_TypeError,
25530                 "instance exception may not have a separate value");
25531             goto raise_error;
25532         }
25533         /* Normalize to raise <class>, <instance> */
25534         Py_DECREF(value);
25535         value = type;
25536         #if PY_VERSION_HEX < 0x02050000
25537             if (PyInstance_Check(type)) {
25538                 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
25539                 Py_INCREF(type);
25540             }
25541             else {
25542                 type = 0;
25543                 PyErr_SetString(PyExc_TypeError,
25544                     "raise: exception must be an old-style class or instance");
25545                 goto raise_error;
25546             }
25547         #else
25548             type = (PyObject*) Py_TYPE(type);
25549             Py_INCREF(type);
25550             if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25551                 PyErr_SetString(PyExc_TypeError,
25552                     "raise: exception class must be a subclass of BaseException");
25553                 goto raise_error;
25554             }
25555         #endif
25556     }
25557
25558     __Pyx_ErrRestore(type, value, tb);
25559     return;
25560 raise_error:
25561     Py_XDECREF(value);
25562     Py_XDECREF(type);
25563     Py_XDECREF(tb);
25564     return;
25565 }
25566
25567 #else /* Python 3+ */
25568
25569 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
25570     if (tb == Py_None) {
25571         tb = 0;
25572     } else if (tb && !PyTraceBack_Check(tb)) {
25573         PyErr_SetString(PyExc_TypeError,
25574             "raise: arg 3 must be a traceback or None");
25575         goto bad;
25576     }
25577     if (value == Py_None)
25578         value = 0;
25579
25580     if (PyExceptionInstance_Check(type)) {
25581         if (value) {
25582             PyErr_SetString(PyExc_TypeError,
25583                 "instance exception may not have a separate value");
25584             goto bad;
25585         }
25586         value = type;
25587         type = (PyObject*) Py_TYPE(value);
25588     } else if (!PyExceptionClass_Check(type)) {
25589         PyErr_SetString(PyExc_TypeError,
25590             "raise: exception class must be a subclass of BaseException");
25591         goto bad;
25592     }
25593
25594     PyErr_SetObject(type, value);
25595
25596     if (tb) {
25597         PyThreadState *tstate = PyThreadState_GET();
25598         PyObject* tmp_tb = tstate->curexc_traceback;
25599         if (tb != tmp_tb) {
25600             Py_INCREF(tb);
25601             tstate->curexc_traceback = tb;
25602             Py_XDECREF(tmp_tb);
25603         }
25604     }
25605
25606 bad:
25607     return;
25608 }
25609 #endif
25610
25611 static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint32_t(uint32_t val) {
25612     const uint32_t neg_one = (uint32_t)-1, const_zero = (uint32_t)0;
25613     const int is_unsigned = const_zero < neg_one;
25614     if ((sizeof(uint32_t) == sizeof(char))  ||
25615         (sizeof(uint32_t) == sizeof(short))) {
25616         return PyInt_FromLong((long)val);
25617     } else if ((sizeof(uint32_t) == sizeof(int)) ||
25618                (sizeof(uint32_t) == sizeof(long))) {
25619         if (is_unsigned)
25620             return PyLong_FromUnsignedLong((unsigned long)val);
25621         else
25622             return PyInt_FromLong((long)val);
25623     } else if (sizeof(uint32_t) == sizeof(PY_LONG_LONG)) {
25624         if (is_unsigned)
25625             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
25626         else
25627             return PyLong_FromLongLong((PY_LONG_LONG)val);
25628     } else {
25629         int one = 1; int little = (int)*(unsigned char *)&one;
25630         unsigned char *bytes = (unsigned char *)&val;
25631         return _PyLong_FromByteArray(bytes, sizeof(uint32_t), 
25632                                      little, !is_unsigned);
25633     }
25634 }
25635
25636 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
25637     const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
25638     const int is_unsigned = neg_one > const_zero;
25639     if (sizeof(unsigned char) < sizeof(long)) {
25640         long val = __Pyx_PyInt_AsLong(x);
25641         if (unlikely(val != (long)(unsigned char)val)) {
25642             if (!unlikely(val == -1 && PyErr_Occurred())) {
25643                 PyErr_SetString(PyExc_OverflowError,
25644                     (is_unsigned && unlikely(val < 0)) ?
25645                     "can't convert negative value to unsigned char" :
25646                     "value too large to convert to unsigned char");
25647             }
25648             return (unsigned char)-1;
25649         }
25650         return (unsigned char)val;
25651     }
25652     return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
25653 }
25654
25655 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
25656     const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
25657     const int is_unsigned = neg_one > const_zero;
25658     if (sizeof(unsigned short) < sizeof(long)) {
25659         long val = __Pyx_PyInt_AsLong(x);
25660         if (unlikely(val != (long)(unsigned short)val)) {
25661             if (!unlikely(val == -1 && PyErr_Occurred())) {
25662                 PyErr_SetString(PyExc_OverflowError,
25663                     (is_unsigned && unlikely(val < 0)) ?
25664                     "can't convert negative value to unsigned short" :
25665                     "value too large to convert to unsigned short");
25666             }
25667             return (unsigned short)-1;
25668         }
25669         return (unsigned short)val;
25670     }
25671     return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
25672 }
25673
25674 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
25675     const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
25676     const int is_unsigned = neg_one > const_zero;
25677     if (sizeof(unsigned int) < sizeof(long)) {
25678         long val = __Pyx_PyInt_AsLong(x);
25679         if (unlikely(val != (long)(unsigned int)val)) {
25680             if (!unlikely(val == -1 && PyErr_Occurred())) {
25681                 PyErr_SetString(PyExc_OverflowError,
25682                     (is_unsigned && unlikely(val < 0)) ?
25683                     "can't convert negative value to unsigned int" :
25684                     "value too large to convert to unsigned int");
25685             }
25686             return (unsigned int)-1;
25687         }
25688         return (unsigned int)val;
25689     }
25690     return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
25691 }
25692
25693 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
25694     const char neg_one = (char)-1, const_zero = 0;
25695     const int is_unsigned = neg_one > const_zero;
25696     if (sizeof(char) < sizeof(long)) {
25697         long val = __Pyx_PyInt_AsLong(x);
25698         if (unlikely(val != (long)(char)val)) {
25699             if (!unlikely(val == -1 && PyErr_Occurred())) {
25700                 PyErr_SetString(PyExc_OverflowError,
25701                     (is_unsigned && unlikely(val < 0)) ?
25702                     "can't convert negative value to char" :
25703                     "value too large to convert to char");
25704             }
25705             return (char)-1;
25706         }
25707         return (char)val;
25708     }
25709     return (char)__Pyx_PyInt_AsLong(x);
25710 }
25711
25712 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
25713     const short neg_one = (short)-1, const_zero = 0;
25714     const int is_unsigned = neg_one > const_zero;
25715     if (sizeof(short) < sizeof(long)) {
25716         long val = __Pyx_PyInt_AsLong(x);
25717         if (unlikely(val != (long)(short)val)) {
25718             if (!unlikely(val == -1 && PyErr_Occurred())) {
25719                 PyErr_SetString(PyExc_OverflowError,
25720                     (is_unsigned && unlikely(val < 0)) ?
25721                     "can't convert negative value to short" :
25722                     "value too large to convert to short");
25723             }
25724             return (short)-1;
25725         }
25726         return (short)val;
25727     }
25728     return (short)__Pyx_PyInt_AsLong(x);
25729 }
25730
25731 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
25732     const int neg_one = (int)-1, const_zero = 0;
25733     const int is_unsigned = neg_one > const_zero;
25734     if (sizeof(int) < sizeof(long)) {
25735         long val = __Pyx_PyInt_AsLong(x);
25736         if (unlikely(val != (long)(int)val)) {
25737             if (!unlikely(val == -1 && PyErr_Occurred())) {
25738                 PyErr_SetString(PyExc_OverflowError,
25739                     (is_unsigned && unlikely(val < 0)) ?
25740                     "can't convert negative value to int" :
25741                     "value too large to convert to int");
25742             }
25743             return (int)-1;
25744         }
25745         return (int)val;
25746     }
25747     return (int)__Pyx_PyInt_AsLong(x);
25748 }
25749
25750 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
25751     const signed char neg_one = (signed char)-1, const_zero = 0;
25752     const int is_unsigned = neg_one > const_zero;
25753     if (sizeof(signed char) < sizeof(long)) {
25754         long val = __Pyx_PyInt_AsLong(x);
25755         if (unlikely(val != (long)(signed char)val)) {
25756             if (!unlikely(val == -1 && PyErr_Occurred())) {
25757                 PyErr_SetString(PyExc_OverflowError,
25758                     (is_unsigned && unlikely(val < 0)) ?
25759                     "can't convert negative value to signed char" :
25760                     "value too large to convert to signed char");
25761             }
25762             return (signed char)-1;
25763         }
25764         return (signed char)val;
25765     }
25766     return (signed char)__Pyx_PyInt_AsSignedLong(x);
25767 }
25768
25769 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
25770     const signed short neg_one = (signed short)-1, const_zero = 0;
25771     const int is_unsigned = neg_one > const_zero;
25772     if (sizeof(signed short) < sizeof(long)) {
25773         long val = __Pyx_PyInt_AsLong(x);
25774         if (unlikely(val != (long)(signed short)val)) {
25775             if (!unlikely(val == -1 && PyErr_Occurred())) {
25776                 PyErr_SetString(PyExc_OverflowError,
25777                     (is_unsigned && unlikely(val < 0)) ?
25778                     "can't convert negative value to signed short" :
25779                     "value too large to convert to signed short");
25780             }
25781             return (signed short)-1;
25782         }
25783         return (signed short)val;
25784     }
25785     return (signed short)__Pyx_PyInt_AsSignedLong(x);
25786 }
25787
25788 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
25789     const signed int neg_one = (signed int)-1, const_zero = 0;
25790     const int is_unsigned = neg_one > const_zero;
25791     if (sizeof(signed int) < sizeof(long)) {
25792         long val = __Pyx_PyInt_AsLong(x);
25793         if (unlikely(val != (long)(signed int)val)) {
25794             if (!unlikely(val == -1 && PyErr_Occurred())) {
25795                 PyErr_SetString(PyExc_OverflowError,
25796                     (is_unsigned && unlikely(val < 0)) ?
25797                     "can't convert negative value to signed int" :
25798                     "value too large to convert to signed int");
25799             }
25800             return (signed int)-1;
25801         }
25802         return (signed int)val;
25803     }
25804     return (signed int)__Pyx_PyInt_AsSignedLong(x);
25805 }
25806
25807 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
25808     const int neg_one = (int)-1, const_zero = 0;
25809     const int is_unsigned = neg_one > const_zero;
25810     if (sizeof(int) < sizeof(long)) {
25811         long val = __Pyx_PyInt_AsLong(x);
25812         if (unlikely(val != (long)(int)val)) {
25813             if (!unlikely(val == -1 && PyErr_Occurred())) {
25814                 PyErr_SetString(PyExc_OverflowError,
25815                     (is_unsigned && unlikely(val < 0)) ?
25816                     "can't convert negative value to int" :
25817                     "value too large to convert to int");
25818             }
25819             return (int)-1;
25820         }
25821         return (int)val;
25822     }
25823     return (int)__Pyx_PyInt_AsLong(x);
25824 }
25825
25826 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
25827     const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
25828     const int is_unsigned = neg_one > const_zero;
25829 #if PY_VERSION_HEX < 0x03000000
25830     if (likely(PyInt_Check(x))) {
25831         long val = PyInt_AS_LONG(x);
25832         if (is_unsigned && unlikely(val < 0)) {
25833             PyErr_SetString(PyExc_OverflowError,
25834                             "can't convert negative value to unsigned long");
25835             return (unsigned long)-1;
25836         }
25837         return (unsigned long)val;
25838     } else
25839 #endif
25840     if (likely(PyLong_Check(x))) {
25841         if (is_unsigned) {
25842             if (unlikely(Py_SIZE(x) < 0)) {
25843                 PyErr_SetString(PyExc_OverflowError,
25844                                 "can't convert negative value to unsigned long");
25845                 return (unsigned long)-1;
25846             }
25847             return PyLong_AsUnsignedLong(x);
25848         } else {
25849             return PyLong_AsLong(x);
25850         }
25851     } else {
25852         unsigned long val;
25853         PyObject *tmp = __Pyx_PyNumber_Int(x);
25854         if (!tmp) return (unsigned long)-1;
25855         val = __Pyx_PyInt_AsUnsignedLong(tmp);
25856         Py_DECREF(tmp);
25857         return val;
25858     }
25859 }
25860
25861 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
25862     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
25863     const int is_unsigned = neg_one > const_zero;
25864 #if PY_VERSION_HEX < 0x03000000
25865     if (likely(PyInt_Check(x))) {
25866         long val = PyInt_AS_LONG(x);
25867         if (is_unsigned && unlikely(val < 0)) {
25868             PyErr_SetString(PyExc_OverflowError,
25869                             "can't convert negative value to unsigned PY_LONG_LONG");
25870             return (unsigned PY_LONG_LONG)-1;
25871         }
25872         return (unsigned PY_LONG_LONG)val;
25873     } else
25874 #endif
25875     if (likely(PyLong_Check(x))) {
25876         if (is_unsigned) {
25877             if (unlikely(Py_SIZE(x) < 0)) {
25878                 PyErr_SetString(PyExc_OverflowError,
25879                                 "can't convert negative value to unsigned PY_LONG_LONG");
25880                 return (unsigned PY_LONG_LONG)-1;
25881             }
25882             return PyLong_AsUnsignedLongLong(x);
25883         } else {
25884             return PyLong_AsLongLong(x);
25885         }
25886     } else {
25887         unsigned PY_LONG_LONG val;
25888         PyObject *tmp = __Pyx_PyNumber_Int(x);
25889         if (!tmp) return (unsigned PY_LONG_LONG)-1;
25890         val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
25891         Py_DECREF(tmp);
25892         return val;
25893     }
25894 }
25895
25896 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
25897     const long neg_one = (long)-1, const_zero = 0;
25898     const int is_unsigned = neg_one > const_zero;
25899 #if PY_VERSION_HEX < 0x03000000
25900     if (likely(PyInt_Check(x))) {
25901         long val = PyInt_AS_LONG(x);
25902         if (is_unsigned && unlikely(val < 0)) {
25903             PyErr_SetString(PyExc_OverflowError,
25904                             "can't convert negative value to long");
25905             return (long)-1;
25906         }
25907         return (long)val;
25908     } else
25909 #endif
25910     if (likely(PyLong_Check(x))) {
25911         if (is_unsigned) {
25912             if (unlikely(Py_SIZE(x) < 0)) {
25913                 PyErr_SetString(PyExc_OverflowError,
25914                                 "can't convert negative value to long");
25915                 return (long)-1;
25916             }
25917             return PyLong_AsUnsignedLong(x);
25918         } else {
25919             return PyLong_AsLong(x);
25920         }
25921     } else {
25922         long val;
25923         PyObject *tmp = __Pyx_PyNumber_Int(x);
25924         if (!tmp) return (long)-1;
25925         val = __Pyx_PyInt_AsLong(tmp);
25926         Py_DECREF(tmp);
25927         return val;
25928     }
25929 }
25930
25931 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
25932     const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
25933     const int is_unsigned = neg_one > const_zero;
25934 #if PY_VERSION_HEX < 0x03000000
25935     if (likely(PyInt_Check(x))) {
25936         long val = PyInt_AS_LONG(x);
25937         if (is_unsigned && unlikely(val < 0)) {
25938             PyErr_SetString(PyExc_OverflowError,
25939                             "can't convert negative value to PY_LONG_LONG");
25940             return (PY_LONG_LONG)-1;
25941         }
25942         return (PY_LONG_LONG)val;
25943     } else
25944 #endif
25945     if (likely(PyLong_Check(x))) {
25946         if (is_unsigned) {
25947             if (unlikely(Py_SIZE(x) < 0)) {
25948                 PyErr_SetString(PyExc_OverflowError,
25949                                 "can't convert negative value to PY_LONG_LONG");
25950                 return (PY_LONG_LONG)-1;
25951             }
25952             return PyLong_AsUnsignedLongLong(x);
25953         } else {
25954             return PyLong_AsLongLong(x);
25955         }
25956     } else {
25957         PY_LONG_LONG val;
25958         PyObject *tmp = __Pyx_PyNumber_Int(x);
25959         if (!tmp) return (PY_LONG_LONG)-1;
25960         val = __Pyx_PyInt_AsLongLong(tmp);
25961         Py_DECREF(tmp);
25962         return val;
25963     }
25964 }
25965
25966 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
25967     const signed long neg_one = (signed long)-1, const_zero = 0;
25968     const int is_unsigned = neg_one > const_zero;
25969 #if PY_VERSION_HEX < 0x03000000
25970     if (likely(PyInt_Check(x))) {
25971         long val = PyInt_AS_LONG(x);
25972         if (is_unsigned && unlikely(val < 0)) {
25973             PyErr_SetString(PyExc_OverflowError,
25974                             "can't convert negative value to signed long");
25975             return (signed long)-1;
25976         }
25977         return (signed long)val;
25978     } else
25979 #endif
25980     if (likely(PyLong_Check(x))) {
25981         if (is_unsigned) {
25982             if (unlikely(Py_SIZE(x) < 0)) {
25983                 PyErr_SetString(PyExc_OverflowError,
25984                                 "can't convert negative value to signed long");
25985                 return (signed long)-1;
25986             }
25987             return PyLong_AsUnsignedLong(x);
25988         } else {
25989             return PyLong_AsLong(x);
25990         }
25991     } else {
25992         signed long val;
25993         PyObject *tmp = __Pyx_PyNumber_Int(x);
25994         if (!tmp) return (signed long)-1;
25995         val = __Pyx_PyInt_AsSignedLong(tmp);
25996         Py_DECREF(tmp);
25997         return val;
25998     }
25999 }
26000
26001 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
26002     const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
26003     const int is_unsigned = neg_one > const_zero;
26004 #if PY_VERSION_HEX < 0x03000000
26005     if (likely(PyInt_Check(x))) {
26006         long val = PyInt_AS_LONG(x);
26007         if (is_unsigned && unlikely(val < 0)) {
26008             PyErr_SetString(PyExc_OverflowError,
26009                             "can't convert negative value to signed PY_LONG_LONG");
26010             return (signed PY_LONG_LONG)-1;
26011         }
26012         return (signed PY_LONG_LONG)val;
26013     } else
26014 #endif
26015     if (likely(PyLong_Check(x))) {
26016         if (is_unsigned) {
26017             if (unlikely(Py_SIZE(x) < 0)) {
26018                 PyErr_SetString(PyExc_OverflowError,
26019                                 "can't convert negative value to signed PY_LONG_LONG");
26020                 return (signed PY_LONG_LONG)-1;
26021             }
26022             return PyLong_AsUnsignedLongLong(x);
26023         } else {
26024             return PyLong_AsLongLong(x);
26025         }
26026     } else {
26027         signed PY_LONG_LONG val;
26028         PyObject *tmp = __Pyx_PyNumber_Int(x);
26029         if (!tmp) return (signed PY_LONG_LONG)-1;
26030         val = __Pyx_PyInt_AsSignedLongLong(tmp);
26031         Py_DECREF(tmp);
26032         return val;
26033     }
26034 }
26035
26036 #ifndef __PYX_HAVE_RT_ImportType
26037 #define __PYX_HAVE_RT_ImportType
26038 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
26039     long size, int strict)
26040 {
26041     PyObject *py_module = 0;
26042     PyObject *result = 0;
26043     PyObject *py_name = 0;
26044     char warning[200];
26045
26046     py_module = __Pyx_ImportModule(module_name);
26047     if (!py_module)
26048         goto bad;
26049     #if PY_MAJOR_VERSION < 3
26050     py_name = PyString_FromString(class_name);
26051     #else
26052     py_name = PyUnicode_FromString(class_name);
26053     #endif
26054     if (!py_name)
26055         goto bad;
26056     result = PyObject_GetAttr(py_module, py_name);
26057     Py_DECREF(py_name);
26058     py_name = 0;
26059     Py_DECREF(py_module);
26060     py_module = 0;
26061     if (!result)
26062         goto bad;
26063     if (!PyType_Check(result)) {
26064         PyErr_Format(PyExc_TypeError, 
26065             "%s.%s is not a type object",
26066             module_name, class_name);
26067         goto bad;
26068     }
26069     if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
26070         PyOS_snprintf(warning, sizeof(warning), 
26071             "%s.%s size changed, may indicate binary incompatibility",
26072             module_name, class_name);
26073         #if PY_VERSION_HEX < 0x02050000
26074         PyErr_Warn(NULL, warning);
26075         #else
26076         PyErr_WarnEx(NULL, warning, 0);
26077         #endif
26078     }
26079     else if (((PyTypeObject *)result)->tp_basicsize != size) {
26080         PyErr_Format(PyExc_ValueError, 
26081             "%s.%s has the wrong size, try recompiling",
26082             module_name, class_name);
26083         goto bad;
26084     }
26085     return (PyTypeObject *)result;
26086 bad:
26087     Py_XDECREF(py_module);
26088     Py_XDECREF(result);
26089     return 0;
26090 }
26091 #endif
26092
26093 #ifndef __PYX_HAVE_RT_ImportModule
26094 #define __PYX_HAVE_RT_ImportModule
26095 static PyObject *__Pyx_ImportModule(const char *name) {
26096     PyObject *py_name = 0;
26097     PyObject *py_module = 0;
26098
26099     #if PY_MAJOR_VERSION < 3
26100     py_name = PyString_FromString(name);
26101     #else
26102     py_name = PyUnicode_FromString(name);
26103     #endif
26104     if (!py_name)
26105         goto bad;
26106     py_module = PyImport_Import(py_name);
26107     Py_DECREF(py_name);
26108     return py_module;
26109 bad:
26110     Py_XDECREF(py_name);
26111     return 0;
26112 }
26113 #endif
26114
26115 static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) {
26116     PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
26117     if (!ob)
26118         goto bad;
26119 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
26120     *(void **)vtabptr = PyCapsule_GetPointer(ob, 0);
26121 #else
26122     *(void **)vtabptr = PyCObject_AsVoidPtr(ob);
26123 #endif
26124     if (!*(void **)vtabptr)
26125         goto bad;
26126     Py_DECREF(ob);
26127     return 0;
26128 bad:
26129     Py_XDECREF(ob);
26130     return -1;
26131 }
26132
26133 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
26134 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
26135     PyObject *ob = PyCapsule_New(vtable, 0, 0);
26136 #else
26137     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26138 #endif
26139     if (!ob)
26140         goto bad;
26141     if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
26142         goto bad;
26143     Py_DECREF(ob);
26144     return 0;
26145 bad:
26146     Py_XDECREF(ob);
26147     return -1;
26148 }
26149
26150 #include "compile.h"
26151 #include "frameobject.h"
26152 #include "traceback.h"
26153
26154 static void __Pyx_AddTraceback(const char *funcname) {
26155     PyObject *py_srcfile = 0;
26156     PyObject *py_funcname = 0;
26157     PyObject *py_globals = 0;
26158     PyCodeObject *py_code = 0;
26159     PyFrameObject *py_frame = 0;
26160
26161     #if PY_MAJOR_VERSION < 3
26162     py_srcfile = PyString_FromString(__pyx_filename);
26163     #else
26164     py_srcfile = PyUnicode_FromString(__pyx_filename);
26165     #endif
26166     if (!py_srcfile) goto bad;
26167     if (__pyx_clineno) {
26168         #if PY_MAJOR_VERSION < 3
26169         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
26170         #else
26171         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
26172         #endif
26173     }
26174     else {
26175         #if PY_MAJOR_VERSION < 3
26176         py_funcname = PyString_FromString(funcname);
26177         #else
26178         py_funcname = PyUnicode_FromString(funcname);
26179         #endif
26180     }
26181     if (!py_funcname) goto bad;
26182     py_globals = PyModule_GetDict(__pyx_m);
26183     if (!py_globals) goto bad;
26184     py_code = PyCode_New(
26185         0,            /*int argcount,*/
26186         #if PY_MAJOR_VERSION >= 3
26187         0,            /*int kwonlyargcount,*/
26188         #endif
26189         0,            /*int nlocals,*/
26190         0,            /*int stacksize,*/
26191         0,            /*int flags,*/
26192         __pyx_empty_bytes, /*PyObject *code,*/
26193         __pyx_empty_tuple,  /*PyObject *consts,*/
26194         __pyx_empty_tuple,  /*PyObject *names,*/
26195         __pyx_empty_tuple,  /*PyObject *varnames,*/
26196         __pyx_empty_tuple,  /*PyObject *freevars,*/
26197         __pyx_empty_tuple,  /*PyObject *cellvars,*/
26198         py_srcfile,   /*PyObject *filename,*/
26199         py_funcname,  /*PyObject *name,*/
26200         __pyx_lineno,   /*int firstlineno,*/
26201         __pyx_empty_bytes  /*PyObject *lnotab*/
26202     );
26203     if (!py_code) goto bad;
26204     py_frame = PyFrame_New(
26205         PyThreadState_GET(), /*PyThreadState *tstate,*/
26206         py_code,             /*PyCodeObject *code,*/
26207         py_globals,          /*PyObject *globals,*/
26208         0                    /*PyObject *locals*/
26209     );
26210     if (!py_frame) goto bad;
26211     py_frame->f_lineno = __pyx_lineno;
26212     PyTraceBack_Here(py_frame);
26213 bad:
26214     Py_XDECREF(py_srcfile);
26215     Py_XDECREF(py_funcname);
26216     Py_XDECREF(py_code);
26217     Py_XDECREF(py_frame);
26218 }
26219
26220 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
26221     while (t->p) {
26222         #if PY_MAJOR_VERSION < 3
26223         if (t->is_unicode) {
26224             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
26225         } else if (t->intern) {
26226             *t->p = PyString_InternFromString(t->s);
26227         } else {
26228             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
26229         }
26230         #else  /* Python 3+ has unicode identifiers */
26231         if (t->is_unicode | t->is_str) {
26232             if (t->intern) {
26233                 *t->p = PyUnicode_InternFromString(t->s);
26234             } else if (t->encoding) {
26235                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
26236             } else {
26237                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
26238             }
26239         } else {
26240             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
26241         }
26242         #endif
26243         if (!*t->p)
26244             return -1;
26245         ++t;
26246     }
26247     return 0;
26248 }
26249
26250 /* Type Conversion Functions */
26251
26252 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
26253    int is_true = x == Py_True;
26254    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
26255    else return PyObject_IsTrue(x);
26256 }
26257
26258 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
26259   PyNumberMethods *m;
26260   const char *name = NULL;
26261   PyObject *res = NULL;
26262 #if PY_VERSION_HEX < 0x03000000
26263   if (PyInt_Check(x) || PyLong_Check(x))
26264 #else
26265   if (PyLong_Check(x))
26266 #endif
26267     return Py_INCREF(x), x;
26268   m = Py_TYPE(x)->tp_as_number;
26269 #if PY_VERSION_HEX < 0x03000000
26270   if (m && m->nb_int) {
26271     name = "int";
26272     res = PyNumber_Int(x);
26273   }
26274   else if (m && m->nb_long) {
26275     name = "long";
26276     res = PyNumber_Long(x);
26277   }
26278 #else
26279   if (m && m->nb_int) {
26280     name = "int";
26281     res = PyNumber_Long(x);
26282   }
26283 #endif
26284   if (res) {
26285 #if PY_VERSION_HEX < 0x03000000
26286     if (!PyInt_Check(res) && !PyLong_Check(res)) {
26287 #else
26288     if (!PyLong_Check(res)) {
26289 #endif
26290       PyErr_Format(PyExc_TypeError,
26291                    "__%s__ returned non-%s (type %.200s)",
26292                    name, name, Py_TYPE(res)->tp_name);
26293       Py_DECREF(res);
26294       return NULL;
26295     }
26296   }
26297   else if (!PyErr_Occurred()) {
26298     PyErr_SetString(PyExc_TypeError,
26299                     "an integer is required");
26300   }
26301   return res;
26302 }
26303
26304 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
26305   Py_ssize_t ival;
26306   PyObject* x = PyNumber_Index(b);
26307   if (!x) return -1;
26308   ival = PyInt_AsSsize_t(x);
26309   Py_DECREF(x);
26310   return ival;
26311 }
26312
26313 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
26314 #if PY_VERSION_HEX < 0x02050000
26315    if (ival <= LONG_MAX)
26316        return PyInt_FromLong((long)ival);
26317    else {
26318        unsigned char *bytes = (unsigned char *) &ival;
26319        int one = 1; int little = (int)*(unsigned char*)&one;
26320        return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
26321    }
26322 #else
26323    return PyInt_FromSize_t(ival);
26324 #endif
26325 }
26326
26327 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
26328    unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
26329    if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
26330        return (size_t)-1;
26331    } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
26332        PyErr_SetString(PyExc_OverflowError,
26333                        "value too large to convert to size_t");
26334        return (size_t)-1;
26335    }
26336    return (size_t)val;
26337 }
26338
26339
26340 #endif /* Py_PYTHON_H */